diff options
author | Michael Mann <mmann78@netscape.net> | 2016-06-17 10:58:32 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-06-18 03:29:54 +0000 |
commit | 631b9c43e2ee52b46811fcd37cdcb334648b6445 (patch) | |
tree | fbbb5fd0e5bc53b47fcea3b4c40597905db93dc1 /epan/dissectors/packet-gtpv2.c | |
parent | 2dc3e52cb7d5384e0d5da1cd1d43eaf3b7f2a280 (diff) |
GTPv2: Use proto_tree_add_bitmask
Change-Id: I236a3513237a7a977389438adaf381542281943d
Reviewed-on: https://code.wireshark.org/review/15997
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-gtpv2.c')
-rw-r--r-- | epan/dissectors/packet-gtpv2.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c index fe7c1b3100..bbf04aad8b 100644 --- a/epan/dissectors/packet-gtpv2.c +++ b/epan/dissectors/packet-gtpv2.c @@ -2190,10 +2190,11 @@ dissect_gtpv2_ecgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *off guint32 octet4; guint8 spare; guint32 ECGI; - guint32 enodebid; - guint8 cellid; - proto_tree *subtree; - proto_item *item; + const int* ECGI_flags[] = { + &hf_gtpv2_enodebid, + &hf_gtpv2_cellid, + NULL + }; mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, TRUE); *offset += 3; @@ -2206,17 +2207,11 @@ dissect_gtpv2_ecgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *off spare = octet & 0xF0; octet4 = tvb_get_ntohl(tvb, *offset); ECGI = octet4 & 0x0FFFFFFF; - enodebid = ECGI >> 8; - cellid = (guint8)ECGI & 0xFF; proto_tree_add_uint(tree, hf_gtpv2_ecgi_eci_spare, tvb, *offset, 1, spare); /* The coding of the E-UTRAN cell identifier is the responsibility of each administration. * Coding using full hexadecimal representation shall be used. */ - item = proto_tree_add_uint(tree, hf_gtpv2_ecgi_eci, tvb, *offset, 4, ECGI); - subtree = proto_item_add_subtree(item, ett_gtpv2_eci); - proto_tree_add_uint(subtree, hf_gtpv2_enodebid, tvb, *offset, 3, enodebid); - proto_tree_add_uint(subtree, hf_gtpv2_cellid, tvb, *offset + 3, 1, cellid); - /*proto_tree_add_item(tree, hf_gtpv2_ecgi_eci, tvb, offset, 4, ENC_BIG_ENDIAN);*/ + proto_tree_add_bitmask(tree, tvb, *offset, hf_gtpv2_ecgi_eci, ett_gtpv2_eci, ECGI_flags, ENC_BIG_ENDIAN); *offset += 4; str = wmem_strdup_printf(wmem_packet_scope(), "%s, ECGI 0x%x", mcc_mnc_str, @@ -8036,17 +8031,17 @@ void proto_register_gtpv2(void) }, {&hf_gtpv2_macro_enodeb_id, {"Macro eNodeB ID", "gtpv2.macro_enodeb_id", - FT_UINT24, BASE_HEX, NULL, 0x0fffff, + FT_UINT32, BASE_HEX, NULL, 0x0fffff, NULL, HFILL} }, {&hf_gtpv2_cellid, {"CellId", "gtpv2.cellid", - FT_UINT8, BASE_DEC, NULL, 0, + FT_UINT32, BASE_DEC, NULL, 0xFF, NULL, HFILL} }, { &hf_gtpv2_enodebid, { "eNodeB Id", "gtpv2.enodebid", - FT_UINT32, BASE_DEC, NULL, 0, + FT_UINT32, BASE_DEC, NULL, 0x0FFFFF00, NULL, HFILL } }, { &hf_gtpv2_CauseProtocol, |