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

#include <SrvOptIA_PD.h>

+ Inheritance diagram for TSrvOptIA_PD:
+ Collaboration diagram for TSrvOptIA_PD:

Public Member Functions

 TSrvOptIA_PD (SPtr< TSrvMsg > clientMsg, SPtr< TSrvOptIA_PD > queryOpt, TMsg *parent)
 constructor used in replies to SOLICIT, REQUEST, RENEW, REBIND, DECLINE and RELEASE
 TSrvOptIA_PD (char *buf, int bufsize, TMsg *parent)
 TSrvOptIA_PD (uint32_t IAID, uint32_t T1, uint32_t T2, TMsg *parent)
 TSrvOptIA_PD (uint32_t IAID, uint32_t T1, uint32_t T2, int Code, const std::string &Msg, TMsg *parent)
void confirm (SPtr< TSrvOptIA_PD > queryOpt, SPtr< TSrvCfgIface > iface)
void decline (SPtr< TSrvOptIA_PD > queryOpt, SPtr< TSrvCfgIface > iface)
bool doDuties ()
void rebind (SPtr< TSrvOptIA_PD > queryOpt, SPtr< TSrvCfgIface > iface)
void release (SPtr< TSrvOptIA_PD > queryOpt, SPtr< TSrvCfgIface > iface)
void releaseAllPrefixes (bool quiet)
void renew (SPtr< TSrvOptIA_PD > queryOpt, SPtr< TSrvCfgIface > iface)
void solicitRequest (SPtr< TSrvMsg > clientMsg, SPtr< TSrvOptIA_PD > queryOpt, SPtr< TSrvCfgIface > ptr, bool fake)
- Public Member Functions inherited from TOptIA_PD
 TOptIA_PD (uint32_t iaid, uint32_t t1, uint32_t t2, TMsg *parent)
 TOptIA_PD (char *&buf, int &bufsize, TMsg *parent)
int countPrefixes ()
uint32_t getIAID () const
size_t getSize ()
int getStatusCode ()
uint32_t getT1 () const
uint32_t getT2 () const
bool isValid () const
void setIAID (uint32_t iaid)
void setT1 (uint32_t t1)
void setT2 (uint32_t t2)
char * storeSelf (char *buf)
- Public Member Functions inherited from TOpt
 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.
void firstOption ()
TOptPtr getOption (int type)
TOptPtr getOption ()
int getOptType ()
virtual std::string getPlain ()
void setParent (TMsg *Parent)

Private Member Functions

bool assignFixedLease (SPtr< TSrvOptIA_PD > request)
 tries to find a fixed lease for a client
bool assignPrefix (SPtr< TSrvMsg > clientMsg, SPtr< TIPv6Addr > hint, bool fake)
bool existingLease ()
 checks if there are existing leases (and assigns them)
TContainer< SPtr< TIPv6Addr > > getFreePrefixes (SPtr< TSrvMsg > clientMsg, SPtr< TIPv6Addr > hint)
 returns list of free prefixes for this client

Private Attributes

SPtr< TIPv6AddrClntAddr
SPtr< TDUIDClntDuid
int Iface
unsigned long PDLength
uint32_t Prefered
uint32_t Valid

Additional Inherited Members

- Public Types inherited from TOpt
enum  EOptionLayout {
  Layout_Addr, Layout_AddrLst, Layout_String, Layout_StringLst,
  Layout_Duid, Layout_Generic
}
- Static Public Member Functions inherited from TOpt
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 inherited from TOpt
static const size_t OPTION6_HDR_LEN = 4
 length of a DHCPv6 option header
- Protected Member Functions inherited from TOpt
int getSubOptSize ()
char * storeHeader (char *buf)
char * storeSubOpt (char *buf)
- Protected Attributes inherited from TOptIA_PD
uint32_t IAID_
uint32_t T1_
uint32_t T2_
bool Valid_

Constructor & Destructor Documentation

TSrvOptIA_PD::TSrvOptIA_PD ( SPtr< TSrvMsg clientMsg,
SPtr< TSrvOptIA_PD queryOpt,
TMsg parent 
)

constructor used in replies to SOLICIT, REQUEST, RENEW, REBIND, DECLINE and RELEASE

