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

#include <SrvTransMgr.h>

+ Collaboration diagram for TSrvTransMgr:

Public Member Functions

int checkReconfigures ()
 Checks loaded database and sends RECONFIGURE to some clients.
bool ClientInPool1 (SPtr< TIPv6Addr > addr, int iface, bool PD)
 Checks if client's address or prefix is in current pool.
void doDuties ()
void dump ()
char * getCtrlAddr ()
int getCtrlIface ()
long getTimeout ()
bool isDone ()
void notifyExpireInfo (TNotifyScriptParams &params, const TSrvAddrMgr::TExpiredInfo &exp, TIAType type)
 Generates parameters for notify script based on expired lease information.
bool openSocket (SPtr< TSrvCfgIface > confIface, int port)
void relayMsg (SPtr< TSrvMsg > msg)
void removeExpired (std::vector< TSrvAddrMgr::TExpiredInfo > &addrLst, std::vector< TSrvAddrMgr::TExpiredInfo > &tempAddrLst, std::vector< TSrvAddrMgr::TExpiredInfo > &prefixLst)
 Removes expired leases and calls notify script.
bool sanitizeAddrDB ()
 checks/updates loaded database (regarding interface names/indexes)
virtual void sendPacket (SPtr< TSrvMsg > msg)
 sends specified packet
bool sendReconfigure (SPtr< TIPv6Addr > addr, int iface, int msgType, SPtr< TDUID > ptrDUID)
void shutdown ()
bool unicastCheck (SPtr< TSrvMsg > msg)
 Checks whether message was sent to unicast when it was forbidden.

Static Public Member Functions

static TSrvTransMgrinstance ()
static void instanceCreate (const std::string &config, int port)

Protected Member Functions

 TSrvTransMgr (std::string xmlFile, int port)
virtual ~TSrvTransMgr ()

Protected Attributes

char ctrlAddr [48]
int ctrlIface
bool IsDone
int port_
std::string XmlFile

Static Protected Attributes

static TSrvTransMgrInstance = 0

Friends

std::ostream & operator<< (std::ostream &strum, TSrvTransMgr &x)

Constructor & Destructor Documentation

TSrvTransMgr::TSrvTransMgr ( std::string  xmlFile,
int  port 
)
protected
TSrvTransMgr::~TSrvTransMgr ( )
protectedvirtual

Member Function Documentation

int TSrvTransMgr::checkReconfigures ( )

Checks loaded database and sends RECONFIGURE to some clients.

Checks loaded database against current configuration and finds addresses that are outdated (do not match current configuration). RECONFIGURE message is sent to clients that currently hold those addresses.

Returns
number of clients that were reconfigured
Todo:
clean up this shit
bool TSrvTransMgr::ClientInPool1 ( SPtr< TIPv6Addr addr,
int  iface,
bool  PD 
)

Checks if client's address or prefix is in current pool.

This method is used after configuration and old database is loaded. We need to check if client's leases are still within current configuration.

Parameters
addraddress
ifaceinterface
PDis this PD?
Returns
void TSrvTransMgr::doDuties ( )
void TSrvTransMgr::dump ( )
char * TSrvTransMgr::getCtrlAddr ( )
int TSrvTransMgr::getCtrlIface ( )
long TSrvTransMgr::getTimeout ( )

Computes number of seconds when next event is expected or a job is supposted to be proceeded.

Returns
Number of seconds when something should happend
TSrvTransMgr & TSrvTransMgr::instance ( )
static
void TSrvTransMgr::instanceCreate ( const std::string &  config,
int  port 
)
static
bool TSrvTransMgr::isDone ( )
void TSrvTransMgr::notifyExpireInfo ( TNotifyScriptParams params,
const TSrvAddrMgr::TExpiredInfo exp,
TIAType  type 
)

Generates parameters for notify script based on expired lease information.

Parameters
paramsNotify parameters (all available info will be set here)
expexpired lease details
typetype of lease (IA, TA or PD)
bool TSrvTransMgr::openSocket ( SPtr< TSrvCfgIface confIface,
int  port 
)
void TSrvTransMgr::relayMsg ( SPtr< TSrvMsg msg)
void TSrvTransMgr::removeExpired ( std::vector< TSrvAddrMgr::TExpiredInfo > &  addrLst,
std::vector< TSrvAddrMgr::TExpiredInfo > &  tempAddrLst,
std::vector< TSrvAddrMgr::TExpiredInfo > &  prefixLst 
)

Removes expired leases and calls notify script.

Parameters
addrLstlist of expired address leases
tempAddrLstlist of expired temporary addresses leases
prefixLstlist of expired prefix delegation leases
Todo:
: remove this FQDN from the list of used names
bool TSrvTransMgr::sanitizeAddrDB ( )

checks/updates loaded database (regarding interface names/indexes)

Returns
true if sanitization was successful, false if it failed
void TSrvTransMgr::sendPacket ( SPtr< TSrvMsg msg)
virtual

sends specified packet

Parameters
msgmessage to be sent
bool TSrvTransMgr::sendReconfigure ( SPtr< TIPv6Addr addr,
int  iface,
int  msgType,
SPtr< TDUID ptrDUID 
)
void TSrvTransMgr::shutdown ( )
bool TSrvTransMgr::unicastCheck ( SPtr< TSrvMsg msg)

Checks whether message was sent to unicast when it was forbidden.

Client is allowed to send data to unicast only if the server is configured with server-unicast option. Otherwise it will send back message with only status-code=UseMulticast, client-id and server-id

Returns
true (accept message) or false (drop it)

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  strum,
TSrvTransMgr x 
)
friend

Member Data Documentation

char TSrvTransMgr::ctrlAddr[48]
protected
int TSrvTransMgr::ctrlIface
protected
TSrvTransMgr * TSrvTransMgr::Instance = 0
staticprotected
bool TSrvTransMgr::IsDone
protected
int TSrvTransMgr::port_
protected
std::string TSrvTransMgr::XmlFile
protected

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