diff options
author | Binh Trinh <beango@gmail.com> | 2016-06-17 01:21:19 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-06-17 13:01:09 +0000 |
commit | 2aa55a387a87cd4f740aea661ca1ca535cd2e392 (patch) | |
tree | 73c56b82057dc9ad32ba74012c0ad1a6427f6d22 | |
parent | a6da022898d7020730889b1c974470c810c5a08d (diff) |
GTPV2: add decoding of ECI into enodebid and cellid
Change-Id: If46cc354e202ff9a126580bf742d747e42678f83
Reviewed-on: https://code.wireshark.org/review/15994
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-gtpv2.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c index fa21fd8864..fe7c1b3100 100644 --- a/epan/dissectors/packet-gtpv2.c +++ b/epan/dissectors/packet-gtpv2.c @@ -317,6 +317,8 @@ static int hf_gtpv2_CauseProtocol = -1; static int hf_gtpv2_CauseMisc = -1; static int hf_gtpv2_target_type = -1; static int hf_gtpv2_macro_enodeb_id = -1; +static int hf_gtpv2_enodebid = -1; +static int hf_gtpv2_cellid = -1; static int hf_gtpv2_node_type= -1; static int hf_gtpv2_fqdn = -1; @@ -563,6 +565,7 @@ static gint ett_gtpv2_preaa_rais = -1; static gint ett_gtpv2_preaa_sais = -1; static gint ett_gtpv2_preaa_cgis = -1; static gint ett_gtpv2_load_control_inf = -1; +static gint ett_gtpv2_eci = -1; static expert_field ei_gtpv2_ie_data_not_dissected = EI_INIT; static expert_field ei_gtpv2_ie_len_invalid = EI_INIT; @@ -2187,6 +2190,10 @@ 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; mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, TRUE); *offset += 3; @@ -2199,11 +2206,16 @@ 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. */ - proto_tree_add_uint(tree, hf_gtpv2_ecgi_eci, tvb, *offset, 4, ECGI); + 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);*/ *offset += 4; str = wmem_strdup_printf(wmem_packet_scope(), "%s, ECGI 0x%x", @@ -8027,6 +8039,16 @@ void proto_register_gtpv2(void) FT_UINT24, BASE_HEX, NULL, 0x0fffff, NULL, HFILL} }, + {&hf_gtpv2_cellid, + {"CellId", "gtpv2.cellid", + FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL} + }, + { &hf_gtpv2_enodebid, + { "eNodeB Id", "gtpv2.enodebid", + FT_UINT32, BASE_DEC, NULL, 0, + NULL, HFILL } + }, { &hf_gtpv2_CauseProtocol, {"Protocol Cause", "gtpv2.CauseProtocol", FT_UINT8, BASE_DEC, VALS(s1ap_CauseProtocol_vals), 0x0, @@ -8556,6 +8578,7 @@ void proto_register_gtpv2(void) &ett_gtpv2_preaa_sais, &ett_gtpv2_preaa_cgis, &ett_gtpv2_load_control_inf, + &ett_gtpv2_eci, }; static ei_register_info ei[] = { |