Fix the wireless settings button for AirPCap devices in the
[obnox/wireshark/wip.git] / gtk / iax2_analysis.h
1 /* iax2_analysis.h
2  * IAX2 analysis addition for Wireshark
3  *
4  * $Id$
5  *
6  * based on rtp_analysis.c
7  * Copyright 2003, Alcatel Business Systems
8  * By Lars Ruoff <lars.ruoff@gmx.net>
9  *
10  * based on tap_rtp.c
11  * Copyright 2003, Iskratel, Ltd, Kranj
12  * By Miha Jemec <m.jemec@iskratel.si>
13  *
14  * Wireshark - Network traffic analyzer
15  * By Gerald Combs <gerald@wireshark.org>
16  * Copyright 1998 Gerald Combs
17  *
18  * This program is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU General Public License
20  * as published by the Free Software Foundation; either version 2
21  * of the License, or (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation,  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
31  */
32
33 #ifndef __IAX2_ANALYSIS_H__
34 #define __IAX2_ANALYSIS_H__
35
36 #include <glib.h>
37 #include <epan/address.h>
38 #include <epan/packet_info.h>
39
40 /** @file
41  *  ??? 
42  *  @todo what's this?
43  */
44
45 void iax2_analysis(
46                 address *ip_src_fwd,
47                 guint16 port_src_fwd,
48                 address *ip_dst_fwd,
49                 guint16 port_dst_fwd,
50                 address *ip_src_rev,
51                 guint16 port_src_rev,
52                 address *ip_dst_rev,
53                 guint16 port_dst_rev
54                 );
55
56 /****************************************************************************/
57 /* structure that holds the information about the forward and reversed direction */
58 typedef struct _iax2_bw_history_item {
59         double time;
60         guint32 bytes;
61 } iax2_bw_history_item;
62
63 #define BUFF_BW 300 
64
65 typedef struct _tap_iax2_stat_t {
66         gboolean first_packet;     /* do not use in code that is called after rtp_packet_analyse */
67                                    /* use (flags & STAT_FLAG_FIRST) instead */
68         /* all of the following fields will be initialized after
69          rtp_packet_analyse has been called */
70         guint32 flags;             /* see STAT_FLAG-defines below */
71         guint16 seq_num;
72         guint32 timestamp;
73         guint32 delta_timestamp;
74         double bandwidth;
75         iax2_bw_history_item bw_history[BUFF_BW];
76         guint16 bw_start_index;
77         guint16 bw_index;
78         guint32 total_bytes;
79         double delta;
80         double jitter;
81         double diff;
82         double time;
83         double start_time;
84         double max_delta;
85         double max_jitter;
86         double mean_jitter;
87         guint32 max_nr;
88         guint16 start_seq_nr;
89         guint16 stop_seq_nr;
90         guint32 total_nr;
91         guint32 sequence;
92         gboolean under;
93         gint cycles;
94         guint16 pt;
95         int reg_pt;
96 } tap_iax2_stat_t;
97
98 #define PT_UNDEFINED -1
99
100 /* status flags for the flags parameter in tap_iax2_stat_t */
101 #define STAT_FLAG_FIRST                         0x001
102 #define STAT_FLAG_MARKER                        0x002
103 #define STAT_FLAG_WRONG_SEQ                     0x004
104 #define STAT_FLAG_PT_CHANGE                     0x008
105 #define STAT_FLAG_PT_CN                         0x010
106 #define STAT_FLAG_FOLLOW_PT_CN          0x020
107 #define STAT_FLAG_REG_PT_CHANGE         0x040
108 #define STAT_FLAG_WRONG_TIMESTAMP       0x080
109
110 /* forward */
111 struct _rtp_info;
112
113 /* function for analysing an RTP packet. Called from rtp_analysis and rtp_streams */
114 extern int iax2_packet_analyse(tap_iax2_stat_t *statinfo,
115         packet_info *pinfo,
116         const struct _iax2_info_t *iax2info);
117
118
119 #endif /* __IAX2_ANALYSIS_H__ */