Dibbler - a portable DHCPv6  1.0.2RC1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TOpt Class Reference

#include <Opt.h>

+ Inheritance diagram for TOpt:
+ Collaboration diagram for TOpt:

Public Types

enum  EOptionLayout {
  Layout_Addr, Layout_AddrLst, Layout_String, Layout_StringLst,
  Layout_Duid, Layout_Generic
}

Public Member Functions

 TOpt (int optType, TMsg *parent)
virtual ~TOpt ()
void addOption (TOptPtr opt)
int countOption ()
void delAllOptions ()
bool delOption (uint16_t type)
 Deletes all specified options of that type.
virtual bool doDuties ()=0
void firstOption ()
TOptPtr getOption (int type)
TOptPtr getOption ()
int getOptType ()
virtual std::string getPlain ()
virtual size_t getSize ()=0
virtual bool isValid () const
void setParent (TMsg *Parent)
virtual char * storeSelf (char *buf)=0

Static Public Member Functions

static TOptPtr getOption (const TOptList &list, uint16_t opt_type)
static bool parseOptions (TOptContainer &options, const char *buf, size_t len, TMsg *parent, uint16_t placeId=0, std::string place="option")
 Parses options or suboptions, creates appropriate objects and store them in options container.

Static Public Attributes

static const size_t OPTION6_HDR_LEN = 4
 length of a DHCPv6 option header

Protected Member Functions

int getSubOptSize ()
char * storeHeader (char *buf)
char * storeSubOpt (char *buf)

Protected Attributes

int OptType
TMsgParent
TOptContainer SubOptions
bool Valid

Member Enumeration Documentation

Enumerator:
Layout_Addr 
Layout_AddrLst 
Layout_String 
Layout_StringLst 
Layout_Duid 
Layout_Generic 

Constructor & Destructor Documentation

TOpt::TOpt ( int  optType,
TMsg parent 
)
TOpt::~TOpt ( )
virtual

Member Function Documentation

void TOpt::addOption ( TOptPtr  opt)
int TOpt::countOption ( )
void TOpt::delAllOptions ( )
bool TOpt::delOption ( uint16_t  type)

Deletes all specified options of that type.

Parameters
type
Returns
void TOpt::firstOption ( )
TOptPtr TOpt::getOption ( int  type)
TOptPtr TOpt::getOption ( )
TOptPtr TOpt::getOption ( const TOptList list,
uint16_t  opt_type 
)
static
int TOpt::getOptType ( )
virtual size_t TOpt::getSize ( )
pure virtual
int TOpt::getSubOptSize ( )
protected
bool TOpt::isValid ( ) const
virtual
bool TOpt::parseOptions ( TOptContainer options,
const char *  buf,
size_t  len,
TMsg parent,
uint16_t  placeId = 0,
std::string  place = "option" 
)
static

Parses options or suboptions, creates appropriate objects and store them in options container.

Parameters
optionsoptions container (new options will be added here)
bufbuffer to be parsed
lenlength of the buffer
parentpointer to parent message
placeIdspecifies location of the message (option number for option parsing or 0 for message parsing)
placetext representation of the parsed scope
Returns
true if parsing was successful, false if anomalies are detected
void TOpt::setParent ( TMsg Parent)
char * TOpt::storeHeader ( char *  buf)
protected
virtual char* TOpt::storeSelf ( char *  buf)
pure virtual

This method transform the instance of the option class into bytecode ready to be sent to the client or server, conform to the RFC

Parameters
bufThe address where to store the option
Returns
The address where the option ends

Implemented in TOptFQDN, TSrvOptLQClientData, TOptAuthentication, TSrvOptLQ, TOptGeneric, TOptIA_PD, TOptOptionRequest, TOptUserClass, TOptAddr, TOptTA, TOptVendorSpecInfo, TOptIA_NA, TOptIAPrefix, TOptIAAddress, TOptDUID, TOptDomainLst, TOptStatusCode, TOptInteger, TOptReconfigureMsg, TOptString, TOptAddrLst, TOptEmpty, TOptVendorClass, TClntOptElapsed, TOptVendorData, and TOptRtPrefix.

char * TOpt::storeSubOpt ( char *  buf)
protected

Member Data Documentation

const size_t TOpt::OPTION6_HDR_LEN = 4
static

length of a DHCPv6 option header

int TOpt::OptType
protected
TMsg* TOpt::Parent
protected
TOptContainer TOpt::SubOptions
protected
bool TOpt::Valid
protected

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