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

#include <SrvOptIA_NA.h>

+ Inheritance diagram for TSrvOptIA_NA:
+ Collaboration diagram for TSrvOptIA_NA:

Public Member Functions

 TSrvOptIA_NA (SPtr< TSrvOptIA_NA > queryOpt, SPtr< TIPv6Addr > clntAddr, SPtr< TDUID > duid, int iface, unsigned long &addrCount, int msgType, TMsg *parent)
 TSrvOptIA_NA (char *buf, int bufsize, TMsg *parent)
 Create IA_NA option based on receive buffer.
 TSrvOptIA_NA (long IAID, long T1, long T2, TMsg *parent)
 Creates an empty IA_NA (used for DECLINE and CONFIRM).
 TSrvOptIA_NA (long IAID, long T1, long T2, int Code, const std::string &Msg, TMsg *parent)
 Creates an IA_NA with option status code.
 TSrvOptIA_NA (SPtr< TSrvOptIA_NA > queryOpt, SPtr< TSrvMsg > queryMsg, TMsg *parent)
void decline (SPtr< TSrvOptIA_NA > queryOpt, unsigned long &addrCount)
bool doDuties ()
void rebind (SPtr< TSrvOptIA_NA > queryOpt, unsigned long &addrCount)
void release (SPtr< TSrvOptIA_NA > queryOpt, unsigned long &addrCount)
void releaseAllAddrs (bool quiet)
bool renew (SPtr< TSrvOptIA_NA > queryOpt, bool complainIfMissing)
void request (SPtr< TSrvOptIA_NA > queryOpt, unsigned long &addrCount)
void solicit (SPtr< TSrvOptIA_NA > queryOpt, unsigned long &addrCount)
- Public Member Functions inherited from TOptIA_NA
 TOptIA_NA (long IAID, long t1, long t2, TMsg *parent)
 TOptIA_NA (char *&buf, int &bufsize, TMsg *parent)
int countAddrs ()
unsigned long getMaxValid ()
size_t getSize ()
bool isValid () const
char * storeSelf (char *buf)
- Public Member Functions inherited from TOptIA
 TOptIA (uint16_t type, uint32_t iaid, uint32_t t1, uint32_t t2, TMsg *parent)
 TOptIA (uint16_t type, TMsg *parent)
unsigned long getIAID () const
int getStatusCode ()
unsigned long getT1 () const
unsigned long getT2 () const
void setIAID (uint32_t iaid)
void setT1 (unsigned long t1)
void setT2 (unsigned long t2)
- 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 assignAddr (SPtr< TIPv6Addr > addr, uint32_t pref, uint32_t valid, bool quiet)
bool assignCachedAddr (bool quiet)
 Tries to get cached address for this client.
bool assignFixedLease (SPtr< TSrvOptIA_NA > req, bool quiet)
 Tries to assign fixed (reserved) lease.
bool assignRandomAddr (SPtr< TSrvMsg > queryMsg, bool quiet)
bool assignRequestedAddr (SPtr< TSrvMsg > queryMsg, SPtr< TSrvOptIA_NA > queryOpt, bool quiet)
bool assignSequentialAddr (SPtr< TSrvMsg > clientMsg, bool quiet)
SPtr< TIPv6AddrgetAddressHint (SPtr< TSrvMsg > clientReq, SPtr< TIPv6Addr > hint)
 Checks if address is sane and assignable.
SPtr< TIPv6AddrgetExceptionAddr ()
 tries to find address reserved for this particular client
SPtr< TIPv6AddrgetFreeAddr (SPtr< TIPv6Addr > hint)

Private Attributes

SPtr< TIPv6AddrClntAddr
SPtr< TDUIDClntDuid
int Iface

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
unsigned long IAID_
unsigned long T1_
unsigned long T2_
bool Valid_

Constructor & Destructor Documentation

TSrvOptIA_NA::TSrvOptIA_NA ( SPtr< TSrvOptIA_NA queryOpt,
SPtr< TIPv6Addr clntAddr,
SPtr< TDUID duid,
int  iface,
unsigned long &  addrCount,
int  msgType,
TMsg parent 
)
TSrvOptIA_NA::TSrvOptIA_NA ( char *  buf,
int  bufsize,
TMsg parent 
)

Create IA_NA option based on receive buffer.

Parameters
bufpointer to beginning of a buffer containing IA_NA (without type and option fields)
bufsizelength of the option (value or already parsed option-len)
parentPointer to parent message.
Todo:
: implement unpack()
TSrvOptIA_NA::TSrvOptIA_NA ( long  IAID,
long  T1,
long  T2,
TMsg parent 
)

Creates an empty IA_NA (used for DECLINE and CONFIRM).

