HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-rtp.h
blob7fb7b69c8a6628245a276048f1fae131100543ed
1 /* packet-rtp.h
3 * Routines for RTP dissection
4 * RTP = Real time Transport Protocol
6 * $Id$
8 * Copyright 2000, Philips Electronics N.V.
9 * Written by Andreas Sikkema <andreas.sikkema@philips.com>
11 * Wireshark - Network traffic analyzer
12 * By Gerald Combs <gerald@wireshark.org>
13 * Copyright 1998 Gerald Combs
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.
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.
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.
30 #include "epan/packet.h"
31 #include "ws_symbol_export.h"
33 #include "packet-btavdtp.h"
35 struct _rtp_info {
36 unsigned int info_version;
37 gboolean info_padding_set;
38 gboolean info_marker_set;
39 gboolean info_is_video;
40 unsigned int info_payload_type;
41 unsigned int info_padding_count;
42 guint16 info_seq_num;
43 guint32 info_timestamp;
44 guint32 info_sync_src;
45 guint info_data_len; /* length of raw rtp data as reported */
46 gboolean info_all_data_present; /* FALSE if data is cut off */
47 guint info_payload_offset; /* start of payload relative to info_data */
48 guint info_payload_len; /* length of payload (incl padding) */
49 gboolean info_is_srtp;
50 guint32 info_setup_frame_num; /* the frame num of the packet that set this RTP connection */
51 const guint8* info_data; /* pointer to raw rtp data */
52 const gchar *info_payload_type_str;
53 gint info_payload_rate;
55 * info_data: pointer to raw rtp data = header + payload incl. padding.
56 * That should be safe because the "epan_dissect_t" constructed for the packet
57 * has not yet been freed when the taps are called.
58 * (destroying the "epan_dissect_t" will end up freeing all the tvbuffs
59 * and hence invalidating pointers to their data).
60 * See "add_packet_to_packet_list()" for details.
64 /* definitions for SRTP dissection */
66 /* Encryption algorithms */
67 #define SRTP_ENC_ALG_NOT_SET 0 /* Data not available/empty record */
68 #define SRTP_ENC_ALG_NULL 1 /* non-encrypted SRTP payload - may still be authenticated */
69 #define SRTP_ENC_ALG_AES_CM 2 /* SRTP default algorithm */
70 #define SRTP_ENC_ALG_AES_F8 3
72 /* Authentication algorithms */
73 #define SRTP_AUTH_ALG_NONE 0 /* no auth tag in SRTP/RTP payload */
74 #define SRTP_AUTH_ALG_HMAC_SHA1 1 /* SRTP default algorithm */
77 #if 0 /* these are only needed once the dissector include the crypto functions to decrypt and/or authenticate */
78 struct srtp_key_info
80 guint8 *master_key; /* pointer to an se_alloc'ed master key */
81 guint8 *master_salt; /* pointer to an se_alloc'ed salt for this master key - NULL if no salt */
82 guint8 key_generation_rate; /* encoded as the power of 2, 0..24, or 255 (=zero rate) */
83 /* Either the MKI value is used (in which case from=to=0), or the <from,to> values are used (and MKI=0) */
84 guint32 from_roc; /* 32 MSBs of a 48 bit value - frame from which this key is valid (roll-over counter part) */
85 guint16 from_seq; /* 16 LSBs of a 48 bit value - frame from which this key is valid (sequence number part) */
86 guint32 to_roc; /* 32 MSBs of a 48 bit value - frame to which this key is valid (roll-over counter part) */
87 guint16 to_seq; /* 16 LSBs of a 48 bit value - frame to which this key is valid (sequence number part) */
88 guint32 mki; /* the MKI value associated with this key */
90 #endif
92 struct srtp_info
94 guint encryption_algorithm; /* at present only NULL vs non-NULL matter */
95 guint auth_algorithm; /* at present only NULL vs non-NULL matter */
96 guint mki_len; /* number of octets used for the MKI in the RTP payload */
97 guint auth_tag_len; /* number of octets used for the Auth Tag in the RTP payload */
98 #if 0 /* these are only needed once the dissector include the crypto functions to decrypt and/or authenticate */
99 struct srtp_key_info **master_keys; /* an array of pointers to master keys and their info, the array and each key struct being se_alloc'ed */
100 void *enc_alg_info, /* algorithm-dependent info struct - may be void for default alg with default params */
101 void *auth_alg_info /* algorithm-dependent info struct - void for default alg with default params */
102 #endif
105 /* Info to save in RTP conversation / packet-info */
106 #define MAX_RTP_SETUP_METHOD_SIZE 7
107 struct _rtp_conversation_info
109 gchar method[MAX_RTP_SETUP_METHOD_SIZE + 1];
110 guint32 frame_number; /* the frame where this conversation is started */
111 gboolean is_video;
112 GHashTable *rtp_dyn_payload; /* a hash table with the dynamic RTP payload */
114 guint32 extended_seqno; /* the sequence number, extended to a 32-bit
115 * int to guarantee it increasing monotonically
118 struct _rtp_private_conv_info *rtp_conv_info; /* conversation info private
119 * to the rtp dissector
121 struct srtp_info *srtp_info; /* SRTP context */
122 bta2dp_codec_info_t *bta2dp_info;
123 btvdp_codec_info_t *btvdp_info;
126 typedef struct {
127 char *encoding_name;
128 int sample_rate;
129 } encoding_name_and_rate_t;
131 /* Add an RTP conversation with the given details */
132 WS_DLL_PUBLIC
133 void rtp_add_address(packet_info *pinfo,
134 address *addr, int port,
135 int other_port,
136 const gchar *setup_method,
137 guint32 setup_frame_number,
138 gboolean is_video,
139 GHashTable *rtp_dyn_payload);
141 /* Add an SRTP conversation with the given details */
142 WS_DLL_PUBLIC
143 void srtp_add_address(packet_info *pinfo,
144 address *addr, int port,
145 int other_port,
146 const gchar *setup_method,
147 guint32 setup_frame_number,
148 gboolean is_video,
149 GHashTable *rtp_dyn_payload,
150 struct srtp_info *srtp_info);
152 /* Add an Bluetooth conversation with the given details */
153 void
154 bluetooth_add_address(packet_info *pinfo, address *addr,
155 const gchar *setup_method, guint32 setup_frame_number,
156 gboolean is_video, void *data);
158 /* Free and destroy the dyn_payload hash table */
159 WS_DLL_PUBLIC
160 void rtp_free_hash_dyn_payload(GHashTable *rtp_dyn_payload);