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

#include <SrvCfgIface.h>

+ Inheritance diagram for TSrvCfgIface:
+ Collaboration diagram for TSrvCfgIface:

Public Member Functions

 TSrvCfgIface (const std::string &ifaceName)
 TSrvCfgIface (int ifindex)
virtual ~TSrvCfgIface ()
void addAddrClass (SPtr< TSrvCfgAddrClass > addrClass)
void addClientExceptionsLst (TContainer< SPtr< TSrvCfgOptions > > exLst)
void addClntAddr (SPtr< TIPv6Addr > ptrAddr, bool quiet=false)
bool addClntPrefix (SPtr< TIPv6Addr > ptrPD, bool quiet=false)
void addPD (SPtr< TSrvCfgPD > pd)
void addPDClass (SPtr< TSrvCfgPD > PDClass)
bool addrInPool (SPtr< TIPv6Addr > addr)
bool addrInSubnet (SPtr< TIPv6Addr > addr)
bool addrInTaPool (SPtr< TIPv6Addr > addr)
bool addrReserved (SPtr< TIPv6Addr > addr)
 Checks if address is reserved.
void addSubnet (SPtr< TIPv6Addr > min, SPtr< TIPv6Addr > max)
void addTA (SPtr< TSrvCfgTA > ta)
void addTAAddr ()
bool checkReservedPrefix (SPtr< TIPv6Addr > pfx, SPtr< TDUID > duid, SPtr< TOptVendorData > remoteID, SPtr< TIPv6Addr > linkLocal)
 Checks if a prefix is reserved for another client.
EAddrStatus confirmAddress (TIAType type, SPtr< TIPv6Addr > addr)
long countAddrClass () const
long countPD () const
void delClntAddr (SPtr< TIPv6Addr > ptrAddr, bool quiet=false)
bool delClntPrefix (SPtr< TIPv6Addr > ptrPD, bool quiet=false)
void delTAAddr ()
void firstAddrClass ()
void firstPD ()
void firstTA ()
SPtr< TSrvCfgAddrClassgetAddrClass ()
int getAllowedAddrClassID (SPtr< TDUID > duid, SPtr< TIPv6Addr > clntAddr)
SPtr< TSrvCfgAddrClassgetClassByID (unsigned long id)
SPtr< TSrvCfgOptionsgetClientException (SPtr< TDUID > duid, TMsg *message, bool quiet=true)
unsigned long getClntMaxLease () const
SPtr< TDUIDgetFQDNDuid (const std::string &name)
TContainer< SPtr< TFQDN > > * getFQDNLst ()
int getFQDNMode () const
std::string getFQDNModeString () const
SPtr< TFQDNgetFQDNName (SPtr< TDUID > duid, SPtr< TIPv6Addr > addr, const std::string &hint)
std::string getFullName () const
int getID () const
long getIfaceMaxLease () const
std::string getName () const
SPtr< TSrvCfgPDgetPD ()
SPtr< TSrvCfgPDgetPDByID (unsigned long id)
uint32_t getPref (uint32_t proposal)
int getPreferedAddrClassID (SPtr< TDUID > duid, SPtr< TIPv6Addr > clntAddr)
 Returns ID of the preferred pool for specified client.
unsigned char getPreference () const
SPtr< TSrvCfgAddrClassgetRandomClass (SPtr< TDUID > clntDuid, SPtr< TIPv6Addr > clntAddr)
bool getRapidCommit () const
int getRelayID () const
SPtr< TSrvOptInterfaceIDgetRelayInterfaceID () const
std::string getRelayName () const
int getRevDNSZoneRootLength () const
uint32_t getT1 (uint32_t proposal)
uint32_t getT2 (uint32_t proposal)
SPtr< TSrvCfgTAgetTA ()
SPtr< TSrvCfgTAgetTA (SPtr< TDUID > duid, SPtr< TIPv6Addr > clntAddr)
SPtr< TIPv6AddrgetUnicast ()
uint32_t getValid (uint32_t proposal)
bool isRelay () const
bool leaseQuerySupport () const
void mapAllowDenyList (TContainer< SPtr< TSrvCfgClientClass > > clientClassLst)
bool prefixInPdPool (SPtr< TIPv6Addr > addr)
bool prefixReserved (SPtr< TIPv6Addr > prefix)
 Checks if prefix is reserved.
unsigned int removeReservedFromCache ()
 removes reserved addresses/prefixes from cache
