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

#include <ClntIfaceMgr.h>

+ Inheritance diagram for TClntIfaceMgr:
+ Collaboration diagram for TClntIfaceMgr:

Public Types

enum  PrefixModifyMode { PREFIX_MODIFY_ADD, PREFIX_MODIFY_UPDATE, PREFIX_MODIFY_DEL }

Public Member Functions

 ~TClntIfaceMgr ()
bool addPrefix (int iface, SPtr< TIPv6Addr > prefix, int prefixLen, unsigned int pref, unsigned int valid, TNotifyScriptParams *params)
 configures prefix in the operating system
SPtr< TIPv6AddrcalculateSubprefix (const SPtr< TIPv6Addr > &prefix, int prefixLen, int numPrefixes, int i, int &subprefixLen)
 Calculates subprefix based on prefix/prefixLen and a given number of sub-prefixes.
bool delPrefix (int iface, SPtr< TIPv6Addr > prefix, int prefixLen, TNotifyScriptParams *params)
bool doDuties ()
void dump ()
bool fqdnAdd (SPtr< TClntIfaceIface > iface, const std::string &domainname)
bool fqdnDel (SPtr< TClntIfaceIface > iface, SPtr< TAddrIA > ia, const std::string &domainname)
unsigned int getTimeout ()
int numBits (int i)
void redetectIfaces ()
void removeAllOpts ()
SPtr< TClntMsgselect (unsigned int timeout)
bool sendMulticast (int iface, char *msg, int msgsize)
bool sendUnicast (int iface, char *msg, int size, SPtr< TIPv6Addr > addr)
bool updatePrefix (int iface, SPtr< TIPv6Addr > prefix, int prefixLen, unsigned int pref, unsigned int valid, TNotifyScriptParams *params)
- Public Member Functions inherited from TIfaceMgr
 TIfaceMgr (const std::string &xmlFile, bool getIfaces)
virtual ~TIfaceMgr ()
virtual void closeSockets ()
 closes all sockets
int countIface ()
void firstIface ()
SPtr< TIfaceIfacegetIface ()
SPtr< TIfaceIfacegetIfaceByID (int id)
SPtr< TIfaceIfacegetIfaceByName (const std::string &name)
virtual SPtr< TIfaceIfacegetIfaceBySocket (int fd)
bool isDone ()
virtual void notifyScript (const std::string &scriptName, std::string action, TNotifyScriptParams &params)
virtual void notifyScripts (const std::string &scriptName, SPtr< TMsg > question, SPtr< TMsg > answer)
virtual void notifyScripts (const std::string &scriptName, SPtr< TMsg > question, SPtr< TMsg > answer, TNotifyScriptParams &params)
std::string printMac (char *mac, int macLen)
int select (unsigned long time, char *buf, int &bufsize, SPtr< TIPv6Addr > peer, SPtr< TIPv6Addr > myaddr)

Static Public Member Functions

static TClntIfaceMgrinstance ()
static void instanceCreate (const std::string &xmlFile)

Private Member Functions

 TClntIfaceMgr (const std::string &xmlFile)
bool modifyPrefix (int iface, SPtr< TIPv6Addr > prefix, int prefixLen, unsigned int pref, unsigned int valid, PrefixModifyMode mode, TNotifyScriptParams *params)

Private Attributes

std::string XmlFile

Static Private Attributes

static TClntIfaceMgrInstance = 0

Friends

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

Additional Inherited Members

- Protected Member Functions inherited from TIfaceMgr
virtual void optionToEnv (TNotifyScriptParams &params, SPtr< TOpt > opt, std::string txtPrefix)
- Protected Attributes inherited from TIfaceMgr
TContainer< SPtr< TIfaceIface > > IfaceLst
bool IsDone
std::string XmlFile

Member Enumeration Documentation

Enumerator:
PREFIX_MODIFY_ADD 
PREFIX_MODIFY_UPDATE 
PREFIX_MODIFY_DEL 

Constructor & Destructor Documentation

TClntIfaceMgr::TClntIfaceMgr ( const std::string &  xmlFile)
private
TClntIfaceMgr::~TClntIfaceMgr ( )

Member Function Documentation

bool TClntIfaceMgr::addPrefix ( int  iface,
SPtr< TIPv6Addr prefix,
int  prefixLen,
unsigned int  pref,
unsigned int  valid,
TNotifyScriptParams params 
)

configures prefix in the operating system

configures specified prefix in the operating system

Parameters
ifaceinterface index
prefixprefix to be configured
prefixLenprefix length
prefprefered lifetime
validvalid lifetime
Returns
true if operation was successful, false otherwise
SPtr< TIPv6Addr > TClntIfaceMgr::calculateSubprefix ( const SPtr< TIPv6Addr > &  prefix,
int  prefixLen,
int  numPrefixes,
int  i,
int &  subprefixLen 
)

Calculates subprefix based on prefix/prefixLen and a given number of sub-prefixes.

Parameters
prefixdelegated prefix
prefixLendelegated prefix length
numPrefixestotal number of sub-prefixes
iindex of the interface
[out]subprefixLenThis parameter is set to appropriate value
Returns
Generated subprefix
bool TClntIfaceMgr::delPrefix ( int  iface,
SPtr< TIPv6Addr prefix,
int  prefixLen,
TNotifyScriptParams params 
)

deletes prefix from the operating system

Parameters
iface
prefix
prefixLen
Returns
true if operation was successful, false otherwise
bool TClntIfaceMgr::doDuties ( )
Todo:
: sleep cannot be performed here. What if client has to perform other action during those 3 seconds?
void TClntIfaceMgr::dump ( )

Reimplemented from TIfaceMgr.

bool TClntIfaceMgr::fqdnAdd ( SPtr< TClntIfaceIface iface,
const std::string &  domainname 
)
bool TClntIfaceMgr::fqdnDel ( SPtr< TClntIfaceIface iface,
SPtr< TAddrIA ia,
const std::string &  domainname 
)
unsigned int TClntIfaceMgr::getTimeout ( )
TClntIfaceMgr & TClntIfaceMgr::instance ( )
static
void TClntIfaceMgr::instanceCreate ( const std::string &  xmlFile)
static
bool TClntIfaceMgr::modifyPrefix ( int  iface,
SPtr< TIPv6Addr prefix,
int  prefixLen,
unsigned int  pref,
unsigned int  valid,
PrefixModifyMode  mode,
TNotifyScriptParams params 
)
private
int TClntIfaceMgr::numBits ( int  i)

Returns number of bits required to store specific number of interfaces

Parameters
i
Returns
ceil(log2(i)) or 0 for 0
void TClntIfaceMgr::redetectIfaces ( )
void TClntIfaceMgr::removeAllOpts ( )
SPtr< TClntMsg > TClntIfaceMgr::select ( unsigned int  timeout)
Todo:
Implement AUTH_DROP_UNAUTH_ on client-side
bool TClntIfaceMgr::sendMulticast ( int  iface,
char *  msg,
int  msgsize 
)
bool TClntIfaceMgr::sendUnicast ( int  iface,
char *  msg,
int  size,
SPtr< TIPv6Addr addr 
)
bool TClntIfaceMgr::updatePrefix ( int  iface,
SPtr< TIPv6Addr prefix,
int  prefixLen,
unsigned int  pref,
unsigned int  valid,
TNotifyScriptParams params 
)

Friends And Related Function Documentation

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

Member Data Documentation

TClntIfaceMgr * TClntIfaceMgr::Instance = 0
staticprivate
std::string TClntIfaceMgr::XmlFile
private

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