diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-08-26 04:36:14 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-08-26 04:36:14 +0000 |
commit | eeb1f0df1886960f2a2058e4e9f3379aa12c8c37 (patch) | |
tree | 0b46718c8dc631996111364db59e0cf51bdf7f2a /epan | |
parent | bd5202c05119fcdd49da36514af5b7c829c0cbe8 (diff) |
From swapnil:
Bug in Traffic Aggregate Description (TAD) IE in Packet-gtpv2.c fixed.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3940
svn path=/trunk/; revision=29556
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-gtpv2.c | 353 |
1 files changed, 131 insertions, 222 deletions
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c index 8b5bc08649..d14aa4d8ed 100644 --- a/epan/dissectors/packet-gtpv2.c +++ b/epan/dissectors/packet-gtpv2.c @@ -975,236 +975,145 @@ static void dissect_gtpv2_tad(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_) { int offset= 0,i=0,newoffset2; - guint8 number, opcode, ebit, comptype, length1; - proto_tree *ie_tree; - proto_item *ti; - number = tvb_get_guint8(tvb,offset)& 0x0f; - opcode = tvb_get_guint8(tvb,offset)& 0xe0; - ebit = tvb_get_guint8(tvb,offset)& 0x10; - proto_tree_add_item(tree, hf_gtpv2_b_tft_opcode, tvb, offset, 1, FALSE); - proto_tree_add_item(tree, hf_gtpv2_b_tft_number, tvb, offset, 1, FALSE); - proto_tree_add_item(tree, hf_gtpv2_b_tft_ebit, tvb, offset, 1, FALSE); - offset++; - switch(opcode) - { - case SPARE: - /* Spare */ - break; - case CREATE_NEW_TFT: - /* Create New TFT */ - case REPLACE_PACKET_FILTERS_TFT: - /*Replace Packet filters in existing TFT */ - while (i<number) - { - i++;newoffset2=0; - length1 =tvb_get_guint8(tvb,offset+2); - ti = proto_tree_add_text(tree, tvb, offset, 3+length1, "Packet Filter %d",i); - ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, offset, 1, FALSE); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, offset, 1, FALSE); - offset++; - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_eval, tvb, offset, 1, FALSE); - offset++; - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_length, tvb, offset, 1, FALSE); - offset++; - - while (newoffset2<length1) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_comp_type, tvb, offset, 1, FALSE); - comptype = tvb_get_guint8(tvb,offset); + guint8 number, opcode, ebit, comptype, length1; + proto_tree *ie_tree; + proto_item *ti; + number = tvb_get_guint8(tvb,offset)& 0x0f; + opcode = tvb_get_guint8(tvb,offset)& 0xe0; + ebit = tvb_get_guint8(tvb,offset)& 0x10; + proto_tree_add_item(tree, hf_gtpv2_b_tft_opcode, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_gtpv2_b_tft_number, tvb, offset, 1, FALSE); + proto_tree_add_item(tree, hf_gtpv2_b_tft_ebit, tvb, offset, 1, FALSE); + offset++; + switch(opcode) + { + case SPARE: + /* Spare */ + break; + case CREATE_NEW_TFT: + /* Create New TFT */ + case ADD_PACKET_FILTERS_TFT: + /* Add packet filters to existing TFT */ + case REPLACE_PACKET_FILTERS_TFT: + /*Replace Packet filters in existing TFT */ + while (i<number) + { + i++;newoffset2=0; + length1 =tvb_get_guint8(tvb,offset+2); + ti = proto_tree_add_text(tree, tvb, offset, 3+length1, "Packet Filter %d",i); + ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie); + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, offset, 1, FALSE); + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, offset, 1, FALSE); + offset++; + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_eval, tvb, offset, 1, FALSE); + offset++; + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_length, tvb, offset, 1, FALSE); offset++; - newoffset2++; - if (comptype==16) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4, tvb, offset, 4, FALSE); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4_mask, tvb, offset, 4, FALSE); - offset+=8; - newoffset2+=8; - } - if (comptype==32) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6, tvb, offset, 16, FALSE); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6_mask, tvb, offset, 16, FALSE); - offset+=32; - newoffset2+=32; - } - if (comptype==48) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_prot_id, tvb, offset, 1, FALSE); - offset+=1; - newoffset2+=1; - } - if (comptype==64) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_local, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==65) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_low, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_high, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==80) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_remote, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==81) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_low, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_high, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==96) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_security, tvb, offset, 4, FALSE); - offset+=4; - newoffset2+=4; - } - if (comptype==112) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type, tvb, offset, 1, FALSE); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type_mask, tvb, offset, 1, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==128) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_flow_label, tvb, offset, 3, FALSE); - offset+=3; - newoffset2+=3; - } - } - } - - break; - case ADD_PACKET_FILTERS_TFT: - /* Add packet filters to existing TFT */ - while (i<number) - { - i++;newoffset2=0; - length1 =tvb_get_guint8(tvb,offset+1); - ti = proto_tree_add_text(tree, tvb, offset, 2+length1, "Packet Filter %d",i); - ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_eval, tvb, offset, 1, FALSE); - offset++; - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_length, tvb, offset, 1, FALSE); - offset++; - while (newoffset2<length1) - { + while (newoffset2<length1) + { proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_comp_type, tvb, offset, 1, FALSE); comptype = tvb_get_guint8(tvb,offset); offset++; newoffset2++; - if (comptype==16) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4, tvb, offset, 4, FALSE); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4_mask, tvb, offset, 4, FALSE); - offset+=8; - newoffset2+=8; - } - if (comptype==32) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6, tvb, offset, 16, FALSE); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6_mask, tvb, offset, 16, FALSE); - offset+=32; - newoffset2+=32; - } - if (comptype==48) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_prot_id, tvb, offset, 1, FALSE); - offset+=1; - newoffset2+=1; - } - if (comptype==64) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_local, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==65) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_low, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_high, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==80) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_remote, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==81) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_low, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_high, tvb, offset, 2, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==96) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_security, tvb, offset, 4, FALSE); - offset+=4; - newoffset2+=4; - } - if (comptype==112) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type, tvb, offset, 1, FALSE); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type_mask, tvb, offset, 1, FALSE); - offset+=2; - newoffset2+=2; - } - if (comptype==128) - { - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_flow_label, tvb, offset, 3, FALSE); - offset+=3; - newoffset2+=3; - } - } - } - - break; - case DELETE_TFT: - /* Delete Existing TFT */ - break; + if (comptype==16) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4, tvb, offset, 4, FALSE); + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4_mask, tvb, offset, 4, FALSE); + offset+=8; + newoffset2+=8; + } + if (comptype==32) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6, tvb, offset, 16, FALSE); + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6_mask, tvb, offset, 16, FALSE); + offset+=32; + newoffset2+=32; + } + if (comptype==48) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_prot_id, tvb, offset, 1, FALSE); + offset+=1; + newoffset2+=1; + } + if (comptype==64) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_local, tvb, offset, 2, FALSE); + offset+=2; + newoffset2+=2; + } + if (comptype==65) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_low, tvb, offset, 2, FALSE); + offset+=2; + newoffset2+=2; + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_high, tvb, offset, 2, FALSE); + offset+=2; + newoffset2+=2; + } + if (comptype==80) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_remote, tvb, offset, 2, FALSE); + offset+=2; + newoffset2+=2; + } + if (comptype==81) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_low, tvb, offset, 2, FALSE); + offset+=2; + newoffset2+=2; + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_high, tvb, offset, 2, FALSE); + offset+=2; + newoffset2+=2; + } + if (comptype==96) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_security, tvb, offset, 4, FALSE); + offset+=4; + newoffset2+=4; + } + if (comptype==112) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type, tvb, offset, 1, FALSE); + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type_mask, tvb, offset, 1, FALSE); + offset+=2; + newoffset2+=2; + } + if (comptype==128) + { + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_flow_label, tvb, offset, 3, FALSE); + offset+=3; + newoffset2+=3; + } + } + } - case DELETE_PACKET_FILTERS_TFT: - /* Delete Packet filters from existing TFT */ - while (i<number) - { - i++; - ti = proto_tree_add_text(tree, tvb, offset, 1, "Packet Filter %d",i); - ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, offset, 1, FALSE); - proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, offset, 1, FALSE); - offset++; - } - break; - case NO_TFT_OPERATION: - /* No TFT operation */ - break; - case RESERVED: - /* Reserved */ - break; - default: - break; - } + break; + case DELETE_TFT: + /* Delete Existing TFT */ + break; + case DELETE_PACKET_FILTERS_TFT: + /* Delete Packet filters from existing TFT */ + while (i<number) + { + i++; + ti = proto_tree_add_text(tree, tvb, offset, 1, "Packet Filter %d",i); + ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie); + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, offset, 1, FALSE); + proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, offset, 1, FALSE); + offset++; + } + break; + case NO_TFT_OPERATION: + /* No TFT operation */ + break; + case RESERVED: + /* Reserved */ + break; + default: + break; + } } /* * 8.21 User Location Info (ULI) |