DPDK
22.11.1
Loading...
Searching...
No Matches
lib
net
rte_l2tpv2.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright(c) 2021 Intel Corporation.
3
*/
4
5
#ifndef _RTE_L2TPV2_H_
6
#define _RTE_L2TPV2_H_
7
74
#include <stdint.h>
75
#include <
rte_byteorder.h
>
76
77
#ifdef __cplusplus
78
extern
"C"
{
79
#endif
80
81
/*
82
* L2TPv2 Message Type
83
*/
84
#define RTE_L2TPV2_MSG_TYPE_CONTROL 0xC802
85
#define RTE_L2TPV2_MSG_TYPE_DATA 0x0002
86
#define RTE_L2TPV2_MSG_TYPE_DATA_L 0x4002
87
#define RTE_L2TPV2_MSG_TYPE_DATA_S 0x0802
88
#define RTE_L2TPV2_MSG_TYPE_DATA_O 0x0202
89
#define RTE_L2TPV2_MSG_TYPE_DATA_L_S 0x4802
90
#define RTE_L2TPV2_MSG_TYPE_DATA_L_O 0x4202
91
#define RTE_L2TPV2_MSG_TYPE_DATA_S_O 0x0A02
92
#define RTE_L2TPV2_MSG_TYPE_DATA_L_S_O 0x4A02
93
97
RTE_STD_C11
98
struct
rte_l2tpv2_common_hdr
{
99
union
{
101
rte_be16_t
flags_version
;
102
__extension__
103
struct
{
104
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
105
uint16_t
ver
:4;
106
uint16_t
res3
:4;
107
uint16_t
p
:1;
108
uint16_t
o
:1;
109
uint16_t
res2
:1;
110
uint16_t
s
:1;
111
uint16_t
res1
:2;
112
uint16_t
l
:1;
113
uint16_t
t
:1;
114
#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
115
uint16_t
t
:1;
116
uint16_t
l
:1;
117
uint16_t
res1
:2;
118
uint16_t
s
:1;
119
uint16_t
res2
:1;
120
uint16_t
o
:1;
121
uint16_t
p
:1;
122
uint16_t
res3
:4;
123
uint16_t
ver
:4;
124
#endif
125
};
126
};
127
};
128
133
struct
rte_l2tpv2_msg_with_all_options
{
134
rte_be16_t
length
;
135
rte_be16_t
tunnel_id
;
136
rte_be16_t
session_id
;
137
rte_be16_t
ns
;
138
rte_be16_t
nr
;
139
rte_be16_t
offset_size
;
140
uint8_t *
offset_padding
;
141
}
__rte_packed
;
142
147
struct
rte_l2tpv2_msg_without_length
{
148
rte_be16_t
tunnel_id
;
149
rte_be16_t
session_id
;
150
rte_be16_t
ns
;
151
rte_be16_t
nr
;
152
rte_be16_t
offset_size
;
153
uint8_t *
offset_padding
;
154
}
__rte_packed
;
155
161
struct
rte_l2tpv2_msg_without_ns_nr
{
162
rte_be16_t
length
;
163
rte_be16_t
tunnel_id
;
164
rte_be16_t
session_id
;
165
rte_be16_t
offset_size
;
166
uint8_t *
offset_padding
;
167
};
168
173
struct
rte_l2tpv2_msg_without_offset
{
174
rte_be16_t
length
;
175
rte_be16_t
tunnel_id
;
176
rte_be16_t
session_id
;
177
rte_be16_t
ns
;
178
rte_be16_t
nr
;
179
};
180
184
struct
rte_l2tpv2_msg_with_offset
{
185
rte_be16_t
tunnel_id
;
186
rte_be16_t
session_id
;
187
rte_be16_t
offset_size
;
188
uint8_t *
offset_padding
;
189
}
__rte_packed
;
190
194
struct
rte_l2tpv2_msg_with_ns_nr
{
195
rte_be16_t
tunnel_id
;
196
rte_be16_t
session_id
;
197
rte_be16_t
ns
;
198
rte_be16_t
nr
;
199
};
200
204
struct
rte_l2tpv2_msg_with_length
{
205
rte_be16_t
length
;
206
rte_be16_t
tunnel_id
;
207
rte_be16_t
session_id
;
208
};
209
213
struct
rte_l2tpv2_msg_without_all_options
{
214
rte_be16_t
tunnel_id
;
215
rte_be16_t
session_id
;
216
};
217
221
RTE_STD_C11
222
struct
rte_l2tpv2_combined_msg_hdr
{
223
struct
rte_l2tpv2_common_hdr
common
;
224
union
{
226
struct
rte_l2tpv2_msg_with_all_options
type0;
228
struct
rte_l2tpv2_msg_without_length
type1;
230
struct
rte_l2tpv2_msg_without_ns_nr
type2;
232
struct
rte_l2tpv2_msg_without_offset
type3;
234
struct
rte_l2tpv2_msg_with_offset
type4;
236
struct
rte_l2tpv2_msg_with_ns_nr
type5;
238
struct
rte_l2tpv2_msg_with_length
type6;
240
struct
rte_l2tpv2_msg_without_all_options
type7;
241
};
242
}
__rte_packed
;
243
244
#ifdef __cplusplus
245
}
246
#endif
247
248
#endif
/* _RTE_L2TPV2_H_ */
rte_byteorder.h
rte_be16_t
uint16_t rte_be16_t
Definition
rte_byteorder.h:110
__rte_packed
#define __rte_packed
Definition
rte_common.h:83
RTE_STD_C11
#define RTE_STD_C11
Definition
rte_common.h:39
rte_l2tpv2_combined_msg_hdr
Definition
rte_l2tpv2.h:222
rte_l2tpv2_combined_msg_hdr::common
struct rte_l2tpv2_common_hdr common
Definition
rte_l2tpv2.h:223
rte_l2tpv2_common_hdr
Definition
rte_l2tpv2.h:98
rte_l2tpv2_common_hdr::l
uint16_t l
Definition
rte_l2tpv2.h:112
rte_l2tpv2_common_hdr::res1
uint16_t res1
Definition
rte_l2tpv2.h:111
rte_l2tpv2_common_hdr::p
uint16_t p
Definition
rte_l2tpv2.h:107
rte_l2tpv2_common_hdr::t
uint16_t t
Definition
rte_l2tpv2.h:113
rte_l2tpv2_common_hdr::s
uint16_t s
Definition
rte_l2tpv2.h:110
rte_l2tpv2_common_hdr::res2
uint16_t res2
Definition
rte_l2tpv2.h:109
rte_l2tpv2_common_hdr::flags_version
rte_be16_t flags_version
Definition
rte_l2tpv2.h:101
rte_l2tpv2_common_hdr::o
uint16_t o
Definition
rte_l2tpv2.h:108
rte_l2tpv2_common_hdr::res3
uint16_t res3
Definition
rte_l2tpv2.h:106
rte_l2tpv2_common_hdr::ver
uint16_t ver
Definition
rte_l2tpv2.h:105
rte_l2tpv2_msg_with_all_options
Definition
rte_l2tpv2.h:133
rte_l2tpv2_msg_with_all_options::tunnel_id
rte_be16_t tunnel_id
Definition
rte_l2tpv2.h:135
rte_l2tpv2_msg_with_all_options::offset_size
rte_be16_t offset_size
Definition
rte_l2tpv2.h:139
rte_l2tpv2_msg_with_all_options::offset_padding
uint8_t * offset_padding
Definition
rte_l2tpv2.h:140
rte_l2tpv2_msg_with_all_options::nr
rte_be16_t nr
Definition
rte_l2tpv2.h:138
rte_l2tpv2_msg_with_all_options::ns
rte_be16_t ns
Definition
rte_l2tpv2.h:137
rte_l2tpv2_msg_with_all_options::length
rte_be16_t length
Definition
rte_l2tpv2.h:134
rte_l2tpv2_msg_with_all_options::session_id
rte_be16_t session_id
Definition
rte_l2tpv2.h:136
rte_l2tpv2_msg_with_length
Definition
rte_l2tpv2.h:204
rte_l2tpv2_msg_with_length::tunnel_id
rte_be16_t tunnel_id
Definition
rte_l2tpv2.h:206
rte_l2tpv2_msg_with_length::length
rte_be16_t length
Definition
rte_l2tpv2.h:205
rte_l2tpv2_msg_with_length::session_id
rte_be16_t session_id
Definition
rte_l2tpv2.h:207
rte_l2tpv2_msg_with_ns_nr
Definition
rte_l2tpv2.h:194
rte_l2tpv2_msg_with_ns_nr::tunnel_id
rte_be16_t tunnel_id
Definition
rte_l2tpv2.h:195
rte_l2tpv2_msg_with_ns_nr::nr
rte_be16_t nr
Definition
rte_l2tpv2.h:198
rte_l2tpv2_msg_with_ns_nr::ns
rte_be16_t ns
Definition
rte_l2tpv2.h:197
rte_l2tpv2_msg_with_ns_nr::session_id
rte_be16_t session_id
Definition
rte_l2tpv2.h:196
rte_l2tpv2_msg_with_offset
Definition
rte_l2tpv2.h:184
rte_l2tpv2_msg_with_offset::tunnel_id
rte_be16_t tunnel_id
Definition
rte_l2tpv2.h:185
rte_l2tpv2_msg_with_offset::offset_size
rte_be16_t offset_size
Definition
rte_l2tpv2.h:187
rte_l2tpv2_msg_with_offset::offset_padding
uint8_t * offset_padding
Definition
rte_l2tpv2.h:188
rte_l2tpv2_msg_with_offset::session_id
rte_be16_t session_id
Definition
rte_l2tpv2.h:186
rte_l2tpv2_msg_without_all_options
Definition
rte_l2tpv2.h:213
rte_l2tpv2_msg_without_all_options::tunnel_id
rte_be16_t tunnel_id
Definition
rte_l2tpv2.h:214
rte_l2tpv2_msg_without_all_options::session_id
rte_be16_t session_id
Definition
rte_l2tpv2.h:215
rte_l2tpv2_msg_without_length
Definition
rte_l2tpv2.h:147
rte_l2tpv2_msg_without_length::tunnel_id
rte_be16_t tunnel_id
Definition
rte_l2tpv2.h:148
rte_l2tpv2_msg_without_length::offset_size
rte_be16_t offset_size
Definition
rte_l2tpv2.h:152
rte_l2tpv2_msg_without_length::offset_padding
uint8_t * offset_padding
Definition
rte_l2tpv2.h:153
rte_l2tpv2_msg_without_length::nr
rte_be16_t nr
Definition
rte_l2tpv2.h:151
rte_l2tpv2_msg_without_length::ns
rte_be16_t ns
Definition
rte_l2tpv2.h:150
rte_l2tpv2_msg_without_length::session_id
rte_be16_t session_id
Definition
rte_l2tpv2.h:149
rte_l2tpv2_msg_without_ns_nr
Definition
rte_l2tpv2.h:161
rte_l2tpv2_msg_without_ns_nr::tunnel_id
rte_be16_t tunnel_id
Definition
rte_l2tpv2.h:163
rte_l2tpv2_msg_without_ns_nr::offset_size
rte_be16_t offset_size
Definition
rte_l2tpv2.h:165
rte_l2tpv2_msg_without_ns_nr::offset_padding
uint8_t * offset_padding
Definition
rte_l2tpv2.h:166
rte_l2tpv2_msg_without_ns_nr::length
rte_be16_t length
Definition
rte_l2tpv2.h:162
rte_l2tpv2_msg_without_ns_nr::session_id
rte_be16_t session_id
Definition
rte_l2tpv2.h:164
rte_l2tpv2_msg_without_offset
Definition
rte_l2tpv2.h:173
rte_l2tpv2_msg_without_offset::tunnel_id
rte_be16_t tunnel_id
Definition
rte_l2tpv2.h:175
rte_l2tpv2_msg_without_offset::nr
rte_be16_t nr
Definition
rte_l2tpv2.h:178
rte_l2tpv2_msg_without_offset::ns
rte_be16_t ns
Definition
rte_l2tpv2.h:177
rte_l2tpv2_msg_without_offset::length
rte_be16_t length
Definition
rte_l2tpv2.h:174
rte_l2tpv2_msg_without_offset::session_id
rte_be16_t session_id
Definition
rte_l2tpv2.h:176
Generated by
1.9.7