DPDK
25.03.0-rc1
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
/*
78
* L2TPv2 Message Type
79
*/
80
#define RTE_L2TPV2_MSG_TYPE_CONTROL 0xC802
81
#define RTE_L2TPV2_MSG_TYPE_DATA 0x0002
82
#define RTE_L2TPV2_MSG_TYPE_DATA_L 0x4002
83
#define RTE_L2TPV2_MSG_TYPE_DATA_S 0x0802
84
#define RTE_L2TPV2_MSG_TYPE_DATA_O 0x0202
85
#define RTE_L2TPV2_MSG_TYPE_DATA_L_S 0x4802
86
#define RTE_L2TPV2_MSG_TYPE_DATA_L_O 0x4202
87
#define RTE_L2TPV2_MSG_TYPE_DATA_S_O 0x0A02
88
#define RTE_L2TPV2_MSG_TYPE_DATA_L_S_O 0x4A02
89
93
struct
rte_l2tpv2_common_hdr
{
94
union
{
96
rte_be16_t
flags_version
;
97
__extension__
98
struct
{
99
#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
100
uint16_t
ver
:4;
101
uint16_t
res3
:4;
102
uint16_t
p
:1;
103
uint16_t
o
:1;
104
uint16_t
res2
:1;
105
uint16_t
s
:1;
106
uint16_t
res1
:2;
107
uint16_t
l
:1;
108
uint16_t
t
:1;
109
#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN
110
uint16_t
t
:1;
111
uint16_t
l
:1;
112
uint16_t
res1
:2;
113
uint16_t
s
:1;
114
uint16_t
res2
:1;
115
uint16_t
o
:1;
116
uint16_t
p
:1;
117
uint16_t
res3
:4;
118
uint16_t
ver
:4;
119
#endif
120
};
121
};
122
};
123
128
struct
__rte_packed_begin
rte_l2tpv2_msg_with_all_options
{
129
rte_be16_t
length
;
130
rte_be16_t
tunnel_id
;
131
rte_be16_t
session_id
;
132
rte_be16_t
ns
;
133
rte_be16_t
nr
;
134
rte_be16_t
offset_size
;
135
uint8_t *
offset_padding
;
136
} __rte_packed_end;
137
142
struct
__rte_packed_begin
rte_l2tpv2_msg_without_length
{
143
rte_be16_t
tunnel_id
;
144
rte_be16_t
session_id
;
145
rte_be16_t
ns
;
146
rte_be16_t
nr
;
147
rte_be16_t
offset_size
;
148
uint8_t *
offset_padding
;
149
} __rte_packed_end;
150
156
struct
rte_l2tpv2_msg_without_ns_nr
{
157
rte_be16_t
length
;
158
rte_be16_t
tunnel_id
;
159
rte_be16_t
session_id
;
160
rte_be16_t
offset_size
;
161
uint8_t *
offset_padding
;
162
};
163
168
struct
rte_l2tpv2_msg_without_offset
{
169
rte_be16_t
length
;
170
rte_be16_t
tunnel_id
;
171
rte_be16_t
session_id
;
172
rte_be16_t
ns
;
173
rte_be16_t
nr
;
174
};
175
179
struct
__rte_packed_begin
rte_l2tpv2_msg_with_offset
{
180
rte_be16_t
tunnel_id
;
181
rte_be16_t
session_id
;
182
rte_be16_t
offset_size
;
183
uint8_t *
offset_padding
;
184
} __rte_packed_end;
185
189
struct
rte_l2tpv2_msg_with_ns_nr
{
190
rte_be16_t
tunnel_id
;
191
rte_be16_t
session_id
;
192
rte_be16_t
ns
;
193
rte_be16_t
nr
;
194
};
195
199
struct
rte_l2tpv2_msg_with_length
{
200
rte_be16_t
length
;
201
rte_be16_t
tunnel_id
;
202
rte_be16_t
session_id
;
203
};
204
208
struct
rte_l2tpv2_msg_without_all_options
{
209
rte_be16_t
tunnel_id
;
210
rte_be16_t
session_id
;
211
};
212
216
struct
__rte_packed_begin
rte_l2tpv2_combined_msg_hdr
{
217
struct
rte_l2tpv2_common_hdr
common;
218
union
{
220
struct
rte_l2tpv2_msg_with_all_options
type0;
222
struct
rte_l2tpv2_msg_without_length
type1;
224
struct
rte_l2tpv2_msg_without_ns_nr
type2;
226
struct
rte_l2tpv2_msg_without_offset
type3;
228
struct
rte_l2tpv2_msg_with_offset
type4;
230
struct
rte_l2tpv2_msg_with_ns_nr
type5;
232
struct
rte_l2tpv2_msg_with_length
type6;
234
struct
rte_l2tpv2_msg_without_all_options
type7;
235
};
236
} __rte_packed_end;
237
238
#endif
/* _RTE_L2TPV2_H_ */
rte_byteorder.h
rte_be16_t
uint16_t rte_be16_t
Definition:
rte_byteorder.h:116
__rte_packed_begin
#define __rte_packed_begin
Definition:
rte_common.h:124
rte_l2tpv2_combined_msg_hdr
Definition:
rte_l2tpv2.h:216
rte_l2tpv2_common_hdr
Definition:
rte_l2tpv2.h:93
rte_l2tpv2_common_hdr::l
uint16_t l
Definition:
rte_l2tpv2.h:107
rte_l2tpv2_common_hdr::res1
uint16_t res1
Definition:
rte_l2tpv2.h:106
rte_l2tpv2_common_hdr::p
uint16_t p
Definition:
rte_l2tpv2.h:102
rte_l2tpv2_common_hdr::t
uint16_t t
Definition:
rte_l2tpv2.h:108
rte_l2tpv2_common_hdr::s
uint16_t s
Definition:
rte_l2tpv2.h:105
rte_l2tpv2_common_hdr::res2
uint16_t res2
Definition:
rte_l2tpv2.h:104
rte_l2tpv2_common_hdr::flags_version
rte_be16_t flags_version
Definition:
rte_l2tpv2.h:96
rte_l2tpv2_common_hdr::o
uint16_t o
Definition:
rte_l2tpv2.h:103
rte_l2tpv2_common_hdr::res3
uint16_t res3
Definition:
rte_l2tpv2.h:101
rte_l2tpv2_common_hdr::ver
uint16_t ver
Definition:
rte_l2tpv2.h:100
rte_l2tpv2_msg_with_all_options
Definition:
rte_l2tpv2.h:128
rte_l2tpv2_msg_with_all_options::tunnel_id
rte_be16_t tunnel_id
Definition:
rte_l2tpv2.h:130
rte_l2tpv2_msg_with_all_options::offset_size
rte_be16_t offset_size
Definition:
rte_l2tpv2.h:134
rte_l2tpv2_msg_with_all_options::offset_padding
uint8_t * offset_padding
Definition:
rte_l2tpv2.h:135
rte_l2tpv2_msg_with_all_options::nr
rte_be16_t nr
Definition:
rte_l2tpv2.h:133
rte_l2tpv2_msg_with_all_options::ns
rte_be16_t ns
Definition:
rte_l2tpv2.h:132
rte_l2tpv2_msg_with_all_options::length
rte_be16_t length
Definition:
rte_l2tpv2.h:129
rte_l2tpv2_msg_with_all_options::session_id
rte_be16_t session_id
Definition:
rte_l2tpv2.h:131
rte_l2tpv2_msg_with_length
Definition:
rte_l2tpv2.h:199
rte_l2tpv2_msg_with_length::tunnel_id
rte_be16_t tunnel_id
Definition:
rte_l2tpv2.h:201
rte_l2tpv2_msg_with_length::length
rte_be16_t length
Definition:
rte_l2tpv2.h:200
rte_l2tpv2_msg_with_length::session_id
rte_be16_t session_id
Definition:
rte_l2tpv2.h:202
rte_l2tpv2_msg_with_ns_nr
Definition:
rte_l2tpv2.h:189
rte_l2tpv2_msg_with_ns_nr::tunnel_id
rte_be16_t tunnel_id
Definition:
rte_l2tpv2.h:190
rte_l2tpv2_msg_with_ns_nr::nr
rte_be16_t nr
Definition:
rte_l2tpv2.h:193
rte_l2tpv2_msg_with_ns_nr::ns
rte_be16_t ns
Definition:
rte_l2tpv2.h:192
rte_l2tpv2_msg_with_ns_nr::session_id
rte_be16_t session_id
Definition:
rte_l2tpv2.h:191
rte_l2tpv2_msg_with_offset
Definition:
rte_l2tpv2.h:179
rte_l2tpv2_msg_with_offset::tunnel_id
rte_be16_t tunnel_id
Definition:
rte_l2tpv2.h:180
rte_l2tpv2_msg_with_offset::offset_size
rte_be16_t offset_size
Definition:
rte_l2tpv2.h:182
rte_l2tpv2_msg_with_offset::offset_padding
uint8_t * offset_padding
Definition:
rte_l2tpv2.h:183
rte_l2tpv2_msg_with_offset::session_id
rte_be16_t session_id
Definition:
rte_l2tpv2.h:181
rte_l2tpv2_msg_without_all_options
Definition:
rte_l2tpv2.h:208
rte_l2tpv2_msg_without_all_options::tunnel_id
rte_be16_t tunnel_id
Definition:
rte_l2tpv2.h:209
rte_l2tpv2_msg_without_all_options::session_id
rte_be16_t session_id
Definition:
rte_l2tpv2.h:210
rte_l2tpv2_msg_without_length
Definition:
rte_l2tpv2.h:142
rte_l2tpv2_msg_without_length::tunnel_id
rte_be16_t tunnel_id
Definition:
rte_l2tpv2.h:143
rte_l2tpv2_msg_without_length::offset_size
rte_be16_t offset_size
Definition:
rte_l2tpv2.h:147
rte_l2tpv2_msg_without_length::offset_padding
uint8_t * offset_padding
Definition:
rte_l2tpv2.h:148
rte_l2tpv2_msg_without_length::nr
rte_be16_t nr
Definition:
rte_l2tpv2.h:146
rte_l2tpv2_msg_without_length::ns
rte_be16_t ns
Definition:
rte_l2tpv2.h:145
rte_l2tpv2_msg_without_length::session_id
rte_be16_t session_id
Definition:
rte_l2tpv2.h:144
rte_l2tpv2_msg_without_ns_nr
Definition:
rte_l2tpv2.h:156
rte_l2tpv2_msg_without_ns_nr::tunnel_id
rte_be16_t tunnel_id
Definition:
rte_l2tpv2.h:158
rte_l2tpv2_msg_without_ns_nr::offset_size
rte_be16_t offset_size
Definition:
rte_l2tpv2.h:160
rte_l2tpv2_msg_without_ns_nr::offset_padding
uint8_t * offset_padding
Definition:
rte_l2tpv2.h:161
rte_l2tpv2_msg_without_ns_nr::length
rte_be16_t length
Definition:
rte_l2tpv2.h:157
rte_l2tpv2_msg_without_ns_nr::session_id
rte_be16_t session_id
Definition:
rte_l2tpv2.h:159
rte_l2tpv2_msg_without_offset
Definition:
rte_l2tpv2.h:168
rte_l2tpv2_msg_without_offset::tunnel_id
rte_be16_t tunnel_id
Definition:
rte_l2tpv2.h:170
rte_l2tpv2_msg_without_offset::nr
rte_be16_t nr
Definition:
rte_l2tpv2.h:173
rte_l2tpv2_msg_without_offset::ns
rte_be16_t ns
Definition:
rte_l2tpv2.h:172
rte_l2tpv2_msg_without_offset::length
rte_be16_t length
Definition:
rte_l2tpv2.h:169
rte_l2tpv2_msg_without_offset::session_id
rte_be16_t session_id
Definition:
rte_l2tpv2.h:171
Generated by
1.9.4