Wireshark  4.3.0
The Wireshark network protocol analyzer
packet-rlc-lte.h
1 /* packet-rlc-lte.h
2  *
3  * Martin Mathieson
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_LTE_H
12 #define PACKET_RLC_LTE_H
13 
14 /* rlcMode */
15 #define RLC_TM_MODE 1
16 #define RLC_UM_MODE 2
17 #define RLC_AM_MODE 4
18 #define RLC_PREDEF 8
19 
20 /* direction */
21 #define DIRECTION_UPLINK 0
22 #define DIRECTION_DOWNLINK 1
23 
24 /* priority ? */
25 
26 /* channelType */
27 #define CHANNEL_TYPE_CCCH 1
28 #define CHANNEL_TYPE_BCCH_BCH 2
29 #define CHANNEL_TYPE_PCCH 3
30 #define CHANNEL_TYPE_SRB 4
31 #define CHANNEL_TYPE_DRB 5
32 #define CHANNEL_TYPE_BCCH_DL_SCH 6
33 #define CHANNEL_TYPE_MCCH 7
34 #define CHANNEL_TYPE_MTCH 8
35 
36 /* sequenceNumberLength */
37 #define UM_SN_LENGTH_5_BITS 5
38 #define UM_SN_LENGTH_10_BITS 10
39 #define AM_SN_LENGTH_10_BITS 10
40 #define AM_SN_LENGTH_16_BITS 16
41 
42 
43 typedef enum rlc_lte_nb_mode {
44  rlc_no_nb_mode = 0,
45  rlc_nb_mode = 1
46 } rlc_lte_nb_mode;
47 
48 
49 /* Info attached to each LTE RLC frame */
50 typedef struct rlc_lte_info
51 {
52  guint8 rlcMode;
53  guint8 direction;
54  guint8 priority;
55  guint8 sequenceNumberLength;
56  guint16 ueid;
57  guint16 channelType;
58  guint16 channelId; /* for SRB: 1=SRB1, 2=SRB2, 3=SRB1bis; for DRB: DRB ID */
59  guint16 pduLength;
60  gboolean extendedLiField;
61  rlc_lte_nb_mode nbMode;
62 } rlc_lte_info;
63 
64 
65 typedef struct rlc_lte_tap_info {
66  /* Info from context */
67  guint8 rlcMode;
68  guint8 direction;
69  guint8 priority;
70  guint16 ueid;
71  guint16 channelType;
72  guint16 channelId;
73  guint16 pduLength;
74  guint8 sequenceNumberLength;
75 
76  nstime_t rlc_lte_time;
77  guint8 loggedInMACFrame;
78  guint16 sequenceNumber;
79  guint8 isResegmented;
80  guint8 isControlPDU;
81  guint16 ACKNo;
82  #define MAX_NACKs 128
83  guint16 noOfNACKs;
84  guint16 NACKs[MAX_NACKs];
85 
86  guint16 missingSNs;
88 
89 
90 /* Configure number of PDCP SN bits to use for DRB channels. */
91 void set_rlc_lte_drb_pdcp_seqnum_length(packet_info *pinfo, guint16 ueid, guint8 drbid, guint8 userplane_seqnum_length);
92 
93 /* Configure LI field for AM DRB channels. */
94 void set_rlc_lte_drb_li_field(packet_info *pinfo, guint16 ueid, guint8 drbid, gboolean ul_ext_li_field, gboolean dl_ext_li_field);
95 
96 /**********************************************************************/
97 /* UDP framing format */
98 /* ----------------------- */
99 /* Several people have asked about dissecting RLC by framing */
100 /* PDUs over IP. A suggested format over UDP has been defined */
101 /* and implemented by this dissector, using the definitions */
102 /* below. A link to an example program showing you how to encode */
103 /* these headers and send LTE RLC PDUs on a UDP socket is */
104 /* provided at https://gitlab.com/wireshark/wireshark/-/wikis/RLC-LTE */
105 /* */
106 /* A heuristic dissector (enabled by a preference) will */
107 /* recognise a signature at the beginning of these frames. */
108 /* Until someone is using this format, suggestions for changes */
109 /* are welcome. */
110 /**********************************************************************/
111 
112 
113 /* Signature. Rather than try to define a port for this, or make the
114  port number a preference, frames will start with this string (with no
115  terminating NULL */
116 #define RLC_LTE_START_STRING "rlc-lte"
117 
118 /* Fixed field. This is followed by the following 1 mandatory field:
119  - rlcMode (1 byte)
120  (where the allowed values are defined above */
121 
122 /* Conditional field. This field is mandatory in case of RLC Unacknowledged mode.
123  In case of RLC Acknowledged mode, the field is optional (assume 10 bits by default).
124  The format is to have the tag, followed by the value (there is no length field,
125  it's implicit from the tag). The allowed values are defined above. */
126 
127 #define RLC_LTE_SN_LENGTH_TAG 0x02
128 /* 1 byte */
129 
130 /* Optional fields. Attaching this info to frames will allow you
131  to show you display/filter/plot/add-custom-columns on these fields, so should
132  be added if available.
133  The format is to have the tag, followed by the value (there is no length field,
134  it's implicit from the tag) */
135 
136 #define RLC_LTE_DIRECTION_TAG 0x03
137 /* 1 byte */
138 
139 #define RLC_LTE_PRIORITY_TAG 0x04
140 /* 1 byte */
141 
142 #define RLC_LTE_UEID_TAG 0x05
143 /* 2 bytes, network order */
144 
145 #define RLC_LTE_CHANNEL_TYPE_TAG 0x06
146 /* 2 bytes, network order */
147 
148 #define RLC_LTE_CHANNEL_ID_TAG 0x07
149 /* 2 bytes, network order */
150 
151 #define RLC_LTE_EXT_LI_FIELD_TAG 0x08
152 /* 0 byte, tag presence indicates that AM DRB PDU is using an extended LI field of 15 bits */
153 
154 #define RLC_LTE_NB_MODE_TAG 0x09
155 /* 1 byte containing rlc_lte_nb_mode enum value */
156 
157 /* RLC PDU. Following this tag comes the actual RLC PDU (there is no length, the PDU
158  continues until the end of the frame) */
159 #define RLC_LTE_PAYLOAD_TAG 0x01
160 
161 #endif
162 
163 /*
164  * Editor modelines - https://www.wireshark.org/tools/modelines.html
165  *
166  * Local variables:
167  * c-basic-offset: 4
168  * tab-width: 8
169  * indent-tabs-mode: nil
170  * End:
171  *
172  * vi: set shiftwidth=4 tabstop=8 expandtab:
173  * :indentSize=4:tabSize=8:noTabs=true:
174  */
Definition: packet_info.h:44
Definition: nstime.h:26
Definition: packet-rlc-lte.h:51
Definition: packet-rlc-lte.h:65