Get rid of a bunch of "Ethereal"s and "ethereal"s in comments, GUI
[obnox/wireshark/wip.git] / 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
30  */
31
32 #ifndef RTP_ANALYSIS_H_INCLUDED
33 #define RTP_ANALYSIS_H_INCLUDED
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         guint32 flags;             /* see STAT_FLAG-defines below */
72         guint16 seq_num;
73         guint32 timestamp;
74         guint32 delta_timestamp;
75         double bandwidth;
76         bw_history_item bw_history[BUFF_BW];
77         guint16 bw_start_index;
78         guint16 bw_index;
79         guint32 total_bytes;
80         double delta;
81         double jitter;
82         double diff;
83         double time;
84         double start_time;
85         double max_delta;
86         double max_jitter;
87         double mean_jitter;
88         guint32 max_nr;
89         guint16 start_seq_nr;
90         guint16 stop_seq_nr;
91         guint32 total_nr;
92         guint32 sequence;
93         gboolean under;
94         gint cycles;
95         guint16 pt;
96         int reg_pt;
97 } tap_rtp_stat_t;
98
99 #define PT_UNDEFINED -1
100
101 /* status flags for the flags parameter in tap_rtp_stat_t */
102 #define STAT_FLAG_FIRST       0x01
103 #define STAT_FLAG_MARKER      0x02
104 #define STAT_FLAG_WRONG_SEQ   0x04
105 #define STAT_FLAG_PT_CHANGE   0x08
106 #define STAT_FLAG_PT_CN       0x10
107 #define STAT_FLAG_FOLLOW_PT_CN  0x20
108 #define STAT_FLAG_REG_PT_CHANGE  0x40
109 #define STAT_FLAG_WRONG_TIMESTAMP  0x80
110
111 /* forward */
112 struct _rtp_info;
113
114 /* function for analysing an RTP packet. Called from rtp_analysis and rtp_streams */
115 extern int rtp_packet_analyse(tap_rtp_stat_t *statinfo,
116         packet_info *pinfo,
117         const struct _rtp_info *rtpinfo);
118
119
120 #endif /*RTP_ANALYSIS_H_INCLUDED*/