replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
[metze/wireshark/wip.git] / ui / tap-iax2-analysis.h
1 /* tap-iax2-analysis.h
2  * IAX2 analysis addition for Wireshark
3  *
4  * based on rtp_analysis.c
5  * Copyright 2003, Alcatel Business Systems
6  * By Lars Ruoff <lars.ruoff@gmx.net>
7  *
8  * based on tap_rtp.c
9  * Copyright 2003, Iskratel, Ltd, Kranj
10  * By Miha Jemec <m.jemec@iskratel.si>
11  *
12  * Wireshark - Network traffic analyzer
13  * By Gerald Combs <gerald@wireshark.org>
14  * Copyright 1998 Gerald Combs
15  *
16  * SPDX-License-Identifier: GPL-2.0-or-later */
17
18 #ifndef __TAP_IAX2_ANALYSIS_H__
19 #define __TAP_IAX2_ANALYSIS_H__
20
21 #include <epan/address.h>
22 #include <epan/packet_info.h>
23
24 /** @file
25  *  ???
26  *  @todo what's this?
27  */
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32
33 /****************************************************************************/
34 /* structure that holds the information about the forward and reversed direction */
35 typedef struct _iax2_bw_history_item {
36     double time;
37     guint32 bytes;
38 } iax2_bw_history_item;
39
40 #define BUFF_BW 300
41
42 typedef struct _tap_iax2_stat_t {
43     gboolean first_packet;     /* do not use in code that is called after rtp_packet_analyse */
44     /* use (flags & STAT_FLAG_FIRST) instead */
45     /* all of the following fields will be initialized after
46        rtp_packet_analyse has been called */
47     guint32 flags;             /* see STAT_FLAG-defines below */
48     guint16 seq_num;
49     guint32 timestamp;
50     guint32 delta_timestamp;
51     double bandwidth;
52     iax2_bw_history_item bw_history[BUFF_BW];
53     guint16 bw_start_index;
54     guint16 bw_index;
55     guint32 total_bytes;
56     double delta;
57     double jitter;
58     double diff;
59     double time;
60     double start_time;
61     double max_delta;
62     double max_jitter;
63     double mean_jitter;
64     guint32 max_nr;
65     guint16 start_seq_nr;
66     guint16 stop_seq_nr;
67     guint32 total_nr;
68     guint32 sequence;
69     gboolean under; /* Unused? */
70     gint cycles; /* Unused? */
71     guint16 pt;
72     int reg_pt;
73 } tap_iax2_stat_t;
74
75 #define PT_UNDEFINED -1
76
77 /* status flags for the flags parameter in tap_iax2_stat_t */
78 #define STAT_FLAG_FIRST                         0x001
79 #define STAT_FLAG_MARKER                        0x002
80 #define STAT_FLAG_WRONG_SEQ                     0x004
81 #define STAT_FLAG_PT_CHANGE                     0x008
82 #define STAT_FLAG_PT_CN                         0x010
83 #define STAT_FLAG_FOLLOW_PT_CN          0x020
84 #define STAT_FLAG_REG_PT_CHANGE         0x040
85 #define STAT_FLAG_WRONG_TIMESTAMP       0x080
86
87 /* function for analysing an IAX2 packet. Called from iax2_analysis. */
88 extern void iax2_packet_analyse(tap_iax2_stat_t *statinfo,
89         packet_info *pinfo,
90         const struct _iax2_info_t *iax2info);
91
92 #ifdef __cplusplus
93 }
94 #endif /* __cplusplus */
95
96 #endif /* __TAP_IAX2_ANALYSIS_H__ */
97
98 /*
99  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
100  *
101  * Local variables:
102  * c-basic-offset: 4
103  * tab-width: 8
104  * indent-tabs-mode: nil
105  * End:
106  *
107  * vi: set shiftwidth=4 tabstop=8 expandtab:
108  * :indentSize=4:tabSize=8:noTabs=true:
109  */