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 /* Configure number of PDCP SN bits to use for DRB channels. */
66 void set_rlc_lte_drb_pdcp_seqnum_length(packet_info *pinfo, guint16 ueid, guint8 drbid, guint8 userplane_seqnum_length);
67 
68 /* Configure LI field for AM DRB channels. */
69 void set_rlc_lte_drb_li_field(packet_info *pinfo, guint16 ueid, guint8 drbid, gboolean ul_ext_li_field, gboolean dl_ext_li_field);
70 
71 /**********************************************************************/
72 /* UDP framing format */
73 /* ----------------------- */
74 /* Several people have asked about dissecting RLC by framing */
75 /* PDUs over IP. A suggested format over UDP has been defined */
76 /* and implemented by this dissector, using the definitions */
77 /* below. A link to an example program showing you how to encode */
78 /* these headers and send LTE RLC PDUs on a UDP socket is */
79 /* provided at https://gitlab.com/wireshark/wireshark/-/wikis/RLC-LTE */
80 /* */
81 /* A heuristic dissector (enabled by a preference) will */
82 /* recognise a signature at the beginning of these frames. */
83 /* Until someone is using this format, suggestions for changes */
84 /* are welcome. */
85 /**********************************************************************/
86 
87 
88 /* Signature. Rather than try to define a port for this, or make the
89  port number a preference, frames will start with this string (with no
90  terminating NULL */
91 #define RLC_LTE_START_STRING "rlc-lte"
92 
93 /* Fixed field. This is followed by the following 1 mandatory field:
94  - rlcMode (1 byte)
95  (where the allowed values are defined above */
96 
97 /* Conditional field. This field is mandatory in case of RLC Unacknowledged mode.
98  In case of RLC Acknowledged mode, the field is optional (assume 10 bits by default).
99  The format is to have the tag, followed by the value (there is no length field,
100  it's implicit from the tag). The allowed values are defined above. */
101 
102 #define RLC_LTE_SN_LENGTH_TAG 0x02
103 /* 1 byte */
104 
105 /* Optional fields. Attaching this info to frames will allow you
106  to show you display/filter/plot/add-custom-columns on these fields, so should
107  be added if available.
108  The format is to have the tag, followed by the value (there is no length field,
109  it's implicit from the tag) */
110 
111 #define RLC_LTE_DIRECTION_TAG 0x03
112 /* 1 byte */
113 
114 #define RLC_LTE_PRIORITY_TAG 0x04
115 /* 1 byte */
116 
117 #define RLC_LTE_UEID_TAG 0x05
118 /* 2 bytes, network order */
119 
120 #define RLC_LTE_CHANNEL_TYPE_TAG 0x06
121 /* 2 bytes, network order */
122 
123 #define RLC_LTE_CHANNEL_ID_TAG 0x07
124 /* 2 bytes, network order */
125 
126 #define RLC_LTE_EXT_LI_FIELD_TAG 0x08
127 /* 0 byte, tag presence indicates that AM DRB PDU is using an extended LI field of 15 bits */
128 
129 #define RLC_LTE_NB_MODE_TAG 0x09
130 /* 1 byte containing rlc_lte_nb_mode enum value */
131 
132 /* RLC PDU. Following this tag comes the actual RLC PDU (there is no length, the PDU
133  continues until the end of the frame) */
134 #define RLC_LTE_PAYLOAD_TAG 0x01
135 
136 #endif
137 
138 /*
139  * Editor modelines - https://www.wireshark.org/tools/modelines.html
140  *
141  * Local variables:
142  * c-basic-offset: 4
143  * tab-width: 8
144  * indent-tabs-mode: nil
145  * End:
146  *
147  * vi: set shiftwidth=4 tabstop=8 expandtab:
148  * :indentSize=4:tabSize=8:noTabs=true:
149  */
Definition: packet_info.h:44
Definition: packet-rlc-lte.h:51