1999-07-07 00:34:58 +00:00
|
|
|
/* packet-sdp.c
|
2000-01-13 03:18:34 +00:00
|
|
|
* Routines for SDP packet disassembly (RFC 2327)
|
1999-07-07 00:34:58 +00:00
|
|
|
*
|
|
|
|
* Jason Lango <jal@netapp.com>
|
2000-01-22 06:22:44 +00:00
|
|
|
* Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu>
|
1999-07-07 00:34:58 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-07-07 00:34:58 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1999-07-07 00:34:58 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-07-07 00:34:58 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-07-07 00:34:58 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-07-07 00:34:58 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
2007-04-10 21:02:50 +00:00
|
|
|
* Ref http://www.ietf.org/rfc/rfc4566.txt?number=4566
|
1999-07-07 00:34:58 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
2003-11-17 21:52:35 +00:00
|
|
|
#include <sys/types.h>
|
2003-11-18 19:20:15 +00:00
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
2003-11-17 21:52:35 +00:00
|
|
|
#include <sys/socket.h>
|
2003-11-18 19:20:15 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
|
|
|
# include <netinet/in.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ARPA_INET_H
|
2003-11-17 21:52:35 +00:00
|
|
|
#include <arpa/inet.h>
|
2003-11-18 19:20:15 +00:00
|
|
|
#endif
|
2003-11-17 21:52:35 +00:00
|
|
|
|
2004-11-24 03:18:30 +00:00
|
|
|
#ifdef HAVE_WINSOCK2_H
|
|
|
|
#include <winsock2.h> /* needed to define AF_ values on Windows */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef NEED_INET_V6DEFS_H
|
|
|
|
# include "inet_v6defs.h"
|
|
|
|
#endif
|
|
|
|
|
2007-08-15 22:27:52 +00:00
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2003-11-17 21:52:35 +00:00
|
|
|
#include <epan/conversation.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/strutil.h>
|
2005-08-17 08:50:04 +00:00
|
|
|
#include <epan/emem.h>
|
2007-03-05 23:11:11 +00:00
|
|
|
#include <epan/base64.h>
|
2007-05-01 22:05:11 +00:00
|
|
|
#include <epan/asn1.h>
|
2004-06-15 18:26:08 +00:00
|
|
|
|
2005-02-01 12:12:35 +00:00
|
|
|
#include "tap.h"
|
|
|
|
#include "packet-sdp.h"
|
|
|
|
|
2004-06-15 18:26:08 +00:00
|
|
|
#include "packet-rtp.h"
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/rtp_pt.h>
|
2006-05-03 05:07:04 +00:00
|
|
|
|
|
|
|
#include <epan/prefs.h>
|
2007-07-17 13:09:44 +00:00
|
|
|
#include <epan/expert.h>
|
2006-05-03 05:07:04 +00:00
|
|
|
|
2004-06-15 18:26:08 +00:00
|
|
|
#include "packet-rtcp.h"
|
2004-10-22 06:19:00 +00:00
|
|
|
#include "packet-t38.h"
|
2006-07-28 21:26:39 +00:00
|
|
|
#include "packet-msrp.h"
|
2006-11-03 20:15:17 +00:00
|
|
|
#include "packet-per.h"
|
|
|
|
#include "packet-h245.h"
|
2007-12-03 20:14:42 +00:00
|
|
|
#include "packet-h264.h"
|
1999-07-07 00:34:58 +00:00
|
|
|
|
2003-11-17 21:52:35 +00:00
|
|
|
static dissector_handle_t rtp_handle=NULL;
|
|
|
|
static dissector_handle_t rtcp_handle=NULL;
|
2004-10-22 06:19:00 +00:00
|
|
|
static dissector_handle_t t38_handle=NULL;
|
2006-07-28 21:26:39 +00:00
|
|
|
static dissector_handle_t msrp_handle=NULL;
|
2007-12-03 20:14:42 +00:00
|
|
|
static dissector_handle_t h264_handle = NULL;
|
2004-10-22 06:19:00 +00:00
|
|
|
|
2005-02-01 12:12:35 +00:00
|
|
|
static int sdp_tap = -1;
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
static int proto_sdp = -1;
|
|
|
|
|
2006-05-03 05:07:04 +00:00
|
|
|
/* preference globals */
|
|
|
|
static gboolean global_sdp_establish_conversation = TRUE;
|
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
/* Top level fields */
|
2001-12-13 21:49:22 +00:00
|
|
|
static int hf_protocol_version = -1;
|
|
|
|
static int hf_owner = -1;
|
|
|
|
static int hf_session_name = -1;
|
|
|
|
static int hf_session_info = -1;
|
|
|
|
static int hf_uri = -1;
|
|
|
|
static int hf_email = -1;
|
|
|
|
static int hf_phone = -1;
|
|
|
|
static int hf_connection_info = -1;
|
|
|
|
static int hf_bandwidth = -1;
|
2001-12-15 20:22:47 +00:00
|
|
|
static int hf_timezone = -1;
|
2001-12-13 21:49:22 +00:00
|
|
|
static int hf_encryption_key = -1;
|
|
|
|
static int hf_session_attribute = -1;
|
|
|
|
static int hf_media_attribute = -1;
|
|
|
|
static int hf_time = -1;
|
|
|
|
static int hf_repeat_time = -1;
|
|
|
|
static int hf_media = -1;
|
|
|
|
static int hf_media_title = -1;
|
|
|
|
static int hf_unknown = -1;
|
|
|
|
static int hf_invalid = -1;
|
2005-06-22 02:18:10 +00:00
|
|
|
static int hf_ipbcp_version = -1;
|
|
|
|
static int hf_ipbcp_type = -1;
|
2001-12-13 21:49:22 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
/* hf_owner subfields*/
|
|
|
|
static int hf_owner_username = -1;
|
|
|
|
static int hf_owner_sessionid = -1;
|
|
|
|
static int hf_owner_version = -1;
|
|
|
|
static int hf_owner_network_type = -1;
|
|
|
|
static int hf_owner_address_type = -1;
|
|
|
|
static int hf_owner_address = -1;
|
|
|
|
|
|
|
|
/* hf_connection_info subfields */
|
|
|
|
static int hf_connection_info_network_type = -1;
|
|
|
|
static int hf_connection_info_address_type = -1;
|
|
|
|
static int hf_connection_info_connection_address = -1;
|
|
|
|
static int hf_connection_info_ttl = -1;
|
|
|
|
static int hf_connection_info_num_addr = -1;
|
|
|
|
|
|
|
|
/* hf_bandwidth subfields */
|
|
|
|
static int hf_bandwidth_modifier = -1;
|
|
|
|
static int hf_bandwidth_value = -1;
|
|
|
|
|
|
|
|
/* hf_time subfields */
|
|
|
|
static int hf_time_start = -1;
|
|
|
|
static int hf_time_stop = -1;
|
|
|
|
|
|
|
|
/* hf_repeat_time subfield */
|
|
|
|
static int hf_repeat_time_interval = -1;
|
|
|
|
static int hf_repeat_time_duration = -1;
|
|
|
|
static int hf_repeat_time_offset = -1;
|
|
|
|
|
|
|
|
/* hf_timezone subfields */
|
|
|
|
static int hf_timezone_time = -1;
|
|
|
|
static int hf_timezone_offset = -1;
|
|
|
|
|
|
|
|
/* hf_encryption_key subfields */
|
|
|
|
static int hf_encryption_key_type = -1;
|
|
|
|
static int hf_encryption_key_data = -1;
|
|
|
|
|
|
|
|
/* hf_session_attribute subfields */
|
|
|
|
static int hf_session_attribute_field = -1;
|
|
|
|
static int hf_session_attribute_value = -1;
|
|
|
|
|
|
|
|
/* hf_media subfields */
|
|
|
|
static int hf_media_media = -1;
|
|
|
|
static int hf_media_port = -1;
|
|
|
|
static int hf_media_portcount = -1;
|
|
|
|
static int hf_media_proto = -1;
|
|
|
|
static int hf_media_format = -1;
|
|
|
|
|
|
|
|
/* hf_session_attribute subfields */
|
|
|
|
static int hf_media_attribute_field = -1;
|
|
|
|
static int hf_media_attribute_value = -1;
|
2006-04-26 20:16:57 +00:00
|
|
|
static int hf_media_encoding_name = -1;
|
2008-07-29 15:58:43 +00:00
|
|
|
static int hf_media_sample_rate = -1;
|
2006-04-26 20:16:57 +00:00
|
|
|
static int hf_media_format_specific_parameter = -1;
|
2007-12-10 21:25:32 +00:00
|
|
|
static int hf_sdp_fmtp_mpeg4_profile_level_id = -1;
|
2006-12-04 23:03:11 +00:00
|
|
|
static int hf_sdp_fmtp_h263_profile = -1;
|
2007-12-10 21:25:32 +00:00
|
|
|
static int hf_sdp_h264_packetization_mode = -1;
|
|
|
|
static int hf_sdp_h264_sprop_parameter_sets = -1;
|
2006-11-03 20:15:17 +00:00
|
|
|
static int hf_SDPh223LogicalChannelParameters = -1;
|
2001-12-15 20:22:47 +00:00
|
|
|
|
2007-03-05 23:11:11 +00:00
|
|
|
/* hf_session_attribute hf_media_attribute subfields */
|
|
|
|
static int hf_key_mgmt_att_value = -1;
|
|
|
|
static int hf_key_mgmt_prtcl_id = -1;
|
|
|
|
static int hf_key_mgmt_data = -1;
|
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
/* trees */
|
1999-11-16 11:44:20 +00:00
|
|
|
static int ett_sdp = -1;
|
2001-12-15 20:22:47 +00:00
|
|
|
static int ett_sdp_owner = -1;
|
|
|
|
static int ett_sdp_connection_info = -1;
|
|
|
|
static int ett_sdp_bandwidth = -1;
|
|
|
|
static int ett_sdp_time = -1;
|
|
|
|
static int ett_sdp_repeat_time = -1;
|
|
|
|
static int ett_sdp_timezone = -1;
|
|
|
|
static int ett_sdp_encryption_key = -1;
|
|
|
|
static int ett_sdp_session_attribute = -1;
|
|
|
|
static int ett_sdp_media = -1;
|
|
|
|
static int ett_sdp_media_attribute = -1;
|
2006-04-26 20:16:57 +00:00
|
|
|
static int ett_sdp_fmtp = -1;
|
2007-03-05 23:11:11 +00:00
|
|
|
static int ett_sdp_key_mgmt = -1;
|
2001-12-15 20:22:47 +00:00
|
|
|
|
2004-01-13 23:18:13 +00:00
|
|
|
|
|
|
|
#define SDP_MAX_RTP_CHANNELS 4
|
2005-03-29 20:58:03 +00:00
|
|
|
#define SDP_MAX_RTP_PAYLOAD_TYPES 20
|
2004-01-13 23:18:13 +00:00
|
|
|
|
2005-04-24 18:43:42 +00:00
|
|
|
typedef struct {
|
2006-04-29 17:31:20 +00:00
|
|
|
gint32 pt[SDP_MAX_RTP_PAYLOAD_TYPES];
|
|
|
|
gint8 pt_count;
|
|
|
|
GHashTable *rtp_dyn_payload;
|
2005-04-24 18:43:42 +00:00
|
|
|
} transport_media_pt_t;
|
|
|
|
|
2003-11-17 21:52:35 +00:00
|
|
|
typedef struct {
|
2006-04-29 17:31:20 +00:00
|
|
|
char *connection_address;
|
|
|
|
char *connection_type;
|
|
|
|
char *encoding_name;
|
|
|
|
char *media_port[SDP_MAX_RTP_CHANNELS];
|
|
|
|
char *media_proto[SDP_MAX_RTP_CHANNELS];
|
|
|
|
transport_media_pt_t media[SDP_MAX_RTP_CHANNELS];
|
|
|
|
gint8 media_count;
|
2003-11-17 21:52:35 +00:00
|
|
|
} transport_info_t;
|
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
|
|
|
|
/* MSRP transport info (as set while parsing path attribute) */
|
|
|
|
static gboolean msrp_transport_address_set = FALSE;
|
|
|
|
static guint32 msrp_ipaddr[4];
|
|
|
|
static guint16 msrp_port_number;
|
|
|
|
|
2007-03-05 23:11:11 +00:00
|
|
|
/* key-mgmt dissector
|
|
|
|
* IANA registry:
|
|
|
|
* http://www.iana.org/assignments/sdp-parameters
|
|
|
|
*/
|
|
|
|
static dissector_table_t key_mgmt_dissector_table;
|
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
|
2006-10-26 17:03:45 +00:00
|
|
|
/* Protocol registration */
|
|
|
|
void proto_register_sdp(void);
|
|
|
|
void proto_reg_handoff_sdp(void);
|
|
|
|
|
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
/* static functions */
|
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
static void call_sdp_subdissector(tvbuff_t *tvb, packet_info *pinfo, int hf, proto_tree* ti,
|
2006-04-29 17:31:20 +00:00
|
|
|
transport_info_t *transport_info);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
|
|
|
/* Subdissector functions */
|
2002-04-14 23:22:22 +00:00
|
|
|
static void dissect_sdp_owner(tvbuff_t *tvb, proto_item* ti);
|
2003-11-17 21:52:35 +00:00
|
|
|
static void dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti,
|
2006-04-29 17:31:20 +00:00
|
|
|
transport_info_t *transport_info);
|
2002-04-14 23:22:22 +00:00
|
|
|
static void dissect_sdp_bandwidth(tvbuff_t *tvb, proto_item *ti);
|
|
|
|
static void dissect_sdp_time(tvbuff_t *tvb, proto_item* ti);
|
|
|
|
static void dissect_sdp_repeat_time(tvbuff_t *tvb, proto_item* ti);
|
|
|
|
static void dissect_sdp_timezone(tvbuff_t *tvb, proto_item* ti);
|
|
|
|
static void dissect_sdp_encryption_key(tvbuff_t *tvb, proto_item * ti);
|
2007-03-05 23:11:11 +00:00
|
|
|
static void dissect_sdp_session_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_item *ti);
|
2003-11-17 21:52:35 +00:00
|
|
|
static void dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
|
2006-04-29 17:31:20 +00:00
|
|
|
transport_info_t *transport_info);
|
2006-11-03 20:15:17 +00:00
|
|
|
static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_item *ti, transport_info_t *transport_info);
|
1999-11-16 11:44:20 +00:00
|
|
|
|
Add a mechanism by which a dissector can be registered by name, another
dissector can get a "handle" for that dissector by name and then call
that dissector through the handle.
This allows dissectors that can't be called through a port table or a
heuristic table to be called from other dissectors without directly
referring to the dissector function - dynamically-loaded modules, under
Windows, cannot directly call functions in the main program, and
non-plugin dissectors are in the main program and thus cannot be called
from plugin dissectors unless either
1) a pointer to the dissector is put in the Big Transfer Vector
or
2) some other mechanism for getting a pointer to the dissector
is provided.
This mechanism could also support registering old-style dissectors and
calling them from new-style dissectors without the new-style dissector
having to do the argument translation itself (I didn't add support for
registering old-style dissectors because I'd prefer to have people
tvbuffify their code if they have to register a dissector...).
It could also, in the future, perhaps support
disabling of protocols;
setting "pinfo->current_proto";
inside "call_dissector()" - and inside "{old_}dissector_try_port()" and
"{old_"dissector_try_heuristic()" - allowing a pile of stuff that
currently has to be done in every dissector be done by common code.
(I have some ideas about how to do this, by
having "proto_register_protocol()" take an abbreviation - of the
sort that would be put in, for example, "pinfo->current_proto" -
as an argument;
having the calls to register dissectors take an index returned
by "proto_register_protocol()" as an argument.
The abbreviation could be used elsewhere as well, e.g. in the "Decoding"
tab of the "Edit->Protocols" dialog box, and in a GUI for constructing
protocol filters. Watch this space.)
Make "dissect_sdp()" the first client of this mechanism; it's now static
to "packet-sdp.c", and all dissectors that call it - including the MGCP
plugin - now call it through a dissector handle fetched by
"find_dissector()". (Next step - see if Ethereal can now compile on
Windows as a result of this.)
svn path=/trunk/; revision=2647
2000-11-15 07:07:52 +00:00
|
|
|
static void
|
2000-11-10 06:50:37 +00:00
|
|
|
dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
1999-07-07 00:34:58 +00:00
|
|
|
{
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree *sdp_tree;
|
|
|
|
proto_item *ti, *sub_ti;
|
|
|
|
gint offset = 0;
|
|
|
|
gint next_offset;
|
|
|
|
int linelen;
|
|
|
|
gboolean in_media_description;
|
|
|
|
guchar type;
|
|
|
|
guchar delim;
|
|
|
|
int datalen;
|
|
|
|
int tokenoffset;
|
|
|
|
int hf = -1;
|
|
|
|
char *string;
|
|
|
|
|
|
|
|
address src_addr;
|
|
|
|
|
|
|
|
transport_info_t transport_info;
|
|
|
|
|
|
|
|
guint32 port=0;
|
|
|
|
gboolean is_rtp=FALSE;
|
2007-11-02 07:41:56 +00:00
|
|
|
gboolean is_srtp=FALSE;
|
2006-04-29 17:31:20 +00:00
|
|
|
gboolean is_t38=FALSE;
|
2006-07-28 21:26:39 +00:00
|
|
|
gboolean is_msrp=FALSE;
|
2006-04-29 17:31:20 +00:00
|
|
|
gboolean set_rtp=FALSE;
|
|
|
|
gboolean is_ipv4_addr=FALSE;
|
|
|
|
gboolean is_ipv6_addr=FALSE;
|
|
|
|
guint32 ipaddr[4];
|
|
|
|
gint n,i;
|
|
|
|
sdp_packet_info *sdp_pi;
|
|
|
|
|
|
|
|
/* Initialise packet info for passing to tap */
|
|
|
|
sdp_pi = ep_alloc(sizeof(sdp_packet_info));
|
|
|
|
sdp_pi->summary_str[0] = '\0';
|
|
|
|
|
|
|
|
/* Initialise RTP channel info */
|
|
|
|
transport_info.connection_address=NULL;
|
|
|
|
transport_info.connection_type=NULL;
|
|
|
|
transport_info.encoding_name=NULL;
|
|
|
|
for (n=0; n < SDP_MAX_RTP_CHANNELS; n++)
|
|
|
|
{
|
|
|
|
transport_info.media_port[n]=NULL;
|
|
|
|
transport_info.media_proto[n]=NULL;
|
|
|
|
transport_info.media[n].pt_count = 0;
|
2008-05-20 09:22:06 +00:00
|
|
|
transport_info.media[n].rtp_dyn_payload =
|
|
|
|
g_hash_table_new_full( g_int_hash, g_int_equal, g_free, g_free);
|
2006-04-29 17:31:20 +00:00
|
|
|
}
|
|
|
|
transport_info.media_count = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* As RFC 2327 says, "SDP is purely a format for session
|
|
|
|
* description - it does not incorporate a transport protocol,
|
|
|
|
* and is intended to use different transport protocols as
|
|
|
|
* appropriate including the Session Announcement Protocol,
|
|
|
|
* Session Initiation Protocol, Real-Time Streaming Protocol,
|
|
|
|
* electronic mail using the MIME extensions, and the
|
|
|
|
* Hypertext Transport Protocol."
|
|
|
|
*
|
|
|
|
* We therefore don't set the protocol or info columns;
|
|
|
|
* instead, we append to them, so that we don't erase
|
|
|
|
* what the protocol inside which the SDP stuff resides
|
|
|
|
* put there.
|
|
|
|
*/
|
|
|
|
if (check_col(pinfo->cinfo, COL_PROTOCOL))
|
|
|
|
col_append_str(pinfo->cinfo, COL_PROTOCOL, "/SDP");
|
|
|
|
|
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
/* XXX: Needs description. */
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, ", with session description");
|
|
|
|
}
|
|
|
|
|
|
|
|
ti = proto_tree_add_item(tree, proto_sdp, tvb, offset, -1, FALSE);
|
|
|
|
sdp_tree = proto_item_add_subtree(ti, ett_sdp);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Show the SDP message a line at a time.
|
|
|
|
*/
|
|
|
|
in_media_description = FALSE;
|
2007-02-24 12:24:13 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
while (tvb_reported_length_remaining(tvb, offset) > 0) {
|
|
|
|
/*
|
|
|
|
* Find the end of the line.
|
|
|
|
*/
|
|
|
|
linelen = tvb_find_line_end_unquoted(tvb, offset, -1, &next_offset);
|
2007-08-15 22:27:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
/*
|
|
|
|
* Line must contain at least e.g. "v=".
|
|
|
|
*/
|
|
|
|
if (linelen < 2)
|
|
|
|
break;
|
|
|
|
|
|
|
|
type = tvb_get_guint8(tvb,offset);
|
|
|
|
delim = tvb_get_guint8(tvb,offset + 1);
|
|
|
|
if (delim != '=') {
|
2007-07-17 13:09:44 +00:00
|
|
|
proto_item *ti = proto_tree_add_item(sdp_tree, hf_invalid, tvb, offset, linelen, FALSE);
|
|
|
|
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_NOTE,
|
|
|
|
"Invalid SDP line (no '=' delimiter)");
|
2006-04-29 17:31:20 +00:00
|
|
|
offset = next_offset;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Attributes.
|
|
|
|
*/
|
|
|
|
switch (type) {
|
|
|
|
case 'v':
|
|
|
|
hf = hf_protocol_version;
|
|
|
|
break;
|
|
|
|
case 'o':
|
|
|
|
hf = hf_owner;
|
|
|
|
break;
|
|
|
|
case 's':
|
|
|
|
hf = hf_session_name;
|
|
|
|
break;
|
|
|
|
case 'i':
|
|
|
|
if (in_media_description) {
|
|
|
|
hf = hf_media_title;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
hf = hf_session_info;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'u':
|
|
|
|
hf = hf_uri;
|
|
|
|
break;
|
|
|
|
case 'e':
|
|
|
|
hf = hf_email;
|
|
|
|
break;
|
|
|
|
case 'p':
|
|
|
|
hf = hf_phone;
|
|
|
|
break;
|
|
|
|
case 'c':
|
|
|
|
hf = hf_connection_info;
|
|
|
|
break;
|
|
|
|
case 'b':
|
|
|
|
hf = hf_bandwidth;
|
|
|
|
break;
|
|
|
|
case 't':
|
|
|
|
hf = hf_time;
|
|
|
|
break;
|
|
|
|
case 'r':
|
|
|
|
hf = hf_repeat_time;
|
|
|
|
break;
|
|
|
|
case 'm':
|
|
|
|
hf = hf_media;
|
|
|
|
in_media_description = TRUE;
|
|
|
|
break;
|
|
|
|
case 'k':
|
|
|
|
hf = hf_encryption_key;
|
|
|
|
break;
|
|
|
|
case 'a':
|
|
|
|
if (in_media_description) {
|
|
|
|
hf = hf_media_attribute;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
hf = hf_session_attribute;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'z':
|
|
|
|
hf = hf_timezone;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
hf = hf_unknown;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
tokenoffset = 2;
|
|
|
|
if (hf == hf_unknown)
|
|
|
|
tokenoffset = 0;
|
2006-10-26 17:03:45 +00:00
|
|
|
string = (char*)tvb_get_ephemeral_string(tvb, offset + tokenoffset,
|
|
|
|
linelen - tokenoffset);
|
2006-04-29 17:31:20 +00:00
|
|
|
sub_ti = proto_tree_add_string(sdp_tree, hf, tvb, offset, linelen,
|
|
|
|
string);
|
|
|
|
call_sdp_subdissector(tvb_new_subset(tvb,offset+tokenoffset,
|
|
|
|
linelen-tokenoffset,
|
|
|
|
linelen-tokenoffset),
|
2008-05-20 09:22:06 +00:00
|
|
|
pinfo,
|
|
|
|
hf,sub_ti,&transport_info),
|
2006-04-29 17:31:20 +00:00
|
|
|
offset = next_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Now look, if we have strings collected.
|
|
|
|
* Try to convert ipv4 addresses and ports into binary format,
|
|
|
|
* so we can use them to detect rtp and rtcp streams.
|
|
|
|
* Don't forget to free the strings!
|
|
|
|
*/
|
|
|
|
|
|
|
|
for (n = 0; n < transport_info.media_count; n++)
|
|
|
|
{
|
|
|
|
if(transport_info.media_port[n]!=NULL) {
|
|
|
|
port = atol(transport_info.media_port[n]);
|
|
|
|
}
|
|
|
|
if(transport_info.media_proto[n]!=NULL) {
|
2006-05-03 05:07:04 +00:00
|
|
|
/* Check if media protocol is RTP
|
2007-08-15 22:27:52 +00:00
|
|
|
* and stream decoding is enabled in preferences
|
2006-07-28 21:26:39 +00:00
|
|
|
*/
|
|
|
|
if(global_sdp_establish_conversation){
|
|
|
|
/* Check if media protocol is RTP */
|
|
|
|
is_rtp = (strcmp(transport_info.media_proto[n],"RTP/AVP")==0);
|
2007-11-02 07:41:56 +00:00
|
|
|
/* Check if media protocol is SRTP */
|
|
|
|
is_srtp = (strcmp(transport_info.media_proto[n],"RTP/SAVP")==0);
|
2006-07-28 21:26:39 +00:00
|
|
|
/* Check if media protocol is T38 */
|
2008-05-20 09:22:06 +00:00
|
|
|
is_t38 = ( (strcmp(transport_info.media_proto[n],"UDPTL")==0) ||
|
|
|
|
(strcmp(transport_info.media_proto[n],"udptl")==0) );
|
2006-07-28 21:26:39 +00:00
|
|
|
/* Check if media protocol is MSRP/TCP */
|
|
|
|
is_msrp = (strcmp(transport_info.media_proto[n],"msrp/tcp")==0);
|
|
|
|
}
|
2006-04-29 17:31:20 +00:00
|
|
|
}
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
if(transport_info.connection_address!=NULL) {
|
|
|
|
if(transport_info.connection_type!=NULL) {
|
|
|
|
if (strcmp(transport_info.connection_type,"IP4")==0) {
|
|
|
|
if(inet_pton(AF_INET,transport_info.connection_address, &ipaddr)==1 ) {
|
|
|
|
/* connection_address could be converted to a valid ipv4 address*/
|
|
|
|
is_ipv4_addr=TRUE;
|
|
|
|
src_addr.type=AT_IPv4;
|
|
|
|
src_addr.len=4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (strcmp(transport_info.connection_type,"IP6")==0){
|
|
|
|
if (inet_pton(AF_INET6, transport_info.connection_address, &ipaddr)==1){
|
|
|
|
/* connection_address could be converted to a valid ipv6 address*/
|
|
|
|
is_ipv6_addr=TRUE;
|
|
|
|
src_addr.type=AT_IPv6;
|
|
|
|
src_addr.len=16;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set_rtp = FALSE;
|
2007-11-02 07:41:56 +00:00
|
|
|
/* Add (s)rtp and (s)rtcp conversation, if available (overrides t38 if conversation already set) */
|
|
|
|
if((!pinfo->fd->flags.visited) && port!=0 && (is_rtp||is_srtp) && (is_ipv4_addr || is_ipv6_addr)){
|
2006-10-27 14:36:48 +00:00
|
|
|
src_addr.data=(guint8*)&ipaddr;
|
2006-04-29 17:31:20 +00:00
|
|
|
if(rtp_handle){
|
2007-11-02 07:41:56 +00:00
|
|
|
if (is_srtp) {
|
|
|
|
struct srtp_info *dummy_srtp_info = se_alloc0(sizeof(struct srtp_info));
|
|
|
|
srtp_add_address(pinfo, &src_addr, port, 0, "SDP", pinfo->fd->num,
|
|
|
|
transport_info.media[n].rtp_dyn_payload, dummy_srtp_info);
|
|
|
|
} else {
|
|
|
|
rtp_add_address(pinfo, &src_addr, port, 0, "SDP", pinfo->fd->num,
|
|
|
|
transport_info.media[n].rtp_dyn_payload);
|
|
|
|
}
|
2006-04-29 17:31:20 +00:00
|
|
|
set_rtp = TRUE;
|
|
|
|
}
|
|
|
|
if(rtcp_handle){
|
|
|
|
port++;
|
|
|
|
rtcp_add_address(pinfo, &src_addr, port, 0, "SDP", pinfo->fd->num);
|
|
|
|
}
|
2006-07-28 21:26:39 +00:00
|
|
|
}
|
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
/* Add t38 conversation, if available and only if no rtp */
|
|
|
|
if((!pinfo->fd->flags.visited) && port!=0 && !set_rtp && is_t38 && is_ipv4_addr){
|
2006-10-27 14:36:48 +00:00
|
|
|
src_addr.data=(guint8*)&ipaddr;
|
2006-04-29 17:31:20 +00:00
|
|
|
if(t38_handle){
|
|
|
|
t38_add_address(pinfo, &src_addr, port, 0, "SDP", pinfo->fd->num);
|
2006-07-28 21:26:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add MSRP conversation. Uses addresses discovered in attribute
|
|
|
|
rather than connection information of media session line */
|
|
|
|
if (is_msrp ){
|
|
|
|
if ((!pinfo->fd->flags.visited) && msrp_transport_address_set){
|
|
|
|
if(msrp_handle){
|
|
|
|
src_addr.type=AT_IPv4;
|
|
|
|
src_addr.len=4;
|
2006-10-27 14:36:48 +00:00
|
|
|
src_addr.data=(guint8*)&msrp_ipaddr;
|
2006-07-28 21:26:39 +00:00
|
|
|
msrp_add_address(pinfo, &src_addr, msrp_port_number, "SDP", pinfo->fd->num);
|
|
|
|
}
|
|
|
|
}
|
2006-04-29 17:31:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Create the RTP summary str for the Voip Call analysis */
|
|
|
|
for (i = 0; i < transport_info.media[n].pt_count; i++)
|
|
|
|
{
|
|
|
|
/* if the payload type is dynamic (96 to 127), check the hash table to add the desc in the SDP summary */
|
|
|
|
if ( (transport_info.media[n].pt[i] >=96) && (transport_info.media[n].pt[i] <=127) ) {
|
|
|
|
gchar *str_dyn_pt = g_hash_table_lookup(transport_info.media[n].rtp_dyn_payload, &transport_info.media[n].pt[i]);
|
|
|
|
if (str_dyn_pt)
|
|
|
|
g_snprintf(sdp_pi->summary_str, 50, "%s %s", sdp_pi->summary_str, str_dyn_pt);
|
|
|
|
else
|
|
|
|
g_snprintf(sdp_pi->summary_str, 50, "%s %d", sdp_pi->summary_str, transport_info.media[n].pt[i]);
|
2007-08-15 22:27:52 +00:00
|
|
|
} else
|
2006-04-29 17:31:20 +00:00
|
|
|
g_snprintf(sdp_pi->summary_str, 50, "%s %s", sdp_pi->summary_str, val_to_str(transport_info.media[n].pt[i], rtp_payload_type_short_vals, "%u"));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Free the hash table if we did't assigned it to a conv use it */
|
2007-08-15 22:27:52 +00:00
|
|
|
if (set_rtp == FALSE)
|
2006-04-29 17:31:20 +00:00
|
|
|
rtp_free_hash_dyn_payload(transport_info.media[n].rtp_dyn_payload);
|
|
|
|
|
|
|
|
/* Create the T38 summary str for the Voip Call analysis */
|
2007-08-15 22:27:52 +00:00
|
|
|
if (is_t38) g_snprintf(sdp_pi->summary_str, 50, "%s t38", sdp_pi->summary_str);
|
2006-04-29 17:31:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Free the remainded hash tables not used */
|
|
|
|
for (n = transport_info.media_count; n < SDP_MAX_RTP_CHANNELS; n++)
|
|
|
|
{
|
|
|
|
rtp_free_hash_dyn_payload(transport_info.media[n].rtp_dyn_payload);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
datalen = tvb_length_remaining(tvb, offset);
|
|
|
|
if (datalen > 0) {
|
|
|
|
proto_tree_add_text(sdp_tree, tvb, offset, datalen, "Data (%d bytes)",
|
|
|
|
datalen);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Report this packet to the tap */
|
|
|
|
tap_queue_packet(sdp_tap, pinfo, sdp_pi);
|
1999-07-07 00:34:58 +00:00
|
|
|
}
|
1999-07-29 05:47:07 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static void
|
2006-11-03 20:15:17 +00:00
|
|
|
call_sdp_subdissector(tvbuff_t *tvb, packet_info *pinfo, int hf, proto_tree* ti, transport_info_t *transport_info){
|
2001-12-15 20:22:47 +00:00
|
|
|
if(hf == hf_owner){
|
2002-04-14 23:22:22 +00:00
|
|
|
dissect_sdp_owner(tvb,ti);
|
2001-12-15 20:22:47 +00:00
|
|
|
} else if ( hf == hf_connection_info) {
|
2003-11-17 21:52:35 +00:00
|
|
|
dissect_sdp_connection_info(tvb,ti,transport_info);
|
2001-12-15 20:22:47 +00:00
|
|
|
} else if ( hf == hf_bandwidth) {
|
2002-04-14 23:22:22 +00:00
|
|
|
dissect_sdp_bandwidth(tvb,ti);
|
2001-12-15 20:22:47 +00:00
|
|
|
} else if ( hf == hf_time) {
|
2002-04-14 23:22:22 +00:00
|
|
|
dissect_sdp_time(tvb,ti);
|
2001-12-15 20:22:47 +00:00
|
|
|
} else if ( hf == hf_repeat_time ){
|
2002-04-14 23:22:22 +00:00
|
|
|
dissect_sdp_repeat_time(tvb,ti);
|
2001-12-15 20:22:47 +00:00
|
|
|
} else if ( hf == hf_timezone ) {
|
2002-04-14 23:22:22 +00:00
|
|
|
dissect_sdp_timezone(tvb,ti);
|
2001-12-15 20:22:47 +00:00
|
|
|
} else if ( hf == hf_encryption_key ) {
|
2002-04-14 23:22:22 +00:00
|
|
|
dissect_sdp_encryption_key(tvb,ti);
|
2001-12-15 20:22:47 +00:00
|
|
|
} else if ( hf == hf_session_attribute ){
|
2007-03-05 23:11:11 +00:00
|
|
|
dissect_sdp_session_attribute(tvb,pinfo,ti);
|
2001-12-15 20:22:47 +00:00
|
|
|
} else if ( hf == hf_media ) {
|
2003-11-17 21:52:35 +00:00
|
|
|
dissect_sdp_media(tvb,ti,transport_info);
|
2001-12-15 20:22:47 +00:00
|
|
|
} else if ( hf == hf_media_attribute ){
|
2006-11-03 20:15:17 +00:00
|
|
|
dissect_sdp_media_attribute(tvb,pinfo,ti,transport_info);
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static void
|
2002-04-14 23:22:22 +00:00
|
|
|
dissect_sdp_owner(tvbuff_t *tvb, proto_item *ti){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree *sdp_owner_tree;
|
|
|
|
gint offset,next_offset,tokenlen;
|
|
|
|
|
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
|
|
|
|
|
|
|
sdp_owner_tree = proto_item_add_subtree(ti,ett_sdp_owner);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
/* Find the username */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_owner_tree, hf_owner_username, tvb, offset, tokenlen,
|
|
|
|
FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
|
|
|
|
/* Find the session id */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_owner_tree, hf_owner_sessionid, tvb, offset,
|
|
|
|
tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
|
|
|
|
/* Find the version */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_owner_tree, hf_owner_version, tvb, offset, tokenlen,
|
|
|
|
FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
|
|
|
|
/* Find the network type */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_owner_tree, hf_owner_network_type, tvb, offset,
|
|
|
|
tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
/* Find the address type */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_owner_tree, hf_owner_address_type, tvb, offset,
|
|
|
|
tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
|
|
|
|
/* Find the address */
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_owner_tree,hf_owner_address, tvb, offset, -1, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
|
|
|
|
2004-01-13 23:18:13 +00:00
|
|
|
/*
|
|
|
|
* XXX - this can leak memory if an exception is thrown after we've fetched
|
|
|
|
* a string.
|
|
|
|
*/
|
2002-08-28 21:04:11 +00:00
|
|
|
static void
|
2003-11-17 21:52:35 +00:00
|
|
|
dissect_sdp_connection_info(tvbuff_t *tvb, proto_item* ti,
|
2006-04-29 17:31:20 +00:00
|
|
|
transport_info_t *transport_info){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree *sdp_connection_info_tree;
|
|
|
|
gint offset,next_offset,tokenlen;
|
|
|
|
|
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
sdp_connection_info_tree = proto_item_add_subtree(ti,
|
2006-04-29 17:31:20 +00:00
|
|
|
ett_sdp_connection_info);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
/* Find the network type */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_connection_info_tree,
|
2006-04-29 17:31:20 +00:00
|
|
|
hf_connection_info_network_type, tvb, offset, tokenlen,
|
|
|
|
FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
|
|
|
|
/* Find the address type */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
2003-11-17 21:52:35 +00:00
|
|
|
/* Save connection address type */
|
2006-10-27 13:03:38 +00:00
|
|
|
transport_info->connection_type = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
2004-01-13 23:18:13 +00:00
|
|
|
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_connection_info_tree,
|
2006-04-29 17:31:20 +00:00
|
|
|
hf_connection_info_address_type, tvb, offset, tokenlen,
|
|
|
|
FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
|
|
|
|
/* Find the connection address */
|
2003-11-17 21:52:35 +00:00
|
|
|
/* XXX - what if there's a <number of addresses> value? */
|
2001-12-15 20:22:47 +00:00
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,'/');
|
|
|
|
if( next_offset == -1){
|
2006-04-29 17:31:20 +00:00
|
|
|
tokenlen = -1; /* end of tvbuff */
|
2003-11-17 21:52:35 +00:00
|
|
|
/* Save connection address */
|
|
|
|
transport_info->connection_address =
|
2006-10-27 13:03:38 +00:00
|
|
|
(char*)tvb_get_ephemeral_string(tvb, offset, tvb_length_remaining(tvb, offset));
|
2001-12-15 20:22:47 +00:00
|
|
|
} else {
|
|
|
|
tokenlen = next_offset - offset;
|
2003-11-17 21:52:35 +00:00
|
|
|
/* Save connection address */
|
2006-10-27 13:03:38 +00:00
|
|
|
transport_info->connection_address = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
2003-11-17 21:52:35 +00:00
|
|
|
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_connection_info_tree,
|
2006-04-29 17:31:20 +00:00
|
|
|
hf_connection_info_connection_address, tvb, offset,
|
|
|
|
tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
if(next_offset != -1){
|
|
|
|
offset = next_offset + 1;
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,'/');
|
|
|
|
if( next_offset == -1){
|
2006-04-29 17:31:20 +00:00
|
|
|
tokenlen = -1; /* end of tvbuff */
|
2001-12-15 20:22:47 +00:00
|
|
|
} else {
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
}
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_connection_info_tree,
|
2006-04-29 17:31:20 +00:00
|
|
|
hf_connection_info_ttl, tvb, offset, tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
if(next_offset != -1){
|
|
|
|
offset = next_offset + 1;
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_connection_info_tree,
|
2006-04-29 17:31:20 +00:00
|
|
|
hf_connection_info_num_addr, tvb, offset, -1, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
static void
|
2002-04-14 23:22:22 +00:00
|
|
|
dissect_sdp_bandwidth(tvbuff_t *tvb, proto_item *ti){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree * sdp_bandwidth_tree;
|
|
|
|
gint offset, next_offset, tokenlen;
|
2006-12-04 23:03:11 +00:00
|
|
|
proto_item *item;
|
|
|
|
gboolean unit_is_kbs = FALSE;
|
|
|
|
gboolean unit_is_bps = FALSE;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
|
|
|
|
|
|
|
sdp_bandwidth_tree = proto_item_add_subtree(ti,ett_sdp_bandwidth);
|
|
|
|
|
|
|
|
/* find the modifier */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,':');
|
|
|
|
|
|
|
|
if( next_offset == -1)
|
|
|
|
return;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
tokenlen = next_offset - offset;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2006-12-04 23:03:11 +00:00
|
|
|
item = proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_modifier, tvb, offset,
|
2006-04-29 17:31:20 +00:00
|
|
|
tokenlen, FALSE);
|
2006-12-04 23:03:11 +00:00
|
|
|
if (tvb_strneql(tvb, offset, "CT", 2) == 0){
|
|
|
|
proto_item_append_text(item, " [Conference Total(total bandwidth of all RTP sessions)]");
|
|
|
|
unit_is_kbs = TRUE;
|
|
|
|
}else if (tvb_strneql(tvb, offset, "AS", 2) == 0){
|
|
|
|
proto_item_append_text(item, " [Application Specific (RTP session bandwidth)]");
|
|
|
|
unit_is_kbs = TRUE;
|
|
|
|
}else if (tvb_strneql(tvb, offset, "TIAS", 4) == 0){
|
|
|
|
proto_item_append_text(item, " [Transport Independent Application Specific maximum]");
|
|
|
|
unit_is_bps = TRUE;
|
|
|
|
}
|
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
|
|
|
|
offset = next_offset + 1;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2006-12-04 23:03:11 +00:00
|
|
|
item = proto_tree_add_item(sdp_bandwidth_tree, hf_bandwidth_value, tvb, offset, -1,
|
2006-04-29 17:31:20 +00:00
|
|
|
FALSE);
|
2006-12-04 23:03:11 +00:00
|
|
|
if (unit_is_kbs == TRUE)
|
|
|
|
proto_item_append_text(item, " kb/s");
|
|
|
|
if (unit_is_bps == TRUE)
|
|
|
|
proto_item_append_text(item, " b/s");
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
|
|
|
|
2002-04-14 23:22:22 +00:00
|
|
|
static void dissect_sdp_time(tvbuff_t *tvb, proto_item* ti){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree *sdp_time_tree;
|
|
|
|
gint offset,next_offset, tokenlen;
|
|
|
|
|
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
sdp_time_tree = proto_item_add_subtree(ti,ett_sdp_time);
|
|
|
|
|
|
|
|
/* get start time */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
|
|
|
|
tokenlen = next_offset - offset;
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_time_tree, hf_time_start, tvb, offset, tokenlen,
|
|
|
|
FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
|
|
|
/* get stop time */
|
|
|
|
offset = next_offset + 1;
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_time_tree, hf_time_stop, tvb, offset, -1, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
|
|
|
|
2002-04-14 23:22:22 +00:00
|
|
|
static void dissect_sdp_repeat_time(tvbuff_t *tvb, proto_item* ti){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree *sdp_repeat_time_tree;
|
|
|
|
gint offset,next_offset, tokenlen;
|
|
|
|
|
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
sdp_repeat_time_tree = proto_item_add_subtree(ti,ett_sdp_time);
|
|
|
|
|
|
|
|
/* get interval */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
|
|
|
|
tokenlen = next_offset - offset;
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_interval, tvb,
|
2006-04-29 17:31:20 +00:00
|
|
|
offset, tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
|
|
|
/* get duration */
|
|
|
|
offset = next_offset + 1;
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if( next_offset == -1 )
|
|
|
|
return;
|
|
|
|
|
|
|
|
tokenlen = next_offset - offset;
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_repeat_time_tree,hf_repeat_time_duration, tvb,
|
2006-04-29 17:31:20 +00:00
|
|
|
offset, tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
|
|
|
/* get offsets */
|
|
|
|
do{
|
|
|
|
offset = next_offset +1;
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if(next_offset != -1){
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
} else {
|
2006-04-29 17:31:20 +00:00
|
|
|
tokenlen = -1; /* end of tvbuff */
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_repeat_time_tree, hf_repeat_time_offset,
|
2006-04-29 17:31:20 +00:00
|
|
|
tvb, offset, tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
} while( next_offset != -1 );
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
static void
|
2002-04-14 23:22:22 +00:00
|
|
|
dissect_sdp_timezone(tvbuff_t *tvb, proto_item* ti){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree* sdp_timezone_tree;
|
|
|
|
gint offset, next_offset, tokenlen;
|
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
sdp_timezone_tree = proto_item_add_subtree(ti,ett_sdp_timezone);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
do{
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if(next_offset == -1)
|
|
|
|
break;
|
|
|
|
tokenlen = next_offset - offset;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_timezone_tree, hf_timezone_time, tvb, offset,
|
|
|
|
tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
|
|
|
if(next_offset != -1){
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
} else {
|
2006-04-29 17:31:20 +00:00
|
|
|
tokenlen = -1; /* end of tvbuff */
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_timezone_tree, hf_timezone_offset, tvb, offset,
|
|
|
|
tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
} while (next_offset != -1);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-04-14 23:22:22 +00:00
|
|
|
static void dissect_sdp_encryption_key(tvbuff_t *tvb, proto_item * ti){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree *sdp_encryption_key_tree;
|
|
|
|
gint offset, next_offset, tokenlen;
|
|
|
|
|
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
|
|
|
|
|
|
|
sdp_encryption_key_tree = proto_item_add_subtree(ti,ett_sdp_encryption_key);
|
|
|
|
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,':');
|
|
|
|
|
|
|
|
if(next_offset == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tokenlen = next_offset - offset;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_encryption_key_tree,hf_encryption_key_type,
|
2006-04-29 17:31:20 +00:00
|
|
|
tvb, offset, tokenlen, FALSE);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_encryption_key_tree,hf_encryption_key_data,
|
2006-04-29 17:31:20 +00:00
|
|
|
tvb, offset, -1, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
|
|
|
|
2007-03-05 23:11:11 +00:00
|
|
|
static void dissect_key_mgmt(tvbuff_t *tvb, packet_info * pinfo, proto_item * ti){
|
|
|
|
gchar *data = NULL;
|
|
|
|
gchar *prtcl_id = NULL;
|
|
|
|
gint len;
|
|
|
|
tvbuff_t *keymgmt_tvb;
|
|
|
|
gboolean found_match = FALSE;
|
|
|
|
proto_tree *key_tree;
|
|
|
|
gint next_offset;
|
|
|
|
gint offset = 0;
|
|
|
|
gint tokenlen;
|
2001-12-15 20:22:47 +00:00
|
|
|
|
2007-03-05 23:11:11 +00:00
|
|
|
key_tree = proto_item_add_subtree(ti, ett_sdp_key_mgmt);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
2007-03-05 23:11:11 +00:00
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2007-03-05 23:11:11 +00:00
|
|
|
if (next_offset == -1)
|
|
|
|
return;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2007-03-05 23:11:11 +00:00
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
prtcl_id = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
|
|
|
|
|
|
|
proto_tree_add_item(key_tree, hf_key_mgmt_prtcl_id, tvb, offset, tokenlen, FALSE);
|
|
|
|
|
|
|
|
offset = next_offset + 1;
|
|
|
|
|
|
|
|
len = tvb_length_remaining(tvb, offset);
|
|
|
|
if (len < 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
data = tvb_get_ephemeral_string(tvb, offset, len);
|
|
|
|
keymgmt_tvb = base64_to_tvb(data);
|
|
|
|
tvb_set_child_real_data_tvbuff(tvb, keymgmt_tvb);
|
|
|
|
add_new_data_source(pinfo, keymgmt_tvb, "Key Management Data");
|
|
|
|
|
|
|
|
if ( prtcl_id != NULL && key_mgmt_dissector_table != NULL ) {
|
|
|
|
found_match = dissector_try_string(key_mgmt_dissector_table,
|
|
|
|
prtcl_id,
|
|
|
|
keymgmt_tvb, pinfo,
|
|
|
|
key_tree);
|
|
|
|
}
|
|
|
|
|
2008-05-08 14:01:31 +00:00
|
|
|
if (found_match) {
|
|
|
|
proto_item *ti = proto_tree_add_item(key_tree, hf_key_mgmt_data,
|
|
|
|
keymgmt_tvb, 0, -1, FALSE);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(ti);
|
|
|
|
}
|
|
|
|
else {
|
2007-03-05 23:11:11 +00:00
|
|
|
proto_tree_add_item(key_tree, hf_key_mgmt_data,
|
2008-05-08 14:01:31 +00:00
|
|
|
keymgmt_tvb, 0, -1, FALSE);
|
|
|
|
}
|
|
|
|
|
2007-03-05 23:11:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void dissect_sdp_session_attribute(tvbuff_t *tvb, packet_info * pinfo, proto_item * ti){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree *sdp_session_attribute_tree;
|
|
|
|
gint offset, next_offset, tokenlen;
|
2005-06-22 02:18:10 +00:00
|
|
|
guint8 *field_name;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
|
|
|
|
|
|
|
sdp_session_attribute_tree = proto_item_add_subtree(ti,
|
2006-04-29 17:31:20 +00:00
|
|
|
ett_sdp_session_attribute);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,':');
|
|
|
|
|
|
|
|
if(next_offset == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tokenlen = next_offset - offset;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_session_attribute_tree, hf_session_attribute_field,
|
|
|
|
tvb, offset, tokenlen, FALSE);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2005-08-10 13:41:13 +00:00
|
|
|
field_name = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
|
2006-10-26 17:03:45 +00:00
|
|
|
if (strcmp((char*)field_name, "ipbcp") == 0) {
|
2006-10-27 13:03:38 +00:00
|
|
|
offset = tvb_pbrk_guint8(tvb,offset,-1,(guint8 *)"0123456789");
|
2005-06-22 02:18:10 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
if (offset == -1)
|
|
|
|
return;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
if (next_offset == -1)
|
|
|
|
return;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
tokenlen = next_offset - offset;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_session_attribute_tree,hf_ipbcp_version,tvb,offset,tokenlen,FALSE);
|
|
|
|
|
2006-10-27 13:03:38 +00:00
|
|
|
offset = tvb_pbrk_guint8(tvb,offset,-1,(guint8 *)"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
|
2006-04-29 17:31:20 +00:00
|
|
|
|
|
|
|
if (offset == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tokenlen = tvb_find_line_end(tvb,offset,-1, &next_offset, FALSE);
|
2007-08-15 22:27:52 +00:00
|
|
|
|
|
|
|
if (tokenlen == -1)
|
2006-04-29 17:31:20 +00:00
|
|
|
return;
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_session_attribute_tree,hf_ipbcp_type,tvb,offset,tokenlen,FALSE);
|
2007-03-05 23:11:11 +00:00
|
|
|
} else if (strcmp((char*)field_name, "key-mgmt") == 0) {
|
|
|
|
tvbuff_t *key_tvb;
|
|
|
|
proto_item *key_ti;
|
|
|
|
|
|
|
|
key_tvb = tvb_new_subset(tvb, offset, -1, -1);
|
|
|
|
key_ti = proto_tree_add_item(sdp_session_attribute_tree, hf_key_mgmt_att_value, key_tvb, 0, -1, FALSE);
|
|
|
|
|
|
|
|
dissect_key_mgmt(key_tvb, pinfo, key_ti);
|
2006-04-29 17:31:20 +00:00
|
|
|
} else {
|
|
|
|
proto_tree_add_item(sdp_session_attribute_tree, hf_session_attribute_value,
|
|
|
|
tvb, offset, -1, FALSE);
|
2005-06-22 02:18:10 +00:00
|
|
|
}
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
|
|
|
|
2007-12-15 18:26:21 +00:00
|
|
|
/* Dissect media description */
|
2002-08-28 21:04:11 +00:00
|
|
|
static void
|
2003-11-17 21:52:35 +00:00
|
|
|
dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
|
2006-04-29 17:31:20 +00:00
|
|
|
transport_info_t *transport_info){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree *sdp_media_tree;
|
2005-04-24 18:43:42 +00:00
|
|
|
gint offset, next_offset, tokenlen, index;
|
2004-06-01 21:40:41 +00:00
|
|
|
guint8 *media_format;
|
2001-12-15 20:22:47 +00:00
|
|
|
|
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
/* Re-initialise for a new media description */
|
|
|
|
msrp_transport_address_set = FALSE;
|
|
|
|
|
2007-12-15 18:26:21 +00:00
|
|
|
/* Create tree for media session */
|
2001-12-15 20:22:47 +00:00
|
|
|
sdp_media_tree = proto_item_add_subtree(ti,ett_sdp_media);
|
|
|
|
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
if(next_offset == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tokenlen = next_offset - offset;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2007-12-15 18:26:21 +00:00
|
|
|
/* Type of media session */
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_media_tree, hf_media_media, tvb, offset, tokenlen,
|
|
|
|
FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
|
|
|
offset = next_offset + 1;
|
|
|
|
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
|
|
|
|
if(next_offset == -1)
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset, tokenlen, '/');
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
if(next_offset != -1){
|
|
|
|
tokenlen = next_offset - offset;
|
2003-11-17 21:52:35 +00:00
|
|
|
/* Save port info */
|
2006-10-27 14:36:48 +00:00
|
|
|
transport_info->media_port[transport_info->media_count] = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
proto_tree_add_uint(sdp_media_tree, hf_media_port, tvb, offset, tokenlen,
|
2007-08-15 22:27:52 +00:00
|
|
|
atoi((char*)tvb_get_ephemeral_string(tvb, offset, tokenlen)));
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
|
|
|
|
if(next_offset == -1)
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_media_tree, hf_media_portcount, tvb, offset,
|
|
|
|
tokenlen, FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
} else {
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
if(next_offset == -1)
|
|
|
|
return;
|
|
|
|
tokenlen = next_offset - offset;
|
2003-11-17 21:52:35 +00:00
|
|
|
/* Save port info */
|
2006-10-27 14:36:48 +00:00
|
|
|
transport_info->media_port[transport_info->media_count] = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2003-10-14 21:26:37 +00:00
|
|
|
/* XXX Remember Port */
|
2006-07-28 21:26:39 +00:00
|
|
|
proto_tree_add_uint(sdp_media_tree, hf_media_port, tvb, offset, tokenlen,
|
2007-08-15 22:27:52 +00:00
|
|
|
atoi((char*)tvb_get_ephemeral_string(tvb, offset, tokenlen)));
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
if( next_offset == -1)
|
|
|
|
return;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
tokenlen = next_offset - offset;
|
2003-11-17 21:52:35 +00:00
|
|
|
/* Save port protocol */
|
2006-10-27 14:36:48 +00:00
|
|
|
transport_info->media_proto[transport_info->media_count] = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
2003-10-14 21:26:37 +00:00
|
|
|
/* XXX Remember Protocol */
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_media_tree, hf_media_proto, tvb, offset, tokenlen,
|
|
|
|
FALSE);
|
2001-12-15 20:22:47 +00:00
|
|
|
|
2007-12-15 18:26:21 +00:00
|
|
|
do {
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
if(next_offset == -1){
|
2006-04-29 17:31:20 +00:00
|
|
|
tokenlen = tvb_length_remaining(tvb, offset); /* End of tvbuff */
|
2004-01-01 21:47:18 +00:00
|
|
|
if (tokenlen == 0)
|
2006-04-29 17:31:20 +00:00
|
|
|
break; /* Nothing more left */
|
2001-12-15 20:22:47 +00:00
|
|
|
} else {
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
}
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2005-01-05 10:51:05 +00:00
|
|
|
if (strcmp(transport_info->media_proto[transport_info->media_count],
|
|
|
|
"RTP/AVP") == 0) {
|
2005-08-10 13:41:13 +00:00
|
|
|
media_format = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2005-01-05 10:51:05 +00:00
|
|
|
proto_tree_add_string(sdp_media_tree, hf_media_format, tvb, offset,
|
2006-10-27 13:03:38 +00:00
|
|
|
tokenlen, val_to_str(atol((char*)media_format), rtp_payload_type_vals, "%u"));
|
2006-04-29 17:31:20 +00:00
|
|
|
index = transport_info->media[transport_info->media_count].pt_count;
|
2006-10-27 13:03:38 +00:00
|
|
|
transport_info->media[transport_info->media_count].pt[index] = atol((char*)media_format);
|
2006-04-29 17:31:20 +00:00
|
|
|
if (index < (SDP_MAX_RTP_PAYLOAD_TYPES-1))
|
|
|
|
transport_info->media[transport_info->media_count].pt_count++;
|
2005-01-05 10:51:05 +00:00
|
|
|
} else {
|
2006-04-29 17:31:20 +00:00
|
|
|
proto_tree_add_item(sdp_media_tree, hf_media_format, tvb, offset,
|
|
|
|
tokenlen, FALSE);
|
2004-06-01 21:40:41 +00:00
|
|
|
}
|
2001-12-15 20:22:47 +00:00
|
|
|
} while (next_offset != -1);
|
|
|
|
|
2004-01-13 23:18:13 +00:00
|
|
|
/* Increase the count of media channels, but don't walk off the end
|
|
|
|
of the arrays. */
|
|
|
|
if (transport_info->media_count < (SDP_MAX_RTP_CHANNELS-1)){
|
|
|
|
transport_info->media_count++;
|
|
|
|
}
|
|
|
|
|
2003-10-14 21:26:37 +00:00
|
|
|
/* XXX Dissect traffic to "Port" as "Protocol"
|
|
|
|
* Remember this Port/Protocol pair so we can tear it down again later
|
|
|
|
* Actually, it's harder than that:
|
|
|
|
* We need to find out the address of the other side first and it
|
|
|
|
* looks like that info can be found in SIP headers only.
|
|
|
|
*/
|
2003-11-17 21:52:35 +00:00
|
|
|
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
2006-04-29 17:31:20 +00:00
|
|
|
|
2007-12-04 06:00:02 +00:00
|
|
|
tvbuff_t *ascii_bytes_to_tvb(tvbuff_t *tvb, packet_info *pinfo, gint len, gchar *msg)
|
2007-12-03 20:14:42 +00:00
|
|
|
{
|
|
|
|
guint8 *buf = ep_alloc(10240);
|
|
|
|
|
|
|
|
/* arbitrary maximum length */
|
|
|
|
if(len<20480){
|
|
|
|
int i;
|
|
|
|
tvbuff_t *bytes_tvb;
|
|
|
|
|
|
|
|
/* first, skip to where the encoded pdu starts, this is
|
|
|
|
the first hex digit after the '=' char.
|
|
|
|
*/
|
|
|
|
while(1){
|
|
|
|
if((*msg==0)||(*msg=='\n')){
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if(*msg=='='){
|
|
|
|
msg++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
msg++;
|
|
|
|
}
|
|
|
|
while(1){
|
|
|
|
if((*msg==0)||(*msg=='\n')){
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if( ((*msg>='0')&&(*msg<='9'))
|
|
|
|
|| ((*msg>='a')&&(*msg<='f'))
|
|
|
|
|| ((*msg>='A')&&(*msg<='F'))){
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
msg++;
|
|
|
|
}
|
|
|
|
i=0;
|
|
|
|
while( ((*msg>='0')&&(*msg<='9'))
|
|
|
|
||((*msg>='a')&&(*msg<='f'))
|
|
|
|
||((*msg>='A')&&(*msg<='F')) ){
|
|
|
|
int val;
|
|
|
|
if((*msg>='0')&&(*msg<='9')){
|
|
|
|
val=(*msg)-'0';
|
|
|
|
} else if((*msg>='a')&&(*msg<='f')){
|
|
|
|
val=(*msg)-'a'+10;
|
|
|
|
} else if((*msg>='A')&&(*msg<='F')){
|
|
|
|
val=(*msg)-'A'+10;
|
|
|
|
} else {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
val<<=4;
|
|
|
|
msg++;
|
|
|
|
if((*msg>='0')&&(*msg<='9')){
|
|
|
|
val|=(*msg)-'0';
|
|
|
|
} else if((*msg>='a')&&(*msg<='f')){
|
|
|
|
val|=(*msg)-'a'+10;
|
|
|
|
} else if((*msg>='A')&&(*msg<='F')){
|
|
|
|
val|=(*msg)-'A'+10;
|
|
|
|
} else {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
msg++;
|
|
|
|
|
|
|
|
buf[i]=(guint8)val;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if(i==0){
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
bytes_tvb = tvb_new_real_data(buf,i,i);
|
|
|
|
tvb_set_child_real_data_tvbuff(tvb,bytes_tvb);
|
|
|
|
add_new_data_source(pinfo, bytes_tvb, "ASCII bytes to tvb");
|
|
|
|
return bytes_tvb;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
2006-04-26 20:16:57 +00:00
|
|
|
/*
|
2006-04-29 17:31:20 +00:00
|
|
|
14496-2, Annex G, Table G-1.
|
2007-08-15 22:27:52 +00:00
|
|
|
Table G-1 FLC table for profile_and_level_indication Profile/Level Code
|
2006-04-26 20:16:57 +00:00
|
|
|
*/
|
|
|
|
static const value_string mpeg4es_level_indication_vals[] =
|
|
|
|
{
|
2006-04-29 17:31:20 +00:00
|
|
|
{ 0, "Reserved" },
|
|
|
|
{ 1, "Simple Profile/Level 1" },
|
|
|
|
{ 2, "Simple Profile/Level 2" },
|
|
|
|
{ 3, "Reserved" },
|
|
|
|
{ 4, "Reserved" },
|
|
|
|
{ 5, "Reserved" },
|
|
|
|
{ 6, "Reserved" },
|
|
|
|
{ 7, "Reserved" },
|
|
|
|
{ 8, "Simple Profile/Level 0" },
|
|
|
|
{ 9, "Simple Profile/Level 0b" },
|
|
|
|
/* Reserved 00001001 - 00010000 */
|
|
|
|
{ 0x11, "Simple Scalable Profile/Level 1" },
|
|
|
|
{ 0x12, "Simple Scalable Profile/Level 2" },
|
|
|
|
/* Reserved 00010011 - 00100000 */
|
|
|
|
{ 0x21, "Core Profile/Level 1" },
|
|
|
|
{ 0x22, "Core Profile/Level 2" },
|
|
|
|
/* Reserved 00100011 - 00110001 */
|
|
|
|
{ 0x32, "Main Profile/Level 2" },
|
|
|
|
{ 0x33, "Main Profile/Level 3" },
|
|
|
|
{ 0x34, "Main Profile/Level 4" },
|
|
|
|
/* Reserved 00110101 - 01000001 */
|
|
|
|
{ 0x42, "N-bit Profile/Level 2" },
|
|
|
|
/* Reserved 01000011 - 01010000 */
|
|
|
|
{ 0x51, "Scalable Texture Profile/Level 1" },
|
|
|
|
/* Reserved 01010010 - 01100000 */
|
|
|
|
{ 0x61, "Simple Face Animation Profile/Level 1" },
|
|
|
|
{ 0x62, "Simple Face Animation Profile/Level 2" },
|
|
|
|
{ 0x63, "Simple FBA Profile/Level 1" },
|
|
|
|
{ 0x64, "Simple FBA Profile/Level 2" },
|
|
|
|
/* Reserved 01100101 - 01110000 */
|
|
|
|
{ 0x71, "Basic Animated Texture Profile/Level 1" },
|
|
|
|
{ 0x72, "Basic Animated Texture Profile/Level 2" },
|
|
|
|
/* Reserved 01110011 - 10000000 */
|
|
|
|
{ 0x81, "Hybrid Profile/Level 1" },
|
|
|
|
{ 0x82, "Hybrid Profile/Level 2" },
|
2007-08-15 22:27:52 +00:00
|
|
|
/* Reserved 10000011 - 10010000 */
|
2006-04-29 17:31:20 +00:00
|
|
|
{ 0x91, "Advanced Real Time Simple Profile/Level 1" },
|
|
|
|
{ 0x92, "Advanced Real Time Simple Profile/Level 2" },
|
|
|
|
{ 0x93, "Advanced Real Time Simple Profile/Level 3" },
|
|
|
|
{ 0x94, "Advanced Real Time Simple Profile/Level 4" },
|
|
|
|
/* Reserved 10010101 - 10100000 */
|
|
|
|
{ 0xa1, "Core Scalable Profile/Level 1" },
|
|
|
|
{ 0xa2, "Core Scalable Profile/Level 2" },
|
|
|
|
{ 0xa3, "Core Scalable Profile/Level 3" },
|
|
|
|
/* Reserved 10100100 - 10110000 */
|
|
|
|
{ 0xb1, "Advanced Coding Efficiency Profile/Level 1" },
|
|
|
|
{ 0xb2, "Advanced Coding Efficiency Profile/Level 2" },
|
|
|
|
{ 0xb3, "Advanced Coding Efficiency Profile/Level 3" },
|
|
|
|
{ 0xb4, "Advanced Coding Efficiency Profile/Level 4" },
|
|
|
|
/* Reserved 10110101 - 11000000 */
|
|
|
|
{ 0xc1, "Advanced Core Profile/Level 1" },
|
|
|
|
{ 0xc2, "Advanced Core Profile/Level 2" },
|
|
|
|
/* Reserved 11000011 - 11010000 */
|
|
|
|
{ 0xd1, "Advanced Scalable Texture/Level 1" },
|
|
|
|
{ 0xd2, "Advanced Scalable Texture/Level 2" },
|
|
|
|
{ 0xd3, "Advanced Scalable Texture/Level 3" },
|
|
|
|
/* Reserved 11010100 - 11100000 */
|
|
|
|
{ 0xe1, "Simple Studio Profile/Level 1" },
|
|
|
|
{ 0xe2, "Simple Studio Profile/Level 2" },
|
|
|
|
{ 0xe3, "Simple Studio Profile/Level 3" },
|
|
|
|
{ 0xe4, "Simple Studio Profile/Level 4" },
|
|
|
|
{ 0xe5, "Core Studio Profile/Level 1" },
|
|
|
|
{ 0xe6, "Core Studio Profile/Level 2" },
|
|
|
|
{ 0xe7, "Core Studio Profile/Level 3" },
|
|
|
|
{ 0xe8, "Core Studio Profile/Level 4" },
|
|
|
|
/* Reserved 11101001 - 11101111 */
|
|
|
|
{ 0xf0, "Advanced Simple Profile/Level 0" },
|
|
|
|
{ 0xf1, "Advanced Simple Profile/Level 1" },
|
|
|
|
{ 0xf2, "Advanced Simple Profile/Level 2" },
|
|
|
|
{ 0xf3, "Advanced Simple Profile/Level 3" },
|
|
|
|
{ 0xf4, "Advanced Simple Profile/Level 4" },
|
|
|
|
{ 0xf5, "Advanced Simple Profile/Level 5" },
|
|
|
|
/* Reserved 11110110 - 11110111 */
|
|
|
|
{ 0xf8, "Fine Granularity Scalable Profile/Level 0" },
|
|
|
|
{ 0xf9, "Fine Granularity Scalable Profile/Level 1" },
|
|
|
|
{ 0xfa, "Fine Granularity Scalable Profile/Level 2" },
|
|
|
|
{ 0xfb, "Fine Granularity Scalable Profile/Level 3" },
|
|
|
|
{ 0xfc, "Fine Granularity Scalable Profile/Level 4" },
|
|
|
|
{ 0xfd, "Fine Granularity Scalable Profile/Level 5" },
|
|
|
|
{ 0xfe, "Reserved" },
|
|
|
|
{ 0xff, "Reserved for Escape" },
|
|
|
|
{ 0, NULL },
|
2006-04-26 20:16:57 +00:00
|
|
|
};
|
2006-12-04 23:03:11 +00:00
|
|
|
/* Annex X Profiles and levels definition */
|
|
|
|
static const value_string h263_profile_vals[] =
|
|
|
|
{
|
|
|
|
{ 0, "Baseline Profile" },
|
|
|
|
{ 1, "H.320 Coding Efficiency Version 2 Backward-Compatibility Profile" },
|
|
|
|
{ 2, "Version 1 Backward-Compatibility Profile" },
|
|
|
|
{ 3, "Version 2 Interactive and Streaming Wireless Profile" },
|
|
|
|
{ 4, "Version 3 Interactive and Streaming Wireless Profile" },
|
|
|
|
{ 5, "Conversational High Compression Profile" },
|
|
|
|
{ 6, "Conversational Internet Profile" },
|
|
|
|
{ 7, "Conversational Interlace Profile" },
|
|
|
|
{ 8, "High Latency Profile" },
|
|
|
|
{ 0, NULL },
|
|
|
|
};
|
|
|
|
|
2007-12-10 21:25:32 +00:00
|
|
|
static const value_string h264_packetization_mode_vals[] =
|
|
|
|
{
|
|
|
|
{ 0, "Single NAL mode" },
|
|
|
|
{ 1, "Non-interleaved mode" },
|
|
|
|
{ 2, "Interleaved mode" },
|
|
|
|
{ 0, NULL },
|
|
|
|
};
|
|
|
|
|
2007-08-15 22:27:52 +00:00
|
|
|
/*
|
2006-06-03 11:48:27 +00:00
|
|
|
* TODO: Make this a more generic routine to dissect fmtp parameters depending on media types
|
|
|
|
*/
|
2006-04-26 20:16:57 +00:00
|
|
|
static void
|
2007-12-03 20:14:42 +00:00
|
|
|
decode_sdp_fmtp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, gint offset, gint tokenlen, guint8 *mime_type){
|
2006-04-26 20:16:57 +00:00
|
|
|
gint next_offset;
|
|
|
|
gint end_offset;
|
|
|
|
guint8 *field_name;
|
2007-12-03 20:14:42 +00:00
|
|
|
gchar *format_specific_parameter;
|
2006-04-26 20:16:57 +00:00
|
|
|
proto_item *item;
|
2007-12-10 21:25:32 +00:00
|
|
|
tvbuff_t *data_tvb;
|
2006-04-26 20:16:57 +00:00
|
|
|
|
|
|
|
end_offset = offset + tokenlen;
|
2006-06-03 11:48:27 +00:00
|
|
|
|
|
|
|
/* Look for an '=' within this value - this may indicate that there is a
|
|
|
|
profile-level-id parameter to find if the MPEG4 media type is in use */
|
2006-04-26 20:16:57 +00:00
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,'=');
|
2006-06-03 11:48:27 +00:00
|
|
|
if (next_offset == -1)
|
|
|
|
{
|
|
|
|
/* Give up (and avoid exception) if '=' not found */
|
|
|
|
return;
|
|
|
|
}
|
2006-04-26 20:16:57 +00:00
|
|
|
|
2006-06-03 11:48:27 +00:00
|
|
|
/* Find the name of the parameter */
|
2006-04-26 20:16:57 +00:00
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
field_name = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2006-06-03 11:48:27 +00:00
|
|
|
|
2006-04-26 20:16:57 +00:00
|
|
|
offset = next_offset;
|
|
|
|
|
2006-06-03 11:48:27 +00:00
|
|
|
/* Dissect the MPEG4 profile-level-id parameter if present */
|
2006-10-26 17:03:45 +00:00
|
|
|
if (mime_type != NULL && strcmp((char*)mime_type, "MP4V-ES") == 0) {
|
|
|
|
if (strcmp((char*)field_name, "profile-level-id") == 0) {
|
2006-04-29 17:31:20 +00:00
|
|
|
offset++;
|
|
|
|
tokenlen = end_offset - offset;
|
|
|
|
format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2007-12-10 21:25:32 +00:00
|
|
|
item = proto_tree_add_uint(tree, hf_sdp_fmtp_mpeg4_profile_level_id, tvb, offset, tokenlen,
|
2006-10-26 17:03:45 +00:00
|
|
|
atol((char*)format_specific_parameter));
|
2006-04-29 17:31:20 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
}
|
2006-04-26 20:16:57 +00:00
|
|
|
}
|
2006-12-04 23:03:11 +00:00
|
|
|
|
|
|
|
/* Dissect the H263-2000 profile parameter if present */
|
|
|
|
if (mime_type != NULL && strcmp((char*)mime_type, "H263-2000") == 0) {
|
|
|
|
if (strcmp((char*)field_name, "profile") == 0) {
|
|
|
|
offset++;
|
|
|
|
tokenlen = end_offset - offset;
|
|
|
|
format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
|
|
|
item = proto_tree_add_uint(tree, hf_sdp_fmtp_h263_profile, tvb, offset, tokenlen,
|
|
|
|
atol((char*)format_specific_parameter));
|
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-12-03 20:14:42 +00:00
|
|
|
|
|
|
|
/* Dissect the H264 profile-level-id parameter */
|
2006-06-03 11:48:27 +00:00
|
|
|
if (mime_type != NULL && strcmp(mime_type, "H264") == 0) {
|
|
|
|
if (strcmp(field_name, "profile-level-id") == 0) {
|
2007-12-10 21:25:32 +00:00
|
|
|
|
2007-12-03 20:14:42 +00:00
|
|
|
/* Length includes "=" */
|
2006-06-03 11:48:27 +00:00
|
|
|
tokenlen = end_offset - offset;
|
|
|
|
format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2007-12-10 21:25:32 +00:00
|
|
|
data_tvb = ascii_bytes_to_tvb(tvb, pinfo, tokenlen, format_specific_parameter);
|
|
|
|
if(h264_handle && data_tvb){
|
|
|
|
dissect_h264_profile(data_tvb, pinfo, tree);
|
|
|
|
}
|
|
|
|
}else if (strcmp(field_name, "packetization-mode") == 0) {
|
|
|
|
offset++;
|
|
|
|
tokenlen = end_offset - offset;
|
|
|
|
format_specific_parameter = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
|
|
|
item = proto_tree_add_uint(tree, hf_sdp_h264_packetization_mode, tvb, offset, tokenlen,
|
|
|
|
atol((char*)format_specific_parameter));
|
|
|
|
|
|
|
|
}else if (strcmp(field_name, "sprop-parameter-sets") == 0) {
|
|
|
|
/* The value of the parameter is the
|
|
|
|
base64 [6] representation of the initial
|
|
|
|
parameter set NAL units as specified in
|
|
|
|
sections 7.3.2.1 and 7.3.2.2 of [1]. The
|
|
|
|
parameter sets are conveyed in decoding order,
|
|
|
|
and no framing of the parameter set NAL units
|
|
|
|
takes place. A comma is used to separate any
|
|
|
|
pair of parameter sets in the list.
|
|
|
|
*/
|
|
|
|
gchar *data = NULL;
|
|
|
|
gint comma_offset;
|
|
|
|
|
|
|
|
|
|
|
|
/* Move past '=' */
|
|
|
|
offset++;
|
|
|
|
comma_offset = tvb_find_guint8(tvb,offset,-1,',');
|
|
|
|
if (comma_offset != -1){
|
|
|
|
tokenlen = comma_offset - offset;
|
|
|
|
}else{
|
|
|
|
tokenlen = end_offset - offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
data = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2007-12-12 21:50:14 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, tokenlen, "NAL unit 1 string: %s", data);
|
|
|
|
|
2007-12-10 21:25:32 +00:00
|
|
|
/* proto_tree_add_text(tree, tvb, offset, tokenlen, "String %s",data); */
|
|
|
|
data_tvb = base64_to_tvb(data);
|
|
|
|
tvb_set_child_real_data_tvbuff(tvb, data_tvb);
|
|
|
|
add_new_data_source(pinfo, data_tvb, "h264 prop-parameter-sets");
|
|
|
|
|
|
|
|
if(h264_handle && data_tvb){
|
|
|
|
dissect_h264_nal_unit(data_tvb, pinfo, tree);
|
|
|
|
if (comma_offset != -1){
|
|
|
|
/* Second NAL unit */
|
|
|
|
offset = comma_offset +1;
|
|
|
|
tokenlen = end_offset - offset;
|
|
|
|
data = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2007-12-12 21:50:14 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, tokenlen, "NAL unit 2 string: %s", data);
|
2007-12-10 21:25:32 +00:00
|
|
|
data_tvb = base64_to_tvb(data);
|
|
|
|
tvb_set_child_real_data_tvbuff(tvb, data_tvb);
|
|
|
|
add_new_data_source(pinfo, data_tvb, "h264 prop-parameter-sets 2");
|
|
|
|
dissect_h264_nal_unit(data_tvb, pinfo, tree);
|
|
|
|
}
|
2007-12-12 21:50:14 +00:00
|
|
|
}
|
2006-06-03 11:48:27 +00:00
|
|
|
}
|
|
|
|
}
|
2007-12-03 20:14:42 +00:00
|
|
|
|
2006-04-26 20:16:57 +00:00
|
|
|
}
|
2006-04-28 21:42:18 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
typedef struct {
|
|
|
|
const char *name;
|
|
|
|
} sdp_names_t;
|
|
|
|
|
|
|
|
#define SDP_RTPMAP 1
|
|
|
|
#define SDP_FMTP 2
|
|
|
|
#define SDP_PATH 3
|
|
|
|
#define SDP_H248_ITEM 4
|
|
|
|
|
|
|
|
static const sdp_names_t sdp_media_attribute_names[] = {
|
|
|
|
{ "Unknown-name"}, /* 0 Pad so that the real headers start at index 1 */
|
|
|
|
{ "rtpmap"}, /* 1 */
|
|
|
|
{ "fmtp"}, /* 2 */
|
|
|
|
{ "path"}, /* 3 */
|
2007-08-15 22:27:52 +00:00
|
|
|
{ "h248item"}, /* 4 */
|
2006-11-03 20:15:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint find_sdp_media_attribute_names(tvbuff_t *tvb, int offset, guint len)
|
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
for (i = 1; i < array_length(sdp_media_attribute_names); i++) {
|
|
|
|
if (len == strlen(sdp_media_attribute_names[i].name) &&
|
|
|
|
tvb_strncaseeql(tvb, offset, sdp_media_attribute_names[i].name, len) == 0)
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dissect_sdp_media_attribute(tvbuff_t *tvb, packet_info *pinfo, proto_item * ti, transport_info_t *transport_info){
|
2001-12-15 20:22:47 +00:00
|
|
|
proto_tree *sdp_media_attribute_tree;
|
2006-11-03 20:15:17 +00:00
|
|
|
proto_item *fmtp_item, *media_format_item;
|
|
|
|
proto_tree *fmtp_tree;
|
2005-04-24 18:43:42 +00:00
|
|
|
gint offset, next_offset, tokenlen, n;
|
2005-03-10 19:32:22 +00:00
|
|
|
guint8 *field_name;
|
|
|
|
guint8 *payload_type;
|
2006-07-28 21:26:39 +00:00
|
|
|
guint8 *attribute_value;
|
2006-04-29 17:31:20 +00:00
|
|
|
gint *key;
|
2006-11-03 20:15:17 +00:00
|
|
|
gint sdp_media_attrbute_code;
|
|
|
|
const char *msrp_res = "msrp://";
|
|
|
|
const char *h324ext_h223lcparm = "h324ext/h223lcparm";
|
2007-12-03 22:40:04 +00:00
|
|
|
gboolean has_more_pars = TRUE;
|
2007-12-04 06:00:02 +00:00
|
|
|
tvbuff_t *h245_tvb;
|
2001-12-15 20:22:47 +00:00
|
|
|
|
|
|
|
offset = 0;
|
|
|
|
next_offset = 0;
|
|
|
|
tokenlen = 0;
|
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
/* Create attribute tree */
|
2001-12-15 20:22:47 +00:00
|
|
|
sdp_media_attribute_tree = proto_item_add_subtree(ti,
|
2006-04-29 17:31:20 +00:00
|
|
|
ett_sdp_media_attribute);
|
2006-07-28 21:26:39 +00:00
|
|
|
/* Find end of field */
|
2001-12-15 20:22:47 +00:00
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,':');
|
|
|
|
|
|
|
|
if(next_offset == -1)
|
|
|
|
return;
|
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
/* Attribute field name is token before ':' */
|
2001-12-15 20:22:47 +00:00
|
|
|
tokenlen = next_offset - offset;
|
2002-02-02 02:52:41 +00:00
|
|
|
proto_tree_add_item(sdp_media_attribute_tree,
|
2006-04-29 17:31:20 +00:00
|
|
|
hf_media_attribute_field,
|
|
|
|
tvb, offset, tokenlen, FALSE);
|
2005-08-10 13:41:13 +00:00
|
|
|
field_name = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2006-11-03 20:15:17 +00:00
|
|
|
sdp_media_attrbute_code = find_sdp_media_attribute_names(tvb, offset, tokenlen);
|
2005-03-10 19:32:22 +00:00
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
/* Skip colon */
|
2001-12-15 20:22:47 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
/* Value is the remainder of the line */
|
2007-08-15 22:27:52 +00:00
|
|
|
attribute_value = tvb_get_ephemeral_string(tvb, offset, tvb_length_remaining(tvb, offset));
|
2006-07-28 21:26:39 +00:00
|
|
|
|
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
|
2006-07-28 21:26:39 +00:00
|
|
|
/*********************************************/
|
|
|
|
/* Special parsing for some field name types */
|
2005-03-27 21:14:15 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
switch (sdp_media_attrbute_code){
|
|
|
|
case SDP_RTPMAP:
|
|
|
|
/* decode the rtpmap to see if it is DynamicPayload to dissect them automatic */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
2005-03-10 19:32:22 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
if(next_offset == -1)
|
|
|
|
return;
|
2005-03-10 19:32:22 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
tokenlen = next_offset - offset;
|
2005-03-10 19:32:22 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
proto_tree_add_item(sdp_media_attribute_tree, hf_media_format, tvb,
|
2006-04-29 17:31:20 +00:00
|
|
|
offset, tokenlen, FALSE);
|
2006-04-26 20:16:57 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
payload_type = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2005-03-10 19:32:22 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
offset = next_offset + 1;
|
2005-03-10 19:32:22 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,'/');
|
2005-03-10 19:32:22 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
if(next_offset == -1){
|
|
|
|
return;
|
|
|
|
}
|
2005-03-10 19:32:22 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
tokenlen = next_offset - offset;
|
2005-03-10 19:32:22 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
proto_tree_add_item(sdp_media_attribute_tree, hf_media_encoding_name, tvb,
|
2006-04-29 17:31:20 +00:00
|
|
|
offset, tokenlen, FALSE);
|
2006-11-03 20:15:17 +00:00
|
|
|
/* get_string is needed here as the string is "saved" in a hashtable */
|
2007-08-17 21:21:50 +00:00
|
|
|
transport_info->encoding_name = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
2006-04-29 17:31:20 +00:00
|
|
|
|
2006-11-03 20:15:17 +00:00
|
|
|
key=g_malloc( sizeof(gint) );
|
|
|
|
*key=atol((char*)payload_type);
|
2006-04-29 17:31:20 +00:00
|
|
|
|
2008-07-29 15:58:43 +00:00
|
|
|
offset = next_offset + 1;
|
|
|
|
tvb_find_line_end_unquoted(tvb, offset, -1, &next_offset);
|
|
|
|
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
proto_tree_add_item(sdp_media_attribute_tree, hf_media_sample_rate, tvb,
|
|
|
|
offset, tokenlen, FALSE);
|
2006-11-03 20:15:17 +00:00
|
|
|
/* As per RFC2327 it is possible to have multiple Media Descriptions ("m=").
|
|
|
|
For example:
|
2006-04-29 17:31:20 +00:00
|
|
|
|
|
|
|
a=rtpmap:101 G726-32/8000
|
|
|
|
m=audio 49170 RTP/AVP 0 97
|
|
|
|
a=rtpmap:97 telephone-event/8000
|
|
|
|
m=audio 49172 RTP/AVP 97 101
|
|
|
|
a=rtpmap:97 G726-24/8000
|
|
|
|
|
2007-08-15 22:27:52 +00:00
|
|
|
The Media attributes ("a="s) after the "m=" only apply for that "m=".
|
2006-11-03 20:15:17 +00:00
|
|
|
If there is an "a=" before the first "m=", that attribute applies for
|
|
|
|
all the session (all the "m="s).
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* so, if this "a=" appear before any "m=", we add it to all the dynamic
|
|
|
|
* hash tables
|
2007-08-15 22:27:52 +00:00
|
|
|
*/
|
2006-11-03 20:15:17 +00:00
|
|
|
if (transport_info->media_count == 0) {
|
|
|
|
for (n=0; n < SDP_MAX_RTP_CHANNELS; n++) {
|
|
|
|
if (n==0)
|
|
|
|
g_hash_table_insert(transport_info->media[n].rtp_dyn_payload,
|
2007-09-04 05:22:43 +00:00
|
|
|
key, g_strdup(transport_info->encoding_name));
|
2006-11-03 20:15:17 +00:00
|
|
|
else { /* we create a new key and encoding_name to assign to the other hash tables */
|
|
|
|
gint *key2;
|
|
|
|
key2=g_malloc( sizeof(gint) );
|
|
|
|
*key2=atol((char*)payload_type);
|
|
|
|
g_hash_table_insert(transport_info->media[n].rtp_dyn_payload,
|
2007-09-04 05:22:43 +00:00
|
|
|
key2, g_strdup(transport_info->encoding_name));
|
2006-11-03 20:15:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
/* if the "a=" is after an "m=", only apply to this "m=" */
|
|
|
|
}else
|
|
|
|
/* in case there is an overflow in SDP_MAX_RTP_CHANNELS, we keep always the last "m=" */
|
|
|
|
if (transport_info->media_count == SDP_MAX_RTP_CHANNELS-1)
|
|
|
|
g_hash_table_insert(transport_info->media[ transport_info->media_count ].rtp_dyn_payload,
|
2007-09-04 05:22:43 +00:00
|
|
|
key, g_strdup(transport_info->encoding_name));
|
2006-11-03 20:15:17 +00:00
|
|
|
else
|
|
|
|
g_hash_table_insert(transport_info->media[ transport_info->media_count-1 ].rtp_dyn_payload,
|
2007-09-04 05:22:43 +00:00
|
|
|
key, g_strdup(transport_info->encoding_name));
|
2006-11-03 20:15:17 +00:00
|
|
|
break;
|
|
|
|
case SDP_FMTP:
|
2007-12-12 21:50:14 +00:00
|
|
|
if(sdp_media_attribute_tree){
|
|
|
|
/* Reading the Format parameter(fmtp) */
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,' ');
|
2006-11-03 20:15:17 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
if(next_offset == -1)
|
|
|
|
return;
|
2006-11-03 20:15:17 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
tokenlen = next_offset - offset;
|
2006-11-03 20:15:17 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
/* Media format extends to the next space */
|
|
|
|
media_format_item = proto_tree_add_item(sdp_media_attribute_tree,
|
2006-04-29 17:31:20 +00:00
|
|
|
hf_media_format, tvb, offset,
|
|
|
|
tokenlen, FALSE);
|
2007-12-12 21:50:14 +00:00
|
|
|
/* Append encoding name to format if known */
|
|
|
|
if (transport_info->encoding_name)
|
|
|
|
proto_item_append_text(media_format_item, " [%s]",
|
2006-04-29 17:31:20 +00:00
|
|
|
transport_info->encoding_name);
|
2006-04-26 20:16:57 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
payload_type = tvb_get_ephemeral_string(tvb, offset, tokenlen);
|
|
|
|
/* Offset past space after ':' */
|
|
|
|
offset = next_offset + 1;
|
2007-12-03 22:40:04 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
while(has_more_pars==TRUE){
|
|
|
|
next_offset = tvb_find_guint8(tvb,offset,-1,';');
|
|
|
|
offset = tvb_skip_wsp(tvb,offset,tvb_length_remaining(tvb,offset));
|
2007-12-10 21:25:32 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
if(next_offset == -1){
|
|
|
|
has_more_pars = FALSE;
|
|
|
|
next_offset= tvb_length(tvb);
|
|
|
|
}else{
|
|
|
|
|
|
|
|
}
|
2006-04-28 21:42:18 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
/* There are 2 - add the first parameter */
|
|
|
|
tokenlen = next_offset - offset;
|
|
|
|
fmtp_item = proto_tree_add_item(sdp_media_attribute_tree,
|
2006-04-29 17:31:20 +00:00
|
|
|
hf_media_format_specific_parameter, tvb,
|
|
|
|
offset, tokenlen, FALSE);
|
2006-04-26 20:16:57 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
fmtp_tree = proto_item_add_subtree(fmtp_item, ett_sdp_fmtp);
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
decode_sdp_fmtp(fmtp_tree, tvb, pinfo, offset, tokenlen,
|
2006-10-27 13:03:38 +00:00
|
|
|
(guint8 *)transport_info->encoding_name);
|
2006-04-26 20:16:57 +00:00
|
|
|
|
2007-12-12 21:50:14 +00:00
|
|
|
/* Move offset past "; " and onto firts char */
|
|
|
|
offset = next_offset + 1;
|
|
|
|
}
|
2006-11-03 20:15:17 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SDP_PATH:
|
|
|
|
/* msrp attributes that contain address needed for conversation */
|
|
|
|
if (strncmp((char*)attribute_value, msrp_res, strlen(msrp_res)) == 0){
|
|
|
|
int address_offset, port_offset, port_end_offset;
|
|
|
|
|
|
|
|
/* Address starts here */
|
|
|
|
address_offset = offset + strlen(msrp_res);
|
|
|
|
|
|
|
|
/* Port is after next ':' */
|
|
|
|
port_offset = tvb_find_guint8(tvb, address_offset, -1, ':');
|
|
|
|
|
|
|
|
/* Port ends with '/' */
|
|
|
|
port_end_offset = tvb_find_guint8(tvb, port_offset, -1, '/');
|
|
|
|
|
|
|
|
/* Attempt to convert address */
|
|
|
|
if (inet_pton(AF_INET, (char*)tvb_get_ephemeral_string(tvb, address_offset, port_offset-address_offset), &msrp_ipaddr) > 0) {
|
|
|
|
/* Get port number */
|
|
|
|
msrp_port_number = atoi((char*)tvb_get_ephemeral_string(tvb, port_offset+1, port_end_offset-port_offset-1));
|
|
|
|
/* Set flag so this info can be used */
|
|
|
|
msrp_transport_address_set = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SDP_H248_ITEM:
|
|
|
|
/* Decode h248 item ITU-T Rec. H.248.12 (2001)/Amd.1 (11/2002)*/
|
|
|
|
if (strncmp((char*)attribute_value, h324ext_h223lcparm, strlen(msrp_res)) == 0){
|
2007-08-15 22:27:52 +00:00
|
|
|
/* A.5.1.3 H.223 Logical channel parameters
|
2006-11-03 20:15:17 +00:00
|
|
|
* This property indicates the H.245
|
|
|
|
* H223LogicalChannelsParameters structure encoded by applying the PER specified in
|
|
|
|
* ITU-T Rec. X.691. Value encoded as per A.5.1.2. For text encoding the mechanism defined
|
|
|
|
* in ITU-T Rec. H.248.15 is used.
|
|
|
|
*/
|
|
|
|
gint len;
|
|
|
|
asn1_ctx_t actx;
|
|
|
|
|
|
|
|
len = strlen(attribute_value);
|
2007-12-04 06:00:02 +00:00
|
|
|
h245_tvb = ascii_bytes_to_tvb(tvb, pinfo, len, attribute_value);
|
2006-11-03 20:15:17 +00:00
|
|
|
/* arbitrary maximum length */
|
2007-12-04 06:00:02 +00:00
|
|
|
/* should go through a handle, however, the two h245 entry
|
|
|
|
points are different, one is over tpkt and the other is raw
|
|
|
|
*/
|
|
|
|
if (h245_tvb){
|
|
|
|
asn1_ctx_init(&actx, ASN1_ENC_PER, TRUE, pinfo);
|
|
|
|
dissect_h245_H223LogicalChannelParameters(h245_tvb, 0, &actx, sdp_media_attribute_tree, hf_SDPh223LogicalChannelParameters);
|
2006-11-03 20:15:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* No special treatment for values of this attribute type, just add as one item. */
|
|
|
|
proto_tree_add_item(sdp_media_attribute_tree, hf_media_attribute_value,
|
2006-04-29 17:31:20 +00:00
|
|
|
tvb, offset, -1, FALSE);
|
2006-11-03 20:15:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2001-12-15 20:22:47 +00:00
|
|
|
}
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
void
|
|
|
|
proto_register_sdp(void)
|
|
|
|
{
|
2001-12-13 21:49:22 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_protocol_version,
|
2001-12-15 05:37:43 +00:00
|
|
|
{ "Session Description Protocol Version (v)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.version", FT_STRING, BASE_NONE,NULL,0x0,
|
|
|
|
"Session Description Protocol Version", HFILL }},
|
2002-08-28 21:04:11 +00:00
|
|
|
{ &hf_owner,
|
2001-12-13 21:49:22 +00:00
|
|
|
{ "Owner/Creator, Session Id (o)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.owner", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Owner/Creator, Session Id", HFILL}},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_session_name,
|
|
|
|
{ "Session Name (s)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.session_name", FT_STRING, BASE_NONE,NULL, 0x0,
|
|
|
|
"Session Name", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_session_info,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "Session Information (i)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.session_info", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Session Information", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_uri,
|
|
|
|
{ "URI of Description (u)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.uri", FT_STRING, BASE_NONE,NULL, 0x0,
|
|
|
|
"URI of Description", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_email,
|
2002-08-28 21:04:11 +00:00
|
|
|
{ "E-mail Address (e)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.email", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"E-mail Address", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_phone,
|
|
|
|
{ "Phone Number (p)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.phone", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Phone Number", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_connection_info,
|
|
|
|
{ "Connection Information (c)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.connection_info", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Connection Information", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_bandwidth,
|
|
|
|
{ "Bandwidth Information (b)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.bandwidth", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Bandwidth Information", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_timezone,
|
2001-12-13 21:49:22 +00:00
|
|
|
{ "Time Zone Adjustments (z)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.timezone", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Time Zone Adjustments", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_encryption_key,
|
|
|
|
{ "Encryption Key (k)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.encryption_key", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Encryption Key", HFILL }},
|
2002-08-28 21:04:11 +00:00
|
|
|
{ &hf_session_attribute,
|
|
|
|
{ "Session Attribute (a)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.session_attr", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Session Attribute", HFILL }},
|
2002-08-28 21:04:11 +00:00
|
|
|
{ &hf_media_attribute,
|
|
|
|
{ "Media Attribute (a)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.media_attr", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Media Attribute", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_time,
|
|
|
|
{ "Time Description, active time (t)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.time", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Time Description, active time", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_repeat_time,
|
|
|
|
{ "Repeat Time (r)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.repeat_time", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Repeat Time", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_media,
|
|
|
|
{ "Media Description, name and address (m)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.media", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Media Description, name and address", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_media_title,
|
|
|
|
{ "Media Title (i)",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.media_title",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Media Title", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_unknown,
|
|
|
|
{ "Unknown",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.unknown",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Unknown", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
{ &hf_invalid,
|
|
|
|
{ "Invalid line",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.invalid",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Invalid line", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_owner_username,
|
|
|
|
{ "Owner Username",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.owner.username",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Owner Username", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_owner_sessionid,
|
|
|
|
{ "Session ID",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.owner.sessionid",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Session ID", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_owner_version,
|
|
|
|
{ "Session Version",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.owner.version",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Session Version", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_owner_network_type,
|
|
|
|
{ "Owner Network Type",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.owner.network_type",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Owner Network Type", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_owner_address_type,
|
|
|
|
{ "Owner Address Type",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.owner.address_type",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Owner Address Type", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_owner_address,
|
|
|
|
{ "Owner Address",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.owner.address",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Owner Address", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_connection_info_network_type,
|
|
|
|
{ "Connection Network Type",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.connection_info.network_type",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Connection Network Type", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_connection_info_address_type,
|
|
|
|
{ "Connection Address Type",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.connection_info.address_type",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Connection Address Type", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_connection_info_connection_address,
|
|
|
|
{ "Connection Address",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.connection_info.address",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Connection Address", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_connection_info_ttl,
|
|
|
|
{ "Connection TTL",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.connection_info.ttl",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Connection TTL", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_connection_info_num_addr,
|
|
|
|
{ "Connection Number of Addresses",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.connection_info.num_addr",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Connection Number of Addresses", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_bandwidth_modifier,
|
|
|
|
{ "Bandwidth Modifier",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.bandwidth.modifier",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Bandwidth Modifier", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_bandwidth_value,
|
|
|
|
{ "Bandwidth Value",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.bandwidth.value",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Bandwidth Value (in kbits/s)", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_time_start,
|
|
|
|
{ "Session Start Time",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.time.start",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Session Start Time", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_time_stop,
|
|
|
|
{ "Session Stop Time",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.time.stop",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Session Stop Time", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_repeat_time_interval,
|
|
|
|
{ "Repeat Interval",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.repeat_time.interval",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Repeat Interval", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_repeat_time_duration,
|
|
|
|
{ "Repeat Duration",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.repeat_time.duration",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Repeat Duration", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_repeat_time_offset,
|
|
|
|
{ "Repeat Offset",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.repeat_time.offset",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Repeat Offset", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_timezone_time,
|
|
|
|
{ "Timezone Time",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.timezone.time",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Timezone Time", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_timezone_offset,
|
|
|
|
{ "Timezone Offset",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.timezone.offset",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Timezone Offset", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_encryption_key_type,
|
|
|
|
{ "Key Type",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.encryption_key.type",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Type", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_encryption_key_data,
|
|
|
|
{ "Key Data",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.encryption_key.data",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Data", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_session_attribute_field,
|
|
|
|
{ "Session Attribute Fieldname",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.session_attr.field",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Session Attribute Fieldname", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_session_attribute_value,
|
|
|
|
{ "Session Attribute Value",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.session_attr.value",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Session Attribute Value", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_media_media,
|
|
|
|
{ "Media Type",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.media.media",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Media Type", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_media_port,
|
|
|
|
{ "Media Port",
|
2006-07-28 21:26:39 +00:00
|
|
|
"sdp.media.port",FT_UINT16, BASE_DEC, NULL, 0x0,
|
2006-04-29 17:31:20 +00:00
|
|
|
"Media Port", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_media_portcount,
|
|
|
|
{ "Media Port Count",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.media.portcount",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Media Port Count", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_media_proto,
|
|
|
|
{ "Media Proto",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.media.proto",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Media Protocol", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_media_format,
|
|
|
|
{ "Media Format",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.media.format",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Media Format", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_media_attribute_field,
|
|
|
|
{ "Media Attribute Fieldname",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.media_attribute.field",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Media Attribute Fieldname", HFILL }},
|
2001-12-15 20:22:47 +00:00
|
|
|
{ &hf_media_attribute_value,
|
|
|
|
{ "Media Attribute Value",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.media_attribute.value",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Media Attribute Value", HFILL }},
|
2007-12-15 18:26:21 +00:00
|
|
|
{ &hf_media_encoding_name,
|
2006-04-26 20:16:57 +00:00
|
|
|
{ "MIME Type",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.mime.type",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"SDP MIME Type", HFILL }},
|
2008-07-29 15:58:43 +00:00
|
|
|
{ &hf_media_sample_rate,
|
|
|
|
{ "Sample Rate",
|
|
|
|
"sdp.sample_rate",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Sample Rate", HFILL }},
|
2007-12-15 18:26:21 +00:00
|
|
|
{ &hf_media_format_specific_parameter,
|
2006-04-26 20:16:57 +00:00
|
|
|
{ "Media format specific parameters",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.fmtp.parameter",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Format specific parameter(fmtp)", HFILL }},
|
2005-06-22 02:18:10 +00:00
|
|
|
{ &hf_ipbcp_version,
|
|
|
|
{ "IPBCP Protocol Version",
|
2006-04-29 17:31:20 +00:00
|
|
|
"ipbcp.version",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"IPBCP Protocol Version", HFILL }},
|
2005-06-22 02:18:10 +00:00
|
|
|
{ &hf_ipbcp_type,
|
|
|
|
{ "IPBCP Command Type",
|
2006-04-29 17:31:20 +00:00
|
|
|
"ipbcp.command",FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"IPBCP Command Type", HFILL }},
|
2007-12-10 21:25:32 +00:00
|
|
|
{&hf_sdp_fmtp_mpeg4_profile_level_id,
|
2006-04-26 20:16:57 +00:00
|
|
|
{ "Level Code",
|
2006-04-29 17:31:20 +00:00
|
|
|
"sdp.fmtp.profile_level_id",FT_UINT32, BASE_DEC,VALS(mpeg4es_level_indication_vals), 0x0,
|
|
|
|
"Level Code", HFILL }},
|
2006-12-04 23:03:11 +00:00
|
|
|
{ &hf_sdp_fmtp_h263_profile,
|
|
|
|
{ "Profile",
|
|
|
|
"sdp.fmtp.h263profile",FT_UINT32, BASE_DEC,VALS(h263_profile_vals), 0x0,
|
|
|
|
"Profile", HFILL }},
|
2007-12-10 21:25:32 +00:00
|
|
|
{ &hf_sdp_h264_packetization_mode,
|
|
|
|
{ "Packetization mode",
|
|
|
|
"sdp.fmtp.h264_packetization_mode",FT_UINT32, BASE_DEC,VALS(h264_packetization_mode_vals), 0x0,
|
|
|
|
"Packetization mode", HFILL }},
|
|
|
|
{ &hf_sdp_h264_sprop_parameter_sets,
|
|
|
|
{ "Sprop_parameter_sets",
|
|
|
|
"sdp.h264.sprop_parameter_sets", FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
"Sprop_parameter_sets", HFILL }},
|
2006-11-03 20:15:17 +00:00
|
|
|
{ &hf_SDPh223LogicalChannelParameters,
|
|
|
|
{ "h223LogicalChannelParameters", "sdp.h223LogicalChannelParameters",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0,
|
|
|
|
"sdp.h223LogicalChannelParameters", HFILL }},
|
2007-03-05 23:11:11 +00:00
|
|
|
{ &hf_key_mgmt_att_value,
|
|
|
|
{ "Key Management",
|
|
|
|
"sdp.key_mgmt", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Key Management", HFILL }},
|
|
|
|
{ &hf_key_mgmt_prtcl_id,
|
|
|
|
{ "Key Management Protocol (kmpid)",
|
|
|
|
"sdp.key_mgmt.kmpid", FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Key Management Protocol", HFILL }},
|
|
|
|
{ &hf_key_mgmt_data,
|
|
|
|
{ "Key Management Data",
|
|
|
|
"sdp.key_mgmt.data", FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
"Key Management Data", HFILL }},
|
2001-12-13 21:49:22 +00:00
|
|
|
};
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_sdp,
|
2001-12-15 20:22:47 +00:00
|
|
|
&ett_sdp_owner,
|
|
|
|
&ett_sdp_connection_info,
|
|
|
|
&ett_sdp_bandwidth,
|
|
|
|
&ett_sdp_time,
|
|
|
|
&ett_sdp_repeat_time,
|
|
|
|
&ett_sdp_timezone,
|
|
|
|
&ett_sdp_encryption_key,
|
|
|
|
&ett_sdp_session_attribute,
|
|
|
|
&ett_sdp_media,
|
|
|
|
&ett_sdp_media_attribute,
|
2006-04-29 17:31:20 +00:00
|
|
|
&ett_sdp_fmtp,
|
2007-03-05 23:11:11 +00:00
|
|
|
&ett_sdp_key_mgmt,
|
2001-12-13 21:49:22 +00:00
|
|
|
};
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2006-05-03 05:07:04 +00:00
|
|
|
module_t *sdp_module;
|
|
|
|
|
2001-12-13 21:49:22 +00:00
|
|
|
proto_sdp = proto_register_protocol("Session Description Protocol",
|
2006-04-29 17:31:20 +00:00
|
|
|
"SDP", "sdp");
|
2001-12-13 21:49:22 +00:00
|
|
|
proto_register_field_array(proto_sdp, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2007-03-05 23:11:11 +00:00
|
|
|
|
|
|
|
key_mgmt_dissector_table = register_dissector_table("key_mgmt",
|
|
|
|
"Key Management", FT_STRING, BASE_NONE);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2006-05-03 05:07:04 +00:00
|
|
|
/*
|
|
|
|
* Preferences registration
|
|
|
|
*/
|
|
|
|
sdp_module = prefs_register_protocol(proto_sdp, NULL);
|
|
|
|
prefs_register_bool_preference(sdp_module, "establish_conversation",
|
2006-07-28 21:26:39 +00:00
|
|
|
"Establish Media Conversation",
|
|
|
|
"Specifies that RTP/RTCP/T.38/MSRP/etc streams are decoded based "
|
2007-12-15 18:26:21 +00:00
|
|
|
"upon port numbers found in SDP payload",
|
2006-05-03 05:07:04 +00:00
|
|
|
&global_sdp_establish_conversation);
|
2007-08-15 22:27:52 +00:00
|
|
|
|
2001-12-13 21:49:22 +00:00
|
|
|
/*
|
|
|
|
* Register the dissector by name, so other dissectors can
|
2006-04-29 17:31:20 +00:00
|
|
|
* grab it by name rather than just referring to it directly.
|
2001-12-13 21:49:22 +00:00
|
|
|
*/
|
|
|
|
register_dissector("sdp", dissect_sdp, proto_sdp);
|
2005-02-01 12:12:35 +00:00
|
|
|
|
|
|
|
/* Register for tapping */
|
|
|
|
sdp_tap = register_tap("sdp");
|
1999-07-29 05:47:07 +00:00
|
|
|
}
|
2003-11-17 21:52:35 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_sdp(void)
|
|
|
|
{
|
2003-12-07 03:46:04 +00:00
|
|
|
dissector_handle_t sdp_handle;
|
|
|
|
|
|
|
|
rtp_handle = find_dissector("rtp");
|
|
|
|
rtcp_handle = find_dissector("rtcp");
|
2006-07-28 21:26:39 +00:00
|
|
|
msrp_handle = find_dissector("msrp");
|
2004-10-22 06:19:00 +00:00
|
|
|
t38_handle = find_dissector("t38");
|
2007-12-03 20:14:42 +00:00
|
|
|
h264_handle = find_dissector("h264");
|
2004-10-22 06:19:00 +00:00
|
|
|
|
2003-12-07 03:46:04 +00:00
|
|
|
sdp_handle = find_dissector("sdp");
|
|
|
|
dissector_add_string("media_type", "application/sdp", sdp_handle);
|
2007-03-01 00:24:57 +00:00
|
|
|
dissector_add("bctp.tpi", 0x20, sdp_handle);
|
2003-11-17 21:52:35 +00:00
|
|
|
}
|