diff options
author | Anders <anders.broman@ericsson.com> | 2017-11-01 10:40:50 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-11-01 16:24:28 +0000 |
commit | c571e692085b4c119d9ebf5c526bd3be77135361 (patch) | |
tree | deeefbc72764b3250f9709a886b46aa6102ba1d4 /epan/dissectors/packet-gtpv2.c | |
parent | dd4f8d08b2e1db8f12cb3deabf2b81ab5d86c4fb (diff) |
[GTPv2] Add dissection of 8.127 Header Compression Configuration.
Change-Id: Iace27ebf536cad73d9aaf4abceb6d235f34d68f6
Reviewed-on: https://code.wireshark.org/review/24208
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-gtpv2.c')
-rw-r--r-- | epan/dissectors/packet-gtpv2.c | 110 |
1 files changed, 106 insertions, 4 deletions
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c index 026fb36b5d..6981bbe75e 100644 --- a/epan/dissectors/packet-gtpv2.c +++ b/epan/dissectors/packet-gtpv2.c @@ -71,7 +71,7 @@ static int hf_gtpv2_teid = -1; static int hf_gtpv2_seq = -1; static int hf_gtpv2_msg_prio = -1; static int hf_gtpv2_spare = -1; - +static int hf_gtpv2_spare_w0 = -1; static int hf_gtpv2_ie = -1; static int hf_gtpv2_ie_len = -1; @@ -588,11 +588,21 @@ static int hf_gtpv2_node_name = -1; static int hf_gtpv2_length_of_node_realm = -1; static int hf_gtpv2_node_realm = -1; static int hf_gtpv2_ms_ts = -1; +static int hf_gtpv2_rohc_profiles_bit0 = -1; +static int hf_gtpv2_rohc_profiles_bit1 = -1; +static int hf_gtpv2_rohc_profiles_bit2 = -1; +static int hf_gtpv2_rohc_profiles_bit3 = -1; +static int hf_gtpv2_rohc_profiles_bit4 = -1; +static int hf_gtpv2_rohc_profiles_bit5 = -1; +static int hf_gtpv2_rohc_profiles_bit6 = -1; +static int hf_gtpv2_rohc_profiles_bit7 = -1; +static int hf_gtpv2_max_cid = -1; static int hf_gtpv2_uplink_rate_limit = -1; static int hf_gtpv2_downlink_rate_limit = -1; static int hf_gtpv2_timestamp_value = -1; static int hf_gtpv2_counter_value = -1; static int hf_gtpv2_uli_flags = -1; +static int hf_gtpv2_rohc_profile_flags = -1; static gint ett_gtpv2 = -1; static gint ett_gtpv2_flags = -1; @@ -651,6 +661,7 @@ static gint ett_gtpv2_load_control_inf = -1; static gint ett_gtpv2_eci = -1; static gint ett_gtpv2_twan_flags = -1; static gint ett_gtpv2_ciot_support_ind = -1; +static gint ett_gtpv2_rohc_profile_flags = -1; static expert_field ei_gtpv2_ie_data_not_dissected = EI_INIT; static expert_field ei_gtpv2_ie_len_invalid = EI_INIT; @@ -993,8 +1004,8 @@ static gint ett_gtpv2_ies[NUM_GTPV2_IES]; #define GTPV2_IE_CIOT_OPT_SUPPORT_IND 194 /* 195 SCEF PDN Connection -196 Header Compression Configuration */ +#define GTPV2_IE_HEADER_COMP_CONF 196 #define GTPV2_IE_EXTENDED_PCO 197 #define GTPV2_IE_SERV_PLMN_RATE_CONTROL 198 #define GTPV2_IE_COUNTER 199 @@ -6592,6 +6603,41 @@ dissect_gtpv2_ciot_opt_support_ind(tvbuff_t *tvb, packet_info *pinfo, proto_tree } /* + * 8.127 Header Compression Configuration + */ + + + +static void +dissect_gtpv2_header_comp_comf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_) +{ + int offset = 0; + + static const int * gtpv2_rohc_profile_flags_flags[] = { + &hf_gtpv2_rohc_profiles_bit7, + &hf_gtpv2_rohc_profiles_bit6, + &hf_gtpv2_rohc_profiles_bit5, + &hf_gtpv2_rohc_profiles_bit4, + &hf_gtpv2_rohc_profiles_bit3, + &hf_gtpv2_rohc_profiles_bit2, + &hf_gtpv2_rohc_profiles_bit1, + &hf_gtpv2_rohc_profiles_bit0, + NULL + }; + + /* Octet 5 to 6 ROHC Profiles */ + + proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_gtpv2_rohc_profile_flags, + ett_gtpv2_rohc_profile_flags, gtpv2_rohc_profile_flags_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE | BMT_NO_INT); + offset++; + proto_tree_add_item(tree, hf_gtpv2_spare_w0, tvb, offset, 1, ENC_BIG_ENDIAN); + offset++; + /* Octet 7 to 8 MAX_CID*/ + proto_tree_add_item(tree, hf_gtpv2_max_cid, tvb, offset, 2, ENC_BIG_ENDIAN); + +} + +/* * 8.129 Serving PLMN Rate Control */ static void @@ -6774,7 +6820,7 @@ static const gtpv2_ie_t gtpv2_ies[] = { /* 193, 8.124 Remote UE IP Information */ {GTPV2_IE_CIOT_OPT_SUPPORT_IND, dissect_gtpv2_ciot_opt_support_ind}, /* 194, 8.125 CIoT Optimizations Support Indication */ /* 195, 8.126 SCEF PDN Connection */ - /* 196, 8.127 Header Compression Configuration */ + {GTPV2_IE_HEADER_COMP_CONF, dissect_gtpv2_header_comp_comf}, /* 196, 8.127 Header Compression Configuration */ {GTPV2_IE_EXTENDED_PCO, dissect_gtpv2_pco}, /* 197, 8.128 Extended Protocol Configuration Options (ePCO) */ {GTPV2_IE_SERV_PLMN_RATE_CONTROL, dissect_gtpv2_serv_plmn_rate_control}, /* 198, 8.129 Serving PLMN Rate Control */ {GTPV2_IE_COUNTER, dissect_gtpv2_counter}, /* 199, 8.130 Counter */ @@ -7318,6 +7364,11 @@ void proto_register_gtpv2(void) FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL} }, + { &hf_gtpv2_spare_w0, + { "Spare", "gtpv2.spare.w0", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, { &hf_gtpv2_ie, {"IE Type", "gtpv2.ie_type", FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_element_type_vals_ext, 0x0, @@ -9415,6 +9466,56 @@ void proto_register_gtpv2(void) FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0, NULL, HFILL } }, + { &hf_gtpv2_rohc_profile_flags, + { "ROHC Profiles flags", "gtpv2.rohc_profile_flags", + FT_UINT8, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + { &hf_gtpv2_rohc_profiles_bit0, + { "Profile Identifier: 0x0002, UDP/IP", "gtpv2.rohc_profiles.b0", + FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x0001, + NULL, HFILL } + }, + { &hf_gtpv2_rohc_profiles_bit1, + { "Profile Identifier: 0x0003, ESP/IP", "gtpv2.rohc_profiles.b1", + FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x0002, + NULL, HFILL } + }, + { &hf_gtpv2_rohc_profiles_bit2, + { "Profile Identifier: 0x0004, IP", "gtpv2.rohc_profiles.b2", + FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x0004, + NULL, HFILL } + }, + { &hf_gtpv2_rohc_profiles_bit3, + { "Profile Identifier: 0x0006, TCP/IP", "gtpv2.rohc_profiles.b3", + FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x0008, + NULL, HFILL } + }, + { &hf_gtpv2_rohc_profiles_bit4, + { "Profile Identifier: 0x0102, UDP/IP", "gtpv2.rohc_profiles.b4", + FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x0010, + NULL, HFILL } + }, + { &hf_gtpv2_rohc_profiles_bit5, + { "Profile Identifier: 0x0103, ESP/IP", "gtpv2.rohc_profiles.b5", + FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x0020, + NULL, HFILL } + }, + { &hf_gtpv2_rohc_profiles_bit6, + { "Profile Identifier: 0x0104, IP", "gtpv2.rohc_profiles.b6", + FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x0040, + NULL, HFILL } + }, + { &hf_gtpv2_rohc_profiles_bit7, + { "Spare", "gtpv2.rohc_profiles.b7", + FT_BOOLEAN, 8, NULL, 0x0080, + NULL, HFILL } + }, + { &hf_gtpv2_max_cid, + { "MAX_CID", "gtpv2.max_cid", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, { &hf_gtpv2_uplink_rate_limit, { "Uplink Rate Limit", "gtpv2.uplink_rate_limit", FT_UINT16, BASE_DEC, NULL, 0x0, @@ -9443,7 +9544,7 @@ void proto_register_gtpv2(void) }; /* Setup protocol subtree array */ -#define GTPV2_NUM_INDIVIDUAL_ELEMS 57 +#define GTPV2_NUM_INDIVIDUAL_ELEMS 58 static gint *ett_gtpv2_array[GTPV2_NUM_INDIVIDUAL_ELEMS + NUM_GTPV2_IES]; ett_gtpv2_array[0] = &ett_gtpv2; @@ -9503,6 +9604,7 @@ void proto_register_gtpv2(void) ett_gtpv2_array[54] = &ett_gtpv2_eci; ett_gtpv2_array[55] = &ett_gtpv2_twan_flags; ett_gtpv2_array[56] = &ett_gtpv2_ciot_support_ind; + ett_gtpv2_array[57] = &ett_gtpv2_rohc_profile_flags; last_offset = GTPV2_NUM_INDIVIDUAL_ELEMS; |