forked from osmocom/wireshark
NR (5G) PDCP
Tested with some hand-generated PDUs. Change-Id: Ic603d0ca4578d23121e438ac2458be34e63492d2 Reviewed-on: https://code.wireshark.org/review/26755 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
This commit is contained in:
parent
d9c9a15f98
commit
2cb93e2121
|
@ -50,6 +50,7 @@ since version 2.6.0:
|
|||
// Add one protocol per line between the -- delimiters.
|
||||
[commaize]
|
||||
--
|
||||
NR (5G) PDCP protocol
|
||||
--
|
||||
|
||||
=== Updated Protocol Support
|
||||
|
|
|
@ -457,6 +457,7 @@ set(DISSECTOR_PUBLIC_HEADERS
|
|||
packet-pcap_pktdata.h
|
||||
packet-pcnfsd.h
|
||||
packet-pdcp-lte.h
|
||||
packet-pdcp-nr.h
|
||||
packet-per.h
|
||||
packet-pkcs1.h
|
||||
packet-pkcs12.h
|
||||
|
@ -1473,6 +1474,7 @@ set(DISSECTOR_SRC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/packet-pcp.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-pdc.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-pdcp-lte.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-pdcp-nr.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-peekremote.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-per.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/packet-pfcp.c
|
||||
|
|
|
@ -1090,6 +1090,7 @@ DISSECTOR_SRC = \
|
|||
packet-pcp.c \
|
||||
packet-pdc.c \
|
||||
packet-pdcp-lte.c \
|
||||
packet-pdcp-nr.c \
|
||||
packet-peekremote.c \
|
||||
packet-per.c \
|
||||
packet-pfcp.c \
|
||||
|
@ -1718,6 +1719,7 @@ DISSECTOR_INCLUDES = \
|
|||
packet-pcap_pktdata.h \
|
||||
packet-pcnfsd.h \
|
||||
packet-pdcp-lte.h \
|
||||
packet-pdcp-nr.h \
|
||||
packet-per.h \
|
||||
packet-pkcs1.h \
|
||||
packet-pkcs12.h \
|
||||
|
|
|
@ -1916,7 +1916,7 @@ static int dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
|
||||
if (pdu_type == 1) {
|
||||
/*****************************/
|
||||
/* Use-plane Data */
|
||||
/* User-plane Data */
|
||||
|
||||
/* Number of sequence number bits depends upon config */
|
||||
switch (p_pdcp_info->seqnum_length) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,150 @@
|
|||
/* packet-pdcp-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
|
||||
*/
|
||||
|
||||
|
||||
#include "packet-rohc.h"
|
||||
|
||||
/* Direction */
|
||||
#define DIRECTION_UPLINK 0
|
||||
#define DIRECTION_DOWNLINK 1
|
||||
|
||||
enum pdcp_nr_plane
|
||||
{
|
||||
NR_SIGNALING_PLANE = 1,
|
||||
NR_USER_PLANE = 2
|
||||
};
|
||||
|
||||
typedef enum NRBearerType
|
||||
{
|
||||
Bearer_DCCH=1,
|
||||
Bearer_BCCH_BCH=2,
|
||||
Bearer_BCCH_DL_SCH=3,
|
||||
Bearer_CCCH=4,
|
||||
Bearer_PCCH=5,
|
||||
} NRBearerType;
|
||||
|
||||
|
||||
#define PDCP_NR_SN_LENGTH_12_BITS 12
|
||||
#define PDCP_NR_SN_LENGTH_18_BITS 18
|
||||
|
||||
|
||||
|
||||
/* Info attached to each nr PDCP/RoHC packet */
|
||||
typedef struct pdcp_nr_info
|
||||
{
|
||||
/* Bearer info is needed for RRC parsing */
|
||||
guint8 direction;
|
||||
guint16 ueid;
|
||||
NRBearerType bearerType;
|
||||
guint8 bearerId;
|
||||
|
||||
/* Details of PDCP header */
|
||||
enum pdcp_nr_plane plane;
|
||||
guint8 seqnum_length;
|
||||
|
||||
/* RoHC settings */
|
||||
rohc_info rohc;
|
||||
|
||||
guint8 is_retx;
|
||||
} pdcp_nr_info;
|
||||
|
||||
|
||||
|
||||
/*****************************************************************/
|
||||
/* UDP framing format */
|
||||
/* ----------------------- */
|
||||
/* Several people have asked about dissecting PDCP by framing */
|
||||
/* PDUs over IP. A suggested format over UDP has been defined */
|
||||
/* and implemented by this dissector, using the definitions */
|
||||
/* below. A link to an example program showing you how to encode */
|
||||
/* these headers and send nr PDCP PDUs on a UDP socket is */
|
||||
/* provided at https://wiki.wireshark.org/PDCP-nr */
|
||||
/* */
|
||||
/* A heuristic dissecter (enabled by a preference) will */
|
||||
/* recognise a signature at the beginning of these frames. */
|
||||
/* Until someone is using this format, suggestions for changes */
|
||||
/* are welcome. */
|
||||
/*****************************************************************/
|
||||
|
||||
|
||||
/* 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 PDCP_NR_START_STRING "pdcp-nr"
|
||||
|
||||
|
||||
/* The format for fields is to have the tag, followed by the value
|
||||
(there is no length field, it's implicit from the tag).
|
||||
The allowed values for each field should be taken from pdcp_nr_info above. */
|
||||
|
||||
#define PDCP_NR_PLANE_TAG 0x02
|
||||
/* 1 byte, mandatory */
|
||||
|
||||
#define PDCP_NR_SEQNUM_LENGTH_TAG 0x03
|
||||
/* 1 byte, mandatory */
|
||||
|
||||
#define PDCP_NR_DIRECTION_TAG 0x04
|
||||
/* 1 byte, mandatory */
|
||||
|
||||
#define PDCP_NR_BEARER_TYPE_TAG 0x05
|
||||
/* 1 byte, mandatory */
|
||||
|
||||
#define PDCP_NR_BEARER_ID_TAG 0x06
|
||||
/* 1 byte, mandatory depending upon bearer type */
|
||||
|
||||
#define PDCP_NR_UEID_TAG 0x07
|
||||
/* 2 bytes, network order. Optional, but needed if > 1 UE logged. */
|
||||
|
||||
|
||||
#define PDCP_NR_ROHC_COMPRESSION_TAG 0x08
|
||||
/* 1 byte, network order (mandatory for user-plane) */
|
||||
|
||||
/* N.B. The following ROHC values only have significance if rohc_compression
|
||||
is in use for the current channel */
|
||||
|
||||
#define PDCP_NR_ROHC_IP_VERSION_TAG 0x09
|
||||
/* 2 bytes, network order */
|
||||
|
||||
#define PDCP_NR_ROHC_CID_INC_INFO_TAG 0x0A
|
||||
/* 1 byte */
|
||||
|
||||
#define PDCP_NR_ROHC_LARGE_CID_PRES_TAG 0x0B
|
||||
/* 1 byte */
|
||||
|
||||
#define PDCP_NR_ROHC_MODE_TAG 0x0C
|
||||
/* 1 byte */
|
||||
|
||||
#define PDCP_NR_ROHC_RND_TAG 0x0D
|
||||
/* 1 byte */
|
||||
|
||||
#define PDCP_NR_ROHC_UDP_CHECKSUM_PRES_TAG 0x0E
|
||||
/* 1 byte */
|
||||
|
||||
#define PDCP_NR_ROHC_PROFILE_TAG 0x0F
|
||||
/* 2 bytes, network order */
|
||||
|
||||
|
||||
/* PDCP PDU. Following this tag comes the actual PDCP PDU (there is no length, the PDU
|
||||
continues until the end of the frame) */
|
||||
#define PDCP_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