void setDefaults ()
void setFQDNLst (TContainer< SPtr< TFQDN > > *fqdn)
void setID (int ifindex)
void setName (const std::string &ifaceName)
void setNoConfig ()
void setOptions (SPtr< TSrvParsGlobalOpt > opt)
void setRelayID (int id)
void setRelayName (const std::string &name)
void setRevDNSZoneRootLength (int revDNSZoneRootLength)
bool subnetDefined ()
bool supportFQDN () const
bool supportPrefixDelegation () const
- Public Member Functions inherited from TSrvCfgOptions
 TSrvCfgOptions ()
 TSrvCfgOptions (SPtr< TDUID > duid)
 TSrvCfgOptions (SPtr< TOptVendorData > remoteid)
 TSrvCfgOptions (SPtr< TIPv6Addr > clntaddr)
void addExtraOption (SPtr< TOpt > extra, bool always)
void addExtraOptions (const TOptList &extra)
 Copies a list of extra options.
void addForcedOptions (const TOptList &extra)
 Copies a list of forced options.
SPtr< TIPv6AddrgetAddr () const
SPtr< TIPv6AddrgetClntAddr () const
SPtr< TDUIDgetDuid () const
SPtr< TOptgetExtraOption (uint16_t type)
const TOptListgetExtraOptions ()
const TOptListgetForcedOptions ()
SPtr< TIPv6AddrgetPrefix ()
uint8_t getPrefixLen ()
SPtr< TOptVendorDatagetRemoteID () const
TContainer< SPtr
< TOptVendorSpecInfo > > 
getVendorSpecLst (unsigned int vendor=0)
void setAddr (SPtr< TIPv6Addr > addr)
void setPrefix (SPtr< TIPv6Addr > prefix, uint8_t length)

Private Member Functions

uint32_t chooseTime (uint32_t min, uint32_t max, uint32_t proposal)

Private Attributes

unsigned long ClntMaxLease_
TContainer< SPtr
< TSrvCfgOptions > > 
ExceptionsLst_
std::string FQDNDomain_
TContainer< SPtr< TFQDN > > FQDNLst_
int FQDNMode_
int ID_
unsigned long IfaceMaxLease_
bool LeaseQuery_
std::string Name_
bool NoConfig_
unsigned char Preference_
uint32_t PrefMax_
uint32_t PrefMin_
bool RapidCommit_
bool Relay_
int RelayID_
SPtr< TSrvOptInterfaceIDRelayInterfaceID_
std::string RelayName_
int RevDNSZoneRootLength_
TContainer< SPtr
< TSrvCfgAddrClass > > 
SrvCfgAddrClassLst_
TContainer< SPtr< TSrvCfgPD > > SrvCfgPDLst_
TContainer< SPtr< TSrvCfgTA > > SrvCfgTALst_
std::vector< THostRangeSubnets_
uint32_t T1Max_
uint32_t T1Min_
uint32_t T2Max_
uint32_t T2Min_
SPtr< TIPv6AddrUnicast_
EUnknownFQDNMode UnknownFQDN_
uint32_t ValidMax_
uint32_t ValidMin_

Friends

std::ostream & operator<< (std::ostream &out, TSrvCfgIface &iface)

Constructor & Destructor Documentation

TSrvCfgIface::TSrvCfgIface ( const std::string &  ifaceName)
TSrvCfgIface::TSrvCfgIface ( int  ifindex)
TSrvCfgIface::~TSrvCfgIface ( )
virtual

Member Function Documentation

void TSrvCfgIface::addAddrClass ( SPtr< TSrvCfgAddrClass addrClass)
void TSrvCfgIface::addClientExceptionsLst ( TContainer< SPtr< TSrvCfgOptions > >  exLst)
void TSrvCfgIface::addClntAddr ( SPtr< TIPv6Addr ptrAddr,
bool  quiet = false 
)
bool TSrvCfgIface::addClntPrefix ( SPtr< TIPv6Addr ptrPD,
bool  quiet = false 
)
void TSrvCfgIface::addPD ( SPtr< TSrvCfgPD pd)
void TSrvCfgIface::addPDClass ( SPtr< TSrvCfgPD PDClass)
bool TSrvCfgIface::addrInPool ( SPtr< TIPv6Addr addr)

checks if address is in NA pool

Parameters
addraddress to be checked
Returns
true if in pool, false otherwise
bool TSrvCfgIface::addrInSubnet ( SPtr< TIPv6Addr addr)
bool TSrvCfgIface::addrInTaPool ( SPtr< TIPv6Addr addr)

checks if address is in TA pool

Parameters
addraddress to be checked
Returns
true if in pool, false otherwise
bool TSrvCfgIface::addrReserved ( SPtr< TIPv6Addr addr)

Checks if address is reserved.

Iterates over exceptions list and checks if specified address is reserved.

