X-TraceC++Library
Public Member Functions
xtr::OptionAny Class Reference

This class can represent any option, and is used when we don't have a specific class for an option. More...

#include <XtrOption.h>

Inheritance diagram for xtr::OptionAny:
xtr::Option

Public Member Functions

 OptionAny ()
 OptionAny (const u_int8_t *b, size_t *size)
 OptionAny (u_int8_t type, u_int8_t length, const u_int8_t *p)
xtr_result initFromBytes (const u_int8_t *b, size_t *size)
OptionAnyclone () const
 Returns a pointer to a newly allocated Option, of the same subtype as the cloned object.
u_int8_t getType () const
 Returns the type of this option.
u_int8_t getLength () const
 Returns the length of the payload for this option.
u_int8_t getSize () const
 Returns the size of the options when packed.
xtr_result pack (u_int8_t *dest, size_t *size) const
 Writes the binary packed form of this option to the destination.
xtr_result setType (u_int8_t _type)
xtr_result setLength (u_int8_t _length)
u_int8_t * getPayload ()

Detailed Description

This class can represent any option, and is used when we don't have a specific class for an option.

A Nop option is created by the default constructor


Constructor & Destructor Documentation

xtr::OptionAny::OptionAny ( ) [inline]

Referenced by clone().

xtr::OptionAny::OptionAny ( const u_int8_t *  b,
size_t *  size 
)
xtr::OptionAny::OptionAny ( u_int8_t  type,
u_int8_t  length,
const u_int8_t *  p 
)

Member Function Documentation

OptionAny* xtr::OptionAny::clone ( ) const [inline, virtual]

Returns a pointer to a newly allocated Option, of the same subtype as the cloned object.

Implements xtr::Option.

References OptionAny().

u_int8_t xtr::OptionAny::getLength ( ) const [inline, virtual]

Returns the length of the payload for this option.

Implements xtr::Option.

Referenced by getSize().

u_int8_t* xtr::OptionAny::getPayload ( ) [inline]
u_int8_t xtr::OptionAny::getSize ( ) const [inline, virtual]

Returns the size of the options when packed.

Implements xtr::Option.

References getLength(), getType(), and xtr::Option::NOP.

u_int8_t xtr::OptionAny::getType ( ) const [inline, virtual]

Returns the type of this option.

Implements xtr::Option.

Referenced by getSize().

xtr_result xtr::OptionAny::initFromBytes ( const u_int8_t *  b,
size_t *  size 
)
xtr_result xtr::OptionAny::pack ( u_int8_t *  dest,
size_t *  size 
) const [virtual]

Writes the binary packed form of this option to the destination.

Parameters:
destbuffer to write option to
sizeINPUT: maximum safe size to write to dest
OUTPUT: actual number of bytes written
Returns:
XTR_SUCCESS if enough space, XTR_FAIL otherwise

Implements xtr::Option.

xtr_result xtr::OptionAny::setLength ( u_int8_t  _length)
xtr_result xtr::OptionAny::setType ( u_int8_t  _type)

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