Parameters
IAIDiaid value to be used.
T1T1 timer value to be used.
T2T2 timer value to be used.
parentPointer to parent message.
TSrvOptIA_NA::TSrvOptIA_NA ( long  iaid,
long  t1,
long  t2,
int  code,
const std::string &  text,
TMsg parent 
)

Creates an IA_NA with option status code.

Parameters
iaidiaid value to be used.
t1T1 timer value to be used.
t2T2 timer value to be used.
codeStatus Code (to be set in status code option)
texttext to be used in status code option as description
parentPointer to parent message.
TSrvOptIA_NA::TSrvOptIA_NA ( SPtr< TSrvOptIA_NA queryOpt,
SPtr< TSrvMsg queryMsg,
TMsg parent 
)

This constructor is used to create IA option as an aswer to a SOLICIT, SOLICIT (RAPID_COMMIT) or REQUEST.

Parameters
queryOpt
queryMsg
parent

Member Function Documentation

bool TSrvOptIA_NA::assignAddr ( SPtr< TIPv6Addr addr,
uint32_t  pref,
uint32_t  valid,
bool  quiet 
)
private
Todo:
: remove get addr-params
bool TSrvOptIA_NA::assignCachedAddr ( bool  quiet)
private

Tries to get cached address for this client.

This method may delete entry from cache if it finds out that entry is used by someone else or is no longer valid (i.e. updated config has different pool definitions). That is step 6 of lease assignment policy.

Parameters
quietshould the assignment messages be logged (it shouldn't for solicit)
Returns
true, if address was assigned
bool TSrvOptIA_NA::assignFixedLease ( SPtr< TSrvOptIA_NA req,
bool  quiet 
)
private

Tries to assign fixed (reserved) lease.

Parameters
reqclient's IA_NA (used for trying to assign as close T1,T2,pref,valid values as possible)
Returns
true, if assignment was successful, false if there are no fixed-leases reserved
bool TSrvOptIA_NA::assignRandomAddr ( SPtr< TSrvMsg queryMsg,
bool  quiet 
)
private
bool TSrvOptIA_NA::assignRequestedAddr ( SPtr< TSrvMsg queryMsg,
SPtr< TSrvOptIA_NA queryOpt,
bool  quiet 
)
private
bool TSrvOptIA_NA::assignSequentialAddr ( SPtr< TSrvMsg clientMsg,
bool  quiet 
)
private
void TSrvOptIA_NA::decline ( SPtr< TSrvOptIA_NA queryOpt,
unsigned long &  addrCount 
)
bool TSrvOptIA_NA::doDuties ( )
virtual

Implements TOpt.

SPtr< TIPv6Addr > TSrvOptIA_NA::getAddressHint ( SPtr< TSrvMsg clientReq,
SPtr< TIPv6Addr hint 
)
private

Checks if address is sane and assignable.

Verifies that requested address is sane (i.e. no anyaddr, not link-local, not multicast etc.) and that it is within supported pool

Parameters
clientReq
hint
Returns
true if it is sane and assignable
SPtr< TIPv6Addr > TSrvOptIA_NA::getExceptionAddr ( )
private

tries to find address reserved for this particular client

Returns
fixed address (if found)
SPtr<TIPv6Addr> TSrvOptIA_NA::getFreeAddr ( SPtr< TIPv6Addr hint)
private
void TSrvOptIA_NA::rebind ( SPtr< TSrvOptIA_NA queryOpt,
unsigned long &  addrCount 
)
Todo:
: 18.2.4 par. 3 (check if addrs are appropriate for this link)
void TSrvOptIA_NA::release ( SPtr< TSrvOptIA_NA queryOpt,
unsigned long &  addrCount 
)
void TSrvOptIA_NA::releaseAllAddrs ( bool  quiet)
bool TSrvOptIA_NA::renew ( SPtr< TSrvOptIA_NA queryOpt,
bool  complainIfMissing 
)

generates OPTION_IA_NA based on OPTION_IA_NA received in RENEW message

Parameters
queryOptIA_NA option received from client in the RENEW message
complainIfMissingspecifies if potential warnings should be printed or not
Returns
true - if binding was renewed, false - if not found or invalid
void TSrvOptIA_NA::request ( SPtr< TSrvOptIA_NA queryOpt,
unsigned long &  addrCount 
)
void TSrvOptIA_NA::solicit ( SPtr< TSrvOptIA_NA queryOpt,
unsigned long &  addrCount 
)

Member Data Documentation

SPtr<TIPv6Addr> TSrvOptIA_NA::ClntAddr
private
SPtr<TDUID> TSrvOptIA_NA::ClntDuid
private
int TSrvOptIA_NA::Iface
private

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