GTPv2: Dissect Core Network Restrictions and UE Radio Capability ID.

Change-Id: I91714384688a554cbca82a0ae887e18f6304e0c1
Reviewed-on: https://code.wireshark.org/review/36379
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Anders Broman 2020-03-12 14:32:26 +01:00 committed by Anders Broman
parent 29614e007e
commit 16adaf33b4
6 changed files with 87 additions and 34 deletions

View File

@ -2530,7 +2530,7 @@ dissect_diameter_3gpp_v2x_permission(tvbuff_t *tvb, packet_info *pinfo _U_, prot
* 7.3.230 Core-Network-Restrictions
* AVP Code: 1704 Core-Network-Restrictions
*/
static int
int
dissect_diameter_3gpp_core_network_restrictions(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
{
static const int *flags[] = {

View File

@ -69,6 +69,8 @@ static const value_string diameter_3gpp_termination_cause_vals[] = {
{ 0, NULL }
};
int dissect_diameter_3gpp_core_network_restrictions(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, void* data);
/*
* Editor modelines
*

View File

@ -799,6 +799,7 @@ guint16 de_esm_ext_eps_qos(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _
void nas_esm_pdn_con_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len);
guint16 de_nas_5gs_mm_ue_radio_cap_id(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo, guint32 offset, guint len, gchar* add_string _U_, int string_len _U_);
guint16 de_nas_5gs_cmn_s_nssai(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
guint16 de_nas_5gs_sm_qos_rules(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
guint16 de_nas_5gs_sm_qos_flow_des(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_);
@ -1796,6 +1797,7 @@ typedef enum
DE_NAS_5GS_MM_UE_STATUS, /* 9.11.3.56 UE status */
DE_NAS_5GS_MM_UL_DATA_STATUS, /* 9.11.3.57 Uplink data status */
DE_NAS_5GS_MM_CP_SERVICE_TYPE, /* 9.11.3.65 Control plane service type*/
DE_NAS_5GS_MM_UE_RADIO_CAP_ID, /* 9.11.3.68 UE radio capability ID*/
DE_NAS_5GS_MM_NONE /* NONE */}
nas_5gs_mm_elem_idx_t;

View File

@ -1,7 +1,7 @@
/* packet-gtpv2.c
*
* Routines for GTPv2 dissection
* Copyright 2009 - 2019, Anders Broman <anders.broman [at] ericsson.com>
* Copyright 2009 - 2020, Anders Broman <anders.broman [at] ericsson.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
@ -4761,7 +4761,8 @@ dissect_gtpv2_mm_context_eps_qq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
If Length of Core Network Restrictions is zero, then the field of Core Network Restrictions
in octets "(l+2) to (l+5)" shall not be present.
*/
proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, ie_len, "The rest of the IE not dissected yet");
tvbuff_t *new_tvb = tvb_new_subset_length(tvb, offset, ie_len);
dissect_diameter_3gpp_core_network_restrictions(new_tvb, pinfo, tree, NULL);
offset += ie_len;
}
@ -4769,12 +4770,14 @@ dissect_gtpv2_mm_context_eps_qq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
return;
}
/* (l+6) Length of UE Radio Capability ID hf_gtpv2_mm_context_ue_radio_cap_len*/
/* (l+6) Length of UE Radio Capability ID */
proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_ue_radio_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ie_len);
offset += 1;
if (ie_len) {
/* (l+7) to z UE Radio Capability ID */
proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, ie_len, "The rest of the IE not dissected yet");
/* (l+7) to z UE Radio Capability ID
* The UE Radio Capability ID is specified in the clause 9.9.3.60 of 3GPP TS24.301
*/
de_nas_5gs_mm_ue_radio_cap_id(tvb, tree, pinfo, offset, ie_len, NULL, 0);
offset += ie_len;
}
if (offset < (gint)length){

View File

@ -418,6 +418,7 @@ static int hf_nas_5gs_os_app_id = -1;
static int hf_nas_5gs_mm_len_of_rej_s_nssai = -1;
static int hf_nas_5gs_mm_rej_s_nssai_cause = -1;
static int hf_nas_5gs_mm_cp_service_type = -1;
static int hf_nas_5gs_mm_ue_radio_cap_id = -1;
static expert_field ei_nas_5gs_extraneous_data = EI_INIT;
static expert_field ei_nas_5gs_unknown_pd = EI_INIT;
@ -2509,37 +2510,40 @@ de_nas_5gs_mm_ul_data_status(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo
}
/*
* 9.11.3.58 Non-3GPP NW provided policies
* See subclause 10.5.5.37 in 3GPP TS 24.008 [12].
* 9.11.3.58 Void
* 9.11.3.59 Void
* 9.11.3.60 Void
* 9.11.3.61 Void
* 9.11.3.62 Void
* 9.11.3.63 Void
* 9.11.3.64 Void
*/
/*
* 9.11.3.59 EPS bearer context status
* See subclause 9.9.2.1 in 3GPP TS 24.301 [15].
*/
/*
* 9.11.3.60 Extended DRX parameters
* See subclause 10.5.5.32 in 3GPP TS 24.008 [12].
*/
/*
* 9.11.3.61 Mobile station classmark 2
* See subclause 10.5.1.6 in 3GPP TS 24.008 [12].
*/
/*
* 9.11.3.62 Supported codec list
* See subclause 10.5.4.32 in 3GPP TS 24.008 [12].
*/
/*
* 9.11.3.63 MA PDU session information
*/
/*
* 9.11.3.64 CAG information list
* 9.11.3.68 UE radio capability ID
*/
/*
* The UE radio capability ID contents contain the UE radio capability ID as specified in 3GPP TS 23.003
* with each digit coded in BCD, starting with the first digit coded in bits 4 to 1 of octet 3,
* the second digit coded in bits 8 to 5 of octet 3, and so on. If the UE radio capability ID contains
* an odd number of digits, bits 8 to 5 of the last octet (octet n) shall be coded as "1111".
*/
guint16
de_nas_5gs_mm_ue_radio_cap_id(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_,
guint32 offset, guint len,
gchar* add_string _U_, int string_len _U_)
{
int curr_offset;
const char* digit_str;
curr_offset = offset;
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, curr_offset, len, NULL, FALSE);
proto_tree_add_string(tree, hf_nas_5gs_mm_ue_radio_cap_id, tvb, 0, -1, digit_str);
return len;
}
/*
@ -3851,6 +3855,7 @@ typedef enum
DE_NAS_5GS_MM_UE_STATUS, /* 9.11.3.56 UE status */
DE_NAS_5GS_MM_UL_DATA_STATUS, /* 9.11.3.57 Uplink data status */
DE_NAS_5GS_MM_CP_SERVICE_TYPE, /* 9.11.3.65 Control plane service type*/
DE_NAS_5GS_MM_UE_RADIO_CAP_ID, /* 9.11.3.68 UE radio capability ID*/
DE_NAS_5GS_MM_NONE /* NONE */
}
nas_5gs_mm_elem_idx_t;
@ -3923,6 +3928,7 @@ static const value_string nas_5gs_mm_elem_strings[] = {
{ DE_NAS_5GS_MM_UE_STATUS, "UE status" }, /* 9.11.3.56 UE status*/
{ DE_NAS_5GS_MM_UL_DATA_STATUS, "Uplink data status" }, /* 9.11.3.57 Uplink data status*/
{ DE_NAS_5GS_MM_CP_SERVICE_TYPE, "Control plane service type" }, /* 9.11.3.65 Control plane service type*/
{ DE_NAS_5GS_MM_UE_RADIO_CAP_ID, "UE radio capability ID" }, /* 9.11.3.68 UE radio capability ID*/
{ 0, NULL }
};
@ -4000,6 +4006,9 @@ guint16(*nas_5gs_mm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pi
de_nas_5gs_mm_ue_status, /* 9.11.3.56 UE status*/
de_nas_5gs_mm_ul_data_status, /* 9.11.3.57 Uplink data status*/
de_nas_5gs_mm_cp_service_type, /* 9.11.3.65 Control plane service type*/
de_nas_5gs_mm_cp_service_type, /* 9.11.3.65 Control plane service type*/
de_nas_5gs_mm_ue_radio_cap_id, /* 9.11.3.68 UE radio capability ID*/
NULL, /* NONE */
};
@ -4307,7 +4316,9 @@ nas_5gs_mm_registration_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
ELEM_OPT_TLV(0x6E, GSM_A_PDU_TYPE_GM, DE_EXT_DRX_PARAMS, NULL);
/* 6A T3324 value GPRS timer 3 9.11.2.5 O TLV 3 */
ELEM_OPT_TLV(0x6A, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3324 value");
/* 67 UE radio capability ID UE radio capability ID 9.11.3.68 O TLV 3-n */
ELEM_OPT_TLV(0x67, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID, NULL);
/* 35 Requested mapped NSSAI Mapped NSSAI 9.11.3.31B O TLV 3-42 */
/* 48 Additional information requested Additional information requested 9.11.3.12A O TLV 3 */
@ -4391,6 +4402,7 @@ nas_5gs_mm_registration_accept(tvbuff_t *tvb, proto_tree *tree, packet_info *pin
/* 6A T3324 value GPRS timer 3 9.11.2.5 O TLV 3 */
ELEM_OPT_TLV(0x6A, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_2, " - T3324 value");
/* 67 UE radio capability ID UE radio capability ID 9.11.3.yy O TLV 3-n */
ELEM_OPT_TLV(0x67, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID, NULL);
/* 68 UE radio capability ID deletion indication UE radio capability ID deletion indication 9.11.3.69 O TV 1 */
EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_5gs_extraneous_data);
@ -4725,6 +4737,7 @@ nas_5gs_mm_conf_upd_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_,
ELEM_OPT_TLV(0x6c, GSM_A_PDU_TYPE_GM, DE_GPRS_TIMER_3, " - T3447");
/* 44 CAG information list CAG information list 9.11.3.64 O TLV-E 3-n */
/* 67 UE radio capability ID UE radio capability ID 9.11.3.yy O TLV 3-n */
ELEM_OPT_TLV(0x67, NAS_5GS_PDU_TYPE_MM, DE_NAS_5GS_MM_UE_RADIO_CAP_ID, NULL);
/* 68 UE radio capability ID deletion indication UE radio capability ID deletion indication 9.11.3.69 O TV 1 */
EXTRANEOUS_DATA_CHECK(curr_len, 0, pinfo, &ei_nas_5gs_extraneous_data);
@ -8503,6 +8516,11 @@ proto_register_nas_5gs(void)
FT_UINT8, BASE_DEC, VALS(nas_5gs_mm_cp_service_type_vals), 0x0f,
NULL, HFILL }
},
{ &hf_nas_5gs_mm_ue_radio_cap_id,
{ "UE radio capability ID", "nas_5gs.mm.ue_radio_cap_id",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
};
guint i;

View File

@ -1,7 +1,7 @@
/* packet-nas_eps.c
* Routines for Non-Access-Stratum (NAS) protocol for Evolved Packet System (EPS) dissection
*
* Copyright 2008 - 2017, Anders Broman <anders.broman@ericsson.com>
* Copyright 2008 - 2020, Anders Broman <anders.broman@ericsson.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
@ -884,6 +884,14 @@ static const value_string nas_emm_elem_strings[] = {
{ DE_EMM_ADD_INFO_REQ, "Additional information requested" }, /* 9.9.3.55 Additional information requested */
{ DE_EMM_CIPH_KEY_DATA, "Ciphering key data" }, /* 9.9.3.56 Ciphering key data */
{ DE_EMM_N1_UE_NETWORK_CAP, "N1 UE network capability" }, /* 9.9.3.57 N1 UE network capability */
/*
* 9.9.3.58 UE radio capability ID availability
* 9.9.3.59 UE radio capability ID request
* 9.9.3.60 UE radio capability ID
* 9.9.3.61 UE radio capability ID deletion indication
* 9.9.3.62 WUS assistance information
*/
{ 0, NULL }
};
value_string_ext nas_emm_elem_strings_ext = VALUE_STRING_EXT_INIT(nas_emm_elem_strings);
@ -2832,6 +2840,18 @@ de_emm_n1_ue_network_cap(tvbuff_t* tvb, proto_tree* tree, packet_info* pinfo _U_
return 1;
}
/*
* 9.9.3.58 UE radio capability ID availability
* 9.9.3.59 UE radio capability ID request
* 9.9.3.60 UE radio capability ID
* See subclause 9.11.3.65 in 3GPP TS 24.501
* 9.9.3.61 UE radio capability ID deletion indication
* See subclause 9.11.3.zz in 3GPP TS 24.501
* 9.9.3.62 WUS assistance information
*/
/*
* 9.9.4 EPS Session Management (ESM) information elements
*/
@ -4047,6 +4067,14 @@ guint16 (*emm_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, g
de_emm_add_info_req, /* 9.9.3.55 Additional information requested */
de_emm_ciph_key_data, /* 9.9.3.56 Ciphering key data */
de_emm_n1_ue_network_cap, /* 9.9.3.57 N1 UE network capability */
/*
* 9.9.3.58 UE radio capability ID availability
* 9.9.3.59 UE radio capability ID request
* 9.9.3.60 UE radio capability ID
* 9.9.3.61 UE radio capability ID deletion indication
* 9.9.3.62 WUS assistance information
*/
NULL, /* NONE */
};