34 #include <tins/macros.h> 35 #include <tins/endianness.h> 36 #include <tins/small_uint.h> 70 IPSecAH(
const uint8_t* buffer, uint32_t total_sz);
79 return header_.next_header;
87 return header_.length;
94 uint32_t
spi()
const {
95 return Endian::be_to_host(header_.spi);
103 return Endian::be_to_host(header_.seq_number);
120 void next_header(uint8_t new_next_header);
126 void length(uint8_t new_length);
132 void spi(uint32_t new_spi);
138 void seq_number(uint32_t new_seq_number);
151 uint32_t header_size()
const;
166 struct ipsec_header {
167 uint8_t next_header, length;
168 uint32_t spi, seq_number;
171 void write_serialization(uint8_t* buffer, uint32_t total_sz);
173 ipsec_header header_;
203 IPSecESP(
const uint8_t* buffer, uint32_t total_sz);
212 return Endian::be_to_host(header_.spi);
220 return Endian::be_to_host(header_.seq_number);
229 void spi(uint32_t new_spi);
235 void seq_number(uint32_t new_seq_number);
242 uint32_t header_size()
const;
257 struct ipsec_header {
258 uint32_t spi, seq_number;
261 void write_serialization(uint8_t* buffer, uint32_t total_sz);
263 ipsec_header header_;
267 #endif // TINS_IPSEC_H std::vector< uint8_t > byte_array
Definition: pdu.h:45
uint8_t next_header() const
Getter for the Next header field.
Definition: ipsec.h:78
PDUType
Enum which identifies each type of PDU.
Definition: pdu.h:127
const byte_array & icv() const
Getter for the ICV field.
Definition: ipsec.h:110
uint32_t seq_number() const
Getter for the Sequence number field.
Definition: ipsec.h:102
uint32_t seq_number() const
Getter for the Sequence number field.
Definition: ipsec.h:219
uint32_t spi() const
Getter for the Security Parameters Index field.
Definition: ipsec.h:94
The Tins namespace.
Definition: address_range.h:38
IPSecAH * clone() const
Definition: ipsec.h:162
PDUType pdu_type() const
Getter for the PDU's type.
Definition: ipsec.h:248
Represents an IPSec Authentication Header.
Definition: ipsec.h:44
PDUType pdu_type() const
Getter for the PDU's type.
Definition: ipsec.h:157
uint32_t spi() const
Getter for the Security Parameters Index field.
Definition: ipsec.h:211
uint8_t length() const
Getter for the Length field.
Definition: ipsec.h:86
Base class for protocol data units.
Definition: pdu.h:107
Represents an IPSec Authentication Header.
Definition: ipsec.h:180
IPSecESP * clone() const
Definition: ipsec.h:253