forked from osmocom/wireshark
5G/NR MAC dissector. Incomplete and only partly tested.
Change-Id: I749d3b967f65c7c21e995b721a3fbcf62c523d15 Reviewed-on: https://code.wireshark.org/review/26381 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
This commit is contained in:
parent
ea59e4c75a
commit
628407dea9
|
@ -119,6 +119,7 @@ Nano / RaiBlocks Cryptocurrency Protocol (UDP)
|
|||
Network Functional Application Platform Interface (NFAPI) Protocol
|
||||
New Radio Radio Resource Control protocol
|
||||
New Radio Radio Link Control protocol
|
||||
NR (5G) MAC protocol
|
||||
NXP 802.15.4 Sniffer Protocol
|
||||
PFCP (Packet Forwarding Control Protocol)
|
||||
Protobuf (Protocol Buffers)
|
||||
|
|
|
@ -1280,6 +1280,7 @@ set(DISSECTOR_SRC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/packet-maap.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-mac-lte-framed.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-mac-lte.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-mac-nr.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-maccontrol.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-macsec.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-mactelnet.c
|
||||
|
|
|
@ -899,6 +899,7 @@ DISSECTOR_SRC = \
|
|||
packet-maap.c \
|
||||
packet-mac-lte-framed.c \
|
||||
packet-mac-lte.c \
|
||||
packet-mac-nr.c \
|
||||
packet-maccontrol.c \
|
||||
packet-macsec.c \
|
||||
packet-mactelnet.c \
|
||||
|
@ -1668,6 +1669,7 @@ DISSECTOR_INCLUDES = \
|
|||
packet-lpp.h \
|
||||
packet-lte-rrc.h \
|
||||
packet-mac-lte.h \
|
||||
packet-mac-nr.h \
|
||||
packet-mausb.h \
|
||||
packet-mbim.h \
|
||||
packet-mbtcp.h \
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,111 @@
|
|||
/* packet-mac-nr.h
|
||||
*
|
||||
* Martin Mathieson
|
||||
*
|
||||
* Wireshark - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@wireshark.org>
|
||||
* Copyright 1998 Gerald Combs
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
/* radioType */
|
||||
#define FDD_RADIO 1
|
||||
#define TDD_RADIO 2
|
||||
|
||||
/* Direction */
|
||||
#define DIRECTION_UPLINK 0
|
||||
#define DIRECTION_DOWNLINK 1
|
||||
|
||||
/* rntiType */
|
||||
#define NO_RNTI 0
|
||||
#define P_RNTI 1
|
||||
#define RA_RNTI 2
|
||||
#define C_RNTI 3
|
||||
#define SI_RNTI 4
|
||||
#define CS_RNTI 5
|
||||
|
||||
/* Context info attached to each NR MAC frame */
|
||||
typedef struct mac_nr_info
|
||||
{
|
||||
/* Needed for decode */
|
||||
guint8 radioType;
|
||||
guint8 direction;
|
||||
guint8 rntiType;
|
||||
|
||||
/* Extra info to display */
|
||||
guint16 rnti;
|
||||
guint16 ueid;
|
||||
|
||||
/* Timing info */
|
||||
guint16 sysframeNumber;
|
||||
guint8 subframeNumber;
|
||||
|
||||
/* Length of DL PDU or UL grant size in bytes */
|
||||
guint16 length;
|
||||
|
||||
} mac_nr_info;
|
||||
|
||||
|
||||
/* Functions to be called from outside this module (e.g. in a plugin, where mac_lte_info
|
||||
isn't available) to get/set per-packet data */
|
||||
WS_DLL_PUBLIC
|
||||
mac_nr_info *get_mac_nr_proto_data(packet_info *pinfo);
|
||||
WS_DLL_PUBLIC
|
||||
void set_mac_nr_proto_data(packet_info *pinfo, mac_nr_info *p_mac_nr_info);
|
||||
|
||||
/*****************************************************************/
|
||||
/* UDP framing format */
|
||||
/* ----------------------- */
|
||||
/* Several people have asked about dissecting MAC by framing */
|
||||
/* PDUs over IP. A suggested format over UDP has been created */
|
||||
/* and implemented by this dissector, using the definitions */
|
||||
/* below. */
|
||||
/* */
|
||||
/* A heuristic dissector (enabled by a preference) will */
|
||||
/* recognise a signature at the beginning of these frames. */
|
||||
/*****************************************************************/
|
||||
|
||||
|
||||
/* Signature. Rather than try to define a port for this, or make the
|
||||
port number a preference, frames will start with this string (with no
|
||||
terminating NULL */
|
||||
#define MAC_NR_START_STRING "mac-nr"
|
||||
|
||||
/* Fixed fields. This is followed by the following 3 mandatory fields:
|
||||
- radioType (1 byte)
|
||||
- direction (1 byte)
|
||||
- rntiType (1 byte)
|
||||
(where the allowed values are defined above */
|
||||
|
||||
/* Optional fields. Attaching this info to frames will allow you
|
||||
to show you display/filter/plot/add-custom-columns on these fields, so should
|
||||
be added if available.
|
||||
The format is to have the tag, followed by the value (there is no length field,
|
||||
it's implicit from the tag) */
|
||||
|
||||
#define MAC_NR_RNTI_TAG 0x02
|
||||
/* 2 bytes, network order */
|
||||
|
||||
#define MAC_NR_UEID_TAG 0x03
|
||||
/* 2 bytes, network order */
|
||||
|
||||
#define MAC_NR_FRAME_SUBFRAME_TAG 0x04
|
||||
/* 2 bytes, network order, SFN is stored in 12 MSB and SF in 4 LSB */
|
||||
|
||||
/* MAC PDU. Following this tag comes the actual MAC PDU (there is no length, the PDU
|
||||
continues until the end of the frame) */
|
||||
#define MAC_NR_PAYLOAD_TAG 0x01
|
||||
|
||||
/*
|
||||
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
||||
*
|
||||
* Local variables:
|
||||
* c-basic-offset: 4
|
||||
* tab-width: 8
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*
|
||||
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
||||
* :indentSize=4:tabSize=8:noTabs=true:
|
||||
*/
|
Loading…
Reference in New Issue