Parameters
clientMsgclient message that server responds to
queryOptIA_PD option from client message
parentmessage that we are currently building
TSrvOptIA_PD::TSrvOptIA_PD ( char *  buf,
int  bufsize,
TMsg parent 
)
Todo:
: implement unpack
TSrvOptIA_PD::TSrvOptIA_PD ( uint32_t  IAID,
uint32_t  T1,
uint32_t  T2,
TMsg parent 
)
TSrvOptIA_PD::TSrvOptIA_PD ( uint32_t  IAID,
uint32_t  T1,
uint32_t  T2,
int  Code,
const std::string &  Msg,
TMsg parent 
)

Member Function Documentation

bool TSrvOptIA_PD::assignFixedLease ( SPtr< TSrvOptIA_PD req)
private

tries to find a fixed lease for a client

Parameters
reqIA_PD sent by client
Returns
true, if fixed lease is assigned
bool TSrvOptIA_PD::assignPrefix ( SPtr< TSrvMsg clientMsg,
SPtr< TIPv6Addr hint,
bool  fake 
)
private
void TSrvOptIA_PD::confirm ( SPtr< TSrvOptIA_PD queryOpt,
SPtr< TSrvCfgIface iface 
)
Todo:
: implement PD support in CONFIRM message
void TSrvOptIA_PD::decline ( SPtr< TSrvOptIA_PD queryOpt,
SPtr< TSrvCfgIface iface 
)
bool TSrvOptIA_PD::doDuties ( )
virtual

Implements TOpt.

bool TSrvOptIA_PD::existingLease ( )
private

checks if there are existing leases (and assigns them)

Returns
true, if existing lease(s) are found
TContainer< SPtr< TIPv6Addr > > TSrvOptIA_PD::getFreePrefixes ( SPtr< TSrvMsg clientMsg,
SPtr< TIPv6Addr cli_hint 
)
private

returns list of free prefixes for this client

return free prefixes for a client. There are several ways that method may work: 1 - client didn't provide any hints: => one prefix from each pool will be granted 2 - client has provided hint and that is valid (supported and unused): => requested prefix will be granted 3 - client has provided hint, which belongs to supported pool, but this prefix is used: => other prefix from that pool will be asigned 4 - client has provided hint, but it is invalid (not beloninging to a supported pool, multicast or link-local): => see 1

Parameters
clientMsgmessage received from a client
cli_hinthint provided by client (or ::)
Returns
- list of prefixes
void TSrvOptIA_PD::rebind ( SPtr< TSrvOptIA_PD queryOpt,
SPtr< TSrvCfgIface iface 
)
Todo:
: implement PD support in REBIND message
void TSrvOptIA_PD::release ( SPtr< TSrvOptIA_PD queryOpt,
SPtr< TSrvCfgIface iface 
)
Todo:
: implement PD support in RELEASE message
void TSrvOptIA_PD::releaseAllPrefixes ( bool  quiet)
void TSrvOptIA_PD::renew ( SPtr< TSrvOptIA_PD queryOpt,
SPtr< TSrvCfgIface iface 
)

generate OPTION_PD based on OPTION_PD received in RENEW message

Parameters
queryOptIA_PD option received from client in the RENEW message
ifaceinterface on which client communicated
void TSrvOptIA_PD::solicitRequest ( SPtr< TSrvMsg clientMsg,
SPtr< TSrvOptIA_PD queryOpt,
SPtr< TSrvCfgIface ptrIface,
bool  fake 
)

this method is used to prepare response to IA_PD received in SOLICIT and REQUEST messages (i.e. it tries to assign prefix as requested by client)

Parameters
clientMsgoriginal message received from a client
queryOptspecific option in clientMsg that we are answering now
ptrIfacepointer to SrvCfgIface
fakeis this fake request? (fake = solicit, so nothing is actually assigned)

Member Data Documentation

SPtr<TIPv6Addr> TSrvOptIA_PD::ClntAddr
private
SPtr<TDUID> TSrvOptIA_PD::ClntDuid
private
int TSrvOptIA_PD::Iface
private
Todo:
: replace with Parent->getIface();
unsigned long TSrvOptIA_PD::PDLength
private
uint32_t TSrvOptIA_PD::Prefered
private
uint32_t TSrvOptIA_PD::Valid
private

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