diff options
author | Anders Broman <anders.broman@ericsson.com> | 2006-06-02 20:29:05 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2006-06-02 20:29:05 +0000 |
commit | b590de7ce0d6d8a9e801006a96243def4aa59191 (patch) | |
tree | 41cc0de855d22dfb06e63e345d8cbc17cd8e5a39 | |
parent | 3b815838f3fabe2d2798900cd9646b89a14eaaf8 (diff) |
From Richard van der Hoff:
Q.931:I
mprovesthe dissection of Q.931 Channel
Identification information elements, by using proper (filterable) header
fields rather than text tree items.
H253:
make the h.263 dissector dissect the group-of-block
number which comes after a GOB start code.
svn path=/trunk/; revision=18323
-rw-r--r-- | epan/dissectors/packet-h263.c | 23 | ||||
-rw-r--r-- | epan/dissectors/packet-q931.c | 116 |
2 files changed, 106 insertions, 33 deletions
diff --git a/epan/dissectors/packet-h263.c b/epan/dissectors/packet-h263.c index 3553b845a3..94f3dd9144 100644 --- a/epan/dissectors/packet-h263.c +++ b/epan/dissectors/packet-h263.c @@ -91,6 +91,7 @@ static int hf_h263_optional_advanced_prediction_mode = -1; static int hf_h263_PB_frames_mode = -1; static int hf_h263_data = -1; static int hf_h263_payload = -1; +static int hf_h263_GN = -1; /* Source format types */ #define SRCFORMAT_FORB 0 /* forbidden */ @@ -301,7 +302,7 @@ static void dissect_h263_data( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr data = tvb_get_ntohl(tvb, offset); if (( data & 0xffff8000) == 0x00008000 ) { /* PSC or Group of Block Start Code (GBSC) found */ - if (( data & 0xfffffc00) == 0x00008000 ) { /* PSC found */ + if (( data & 0x00007c00) == 0 ) { /* PSC found */ if ( check_col( pinfo->cinfo, COL_INFO) ) col_append_str( pinfo->cinfo, COL_INFO, "(PSC) "); if( tree ) { @@ -339,7 +340,7 @@ static void dissect_h263_data( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr proto_tree_add_item( h263_payload_tree, hf_h263_PB_frames_mode, tvb, offset, 1, FALSE ); } } - }else if ((data & 0x00007c00)!= 0) { /* GBSC found */ + } else { /* GBSC found */ if ( check_col( pinfo->cinfo, COL_INFO) ) col_append_str( pinfo->cinfo, COL_INFO, "(GBSC) "); if( tree ) { @@ -350,6 +351,11 @@ static void dissect_h263_data( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr * */ proto_tree_add_uint(h263_payload_tree, hf_h263_gbsc,tvb, offset,3,data); + proto_tree_add_uint(h263_payload_tree, hf_h263_GN, tvb, offset,3,data); + /* GN is followed by (optionally) GBSI, then + * GFID and GQUANT, but decoding them requires + * knowing the value of CPM in the picture + * header */ offset = offset + 2; } } @@ -782,7 +788,18 @@ proto_register_h263(void) "Optional PB-frames mode", HFILL } }, - + { + &hf_h263_GN, + { + "H.263 Group Number", + "h263.gn", + FT_UINT32, + BASE_DEC, + NULL, + 0x00007c00, + "Group Number, GN", HFILL + } + }, }; static gint *ett[] = diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c index 0d9d10633b..6f6714c411 100644 --- a/epan/dissectors/packet-q931.c +++ b/epan/dissectors/packet-q931.c @@ -89,6 +89,18 @@ static int hf_q931_redirecting_number = -1; static int hf_q931_screening_ind = -1; static int hf_q931_presentation_ind = -1; +/* fields for Channel Indentification IE */ +static int hf_q931_channel_interface_explicit = -1; +static int hf_q931_channel_interface_type = -1; +static int hf_q931_channel_exclusive = -1; +static int hf_q931_channel_dchan = -1; +static int hf_q931_channel_selection_bri = -1; +static int hf_q931_channel_selection_pri = -1; +static int hf_q931_channel_map = -1; +static int hf_q931_channel_element_type = -1; +static int hf_q931_channel_number = -1; + + static int hf_q931_segments = -1; static int hf_q931_segment = -1; static int hf_q931_segment_overlap = -1; @@ -187,6 +199,21 @@ static const true_false_string tfs_call_ref_flag = { "Message sent from originating side" }; +static const true_false_string tfs_interface_type = { + "Primary rate interface", + "Basic rate interface" +}; + +static const true_false_string tfs_channel_exclusive = { + "Exclusive; only the indicated channel is acceptable", + "Indicated channel is preferred" +}; + +static const true_false_string tfs_channel_map = { + "Channel indicated by slot map", + "Channel indicated by number" +}; + /* * Information elements. */ @@ -1401,28 +1428,17 @@ dissect_q931_channel_identification_ie(tvbuff_t *tvb, int offset, int len, if (len == 0) return; octet = tvb_get_guint8(tvb, offset); - proto_tree_add_text(tree, tvb, offset, 1, - "Interface %s identified", - (octet & Q931_INTERFACE_IDENTIFIED) ? "explicitly" : "implicitly"); - proto_tree_add_text(tree, tvb, offset, 1, - "%s interface", - (octet & Q931_NOT_BASIC_CHANNEL) ? "Not basic" : "Basic"); - proto_tree_add_text(tree, tvb, offset, 1, - "Indicated channel is %s", - (octet & 0x08) ? "required" : "preferred"); - proto_tree_add_text(tree, tvb, offset, 1, - "Indicated channel is %sthe D-channel", - (octet & 0x04) ? "" : "not "); + + proto_tree_add_item(tree, hf_q931_extension_ind, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_q931_channel_interface_explicit, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_q931_channel_interface_type, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_q931_channel_exclusive, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_q931_channel_dchan, tvb, offset, 1, FALSE); + if (octet & Q931_NOT_BASIC_CHANNEL) { - proto_tree_add_text(tree, tvb, offset, 1, - "Channel selection: %s", - val_to_str(octet & 0x03, q931_not_basic_channel_selection_vals, - "Unknown (0x%X)")); + proto_tree_add_item(tree, hf_q931_channel_selection_pri, tvb, offset, 1, FALSE); } else { - proto_tree_add_text(tree, tvb, offset, 1, - "Channel selection: %s", - val_to_str(octet & 0x03, q931_basic_channel_selection_vals, - "Unknown (0x%02X)")); + proto_tree_add_item(tree, hf_q931_channel_selection_bri, tvb, offset, 1, FALSE); } offset += 1; len -= 1; @@ -1458,6 +1474,7 @@ dissect_q931_channel_identification_ie(tvbuff_t *tvb, int offset, int len, return; octet = tvb_get_guint8(tvb, offset); coding_standard = octet & 0x60; + proto_tree_add_item(tree, hf_q931_extension_ind, tvb, offset, 1, FALSE); proto_tree_add_uint(tree, hf_q931_coding_standard, tvb, offset, 1, octet); if (coding_standard != Q931_ITU_STANDARDIZED_CODING) { /* @@ -1470,14 +1487,9 @@ dissect_q931_channel_identification_ie(tvbuff_t *tvb, int offset, int len, tvb_bytes_to_str(tvb, offset, len)); return; } - proto_tree_add_text(tree, tvb, offset, 1, - "Channel is indicated by %s", - (octet & Q931_IS_SLOT_MAP) ? "slot map" : "number"); - proto_tree_add_text(tree, tvb, offset, 1, - "%s type: %s", - (octet & Q931_IS_SLOT_MAP) ? "Map element" : "Channel", - val_to_str(octet & 0x0F, q931_element_type_vals, - "Unknown (0x%02X)")); + proto_tree_add_item(tree, hf_q931_channel_map, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_q931_channel_element_type, tvb, offset, 1, FALSE); + offset += 1; len -= 1; @@ -1496,8 +1508,10 @@ dissect_q931_channel_identification_ie(tvbuff_t *tvb, int offset, int len, if (len == 0) break; octet = tvb_get_guint8(tvb, offset); - proto_tree_add_text(tree, tvb, offset, 1, - "Channel number: %u", octet & ~Q931_IE_VL_EXTENSION); + + proto_tree_add_item(tree, hf_q931_extension_ind, tvb, offset, 1, FALSE); + proto_tree_add_item(tree,hf_q931_channel_number,tvb,offset,1,FALSE); + offset += 1; len -= 1; } while (!(octet & Q931_IE_VL_EXTENSION)); @@ -3176,6 +3190,48 @@ proto_register_q931(void) { &hf_q931_redirecting_number, { "Redirecting party number digits", "q931.redirecting_number.digits", FT_STRING, BASE_NONE, NULL, 0x0, "", HFILL }}, + + /* fields for channel identification IE */ + /* 0x80 is the extension bit */ + + { &hf_q931_channel_interface_explicit, + { "Interface identifier present", "q931.channel.interface_id_present", FT_BOOLEAN, 8, NULL, 0x40, + "True if the interface identifier is explicit in the following octets", HFILL }}, + + { &hf_q931_channel_interface_type, + { "Interface type", "q931.channel.interface_type", FT_BOOLEAN, 8, &tfs_interface_type, 0x20, + "Identifies the ISDN interface type", HFILL }}, + + /* 0x10 is spare */ + + { &hf_q931_channel_exclusive, + { "Indicated channel is exclusive", "q931.channel.exclusive", FT_BOOLEAN, 8, &tfs_channel_exclusive, 0x08, + "True if only the indicated channel is acceptable", HFILL }}, + + { &hf_q931_channel_dchan, + { "D-channel indicator", "q931.channel.dchan", FT_BOOLEAN, 8, NULL, 0x04, + "True if the identified channel is the D-Channel", HFILL }}, + + { &hf_q931_channel_selection_bri, + { "Information channel selection", "q931.channel.selection", FT_UINT8, BASE_HEX, q931_basic_channel_selection_vals, 0x03, + "Identifies the information channel to be used", HFILL }}, + + { &hf_q931_channel_selection_pri, + { "Information channel selection", "q931.channel.selection", FT_UINT8, BASE_HEX, q931_not_basic_channel_selection_vals, 0x03, + "Identifies the information channel to be used", HFILL }}, + + { &hf_q931_channel_map, + { "Number/map", "q931.channel.map", FT_BOOLEAN, 8, &tfs_channel_map, 0x10, + "True if channel is indicates by channel map rather than number", HFILL }}, + + { &hf_q931_channel_element_type, + { "Element type", "q931.channel.element_type", FT_UINT8, BASE_HEX, q931_element_type_vals, 0xF, + "Type of element in the channel number/slot map octets", HFILL }}, + + { &hf_q931_channel_number, + { "Channel number", "q931.channel.number", FT_UINT8, BASE_DEC, NULL, 0x7F, + "Channel number", HFILL }}, + /* desegmentation fields */ { &hf_q931_segment_overlap, { "Segment overlap", "q931.segment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, |