Parameters
addrAddress in question.
Returns
True if reserved (false otherwise).
void TSrvCfgIface::addSubnet ( SPtr< TIPv6Addr min,
SPtr< TIPv6Addr max 
)
void TSrvCfgIface::addTA ( SPtr< TSrvCfgTA ta)
void TSrvCfgIface::addTAAddr ( )
bool TSrvCfgIface::checkReservedPrefix ( SPtr< TIPv6Addr pfx,
SPtr< TDUID duid,
SPtr< TOptVendorData myRemoteID,
SPtr< TIPv6Addr linkLocal 
)

Checks if a prefix is reserved for another client.

Parameters
pfxchecked prefix (mandatory)
duidClient's duid (mandatory)
myRemoteID(can be NULL)
linkLocal(can be NULL)
Returns
true if reserved for some else, false = not reserved
uint32_t TSrvCfgIface::chooseTime ( uint32_t  min,
uint32_t  max,
uint32_t  proposal 
)
private
EAddrStatus TSrvCfgIface::confirmAddress ( TIAType  type,
SPtr< TIPv6Addr addr 
)

checks if given address/prefix is valid on this interface

Parameters
typeIA, TA or PD
addraddress or prefix to be confirmed
Returns
YES, NO or UNKNOWN (if no subnet is defined and addr is outside of pool)
long TSrvCfgIface::countAddrClass ( ) const
long TSrvCfgIface::countPD ( ) const
void TSrvCfgIface::delClntAddr ( SPtr< TIPv6Addr ptrAddr,
bool  quiet = false 
)
bool TSrvCfgIface::delClntPrefix ( SPtr< TIPv6Addr ptrPD,
bool  quiet = false 
)
void TSrvCfgIface::delTAAddr ( )
void TSrvCfgIface::firstAddrClass ( )
void TSrvCfgIface::firstPD ( )
void TSrvCfgIface::firstTA ( )
SPtr< TSrvCfgAddrClass > TSrvCfgIface::getAddrClass ( )
int TSrvCfgIface::getAllowedAddrClassID ( SPtr< TDUID duid,
SPtr< TIPv6Addr clntAddr 
)

tries to find a class, which client is allowed to use

Parameters
duidclient's DUID
clntAddrclient's linkaddress
Returns
classid (or -1 if no suitable class is found)
Todo:
Buffer overflow for more than 100 classes
SPtr< TSrvCfgAddrClass > TSrvCfgIface::getClassByID ( unsigned long  id)
SPtr< TSrvCfgOptions > TSrvCfgIface::getClientException ( SPtr< TDUID duid,
TMsg message,
bool  quiet = true 
)
unsigned long TSrvCfgIface::getClntMaxLease ( ) const
SPtr< TDUID > TSrvCfgIface::getFQDNDuid ( const std::string &  name)
Todo:
: Implement this!
TContainer< SPtr< TFQDN > > * TSrvCfgIface::getFQDNLst ( )
int TSrvCfgIface::getFQDNMode ( ) const
string TSrvCfgIface::getFQDNModeString ( ) const
SPtr< TFQDN > TSrvCfgIface::getFQDNName ( SPtr< TDUID duid,
SPtr< TIPv6Addr addr,
const std::string &  hint 
)

this method tries to find a name for a client. It check client's hint, and possible reservations by duid or by address

Parameters
duid
addr
hint
Returns
string TSrvCfgIface::getFullName ( void  ) const
int TSrvCfgIface::getID ( void  ) const
long TSrvCfgIface::getIfaceMaxLease ( ) const
string TSrvCfgIface::getName ( void  ) const
SPtr< TSrvCfgPD > TSrvCfgIface::getPD ( )
SPtr< TSrvCfgPD > TSrvCfgIface::getPDByID ( unsigned long  id)
uint32_t TSrvCfgIface::getPref ( uint32_t  proposal)
int TSrvCfgIface::getPreferedAddrClassID ( SPtr< TDUID duid,
SPtr< TIPv6Addr clntAddr 
)

Returns ID of the preferred pool for specified client.

tries to find if there is a class, where client is on white-list

