S1AP: Use specific MCC/MNC fields

Use the specific MCC/MNC fields for the LAI, CGI, ECGI, NR-CGI, TAI,
and 5GS-TAI IEs, continuing to use E212_NONE for PLMNidentity in all
other cases. Add fields and an enum value for 5GS-TAI to packet-e212.
(The 5GSTAC has an additional octet compared to the original TAC.)
This commit is contained in:
John Thacker 2021-05-09 23:07:19 -04:00
parent a106ba9d27
commit 1701a2db5d
5 changed files with 266 additions and 188 deletions

View File

@ -199,6 +199,7 @@ struct s1ap_private_data {
guint16 enb_ue_s1ap_id;
gboolean srvcc_ho_cs_only;
guint8 transparent_container_type;
e212_number_type_t number_type;
};
enum {

View File

@ -247,6 +247,8 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
#.FN_BODY PLMNidentity VAL_PTR = parameter_tvb
tvbuff_t *parameter_tvb=NULL;
struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo);
e212_number_type_t number_type = s1ap_data->number_type;
s1ap_data->number_type = E212_NONE;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
3, 3, FALSE, &parameter_tvb);
@ -255,7 +257,7 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
if (!parameter_tvb)
return offset;
dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, tree, 0, E212_NONE, FALSE);
dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, tree, 0, number_type, FALSE);
if (s1ap_data->supported_ta) {
guint32 plmn = tvb_get_ntoh24(parameter_tvb, 0);
wmem_array_append_one(s1ap_data->supported_ta->plmn, plmn);
@ -1311,6 +1313,11 @@ TAC TYPE = FT_UINT16 DISPLAY = BASE_DEC_HEX
}
}
#.FN_BODY LAI
struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo);
s1ap_data->number_type = E212_LAI;
%(DEFAULT_BODY)s
#.TYPE_ATTR
LAC TYPE = FT_UINT16 DISPLAY = BASE_DEC_HEX
#.FN_BODY LAC VAL_PTR = &parameter_tvb HF_INDEX = -1
@ -1329,6 +1336,11 @@ RAC TYPE = FT_UINT8 DISPLAY = BASE_DEC_HEX
actx->created_item = proto_tree_add_item(tree, hf_index, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
}
#.FN_BODY FiveGSTAI
struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo);
s1ap_data->number_type = E212_5GSTAI;
%(DEFAULT_BODY)s
#.TYPE_ATTR
FiveGSTAC TYPE = FT_UINT24 DISPLAY = BASE_DEC_HEX
#.FN_BODY FiveGSTAC VAL_PTR = &parameter_tvb HF_INDEX = -1
@ -1427,7 +1439,7 @@ M-TMSI TYPE = FT_UINT32 DISPLAY = BASE_DEC_HEX
#.FN_BODY TAI
struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo);
s1ap_data->number_type = E212_TAI;
s1ap_data->tai = wmem_new0(wmem_packet_scope(), struct s1ap_tai);
%(DEFAULT_BODY)s
if (!PINFO_FD_VISITED(actx->pinfo) && s1ap_data->s1ap_conv &&
@ -2590,6 +2602,16 @@ MMEEarlyStatusTransfer N s1ap.proc.imsg id-MMEEarlyStatusTransf
#.END
#.FN_BODY CGI
struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo);
s1ap_data->number_type = E212_CGI;
%(DEFAULT_BODY)s
#.FN_BODY EUTRAN-CGI
struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo);
s1ap_data->number_type = E212_ECGI;
%(DEFAULT_BODY)s
#.FIELD_ATTR
EUTRAN-CGI/cell-ID ABBREV=CellIdentity TYPE=FT_UINT32 DISPLAY=BASE_HEX
#.FN_BODY CellIdentity VAL_PTR = &cell_id_tvb HF_INDEX=-1
@ -2601,6 +2623,11 @@ EUTRAN-CGI/cell-ID ABBREV=CellIdentity TYPE=FT_UINT32 DISPLAY=BASE_HEX
}
#.END
#.FN_BODY NR-CGI
struct s1ap_private_data *s1ap_data = s1ap_get_private_data(actx->pinfo);
s1ap_data->number_type = E212_NRCGI;
%(DEFAULT_BODY)s
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#

View File

@ -3027,6 +3027,7 @@ static int hf_E212_mcc_cgi = -1;
static int hf_E212_mcc_ecgi = -1;
static int hf_E212_mcc_tai = -1;
static int hf_E212_mcc_nrcgi = -1;
static int hf_E212_mcc_5gstai = -1;
static int hf_E212_mnc = -1;
static int hf_E212_mnc_lai = -1;
static int hf_E212_mnc_sai = -1;
@ -3035,6 +3036,7 @@ static int hf_E212_mnc_cgi = -1;
static int hf_E212_mnc_ecgi = -1;
static int hf_E212_mnc_tai = -1;
static int hf_E212_mnc_nrcgi = -1;
static int hf_E212_mnc_5gstai = -1;
static int ett_e212_imsi = -1;
@ -3140,6 +3142,10 @@ dissect_e212_mcc_mnc_wmem_packet_str(tvbuff_t *tvb, packet_info *pinfo, proto_tr
hf_E212_mcc_id = hf_E212_mcc_nrcgi;
hf_E212_mnc_id = hf_E212_mnc_nrcgi;
break;
case E212_5GSTAI:
hf_E212_mcc_id = hf_E212_mcc_5gstai;
hf_E212_mnc_id = hf_E212_mnc_5gstai;
break;
default:
hf_E212_mcc_id = hf_E212_mcc;
hf_E212_mnc_id = hf_E212_mnc;
@ -3583,6 +3589,11 @@ proto_register_e212(void)
FT_UINT16, BASE_DEC|BASE_EXT_STRING, &E212_codes_ext, 0x0,
"Mobile Country Code MCC", HFILL }
},
{ &hf_E212_mcc_5gstai,
{ "Mobile Country Code (MCC)","e212.5gstai.mcc",
FT_UINT16, BASE_DEC|BASE_EXT_STRING, &E212_codes_ext, 0x0,
"Mobile Country Code MCC", HFILL }
},
{ &hf_E212_mnc,
{ "Mobile Network Code (MNC)","e212.mnc",
FT_UINT16, BASE_DEC, NULL, 0x0,
@ -3623,6 +3634,11 @@ proto_register_e212(void)
FT_UINT16, BASE_DEC, NULL, 0x0,
"Mobile network code", HFILL }
},
{ &hf_E212_mnc_5gstai,
{ "Mobile Network Code (MNC)","e212.5gstai.mnc",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Mobile network code", HFILL }
},
#if 0
{ &hf_E212_msin,
{ "Mobile Subscriber Identification Number (MSIN)", "e212.msin",

View File

@ -29,7 +29,8 @@ typedef enum {
E212_CGI,
E212_ECGI,
E212_TAI,
E212_NRCGI
E212_NRCGI,
E212_5GSTAI,
} e212_number_type_t;
gchar* dissect_e212_mcc_mnc_wmem_packet_str(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, e212_number_type_t number_type, gboolean little_endian);

File diff suppressed because it is too large Load Diff