aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-catapult-dct2000.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2006-10-23 17:22:20 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2006-10-23 17:22:20 +0000
commitd55c609c5541e2ba2e4fb62d3ed3474e31084128 (patch)
tree1f011ab37033d6fad209b46a69c4fa4fd2ec6992 /epan/dissectors/packet-catapult-dct2000.c
parent3ce4a7041295e1f1ed6fe55accab30791ee06774 (diff)
- Fix problems with parsing sctpprim headers
- Add dissection of nbap (as encap or inside sctp primitive) svn path=/trunk/; revision=19664
Diffstat (limited to 'epan/dissectors/packet-catapult-dct2000.c')
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c65
1 files changed, 54 insertions, 11 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c
index cf0c2f1616..7d94cc19a0 100644
--- a/epan/dissectors/packet-catapult-dct2000.c
+++ b/epan/dissectors/packet-catapult-dct2000.c
@@ -192,10 +192,11 @@ static gboolean find_sctpprim_variant1_data_offset(tvbuff_t *tvb, int *data_offs
int offset = *data_offset;
/* Get the sctpprim command code. */
- guint8 tag = tvb_get_guint8(tvb, offset++);
+ guint8 first_tag = tvb_get_guint8(tvb, offset++);
+ guint8 tag;
/* Only accept interested in data requests or indications */
- switch (tag)
+ switch (first_tag)
{
case 0x04: /* data request */
case 0x62: /* data indication */
@@ -204,17 +205,24 @@ static gboolean find_sctpprim_variant1_data_offset(tvbuff_t *tvb, int *data_offs
return FALSE;
}
- /* Length field. msb set indicates 2 bytes */
- if (tvb_get_guint8(tvb, offset) & 0x80)
+ if (first_tag == 0x04)
{
- offset += 2;
+ /* Overall length field. msb set indicates 2 bytes */
+ if (tvb_get_guint8(tvb, offset) & 0x80)
+ {
+ offset += 2;
+ }
+ else
+ {
+ offset++;
+ }
}
else
{
- offset++;
+ offset += 3;
}
- /* Skip any other TLC fields before reach payload */
+ /* Skip any other fields before reach payload */
while (tvb_length_remaining(tvb, offset) > 2)
{
/* Look at next tag */
@@ -228,10 +236,29 @@ static gboolean find_sctpprim_variant1_data_offset(tvbuff_t *tvb, int *data_offs
}
else
{
- /* Read length in next byte */
- length = tvb_get_guint8(tvb, offset++);
- /* Skip the following value */
- offset += length;
+ if (first_tag == 0x62)
+ {
+ switch (tag)
+ {
+ case 0x0a: /* dest port */
+ case 0x1e: /* strseqnum */
+ case 0x0d:
+ offset += 2;
+ continue;
+ case 0x1d:
+ case 0x09:
+ case 0x0c:
+ offset += 4;
+ continue;
+ }
+ }
+ else
+ {
+ /* Read length in next byte */
+ length = tvb_get_guint8(tvb, offset++);
+ /* Skip the following value */
+ offset += length;
+ }
}
}
@@ -282,6 +309,9 @@ static gboolean find_sctpprim_variant3_data_offset(tvbuff_t *tvb, int *data_offs
/* 2-byte length field */
offset += 2;
+ /* Skip 2-byte length field */
+ offset += 2;
+
/* Data is here!!! */
*data_offset = offset;
return TRUE;
@@ -372,6 +402,16 @@ dissector_handle_t look_for_dissector(char *protocol_name)
{
return find_dissector("rtp");
}
+ else
+ if (strcmp(protocol_name, "sipt") == 0)
+ {
+ return find_dissector("sip");
+ }
+ else
+ if (strncmp(protocol_name, "nbap_sctp", strlen("nbap_sctp")) == 0)
+ {
+ return find_dissector("nbap");
+ }
/* Try for an exact match */
else
@@ -696,6 +736,9 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case DCT2000_ENCAP_MTP2:
protocol_handle = find_dissector("mtp2");
break;
+ case DCT2000_ENCAP_NBAP:
+ protocol_handle = find_dissector("nbap");
+ break;
case DCT2000_ENCAP_UNHANDLED:
/* Show context.port in src or dest column as appropriate */
if (check_col(pinfo->cinfo, COL_DEF_SRC) && direction == 0)