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