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