30#ifndef TINS_ICMP_EXTENSION_H
31#define TINS_ICMP_EXTENSION_H
35#include <tins/macros.h>
36#include <tins/small_uint.h>
37#include <tins/endianness.h>
85 void extension_class(
uint8_t value);
92 void extension_type(
uint8_t value);
107 return extension_class_;
116 return extension_type_;
150 serialization_type serialize()
const;
152 static const uint32_t BASE_HEADER_SIZE;
154 payload_type payload_;
155 uint8_t extension_class_, extension_type_;
215 uint16_t value = Endian::be_to_host(version_and_reserved_);
216 return (value >> 12) & 0xf;
225 uint16_t value = Endian::be_to_host(version_and_reserved_);
226 return value & 0xfff;
235 return Endian::be_to_host(checksum_);
284 serialization_type serialize();
298 static const uint32_t BASE_HEADER_SIZE;
302 extensions_type extensions_;
Represents a range of addresses.
Definition address_range.h:167
Class that represents an ICMP extension object.
Definition icmp_extension.h:46
uint8_t extension_class() const
Getter for the extension class field.
Definition icmp_extension.h:106
std::vector< uint8_t > serialization_type
Definition icmp_extension.h:57
const payload_type & payload() const
Getter for the extension payload field.
Definition icmp_extension.h:124
std::vector< uint8_t > payload_type
Definition icmp_extension.h:51
uint8_t extension_type() const
Getter for the extension sub-type field.
Definition icmp_extension.h:115
Class that represents an ICMP extensions structure.
Definition icmp_extension.h:161
const extensions_type & extensions() const
Getter for the extensions stored by this structure.
Definition icmp_extension.h:243
small_uint< 12 > reserved() const
Getter for the reserved field.
Definition icmp_extension.h:224
static const uint32_t MINIMUM_ICMP_PAYLOAD
Definition icmp_extension.h:167
std::vector< ICMPExtension > extensions_type
Definition icmp_extension.h:178
uint16_t checksum() const
Getter for the checksum field.
Definition icmp_extension.h:234
small_uint< 4 > version() const
Getter for the version field.
Definition icmp_extension.h:214
ICMPExtension::serialization_type serialization_type
Definition icmp_extension.h:173
Represents an MPLS PDU.
Definition mpls.h:46
The Tins namespace.
Definition address_range.h:38