rte_l2tpv2.h(3)
π rte_l2tpv2.h π
okay bestie, welcome to the Library Functions Manual page for rte_l2tpv2.h β it's giving DPDK, it's giving L2TPv2 headers, and honestly? iconic. grab a boba, we're doing bitfields. π§β¨
πΈ NAME πΈ
rte_l2tpv2.h β the header file that holds all the L2TPv2 header structs, no cap.
π SYNOPSIS π
#include <stdint.h>
#include <rte_byteorder.h>
β¨ Data Structures β¨
these are the structs, and yes you need to know all of them, we don't skip:
struct rte_l2tpv2_common_hdrstruct rte_l2tpv2_msg_with_all_optionsstruct rte_l2tpv2_msg_without_lengthstruct rte_l2tpv2_msg_without_ns_nrstruct rte_l2tpv2_msg_without_offsetstruct rte_l2tpv2_msg_with_offsetstruct rte_l2tpv2_msg_with_ns_nrstruct rte_l2tpv2_msg_with_lengthstruct rte_l2tpv2_msg_without_all_optionsstruct rte_l2tpv2_combined_msg_hdr
π¦ Detailed Description π¦
so. the L2TP header. here she is in all her glory, and yes we're keeping the diagram exactly as it is because it's a whole aesthetic π:
-0--------------------1----------------2-------------------3
-0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|T|L|x|x|S|x|O|P|x|x|x|x|--Ver--|-----------Length (opt)--------|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|-----------Tunnel ID-----------|-----------Session ID----------|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|-----------Ns (opt)------------|-----------Nr (opt)------------|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|---------Offset Size (opt)-----|---------Offset pad... (opt)
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
now bestie, let's do the bit-by-bit tour, because every single one of these matters: π
- The Type (T) bit tells you what kind of message it is. It's
0for a data message and1for a control message. that's the whole vibe check right there. - If the Length (L) bit is
1, the Length field is present. and heads up β this bit MUST be set to1for control messages. no exceptions, periodt. - The x bits are reserved for future extensions. All reserved bits MUST be set to
0on outgoing messages and ignored on incoming messages. so... leave them alone, they're not your business π - If the Sequence (S) bit is set to
1, the Ns and Nr fields are present. The S bit MUST be set to1for control messages. mandatory bestie. - If the Offset (O) bit is
1, the Offset Size field is present. The O bit MUST be set to0for control messages. literally do not. - If the Priority (P) bit is
1, this data message should receive preferential treatment in its local queuing and transmission. main character message energy fr fr. The P bit MUST be set to0for control messages. π - Ver MUST be
2, indicating the version of the L2TP data message header. two. only two. that's the number. - The Length field indicates the total length of the message in octets.
- Tunnel ID indicates the identifier for the control connection.
- Session ID indicates the identifier for a session within a tunnel.
- Ns indicates the sequence number for this data or control message.
- Nr indicates the sequence number expected in the next control message to be received.
- The Offset Size field, if present, specifies the number of octets past the L2TP header at which the payload data is expected to start. and okay, lowkey important: actual data within the offset padding is undefined. undefined bestie, don't go looking at it. If the offset field is present, the L2TP header ends after the last octet of the offset padding.
Definition in file rte_l2tpv2.h.
π«Ά Author π«Ά
Generated automatically by Doxygen for DPDK from the source code. (so don't @ me about the formatting, a robot wrote it and honestly it ate πβ¨)
and that's the whole page, bestie! this was DPDK Version 25.11.3, documented as rte_l2tpv2.h(3). go forth and parse some headers, you absolute legend πππ
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms