Note that variadic macros *can* be sued.
[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  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation,  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29  */
30
31 #ifndef __TAP_IAX2_ANALYSIS_H__
32 #define __TAP_IAX2_ANALYSIS_H__
33
34 #include <epan/address.h>
35 #include <epan/packet_info.h>
36
37 /** @file
38  *  ???
39  *  @todo what's this?
40  */
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif /* __cplusplus */
45
46 /****************************************************************************/
47 /* structure that holds the information about the forward and reversed direction */
48 typedef struct _iax2_bw_history_item {
49     double time;
50     guint32 bytes;
51 } iax2_bw_history_item;
52
53 #define BUFF_BW 300
54
55 typedef struct _tap_iax2_stat_t {
56     gboolean first_packet;     /* do not use in code that is called after rtp_packet_analyse */
57     /* use (flags & STAT_FLAG_FIRST) instead */
58     /* all of the following fields will be initialized after
59        rtp_packet_analyse has been called */
60     guint32 flags;             /* see STAT_FLAG-defines below */
61     guint16 seq_num;
62     guint32 timestamp;
63     guint32 delta_timestamp;
64     double bandwidth;
65     iax2_bw_history_item bw_history[BUFF_BW];
66     guint16 bw_start_index;
67     guint16 bw_index;
68     guint32 total_bytes;
69     double delta;
70     double jitter;
71     double diff;
72     double time;
73     double start_time;
74     double max_delta;
75     double max_jitter;
76     double mean_jitter;
77     guint32 max_nr;
78     guint16 start_seq_nr;
79     guint16 stop_seq_nr;
80     guint32 total_nr;
81     guint32 sequence;
82     gboolean under; /* Unused? */
83     gint cycles; /* Unused? */
84     guint16 pt;
85     int reg_pt;
86 } tap_iax2_stat_t;
87
88 #define PT_UNDEFINED -1
89
90 /* status flags for the flags parameter in tap_iax2_stat_t */
91 #define STAT_FLAG_FIRST                         0x001
92 #define STAT_FLAG_MARKER                        0x002
93 #define STAT_FLAG_WRONG_SEQ                     0x004
94 #define STAT_FLAG_PT_CHANGE                     0x008
95 #define STAT_FLAG_PT_CN                         0x010
96 #define STAT_FLAG_FOLLOW_PT_CN          0x020
97 #define STAT_FLAG_REG_PT_CHANGE         0x040
98 #define STAT_FLAG_WRONG_TIMESTAMP       0x080
99
100 /* function for analysing an IAX2 packet. Called from iax2_analysis. */
101 extern void iax2_packet_analyse(tap_iax2_stat_t *statinfo,
102         packet_info *pinfo,
103         const struct _iax2_info_t *iax2info);
104
105 #ifdef __cplusplus
106 }
107 #endif /* __cplusplus */
108
109 #endif /* __TAP_IAX2_ANALYSIS_H__ */
110
111 /*
112  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
113  *
114  * Local variables:
115  * c-basic-offset: 4
116  * tab-width: 8
117  * indent-tabs-mode: nil
118  * End:
119  *
120  * vi: set shiftwidth=4 tabstop=8 expandtab:
121  * :indentSize=4:tabSize=8:noTabs=true:
122  */