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

#include <SrvIfaceMgr.h>

+ Inheritance diagram for TSrvIfaceMgr:
+ Collaboration diagram for TSrvIfaceMgr:

Public Member Functions

 ~TSrvIfaceMgr ()
bool addFQDN (int iface, SPtr< TIPv6Addr > dnsAddr, SPtr< TIPv6Addr > addr, const std::string &domainname)
SPtr< TSrvMsgdecodeMsg (int ifindex, SPtr< TIPv6Addr > peer, char *buf, int bufsize)
SPtr< TSrvMsgdecodeRelayForw (SPtr< TIfaceIface > physicalIface, SPtr< TIPv6Addr > peer, char *buf, int bufsize)
bool delFQDN (int iface, SPtr< TIPv6Addr > dnsAddr, SPtr< TIPv6Addr > addr, const std::string &domainname)
void dump ()
virtual void notifyScripts (const std::string &scriptName, SPtr< TMsg > question, SPtr< TMsg > answer)
virtual int receive (unsigned long timeout, char *buf, int &bufsize, SPtr< TIPv6Addr > peer, SPtr< TIPv6Addr > myaddr)
 tries to receive a packet
void redetectIfaces ()
SPtr< TSrvMsgselect (unsigned long timeout)
virtual bool send (int iface, char *msg, int size, SPtr< TIPv6Addr > addr, int port)
- 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, 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 TSrvIfaceMgrinstance ()
static void instanceCreate (const std::string &xmlDumpFile)

Protected Member Functions

 TSrvIfaceMgr (const std::string &xmlFile)
- Protected Member Functions inherited from TIfaceMgr
virtual void optionToEnv (TNotifyScriptParams &params, SPtr< TOpt > opt, std::string txtPrefix)

Protected Attributes

std::string XmlFile
- Protected Attributes inherited from TIfaceMgr
TContainer< SPtr< TIfaceIface > > IfaceLst
bool IsDone
std::string XmlFile

Static Protected Attributes

static TSrvIfaceMgrInstance = 0

Friends

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

Constructor & Destructor Documentation

TSrvIfaceMgr::~TSrvIfaceMgr ( )
TSrvIfaceMgr::TSrvIfaceMgr ( const std::string &  xmlFile)
protected

Member Function Documentation

bool TSrvIfaceMgr::addFQDN ( int  iface,
SPtr< TIPv6Addr dnsAddr,
SPtr< TIPv6Addr addr,
const std::string &  domainname 
)
SPtr< TSrvMsg > TSrvIfaceMgr::decodeMsg ( int  ifindex,
SPtr< TIPv6Addr peer,
char *  buf,
int  bufsize 
)
SPtr< TSrvMsg > TSrvIfaceMgr::decodeRelayForw ( SPtr< TIfaceIface physicalIface,
SPtr< TIPv6Addr peer,
char *  buf,
int  bufsize 
)
Todo:
: WTF is that? ----v
bool TSrvIfaceMgr::delFQDN ( int  iface,
SPtr< TIPv6Addr dnsAddr,
SPtr< TIPv6Addr addr,
const std::string &  domainname 
)
void TSrvIfaceMgr::dump ( )

Reimplemented from TIfaceMgr.

TSrvIfaceMgr & TSrvIfaceMgr::instance ( )
static
void TSrvIfaceMgr::instanceCreate ( const std::string &  xmlDumpFile)
static
void TSrvIfaceMgr::notifyScripts ( const std::string &  scriptName,
SPtr< TMsg question,
SPtr< TMsg answer 
)
virtual

Reimplemented from TIfaceMgr.

int TSrvIfaceMgr::receive ( unsigned long  timeout,
char *  buf,
int &  bufsize,
SPtr< TIPv6Addr peer,
SPtr< TIPv6Addr myaddr 
)
virtual

tries to receive a packet

This method is virtual for the purpose of easy faking packet reception in tests

Parameters
timeoutselect() timeout in seconds
bufpointer to reception buffer
bufsizereference to buffer size (will be updated to received packet size if reception is successful)
peeraddress of the pkt sender
myaddraddress the packet was received on
Returns
socket descriptor (or negative values for errors)
void TSrvIfaceMgr::redetectIfaces ( )

Compares current flags of interfaces with old flags. If change is detected, stored flags of the interface are updated

SPtr< TSrvMsg > TSrvIfaceMgr::select ( unsigned long  timeout)
Todo:
: Implement support for draft-ietf-dhc-link-layer-address-opt
Todo:
: Store MAC address in the message, so it could be logged later or added to the database
bool TSrvIfaceMgr::send ( int  iface,
char *  msg,
int  size,
SPtr< TIPv6Addr addr,
int  port 
)
virtual

sends data to client. Uses unicast address as source

Parameters
ifaceinterface index
msg- buffer containing message ready to send
size- size of message
addrdestination IPv6 address
portdestination UDP port
Returns
true if message was send successfully

Friends And Related Function Documentation

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

Member Data Documentation

TSrvIfaceMgr * TSrvIfaceMgr::Instance = 0
staticprotected
std::string TSrvIfaceMgr::XmlFile
protected

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