diff options
author | pascal <pascal@localhost> | 2012-04-28 17:34:23 +0000 |
---|---|---|
committer | pascal <pascal@localhost> | 2012-04-28 17:34:23 +0000 |
commit | 5e0e1ceea88060b55a6df4035e030e8fb7c9d6a9 (patch) | |
tree | 34050910561e1b6cd5489ef96f05098fb8733ff7 /epan/dissectors/packet-x25.c | |
parent | 120f19310a5cc632497249e226104f7c4be685b3 (diff) |
Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7213:
Update dissection of Reverse charging, fast select, and ICRD status selection facilities
svn path=/trunk/; revision=42319
Diffstat (limited to 'epan/dissectors/packet-x25.c')
-rw-r--r-- | epan/dissectors/packet-x25.c | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c index cdd4c176bf..6d4a04a64d 100644 --- a/epan/dissectors/packet-x25.c +++ b/epan/dissectors/packet-x25.c @@ -178,6 +178,9 @@ static gint hf_x25_segment_too_long_segment = -1; static gint hf_x25_segment_error = -1; static gint hf_x25_segment_count = -1; static gint hf_x25_reassembled_length = -1; +static gint hf_x25_fast_select = -1; +static gint hf_x25_icrd = -1; +static gint hf_x25_reverse_charging = -1; static const value_string vals_modulo[] = { { 1, "8" }, @@ -211,6 +214,27 @@ static struct true_false_string m_bit_tfs = { "End of data" }; +static const value_string x25_fast_select_vals[] = { + { 0, "Not requested" }, + { 1, "Not requested" }, + { 2, "No restriction on response" }, + { 3, "Restriction on response" }, + { 0, NULL} +}; + +static const value_string x25_icrd_vals[] = { + { 0, "Status not selected" }, + { 1, "Prevention requested" }, + { 2, "Allowance requested" }, + { 3, "Not allowed" }, + { 0, NULL} +}; + +static struct true_false_string x25_reverse_charging_val = { + "Requested", + "Not requested" +}; + static const fragment_items x25_frag_items = { &ett_x25_segment, &ett_x25_segments, @@ -670,22 +694,11 @@ dump_facilities(proto_tree *tree, int *offset, tvbuff_t *tvb) ti = proto_tree_add_text(fac_tree, tvb, *offset, 1, "Code : %02X " "(Reverse charging / Fast select)", fac); fac_subtree = proto_item_add_subtree(ti, ett_x25_fac_reverse); - byte1 = tvb_get_guint8(tvb, *offset + 1); proto_tree_add_text(fac_subtree, tvb, *offset+1, 1, - "Parameter : %02X", byte1); - if (byte1 & 0xC0) - proto_tree_add_text(fac_subtree, tvb, *offset+1, 1, - "11.. .... = Fast select with restriction"); - else if (byte1 & 0x80) - proto_tree_add_text(fac_subtree, tvb, *offset+1, 1, - "10.. .... = Fast select - no restriction"); - else - proto_tree_add_text(fac_subtree, tvb, *offset+1, 1, - "00.. .... = Fast select not requested"); - proto_tree_add_text(fac_subtree, tvb, *offset+1, 1, "%s", - decode_boolean_bitfield(byte1, 0x01, 1*8, - "Reverse charging requested", - "Reverse charging not requested")); + "Parameter : %02X", tvb_get_guint8(tvb, *offset + 1)); + proto_tree_add_item(fac_subtree, hf_x25_fast_select, tvb, *offset+1, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(fac_subtree, hf_x25_icrd, tvb, *offset+1, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(fac_subtree, hf_x25_reverse_charging, tvb, *offset+1, 1, ENC_BIG_ENDIAN); } break; case X25_FAC_CHARGING_INFO: @@ -2654,6 +2667,18 @@ proto_register_x25(void) { &hf_x25_segments, { "X.25 Fragments", "x25.fragments", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + + { &hf_x25_fast_select, + { "X.25 Fast select", "x25.fast_select", FT_UINT8, BASE_DEC, VALS(x25_fast_select_vals), 0xC0, + NULL, HFILL }}, + + { &hf_x25_icrd, + { "X.25 ICRD", "x25.icrd", FT_UINT8, BASE_DEC, VALS(x25_icrd_vals), 0x30, + NULL, HFILL }}, + + { &hf_x25_reverse_charging, + { "X.25 Fast select", "x25.reverse_charging", FT_BOOLEAN, 8, TFS(&x25_reverse_charging_val), 0x01, + NULL, HFILL }}, }; static gint *ett[] = { &ett_x25, |