libtins  4.0
Public Types | Public Member Functions | List of all members
Tins::ICMPExtension Class Reference

Class that represents an ICMP extension object. More...

#include <icmp_extension.h>

Public Types

typedef std::vector< uint8_t > payload_type
 
typedef std::vector< uint8_t > serialization_type
 

Public Member Functions

 ICMPExtension ()
 Default constructor.
 
 ICMPExtension (uint8_t ext_class, uint8_t ext_type)
 Constructor taking class and type. More...
 
 ICMPExtension (const uint8_t *buffer, uint32_t total_sz)
 Constructs an ICMP extension from a buffer. More...
 
void extension_class (uint8_t value)
 Setter for the extension class field. More...
 
void extension_type (uint8_t value)
 Setter for the extension sub-type field. More...
 
void payload (const payload_type &value)
 Setter for the payload field. More...
 
uint8_t extension_class () const
 Getter for the extension class field. More...
 
uint8_t extension_type () const
 Getter for the extension sub-type field. More...
 
const payload_typepayload () const
 Getter for the extension payload field. More...
 
uint32_t size () const
 Gets the size of this ICMP extension. More...
 
void serialize (uint8_t *buffer, uint32_t buffer_size) const
 Serializes this extension into a buffer. More...
 
serialization_type serialize () const
 Serializes this extension object. More...
 

Detailed Description

Class that represents an ICMP extension object.

Member Typedef Documentation

typedef std::vector<uint8_t> Tins::ICMPExtension::payload_type

The type used to store the payload

typedef std::vector<uint8_t> Tins::ICMPExtension::serialization_type

The type that will be returned when serializing an extensions structure object

Constructor & Destructor Documentation

Tins::ICMPExtension::ICMPExtension ( uint8_t  ext_class,
uint8_t  ext_type 
)

Constructor taking class and type.

Parameters
ext_classThe extension class
ext_typeThe extension sub-type
Tins::ICMPExtension::ICMPExtension ( const uint8_t *  buffer,
uint32_t  total_sz 
)

Constructs an ICMP extension from a buffer.

Parameters
bufferThe input buffer
total_szThe input buffer size

Member Function Documentation

void Tins::ICMPExtension::extension_class ( uint8_t  value)

Setter for the extension class field.

Parameters
valueThe new extension class field value
uint8_t Tins::ICMPExtension::extension_class ( ) const
inline

Getter for the extension class field.

Returns
The extension class field value
void Tins::ICMPExtension::extension_type ( uint8_t  value)

Setter for the extension sub-type field.

Parameters
valueThe new extension sub-type field value
uint8_t Tins::ICMPExtension::extension_type ( ) const
inline

Getter for the extension sub-type field.

Returns
The extension sub-type field value
void Tins::ICMPExtension::payload ( const payload_type value)

Setter for the payload field.

Parameters
valueThe new payload field value
const payload_type& Tins::ICMPExtension::payload ( ) const
inline

Getter for the extension payload field.

Returns
The extension payload field value
void Tins::ICMPExtension::serialize ( uint8_t *  buffer,
uint32_t  buffer_size 
) const

Serializes this extension into a buffer.

Parameters
bufferThe output buffer in which to store the serialization
buffer_sizeThe size of the output buffer
ICMPExtension::serialization_type Tins::ICMPExtension::serialize ( ) const

Serializes this extension object.

Returns
The serialized extension
uint32_t Tins::ICMPExtension::size ( ) const

Gets the size of this ICMP extension.

This returns the basic header size + the payload size

Returns
The size of this extension

The documentation for this class was generated from the following files: