aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rtp.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-03-04 22:00:48 +0000
committerEvan Huus <eapache@gmail.com>2013-03-04 22:00:48 +0000
commit1cece569c8ca55f18db9b8ae354aab94f1d8b367 (patch)
treed5db2b82845a9e9257039cf27a057dd06cb5dc9d /epan/dissectors/packet-rtp.c
parent029c5bdbac6d2ff9baafa217946bf77b8f47ec33 (diff)
From Jiri Novak via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8424
Extend RTP dissector with ED-137 extension From me: Don't try to dissect a non-existent payload (see comment #9 on the bug). svn path=/trunk/; revision=48069
Diffstat (limited to 'epan/dissectors/packet-rtp.c')
-rw-r--r--epan/dissectors/packet-rtp.c794
1 files changed, 762 insertions, 32 deletions
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index 121e5f40e2..5909f203c9 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -175,6 +175,40 @@ static int hf_rtp_length = -1;
static int hf_rtp_hdr_exts = -1;
static int hf_rtp_hdr_ext = -1;
+/* RTP header ED137A extension fields */
+static int hf_rtp_hdr_ed137s = -1;
+static int hf_rtp_hdr_ed137 = -1;
+static int hf_rtp_hdr_ed137a = -1;
+static int hf_rtp_hdr_ed137_ptt_type = -1;
+static int hf_rtp_hdr_ed137_squ = -1;
+static int hf_rtp_hdr_ed137_ptt_id = -1;
+static int hf_rtp_hdr_ed137_sct = -1;
+static int hf_rtp_hdr_ed137_x = -1;
+static int hf_rtp_hdr_ed137_x_nu = -1;
+static int hf_rtp_hdr_ed137_ft_type = -1;
+static int hf_rtp_hdr_ed137_ft_len = -1;
+static int hf_rtp_hdr_ed137_ft_value = -1;
+static int hf_rtp_hdr_ed137_ft_bss_qidx = -1;
+static int hf_rtp_hdr_ed137_ft_bss_rssi_qidx = -1;
+static int hf_rtp_hdr_ed137_ft_bss_qidx_ml = -1;
+static int hf_rtp_hdr_ed137_ft_bss_nu = -1;
+static int hf_rtp_hdr_ed137_vf = -1;
+static int hf_rtp_hdr_ed137a_ptt_type = -1;
+static int hf_rtp_hdr_ed137a_squ = -1;
+static int hf_rtp_hdr_ed137a_ptt_id = -1;
+static int hf_rtp_hdr_ed137a_pm = -1;
+static int hf_rtp_hdr_ed137a_ptts = -1;
+static int hf_rtp_hdr_ed137a_sct = -1;
+static int hf_rtp_hdr_ed137a_reserved = -1;
+static int hf_rtp_hdr_ed137a_x = -1;
+static int hf_rtp_hdr_ed137a_x_nu = -1;
+static int hf_rtp_hdr_ed137a_ft_type = -1;
+static int hf_rtp_hdr_ed137a_ft_len = -1;
+static int hf_rtp_hdr_ed137a_ft_value = -1;
+static gint ett_hdr_ext_ed137s = -1;
+static gint ett_hdr_ext_ed137 = -1;
+static gint ett_hdr_ext_ed137a = -1;
+
/* RTP setup fields */
static int hf_rtp_setup = -1;
static int hf_rtp_setup_frame = -1;
@@ -262,6 +296,47 @@ static guint rtp_rfc2198_pt = 99;
/* Extension bit is the fourth bit */
#define RTP_EXTENSION(octet) ((octet) & 0x10)
+/* ED137 signature */
+#define RTP_ED137_SIG 0x0067
+
+/* ED137A signature */
+#define RTP_ED137A_SIG 0x0167
+
+/* ED137 PTT */
+#define RTP_ED137_ptt_mask(octet) ((octet) & 0xE0000000)
+#define RTP_ED137A_ptt_mask(octet) ((octet) & 0xE0000000)
+#define RTP_ED137_squ_mask(octet) ((octet) & 0x10000000)
+#define RTP_ED137A_squ_mask(octet) ((octet) & 0x10000000)
+
+/* ED137 extended information */
+#define RTP_ED137_extended_information(octet) ((octet) & 0x00400000)
+#define RTP_ED137A_extended_information(octet) ((octet) & 0x00010000)
+
+/* ED137 feature type */
+#define RTP_ED137_feature_type(octet) (((octet) & 0x003C0000) >> 18)
+#define RTP_ED137A_feature_type(octet) (((octet) & 0x0000F000) >> 12)
+
+/* ED137 feature length */
+#define RTP_ED137_feature_length(octet) (((octet) & 0x0003C000) >> 14)
+#define RTP_ED137A_feature_length(octet) (((octet) & 0x00000F00) >> 8)
+
+/* ED137 feature value */
+#define RTP_ED137_feature_value(octet) (((octet) & 0x00003FFE) >> 1)
+#define RTP_ED137A_feature_value(octet) (((octet) & 0x000000FF) >> 0)
+
+/* ED137 BSS constants */
+#define RTP_ED137_feature_bss_type 0x1
+#define RTP_ED137_feature_bss_len 11
+#define RTP_ED137_feature_bss_qidx(octet) (((octet) & 0x00003FC0) >> 6)
+#define RTP_ED137_feature_bss_qidx_ml(octet) (((octet) & 0x00000038) >> 2)
+
+/* RFC 5215 one byte header signature */
+#define RTP_RFC5215_ONE_BYTE_SIG 0xBEDE
+
+/* RFC 5215 two byte header mask and signature */
+#define RTP_RFC5215_TWO_BYTE_MASK 0xFFF0
+#define RTP_RFC5215_TWO_BYTE_SIG 0x1000
+
/* CSRC count is the last four bits */
#define RTP_CSRC_COUNT(octet) ((octet) & 0xF)
@@ -273,6 +348,136 @@ static const value_string rtp_version_vals[] =
{ 0, NULL },
};
+static const value_string rtp_ext_profile_vals[] =
+{
+ { RTP_ED137_SIG, "ED137" },
+ { RTP_ED137A_SIG, "ED137A" },
+ { 0, NULL },
+};
+
+static const value_string rtp_ext_ed137_ptt_type[] =
+{
+ { 0x00, "PTT OFF" },
+ { 0x01, "Normal PTT ON" },
+ { 0x02, "Coupling PTT ON" },
+ { 0x03, "Priority PTT ON" },
+ { 0x04, "Emergency PTT ON" },
+ { 0x05, "Reserved" },
+ { 0x06, "Reserved" },
+ { 0x07, "Reserved" },
+ { 0, NULL },
+};
+
+static const value_string rtp_ext_ed137_squ[] =
+{
+ { 0x00, "SQ OFF" },
+ { 0x01, "SQ ON" },
+ { 0, NULL },
+};
+
+static const value_string rtp_ext_ed137_ft_type[] =
+{
+ { 0x0, "No features" },
+ { 0x1, "Best signal selection" },
+ { 0x2, "CLIMAX time delay" },
+ { 0x3, "Reserved" },
+ { 0x4, "Reserved" },
+ { 0x5, "Reserved" },
+ { 0x6, "Reserved" },
+ { 0x7, "Reserved" },
+ { 0x8, "Reserved" },
+ { 0x9, "Reserved" },
+ { 0xA, "Reserved" },
+ { 0xB, "Vendor reserved" },
+ { 0xC, "Vendor reserved" },
+ { 0xD, "Vendor reserved" },
+ { 0xE, "Vendor reserved" },
+ { 0xF, "Vendor reserved" },
+ { 0, NULL },
+};
+
+static const value_string rtp_ext_ed137_vf[] =
+{
+ { 0x00, "VF OFF" },
+ { 0x01, "VF ON" },
+ { 0, NULL },
+};
+
+static const value_string rtp_ext_ed137_ft_bss_rssi_qidx[] =
+{
+ { 0x00, "lower than -100.00 dBm" },
+ { 0x01, "lower than or equal to -97.86 dBm" },
+ { 0x02, "lower than or equal to -95.71 dBm" },
+ { 0x03, "lower than or equal to -93.57 dBm" },
+ { 0x04, "lower than or equal to -91.43 dBm" },
+ { 0x05, "lower than or equal to -89.29 dBm" },
+ { 0x06, "lower than or equal to -87.14 dBm" },
+ { 0x07, "lower than or equal to -85.00 dBm" },
+ { 0x08, "lower than or equal to -82.86 dBm" },
+ { 0x09, "lower than or equal to -80.71 dBm" },
+ { 0x0a, "lower than or equal to -78.57 dBm" },
+ { 0x0b, "lower than or equal to -76.43 dBm" },
+ { 0x0c, "lower than or equal to -74.29 dBm" },
+ { 0x0d, "lower than or equal to -72.14 dBm" },
+ { 0x0e, "lower than or equal to -70.00 dBm" },
+ { 0x0f, "higher than -70.00 dBm" },
+ { 0, NULL },
+};
+
+static const value_string rtp_ext_ed137_ft_bss_qidx_ml[] =
+{
+ { 0x00, "RSSI" },
+ { 0x01, "AGC Level" },
+ { 0x02, "C/N" },
+ { 0x03, "Standardized PSD" },
+ { 0x04, "Vendor specific method" },
+ { 0x05, "Vendor specific method" },
+ { 0x06, "Vendor specific method" },
+ { 0x07, "Vendor specific method" },
+ { 0, NULL },
+};
+
+static const value_string rtp_ext_ed137a_ptt_type[] =
+{
+ { 0x00, "PTT OFF" },
+ { 0x01, "Normal PTT ON" },
+ { 0x02, "Coupling PTT ON" },
+ { 0x03, "Priority PTT ON" },
+ { 0x04, "Emergency PTT ON" },
+ { 0x05, "Reserved" },
+ { 0x06, "Reserved" },
+ { 0x07, "Reserved" },
+ { 0, NULL },
+};
+
+static const value_string rtp_ext_ed137a_squ[] =
+{
+ { 0x00, "SQ OFF" },
+ { 0x01, "SQ ON" },
+ { 0, NULL },
+};
+
+static const value_string rtp_ext_ed137a_ft_type[] =
+{
+ { 0x0, "No features" },
+ { 0x1, "Signal Quality Information" },
+ { 0x2, "CLIMAX time delay" },
+ { 0x3, "Radio remote control" },
+ { 0x4, "CLIMAX dynamic delay compensation" },
+ { 0x5, "Reserved" },
+ { 0x6, "Reserved" },
+ { 0x7, "Reserved" },
+ { 0x8, "Reserved" },
+ { 0x9, "Reserved" },
+ { 0xA, "Reserved" },
+ { 0xB, "Vendor reserved" },
+ { 0xC, "Vendor reserved" },
+ { 0xD, "Vendor reserved" },
+ { 0xE, "Vendor reserved" },
+ { 0xF, "Vendor reserved" },
+ { 0, NULL },
+};
+
/*
* Fields in the second octet of the RTP header.
*/
@@ -1255,7 +1460,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
gchar *payload_type_str = NULL;
gboolean is_srtp = FALSE;
unsigned int i = 0;
- unsigned int hdr_extension= 0;
+ unsigned int hdr_extension_len= 0;
unsigned int hdr_extension_id = 0;
unsigned int padding_count;
gint length, reported_length;
@@ -1435,7 +1640,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
sync_src,
seq_num,
timestamp,
- marker_set ? ", Mark " : " ");
+ marker_set ? ", Mark" : "");
if ( tree ) {
@@ -1514,40 +1719,37 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
if ( tree ) proto_tree_add_uint( rtp_tree, hf_rtp_prof_define, tvb, offset, 2, hdr_extension_id );
offset += 2;
- hdr_extension = tvb_get_ntohs( tvb, offset );
- if ( tree ) proto_tree_add_uint( rtp_tree, hf_rtp_length, tvb, offset, 2, hdr_extension);
+ hdr_extension_len = tvb_get_ntohs( tvb, offset );
+ if ( tree ) proto_tree_add_uint( rtp_tree, hf_rtp_length, tvb, offset, 2, hdr_extension_len);
offset += 2;
- if ( hdr_extension > 0 ) {
+ if ( hdr_extension_len > 0 ) {
if ( tree ) {
- ti = proto_tree_add_item(rtp_tree, hf_rtp_hdr_exts, tvb, offset, hdr_extension * 4, ENC_NA);
+ ti = proto_tree_add_item(rtp_tree, hf_rtp_hdr_exts, tvb, offset, hdr_extension_len * 4, ENC_NA);
rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext );
}
/* pass interpretation of header extension to a registered subdissector */
- newtvb = tvb_new_subset(tvb, offset, hdr_extension * 4, hdr_extension * 4);
- if ( !(dissector_try_uint(rtp_hdr_ext_dissector_table, hdr_extension_id, newtvb, pinfo, rtp_hext_tree)) ) {
-
- /* 0xBEDE is defined by RFC 5215 as a header
- * extension with a one byte header
- */
- if (hdr_extension_id == 0xBEDE) {
- dissect_rtp_hext_rfc5215_onebyte (newtvb, pinfo, rtp_hext_tree);
- }
- else if ((hdr_extension_id & 0xFFF0) == 0x1000) {
- dissect_rtp_hext_rfc5215_twobytes(tvb,
- offset - 4, hdr_extension_id, newtvb,
- pinfo, rtp_hext_tree);
- }
- else {
+ newtvb = tvb_new_subset(tvb, offset, hdr_extension_len * 4, hdr_extension_len * 4);
+
+ if (hdr_extension_id == RTP_RFC5215_ONE_BYTE_SIG) {
+ dissect_rtp_hext_rfc5215_onebyte (newtvb, pinfo, rtp_hext_tree);
+ }
+ else if ((hdr_extension_id & RTP_RFC5215_TWO_BYTE_MASK) == RTP_RFC5215_TWO_BYTE_SIG) {
+ dissect_rtp_hext_rfc5215_twobytes(tvb,
+ offset - 4, hdr_extension_id, newtvb,
+ pinfo, rtp_hext_tree);
+ }
+ else {
+ if ( !(dissector_try_uint(rtp_hdr_ext_dissector_table, hdr_extension_id, newtvb, pinfo, rtp_hext_tree)) ) {
hdrext_offset = offset;
- for ( i = 0; i < hdr_extension; i++ ) {
+ for ( i = 0; i < hdr_extension_len; i++ ) {
if ( tree ) proto_tree_add_uint( rtp_hext_tree, hf_rtp_hdr_ext, tvb, hdrext_offset, 4, tvb_get_ntohl( tvb, hdrext_offset ) );
hdrext_offset += 4;
}
}
}
- offset += hdr_extension * 4;
}
+ offset += hdr_extension_len * 4;
}
if ( padding_set ) {
@@ -1638,13 +1840,170 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
if (!pinfo->flags.in_error_pkt)
tap_queue_packet(rtp_tap, pinfo, rtp_info);
- dissect_rtp_data( tvb, pinfo, tree, rtp_tree, offset,
- tvb_length_remaining( tvb, offset ),
- tvb_reported_length_remaining( tvb, offset ),
- payload_type );
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
+ dissect_rtp_data( tvb, pinfo, tree, rtp_tree, offset,
+ tvb_length_remaining( tvb, offset ),
+ tvb_reported_length_remaining( tvb, offset ),
+ payload_type );
+ }
}
}
+static void
+dissect_rtp_hdr_ext_ed137(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+{
+ unsigned int offset = 0;
+ unsigned int hdr_extension_len = 0;
+ proto_item *ti = NULL;
+ proto_item *ti2 = NULL;
+ proto_tree *rtp_hext_tree = NULL;
+ proto_tree *rtp_hext_tree2 = NULL;
+ unsigned int i;
+ guint32 ext_value;
+ unsigned int ft_type = 0;
+ unsigned int bss_qidx = 0;
+ unsigned int bss_qidx_ml = 0;
+
+ hdr_extension_len = tvb_reported_length(tvb)/4;
+
+ if ( hdr_extension_len > 0 ) {
+ unsigned int hdrext_offset = 0;
+
+ if ( tree ) {
+ ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, offset, hdr_extension_len * 4, FALSE);
+ rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext_ed137s );
+ }
+ for(i=0; i<hdr_extension_len; i++) {
+ if ( tree ) {
+ ti2 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137, tvb, hdrext_offset, 4, FALSE);
+ rtp_hext_tree2 = proto_item_add_subtree( ti2, ett_hdr_ext_ed137 );
+ ext_value=tvb_get_ntohl( tvb, hdrext_offset );
+
+ if (RTP_ED137_ptt_mask(ext_value)) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", PTT");
+ }
+ if (RTP_ED137_squ_mask(ext_value)) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", SQU");
+ }
+
+ /* Following bits are used from ED137 RTPRx/RTPTx Information field */
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ptt_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_squ, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ptt_id, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_sct, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_x, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+
+ if (RTP_ED137_extended_information(ext_value)) {
+ /* Extended information is used */
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ft_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ft_len, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+
+ ft_type=RTP_ED137_feature_type(ext_value);
+ switch (ft_type) {
+ case RTP_ED137_feature_bss_type:
+ bss_qidx=RTP_ED137_feature_bss_qidx(ext_value);
+ bss_qidx_ml=RTP_ED137_feature_bss_qidx_ml(ext_value);
+ if (0==bss_qidx_ml) {
+ /* Special handling for RSSI method */
+ if (bss_qidx<=15) {
+ /* Correct range */
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ft_bss_rssi_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ }
+ else {
+ /* Handle as other method */
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ft_bss_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ }
+ }
+ else {
+ /* Other BSS method handling */
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ft_bss_qidx, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ }
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ft_bss_qidx_ml, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ft_bss_nu, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ break;
+ default:
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_ft_value, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ break;
+ }
+ }
+ else {
+ /* Extended information is not used */
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_x_nu, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ }
+
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137_vf, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ }
+ hdrext_offset += 4;
+ }
+ }
+}
+
+static void
+dissect_rtp_hdr_ext_ed137a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+{
+ unsigned int offset = 0;
+ unsigned int hdr_extension_len = 0;
+ proto_item *ti = NULL;
+ proto_item *ti2 = NULL;
+ proto_tree *rtp_hext_tree = NULL;
+ proto_tree *rtp_hext_tree2 = NULL;
+ unsigned int i;
+ guint32 ext_value;
+ unsigned int ft_type = 0;
+
+ hdr_extension_len = tvb_reported_length(tvb)/4;
+
+ if ( hdr_extension_len > 0 ) {
+ unsigned int hdrext_offset = 0;
+
+ if ( tree ) {
+ ti = proto_tree_add_item(tree, hf_rtp_hdr_ed137s, tvb, offset, hdr_extension_len * 4, FALSE);
+ rtp_hext_tree = proto_item_add_subtree( ti, ett_hdr_ext_ed137s );
+ }
+ for(i=0; i<hdr_extension_len; i++) {
+ if ( tree ) {
+ ti2 = proto_tree_add_item(rtp_hext_tree, hf_rtp_hdr_ed137a, tvb, hdrext_offset, 4, FALSE);
+ rtp_hext_tree2 = proto_item_add_subtree( ti2, ett_hdr_ext_ed137a );
+ ext_value=tvb_get_ntohl( tvb, hdrext_offset );
+
+ if (RTP_ED137A_ptt_mask(ext_value)) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", PTT");
+ }
+ if (RTP_ED137A_squ_mask(ext_value)) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", SQU");
+ }
+
+ /* Following bits are used from ED137A/B RTPRx Information field */
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptt_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_squ, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptt_id, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_pm, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ptts, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_sct, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_reserved, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_x, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+
+ if (RTP_ED137A_extended_information(ext_value)) {
+ /* Extended information is used */
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ft_type, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ft_len, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+
+ ft_type=RTP_ED137A_feature_type(ext_value);
+ switch (ft_type) {
+ default:
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_ft_value, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ break;
+ }
+ }
+ else {
+ /* Extended information is not used */
+ proto_tree_add_item( rtp_hext_tree2, hf_rtp_hdr_ed137a_x_nu, tvb, hdrext_offset, 4, ENC_BIG_ENDIAN);
+ }
+ }
+ hdrext_offset += 4;
+ }
+ }
+}
/* calculate the extended sequence number - top 16 bits of the previous sequence number,
* plus our own; then correct for wrapping */
@@ -1982,7 +2341,7 @@ proto_register_rtp(void)
"rtp.ext.profile",
FT_UINT16,
BASE_HEX_DEC,
- NULL,
+ VALS(rtp_ext_profile_vals),
0x0,
NULL, HFILL
}
@@ -2035,13 +2394,365 @@ proto_register_rtp(void)
NULL, HFILL
}
},
+/* ED137 and ED137A common structures */
+ {
+ &hf_rtp_hdr_ed137s,
+ {
+ "ED137 extensions",
+ "rtp.ext.ed137s",
+ FT_NONE,
+ BASE_NONE,
+ NULL,
+ 0x0,
+ NULL, HFILL
+ }
+ },
+/* ED137 only structures */
+ {
+ &hf_rtp_hdr_ed137,
+ {
+ "ED137 extension",
+ "rtp.ext.ed137",
+ FT_NONE,
+ BASE_NONE,
+ NULL,
+ 0x0,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_ptt_type,
+ {
+ "PTT Type",
+ "rtp.ext.ed137.ptt_type",
+ FT_UINT32,
+ BASE_DEC,
+ VALS(rtp_ext_ed137_ptt_type),
+ 0xE0000000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_squ,
+ {
+ "SQU",
+ "rtp.ext.ed137.squ",
+ FT_UINT32,
+ BASE_DEC,
+ VALS(rtp_ext_ed137_squ),
+ 0x10000000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_ptt_id,
+ {
+ "PTT-id",
+ "rtp.ext.ed137.ptt_id",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x0F000000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_sct,
+ {
+ "Simultaneous Call Transmissions",
+ "rtp.ext.ed137.sct",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x00800000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_x,
+ {
+ "X",
+ "rtp.ext.ed137.x",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x00400000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_x_nu,
+ {
+ "Not used",
+ "rtp.ext.ed137.x-nu",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x003FFFFE,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_ft_type,
+ {
+ "Feature type",
+ "rtp.ext.ed137.ft.type",
+ FT_UINT32,
+ BASE_HEX_DEC,
+ VALS(rtp_ext_ed137_ft_type),
+ 0x003C0000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_ft_len,
+ {
+ "Feature length",
+ "rtp.ext.ed137.ft.len",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x0003C000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_ft_value,
+ {
+ "Feature value",
+ "rtp.ext.ed137.ft.value",
+ FT_UINT32,
+ BASE_HEX_DEC,
+ NULL,
+ 0x00003FFE,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_vf,
+ {
+ "VF",
+ "rtp.ext.ed137.vf",
+ FT_UINT32,
+ BASE_DEC,
+ VALS(rtp_ext_ed137_vf),
+ 0x00000001,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_ft_bss_qidx,
+ {
+ "BSS Quality Index",
+ "rtp.ext.ed137.ft.bss.qidx",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x00003FC0,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_ft_bss_rssi_qidx,
+ {
+ "BSS Quality Index",
+ "rtp.ext.ed137.ft.bss.qidx",
+ FT_UINT32,
+ BASE_DEC,
+ VALS(rtp_ext_ed137_ft_bss_rssi_qidx),
+ 0x00003FC0,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_ft_bss_qidx_ml,
+ {
+ "BSS Quality Index Method",
+ "rtp.ext.ed137.ft.bss.qidx-ml",
+ FT_UINT32,
+ BASE_DEC,
+ VALS(rtp_ext_ed137_ft_bss_qidx_ml),
+ 0x00000038,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137_ft_bss_nu,
+ {
+ "Not used",
+ "rtp.ext.ed137.ft.bss-nu",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x00000006,
+ NULL, HFILL
+ }
+ },
+/* ED137A only structures */
+ {
+ &hf_rtp_hdr_ed137a,
+ {
+ "ED137A extension",
+ "rtp.ext.ed137A",
+ FT_NONE,
+ BASE_NONE,
+ NULL,
+ 0x0,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_ptt_type,
+ {
+ "PTT Type",
+ "rtp.ext.ed137A.ptt_type",
+ FT_UINT32,
+ BASE_DEC,
+ VALS(rtp_ext_ed137a_ptt_type),
+ 0xE0000000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_squ,
+ {
+ "SQU",
+ "rtp.ext.ed137A.squ",
+ FT_UINT32,
+ BASE_DEC,
+ VALS(rtp_ext_ed137a_squ),
+ 0x10000000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_ptt_id,
+ {
+ "PTT-id",
+ "rtp.ext.ed137A.ptt_id",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x0FC00000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_pm,
+ {
+ "PTT Mute",
+ "rtp.ext.ed137A.pm",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x00200000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_ptts,
+ {
+ "PTT Summation",
+ "rtp.ext.ed137A.ptts",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x00100000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_sct,
+ {
+ "Simultaneous Call Transmissions",
+ "rtp.ext.ed137a.sct",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x00080000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_reserved,
+ {
+ "Reserved",
+ "rtp.ext.ed137A.reserved",
+ FT_UINT32,
+ BASE_HEX_DEC,
+ NULL,
+ 0x00060000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_x,
+ {
+ "X",
+ "rtp.ext.ed137A.x",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x00010000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_x_nu,
+ {
+ "Not used",
+ "rtp.ext.ed137A.x-nu",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x0000FFFF,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_ft_type,
+ {
+ "Feature type",
+ "rtp.ext.ed137A.ft.type",
+ FT_UINT32,
+ BASE_HEX_DEC,
+ VALS(rtp_ext_ed137a_ft_type),
+ 0x0000F000,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_ft_len,
+ {
+ "Feature length",
+ "rtp.ext.ed137A.ft.len",
+ FT_UINT32,
+ BASE_DEC,
+ NULL,
+ 0x00000F00,
+ NULL, HFILL
+ }
+ },
+ {
+ &hf_rtp_hdr_ed137a_ft_value,
+ {
+ "Feature value",
+ "rtp.ext.ed137A.ft.value",
+ FT_UINT32,
+ BASE_HEX_DEC,
+ NULL,
+ 0x000000FF,
+ NULL, HFILL
+ }
+ },
+/* Other RTP structures */
{
&hf_rtp_hdr_ext,
{
"Header extension",
"rtp.hdr_ext",
FT_UINT32,
- BASE_DEC,
+ BASE_HEX_DEC,
NULL,
0x0,
NULL, HFILL
@@ -2288,6 +2999,9 @@ proto_register_rtp(void)
&ett_csrc_list,
&ett_hdr_ext,
&ett_hdr_ext_rfc5285,
+ &ett_hdr_ext_ed137s,
+ &ett_hdr_ext_ed137,
+ &ett_hdr_ext_ed137a,
&ett_rtp_setup,
&ett_rtp_rfc2198,
&ett_rtp_rfc2198_hdr,
@@ -2314,10 +3028,14 @@ proto_register_rtp(void)
"Dynamic RTP payload type", FT_STRING, BASE_NONE);
- rtp_hdr_ext_dissector_table = register_dissector_table("rtp_hdr_ext",
+ rtp_hdr_ext_dissector_table = register_dissector_table("rtp.hdr_ext",
"RTP header extension", FT_UINT32, BASE_HEX);
rtp_hdr_ext_rfc5285_dissector_table = register_dissector_table("rtp.ext.rfc5285.id",
"RTP Generic header extension (RFC 5285)", FT_UINT8, BASE_DEC);
+
+ register_dissector("rtp.ext.ed137", dissect_rtp_hdr_ext_ed137, proto_rtp);
+ register_dissector("rtp.ext.ed137a", dissect_rtp_hdr_ext_ed137a, proto_rtp);
+
rtp_module = prefs_register_protocol(proto_rtp, proto_reg_handoff_rtp);
prefs_register_bool_preference(rtp_module, "show_setup_info",
@@ -2357,6 +3075,8 @@ proto_reg_handoff_rtp(void)
{
static gboolean rtp_prefs_initialized = FALSE;
static dissector_handle_t rtp_rfc2198_handle;
+ static dissector_handle_t rtp_hdr_ext_ed137_handle;
+ static dissector_handle_t rtp_hdr_ext_ed137a_handle;
static guint rtp_saved_rfc2198_pt;
if (!rtp_prefs_initialized) {
@@ -2368,6 +3088,11 @@ proto_reg_handoff_rtp(void)
heur_dissector_add( "udp", dissect_rtp_heur_udp, proto_rtp);
heur_dissector_add("stun", dissect_rtp_heur_stun, proto_rtp);
+ rtp_hdr_ext_ed137_handle = find_dissector("rtp.ext.ed137");
+ rtp_hdr_ext_ed137a_handle = find_dissector("rtp.ext.ed137a");
+ dissector_add_uint("rtp.hdr_ext", RTP_ED137_SIG, rtp_hdr_ext_ed137_handle);
+ dissector_add_uint("rtp.hdr_ext", RTP_ED137A_SIG, rtp_hdr_ext_ed137a_handle);
+
data_handle = find_dissector("data");
classicstun_handle = find_dissector("classicstun");
classicstun_heur_handle = find_dissector("classicstun-heur");
@@ -2388,9 +3113,14 @@ proto_reg_handoff_rtp(void)
}
/*
- * Local Variables:
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
* c-basic-offset: 8
- * indent-tabs-mode: t
* tab-width: 8
+ * indent-tabs-mode: t
* End:
+ *
+ * vi: set shiftwidth=8 tabstop=8 noexpandtab:
+ * :indentSize=8:tabSize=8:noTabs=false:
*/