diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2018-12-14 13:26:29 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2018-12-14 14:07:10 +0000 |
commit | 18c737c2a68c44185dc874a550fa34245d12bf07 (patch) | |
tree | a3764f362b9486688d9876783fbbbd1a37fb1c50 /epan/dissectors/packet-catapult-dct2000.c | |
parent | b430ac31afa77a2247ed87e08f690f1dcb32c9c3 (diff) |
DCT2000: Pass NR NAS payload to dissector with S1AP framing
Change-Id: I2aa7a7f347e897b1a455ff3eb8ae126982ecc681
Reviewed-on: https://code.wireshark.org/review/31045
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Diffstat (limited to 'epan/dissectors/packet-catapult-dct2000.c')
-rw-r--r-- | epan/dissectors/packet-catapult-dct2000.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c index 74da4c1521..5a01987eff 100644 --- a/epan/dissectors/packet-catapult-dct2000.c +++ b/epan/dissectors/packet-catapult-dct2000.c @@ -93,6 +93,7 @@ static int hf_catapult_dct2000_lte_nas_rrc_establish_cause = -1; static int hf_catapult_dct2000_lte_nas_rrc_priority = -1; static int hf_catapult_dct2000_lte_nas_rrc_release_cause = -1; +static int hf_catapult_dct2000_nr_nas_s1ap_opcode = -1; /* UMTS RLC fields */ static int hf_catapult_dct2000_rbid = -1; @@ -265,6 +266,17 @@ static const value_string lte_nas_rrc_opcode_vals[] = { { 0, NULL} }; + +#define NAS_S1AP_DATA_REQ 0x00 +#define NAS_S1AP_DATA_IND 0x01 + +static const value_string nas_s1ap_opcode_vals[] = { + { NAS_S1AP_DATA_REQ, "Data-Req"}, + { NAS_S1AP_DATA_IND, "Data-Ind"}, + { 0, NULL} +}; + + /* Distinguish between similar 4G or 5G protocols */ enum LTE_or_NR { LTE, @@ -2443,6 +2455,37 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo } } + /* NR NAS for S1AP */ + else if (strcmp(protocol_name, "nas_s1ap_r15_5gnr") == 0) { + guint8 opcode = tvb_get_guint8(tvb, offset); + if (opcode <= NAS_S1AP_DATA_IND) { + /* Opcode tag (only interested in ones that carry NAS PDU) */ + proto_tree_add_item(tree, hf_catapult_dct2000_nr_nas_s1ap_opcode, + tvb, offset++, 1, ENC_BIG_ENDIAN); + + /* Skip overall length */ + offset += skipASNLength(tvb_get_guint8(tvb, offset)); + + /* UE Id. Skip tag and fixed length */ + offset += 2; + proto_tree_add_item(tree, hf_catapult_dct2000_ueid, + tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + /* NAS PDU tag is 2 bytes */ + guint16 data_tag = tvb_get_ntohs(tvb, offset); + if (data_tag == 0x0021) { + offset += 2; + /* Also skip length */ + offset += 2; + protocol_handle = find_dissector("nas-5gs"); + + /* N.B. Ignoring some optional fields after the NAS PDU */ + } + } + } + + /* Note that the first item of pinfo->pseudo_header->dct2000 will contain the pseudo-header needed (in some cases) by the Wireshark dissector that this packet data will be handed off to. */ @@ -3327,6 +3370,12 @@ void proto_register_catapult_dct2000(void) NULL, HFILL } }, + { &hf_catapult_dct2000_nr_nas_s1ap_opcode, + { "NAS S1AP Opcode", + "dct2000.nas-s1ap.opcode", FT_UINT8, BASE_DEC, VALS(nas_s1ap_opcode_vals), 0x0, + NULL, HFILL + } + }, { &hf_catapult_dct2000_rbid, { "Channel", |