Wireshark  4.3.0
The Wireshark network protocol analyzer
packet-rlc-nr.h
1 /* packet-rlc-nr.h
2  *
3  * Pascal Quantin
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #ifndef PACKET_RLC_NR_H
12 #define PACKET_RLC_NR_H
13 
14 /* rlcMode */
15 #define RLC_TM_MODE 1
16 #define RLC_UM_MODE 2
17 #define RLC_AM_MODE 4
18 
19 /* direction */
20 #define DIRECTION_UPLINK 0
21 #define DIRECTION_DOWNLINK 1
22 
23 /* bearerType */
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
30 
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
37 
38 /* Info attached to each NR RLC frame */
39 typedef struct rlc_nr_info
40 {
41  guint8 rlcMode;
42  guint8 direction;
43  guint8 sequenceNumberLength;
44  guint8 bearerType;
45  guint8 bearerId;
46  guint16 ueid;
47  guint16 pduLength;
48 } rlc_nr_info;
49 
51 {
52  gboolean active;
53  guint16 ueid; /* Mandatory */
54  guint8 drbid; /* Mandatory */
55 
56  gboolean pdcpUlSnLength_present;
57  guint8 pdcpUlSnLength; /* Part of PDCP config - optional */
58  gboolean pdcpDlSnLength_present;
59  guint8 pdcpDlSnLength; /* Part of PDCP config - optional */
60  gboolean pdcpUlSdap;
61  gboolean pdcpDlSdap;
62  gboolean pdcpIntegrityProtection;
63  gboolean pdcpCipheringDisabled;
64 
66 
67 /* TODO: could probably merge this struct with above */
68 typedef struct pdcp_ue_parameters {
69  guint32 id;
70  guint8 pdcp_sn_bits_ul;
71  guint8 pdcp_sn_bits_dl;
72  gboolean pdcp_sdap_ul;
73  gboolean pdcp_sdap_dl;
74  gboolean pdcp_integrity;
75  gboolean pdcp_ciphering_disabled;
77 
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);
81 
82 pdcp_bearer_parameters* get_rlc_nr_drb_pdcp_mapping(guint16 ue_id, guint8 drb_id);
83 
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 */
90 /* below. */
91 /* */
92 /* A heuristic dissector (enabled by a preference) will */
93 /* recognise a signature at the beginning of these frames. */
94 /*****************************************************************/
95 
96 
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
99  terminating NULL */
100 #define RLC_NR_START_STRING "rlc-nr"
101 
102 /* Fixed field. This is followed by the following 2 mandatory field:
103  - rlcMode (1 byte)
104  - sequenceNumberLength (1 byte)
105  (where the allowed values are defined above) */
106 
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) */
112 
113 #define RLC_NR_DIRECTION_TAG 0x02
114 /* 1 byte */
115 
116 #define RLC_NR_UEID_TAG 0x03
117 /* 2 bytes, network order */
118 
119 #define RLC_NR_BEARER_TYPE_TAG 0x04
120 /* 1 byte */
121 
122 #define RLC_NR_BEARER_ID_TAG 0x05
123 /* 1 byte */
124 
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
128 
129 #endif
130 
131 /*
132  * Editor modelines - https://www.wireshark.org/tools/modelines.html
133  *
134  * Local variables:
135  * c-basic-offset: 4
136  * tab-width: 8
137  * indent-tabs-mode: nil
138  * End:
139  *
140  * vi: set shiftwidth=4 tabstop=8 expandtab:
141  * :indentSize=4:tabSize=8:noTabs=true:
142  */
Definition: packet_info.h:44
Definition: packet-rlc-nr.h:51
Definition: packet-rlc-nr.h:68
Definition: packet-rlc-nr.h:40