Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-pdcp-lte.h
1/* packet-pdcp-lte.h
2 *
3 * Martin Mathieson
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <[email protected]>
6 * Copyright 1998 Gerald Combs
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11
12#include "packet-rohc.h"
13
14/* Direction */
15#define DIRECTION_UPLINK 0
16#define DIRECTION_DOWNLINK 1
17
18enum pdcp_plane
19{
20 SIGNALING_PLANE = 1,
21 USER_PLANE = 2
22};
23
24typedef enum LogicalChannelType
25{
26 Channel_DCCH=1,
27 Channel_BCCH=2,
28 Channel_CCCH=3,
29 Channel_PCCH=4,
30 Channel_DCCH_NB=5,
31 Channel_BCCH_NB=6,
32 Channel_CCCH_NB=7,
33 Channel_PCCH_NB=8
34} LogicalChannelType;
35
36typedef enum
37{
38 BCH_TRANSPORT=1,
39 DLSCH_TRANSPORT=2
40} BCCHTransportType;
41
42#define PDCP_SN_LENGTH_5_BITS 5
43#define PDCP_SN_LENGTH_7_BITS 7
44#define PDCP_SN_LENGTH_12_BITS 12
45#define PDCP_SN_LENGTH_15_BITS 15
46#define PDCP_SN_LENGTH_18_BITS 18
47
48enum lte_security_integrity_algorithm_e { eia0, eia1, eia2, eia3 };
49enum lte_security_ciphering_algorithm_e { eea0, eea1, eea2, eea3 };
50
52{
53 uint32_t configuration_frame;
54 bool seen_next_ul_pdu; /* i.e. have we seen SecurityModeResponse */
55 enum lte_security_integrity_algorithm_e integrity;
56 enum lte_security_ciphering_algorithm_e ciphering;
57
58 /* Store previous settings so can revert if get SecurityModeFailure */
59 uint32_t previous_configuration_frame;
60 enum lte_security_integrity_algorithm_e previous_integrity;
61 enum lte_security_ciphering_algorithm_e previous_ciphering;
63
64
65/* Info attached to each LTE PDCP/RoHC packet */
66typedef struct pdcp_lte_info
67{
68 /* Channel info is needed for RRC parsing */
69 uint8_t direction;
70 uint16_t ueid;
71 LogicalChannelType channelType;
72 uint16_t channelId;
73 BCCHTransportType BCCHTransport;
74
75 /* Details of PDCP header */
76 bool no_header_pdu;
77 enum pdcp_plane plane;
78 uint8_t seqnum_length;
79
80 /* RoHC settings */
81 rohc_info rohc;
82
83 uint8_t is_retx;
84
85 /* Used by heuristic dissector only */
86 uint16_t pdu_length;
88
89
90
91/***********************************************************************/
92/* UDP framing format */
93/* ----------------------- */
94/* Several people have asked about dissecting PDCP by framing */
95/* PDUs over IP. A suggested format over UDP has been defined */
96/* and implemented by this dissector, using the definitions */
97/* below. A link to an example program showing you how to encode */
98/* these headers and send LTE PDCP PDUs on a UDP socket is */
99/* provided at https://gitlab.com/wireshark/wireshark/-/wikis/PDCP-LTE */
100/* */
101/* A heuristic dissector (enabled by a preference) will */
102/* recognise a signature at the beginning of these frames. */
103/* Until someone is using this format, suggestions for changes */
104/* are welcome. */
105/***********************************************************************/
106
107
108/* Signature. Rather than try to define a port for this, or make the
109 port number a preference, frames will start with this string (with no
110 terminating NULL */
111#define PDCP_LTE_START_STRING "pdcp-lte"
112
113/* Fixed fields. This is followed by the following 3 mandatory fields:
114 - no_header_pdu (1 byte)
115 - plane (1 byte)
116 - rohc_compression ( byte)
117 (where the allowed values are defined above) */
118
119/* Conditional field. This field is mandatory in case of User Plane PDCP PDU.
120 The format is to have the tag, followed by the value (there is no length field,
121 it's implicit from the tag). The allowed values are defined above. */
122
123#define PDCP_LTE_SEQNUM_LENGTH_TAG 0x02
124/* 1 byte */
125
126/* Optional fields. Attaching this info to frames will allow you
127 to show you display/filter/plot/add-custom-columns on these fields, so should
128 be added if available.
129 The format is to have the tag, followed by the value (there is no length field,
130 it's implicit from the tag) */
131
132#define PDCP_LTE_DIRECTION_TAG 0x03
133/* 1 byte */
134
135#define PDCP_LTE_LOG_CHAN_TYPE_TAG 0x04
136/* 1 byte */
137
138#define PDCP_LTE_BCCH_TRANSPORT_TYPE_TAG 0x05
139/* 1 byte */
140
141#define PDCP_LTE_ROHC_IP_VERSION_TAG 0x06
142/* 2 bytes, network order */
143
144#define PDCP_LTE_ROHC_CID_INC_INFO_TAG 0x07
145/* 1 byte */
146
147#define PDCP_LTE_ROHC_LARGE_CID_PRES_TAG 0x08
148/* 1 byte */
149
150#define PDCP_LTE_ROHC_MODE_TAG 0x09
151/* 1 byte */
152
153#define PDCP_LTE_ROHC_RND_TAG 0x0A
154/* 1 byte */
155
156#define PDCP_LTE_ROHC_UDP_CHECKSUM_PRES_TAG 0x0B
157/* 1 byte */
158
159#define PDCP_LTE_ROHC_PROFILE_TAG 0x0C
160/* 2 bytes, network order */
161
162#define PDCP_LTE_CHANNEL_ID_TAG 0x0D
163/* 2 bytes, network order */
164
165#define PDCP_LTE_UEID_TAG 0x0E
166/* 2 bytes, network order */
167
168/* PDCP PDU. Following this tag comes the actual PDCP PDU (there is no length, the PDU
169 continues until the end of the frame) */
170#define PDCP_LTE_PAYLOAD_TAG 0x01
171
172
173
174/* Called by RRC, or other configuration protocols */
175
176/* Function to configure ciphering & integrity algorithms */
177void set_pdcp_lte_security_algorithms(uint16_t ueid, pdcp_lte_security_info_t *security_info);
178
179/* Function to indicate securityModeCommand did not complete */
180void set_pdcp_lte_security_algorithms_failed(uint16_t ueid);
181
182
183/* Called by external dissectors */
184void set_pdcp_lte_rrc_ciphering_key(uint16_t ueid, const char *key, uint32_t frame_num);
185void set_pdcp_lte_rrc_integrity_key(uint16_t ueid, const char *key, uint32_t frame_num);
186void set_pdcp_lte_up_ciphering_key(uint16_t ueid, const char *key, uint32_t frame_num);
187
188/* Reset UE's bearers */
189void pdcp_lte_reset_ue_bearers(packet_info *pinfo, uint16_t ueid, bool including_drb_am);
190
191/*
192 * Editor modelines - https://www.wireshark.org/tools/modelines.html
193 *
194 * Local variables:
195 * c-basic-offset: 4
196 * tab-width: 8
197 * indent-tabs-mode: nil
198 * End:
199 *
200 * vi: set shiftwidth=4 tabstop=8 expandtab:
201 * :indentSize=4:tabSize=8:noTabs=true:
202 */
Definition packet_info.h:43
Definition packet-pdcp-lte.h:67
Definition packet-pdcp-lte.h:52
Definition packet-rohc.h:40