4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef PACKET_RLC_NR_H
12 #define PACKET_RLC_NR_H
20 #define DIRECTION_UPLINK 0
21 #define DIRECTION_DOWNLINK 1
24 #define BEARER_TYPE_CCCH 1
25 #define BEARER_TYPE_BCCH_BCH 2
26 #define BEARER_TYPE_PCCH 3
27 #define BEARER_TYPE_SRB 4
28 #define BEARER_TYPE_DRB 5
29 #define BEARER_TYPE_BCCH_DL_SCH 6
31 /* sequenceNumberLength */
32 #define TM_SN_LENGTH_0_BITS 0
33 #define UM_SN_LENGTH_6_BITS 6
34 #define UM_SN_LENGTH_12_BITS 12
35 #define AM_SN_LENGTH_12_BITS 12
36 #define AM_SN_LENGTH_18_BITS 18
38 /* Info attached to each NR RLC frame */
39 typedef struct rlc_nr_info
43 uint8_t sequenceNumberLength
;
50 typedef struct nr_drb_rlc_pdcp_mapping_t
53 uint16_t ueid
; /* Mandatory */
54 uint8_t drbid
; /* Mandatory */
56 bool pdcpUlSnLength_present
;
57 uint8_t pdcpUlSnLength
; /* Part of PDCP config - optional */
58 bool pdcpDlSnLength_present
;
59 uint8_t pdcpDlSnLength
; /* Part of PDCP config - optional */
62 bool pdcpIntegrityProtection
;
63 bool pdcpCipheringDisabled
;
65 } nr_drb_rlc_pdcp_mapping_t
;
67 /* TODO: could probably merge this struct with above */
68 typedef struct pdcp_ue_parameters
{
70 uint8_t pdcp_sn_bits_ul
;
71 uint8_t pdcp_sn_bits_dl
;
75 bool pdcp_ciphering_disabled
;
76 } pdcp_bearer_parameters
;
78 /* Configure DRB PDCP channel properties. */
79 void set_rlc_nr_drb_pdcp_mapping(packet_info
*pinfo
,
80 nr_drb_rlc_pdcp_mapping_t
*drb_mapping
);
82 pdcp_bearer_parameters
* get_rlc_nr_drb_pdcp_mapping(uint16_t ue_id
, uint8_t drb_id
);
84 /*****************************************************************/
85 /* UDP framing format */
86 /* ----------------------- */
87 /* Several people have asked about dissecting RLC by framing */
88 /* PDUs over IP. A suggested format over UDP has been defined */
89 /* and implemented by this dissector, using the definitions */
92 /* A heuristic dissector (enabled by a preference) will */
93 /* recognise a signature at the beginning of these frames. */
94 /*****************************************************************/
97 /* Signature. Rather than try to define a port for this, or make the
98 port number a preference, frames will start with this string (with no
100 #define RLC_NR_START_STRING "rlc-nr"
102 /* Fixed field. This is followed by the following 2 mandatory field:
104 - sequenceNumberLength (1 byte)
105 (where the allowed values are defined above) */
107 /* Optional fields. Attaching this info to frames will allow you
108 to show you display/filter/plot/add-custom-columns on these fields, so should
109 be added if available.
110 The format is to have the tag, followed by the value (there is no length field,
111 it's implicit from the tag) */
113 #define RLC_NR_DIRECTION_TAG 0x02
116 #define RLC_NR_UEID_TAG 0x03
117 /* 2 bytes, network order */
119 #define RLC_NR_BEARER_TYPE_TAG 0x04
122 #define RLC_NR_BEARER_ID_TAG 0x05
125 /* RLC PDU. Following this tag comes the actual RLC PDU (there is no length, the PDU
126 continues until the end of the frame) */
127 #define RLC_NR_PAYLOAD_TAG 0x01
132 * Editor modelines - https://www.wireshark.org/tools/modelines.html
137 * indent-tabs-mode: nil
140 * vi: set shiftwidth=4 tabstop=8 expandtab:
141 * :indentSize=4:tabSize=8:noTabs=true: