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

#include <ClntAddrMgr.h>

+ Inheritance diagram for TClntAddrMgr:
+ Collaboration diagram for TClntAddrMgr:

Public Member Functions

 ~TClntAddrMgr ()
void addIA (SPtr< TAddrIA > ptr)
void addPD (SPtr< TAddrIA > ptr)
bool addPrefix (SPtr< TDUID > srvDuid, SPtr< TIPv6Addr > srvAddr, const std::string &ifacename, int iface, unsigned long IAID, unsigned long T1, unsigned long T2, SPtr< TIPv6Addr > prefix, unsigned long pref, unsigned long valid, int length, bool quiet)
 Adds a prefix.
void addTA (SPtr< TAddrIA > ptr)
int countIA ()
int countPD ()
int countTA ()
bool delIA (long IAID)
bool delPD (long IAID)
bool delTA (unsigned long iaid)
void doDuties ()
 Removes outdated addresses.
void firstIA ()
void firstPD ()
void firstTA ()
SPtr< TAddrIAgetIA ()
SPtr< TAddrIAgetIA (unsigned long IAID)
SPtr< TAddrIAgetPD ()
SPtr< TAddrIAgetPD (unsigned long IAID)
SPtr< TIPv6AddrgetPreferredAddr ()
unsigned long getPrefTimeout ()
unsigned long getT1Timeout ()
unsigned long getT2Timeout ()
SPtr< TAddrIAgetTA ()
SPtr< TAddrIAgetTA (unsigned long iaid)
unsigned long getTentativeTimeout ()
unsigned long getTimeout ()
unsigned long getValidTimeout ()
void processLoadedDB ()
void setIA2Confirm (volatile link_state_notify_t *changedLinks)
bool updatePrefix (SPtr< TDUID > srvDuid, SPtr< TIPv6Addr > srvAddr, const std::string &ifname, int iface, unsigned long IAID, unsigned long T1, unsigned long T2, SPtr< TIPv6Addr > prefix, unsigned long pref, unsigned long valid, int length, bool quiet)
- Public Member Functions inherited from TAddrMgr
 TAddrMgr (const std::string &addrdb, bool loadfile=false)
virtual ~TAddrMgr ()
void addClient (SPtr< TAddrClient > x)
int countClient ()
void dbLoad (const char *xmlFile)
 loads XML database from disk
bool delClient (SPtr< TDUID > duid)
virtual bool delPrefix (SPtr< TDUID > clntDuid, unsigned long IAID, SPtr< TIPv6Addr > prefix, bool quiet)
virtual void dump ()
 stores content of the AddrMgr database to a file
void firstClient ()
SPtr< TAddrClientgetClient ()
SPtr< TAddrClientgetClient (SPtr< TDUID > duid)
 returns client with a specified DUID
SPtr< TAddrClientgetClient (uint32_t SPI)
 returns client with specified SPI index
SPtr< TAddrClientgetClient (SPtr< TIPv6Addr > leasedAddr)
 returns client that leased specified address
uint64_t getNextReplayDetectionValue ()
bool isDone ()
 returns if shutdown is complete
SPtr< TAddrAddrparseAddrAddr (const char *xmlFile, char *buf, bool pd)
 parses single address
SPtr< TAddrClientparseAddrClient (const char *xmlFile, FILE *f)
 parses XML section that defines single client
SPtr< TAddrIAparseAddrIA (const char *xmlFile, FILE *f, int t1, int t2, int iaid, const std::string &ifname, int ifindex, SPtr< TIPv6Addr > unicast=SPtr< TIPv6Addr >())
 parses part XML section that represents single IA
SPtr< TAddrIAparseAddrPD (const char *xmlFile, FILE *f, int t1, int t2, int iaid, const std::string &ifname, int ifindex, SPtr< TIPv6Addr > unicast=SPtr< TIPv6Addr >())
 parses part XML section that represents single PD
SPtr< TAddrPrefixparseAddrPrefix (const char *xmlFile, char *buf, bool pd)
SPtr< TAddrIAparseAddrTA (const char *xmlFile, FILE *f)
bool prefixIsFree (SPtr< TIPv6Addr > prefix)
bool updateInterfacesInfo (const NameToIndexMapping &nameToIndex, const IndexToNameMapping &indexToName)
 tries to update interface name/index information (if required)
bool updateInterfacesInfoIA (SPtr< TAddrIA > ia, const NameToIndexMapping &nameToIndex, const IndexToNameMapping &indexToName)
virtual bool verifyAddr (SPtr< TIPv6Addr > addr)
virtual bool verifyPrefix (SPtr< TIPv6Addr > addr)
bool xmlLoadBuiltIn (const char *xmlFile)
 loads AddrMgr database from a file

Static Public Member Functions

static TClntAddrMgrinstance ()
static void instanceCreate (SPtr< TDUID > clientDUID, bool useConfirm, const std::string &xmlFile, bool loadDB)

Protected Member Functions

void print (std::ostream &x)
- Protected Member Functions inherited from TAddrMgr
bool addPrefix (SPtr< TAddrClient > client, SPtr< TDUID > duid, SPtr< TIPv6Addr > clntAddr, const std::string &ifname, int ifindex, unsigned long IAID, unsigned long T1, unsigned long T2, SPtr< TIPv6Addr > prefix, unsigned long pref, unsigned long valid, int length, bool quiet)
bool updatePrefix (SPtr< TAddrClient > client, SPtr< TDUID > duid, SPtr< TIPv6Addr > clntAddr, int iface, unsigned long IAID, unsigned long T1, unsigned long T2, SPtr< TIPv6Addr > prefix, unsigned long pref, unsigned long valid, int length, bool quiet)

Private Member Functions

 TClntAddrMgr (SPtr< TDUID > clientDuid, bool useConfirm, const std::string &xmlFile, bool loadDB)
 Client Address Manager constructor.

Private Attributes

SPtr< TAddrClientClient

Static Private Attributes

static TClntAddrMgrInstance = 0

Additional Inherited Members

- Public Types inherited from TAddrMgr
typedef std::map< int,
std::string > 
IndexToNameMapping
 holds network interface ifindex to name mapping
typedef std::map< std::string,
int > 
NameToIndexMapping
 holds network interface name to ifindex mapping
- Protected Attributes inherited from TAddrMgr
TContainer< SPtr< TAddrClient > > ClntsLst
bool DeleteEmptyClient
 should the client without any IA, TA or PDs be deleted? (srv = yes, client = no)
bool IsDone
uint64_t ReplayDetectionValue_
std::string XmlFile

Constructor & Destructor Documentation

TClntAddrMgr::TClntAddrMgr ( SPtr< TDUID clientDUID,
bool  useConfirm,
const std::string &  xmlFile,
bool  loadDB 
)
private

Client Address Manager constructor.

constructor used for creation of client version of address manager

Parameters
clientDUIDpointer to client DUID
useConfirmshould confirm be used or not?
xmlFileXML filename (AddrMgr dumps will be stored there)
loadDBshould existing dump be loaded?
TClntAddrMgr::~TClntAddrMgr ( )

Member Function Documentation

void TClntAddrMgr::addIA ( SPtr< TAddrIA ptr)
void TClntAddrMgr::addPD ( SPtr< TAddrIA ptr)
bool TClntAddrMgr::addPrefix ( SPtr< TDUID srvDuid,
SPtr< TIPv6Addr srvAddr,
const std::string &  ifacename,
int  iface,
unsigned long  IAID,
unsigned long  T1,
unsigned long  T2,
SPtr< TIPv6Addr prefix,
unsigned long  pref,
unsigned long  valid,
int  length,
bool  quiet 
)
virtual

Adds a prefix.

Parameters
srvDuidServer DUID
srvAddrServer address.
ifaceinterface index
IAIDIAID
T1T1 timer
T2T2 timer
prefixprefix
prefprefered lifetime
validvalid lifetime
lengthprefix length
quietquiet mode (true=be quiet)
Returns
true if successful, false otherwise

Reimplemented from TAddrMgr.

void TClntAddrMgr::addTA ( SPtr< TAddrIA ptr)
int TClntAddrMgr::countIA ( )
int TClntAddrMgr::countPD ( )
int TClntAddrMgr::countTA ( )
bool TClntAddrMgr::delIA ( long  IAID)
bool TClntAddrMgr::delPD ( long  IAID)
bool TClntAddrMgr::delTA ( unsigned long  iaid)
void TClntAddrMgr::doDuties ( )

Removes outdated addresses.

removes addresses that already expired. May also perform other duties. This method should be called periodically.

void TClntAddrMgr::firstIA ( )
void TClntAddrMgr::firstPD ( )
void TClntAddrMgr::firstTA ( )
SPtr< TAddrIA > TClntAddrMgr::getIA ( )
SPtr< TAddrIA > TClntAddrMgr::getIA ( unsigned long  IAID)
SPtr< TAddrIA > TClntAddrMgr::getPD ( )
SPtr< TAddrIA > TClntAddrMgr::getPD ( unsigned long  IAID)
SPtr< TIPv6Addr > TClntAddrMgr::getPreferredAddr ( )
unsigned long TClntAddrMgr::getPrefTimeout ( )

Reimplemented from TAddrMgr.

unsigned long TClntAddrMgr::getT1Timeout ( )

Reimplemented from TAddrMgr.

unsigned long TClntAddrMgr::getT2Timeout ( )

Reimplemented from TAddrMgr.

SPtr< TAddrIA > TClntAddrMgr::getTA ( )
SPtr< TAddrIA > TClntAddrMgr::getTA ( unsigned long  iaid)
unsigned long TClntAddrMgr::getTentativeTimeout ( )
unsigned long TClntAddrMgr::getTimeout ( )
unsigned long TClntAddrMgr::getValidTimeout ( )

Reimplemented from TAddrMgr.

TClntAddrMgr & TClntAddrMgr::instance ( )
static
void TClntAddrMgr::instanceCreate ( SPtr< TDUID clientDUID,
bool  useConfirm,
const std::string &  xmlFile,
bool  loadDB 
)
static
void TClntAddrMgr::print ( std::ostream &  x)
protectedvirtual

Implements TAddrMgr.

void TClntAddrMgr::processLoadedDB ( )
void TClntAddrMgr::setIA2Confirm ( volatile link_state_notify_t changedLinks)

sets specified interface to CONFIRMME state when network switch off signal received, the funtion will be invoked to set valid IA to CONFIRMME state.

Parameters
changedLinksstructure containing interface indexes to be confirmed
bool TClntAddrMgr::updatePrefix ( SPtr< TDUID srvDuid,
SPtr< TIPv6Addr srvAddr,
const std::string &  ifname,
int  iface,
unsigned long  IAID,
unsigned long  T1,
unsigned long  T2,
SPtr< TIPv6Addr prefix,
unsigned long  pref,
unsigned long  valid,
int  length,
bool  quiet 
)
virtual

Reimplemented from TAddrMgr.

Member Data Documentation

SPtr<TAddrClient> TClntAddrMgr::Client
private
TClntAddrMgr * TClntAddrMgr::Instance = 0
staticprivate

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