Parameters
duidclient's DUID
clntAddrclient's address
Returns
ID of prefered pool (or -1 if there is none)
unsigned char TSrvCfgIface::getPreference ( ) const
SPtr< TSrvCfgAddrClass > TSrvCfgIface::getRandomClass ( SPtr< TDUID clntDuid,
SPtr< TIPv6Addr clntAddr 
)
bool TSrvCfgIface::getRapidCommit ( ) const
int TSrvCfgIface::getRelayID ( ) const
SPtr< TSrvOptInterfaceID > TSrvCfgIface::getRelayInterfaceID ( ) const
string TSrvCfgIface::getRelayName ( ) const
int TSrvCfgIface::getRevDNSZoneRootLength ( ) const
uint32_t TSrvCfgIface::getT1 ( uint32_t  proposal)
uint32_t TSrvCfgIface::getT2 ( uint32_t  proposal)
SPtr< TSrvCfgTA > TSrvCfgIface::getTA ( )
SPtr< TSrvCfgTA > TSrvCfgIface::getTA ( SPtr< TDUID duid,
SPtr< TIPv6Addr clntAddr 
)
SPtr< TIPv6Addr > TSrvCfgIface::getUnicast ( )
uint32_t TSrvCfgIface::getValid ( uint32_t  proposal)
bool TSrvCfgIface::isRelay ( ) const
bool TSrvCfgIface::leaseQuerySupport ( ) const
void TSrvCfgIface::mapAllowDenyList ( TContainer< SPtr< TSrvCfgClientClass > >  clientClassLst)
bool TSrvCfgIface::prefixInPdPool ( SPtr< TIPv6Addr prefix)

checks if prefix is in PD pool

Parameters
prefixprefix to be checked
Returns
true if in pool, false otherwise
bool TSrvCfgIface::prefixReserved ( SPtr< TIPv6Addr prefix)

Checks if prefix is reserved.

Iterates over exceptions list and checks if specified prefix is reserved.

Parameters
prefixprefix in question.
Returns
True if reserved (false otherwise).
unsigned int TSrvCfgIface::removeReservedFromCache ( )

removes reserved addresses/prefixes from cache

Returns
number of removed entries
void TSrvCfgIface::setDefaults ( )
void TSrvCfgIface::setFQDNLst ( TContainer< SPtr< TFQDN > > *  fqdn)
void TSrvCfgIface::setID ( int  ifindex)
void TSrvCfgIface::setName ( const std::string &  ifaceName)
void TSrvCfgIface::setNoConfig ( )
void TSrvCfgIface::setOptions ( SPtr< TSrvParsGlobalOpt opt)

Reimplemented from TSrvCfgOptions.

void TSrvCfgIface::setRelayID ( int  id)
void TSrvCfgIface::setRelayName ( const std::string &  name)
void TSrvCfgIface::setRevDNSZoneRootLength ( int  revDNSZoneRootLength)
bool TSrvCfgIface::subnetDefined ( )
bool TSrvCfgIface::supportFQDN ( ) const
bool TSrvCfgIface::supportPrefixDelegation ( ) const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
TSrvCfgIface iface 
)
friend

Member Data Documentation

unsigned long TSrvCfgIface::ClntMaxLease_
private
TContainer< SPtr<TSrvCfgOptions> > TSrvCfgIface::ExceptionsLst_
private
std::string TSrvCfgIface::FQDNDomain_
private
TContainer< SPtr<TFQDN> > TSrvCfgIface::FQDNLst_
private
int TSrvCfgIface::FQDNMode_
private
int TSrvCfgIface::ID_
private
unsigned long TSrvCfgIface::IfaceMaxLease_
private
bool TSrvCfgIface::LeaseQuery_
private
std::string TSrvCfgIface::Name_
private
bool TSrvCfgIface::NoConfig_
private
unsigned char TSrvCfgIface::Preference_
private
uint32_t TSrvCfgIface::PrefMax_
private
uint32_t TSrvCfgIface::PrefMin_
private
bool TSrvCfgIface::RapidCommit_
private
bool TSrvCfgIface::Relay_
private
int TSrvCfgIface::RelayID_
private
SPtr<TSrvOptInterfaceID> TSrvCfgIface::RelayInterfaceID_
private
std::string TSrvCfgIface::RelayName_
private
int TSrvCfgIface::RevDNSZoneRootLength_
private
TContainer< SPtr<TSrvCfgAddrClass> > TSrvCfgIface::SrvCfgAddrClassLst_
private
TContainer< SPtr<TSrvCfgPD> > TSrvCfgIface::SrvCfgPDLst_
private
TContainer< SPtr<TSrvCfgTA> > TSrvCfgIface::SrvCfgTALst_
private
std::vector<THostRange> TSrvCfgIface::Subnets_
private
uint32_t TSrvCfgIface::T1Max_
private
uint32_t TSrvCfgIface::T1Min_
private
uint32_t TSrvCfgIface::T2Max_
private
uint32_t TSrvCfgIface::T2Min_
private
SPtr<TIPv6Addr> TSrvCfgIface::Unicast_
private
EUnknownFQDNMode TSrvCfgIface::UnknownFQDN_
private
uint32_t TSrvCfgIface::ValidMax_
private
uint32_t TSrvCfgIface::ValidMin_
private

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