本文整理汇总了C++中SPtr::addrInPool方法的典型用法代码示例。如果您正苦于以下问题:C++ SPtr::addrInPool方法的具体用法?C++ SPtr::addrInPool怎么用?C++ SPtr::addrInPool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPtr
的用法示例。
在下文中一共展示了SPtr::addrInPool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isIAAddrSupported
/**
* checks if this Addr is already configured in that IA belonging to that client
* (used in CONFIRM message)
*
* @param iface
* @param addr
*
* @return true, if address is supported
*/
bool TSrvCfgMgr::isIAAddrSupported(int iface, SPtr<TIPv6Addr> addr) {
SPtr<TSrvCfgIface> ptrIface = this->getIfaceByID(iface);
if (!ptrIface)
return false;
ptrIface->firstAddrClass();
SPtr<TSrvCfgAddrClass> addrClass;
while (addrClass = ptrIface->getAddrClass()) {
if (addrClass->addrInPool(addr))
return true;
}
return false;
}
示例2: getAddrsCount
void TSrvAddrMgr::getAddrsCount(
SPtr<TContainer<SPtr<TSrvCfgAddrClass> > > classes,
long *clntCnt,
long *addrCnt,
SPtr<TDUID> duid,
int iface)
{
memset(clntCnt,0,sizeof(long)*classes->count());
memset(addrCnt,0,sizeof(long)*classes->count());
int classNr=0;
SPtr<TAddrClient> ptrClient;
firstClient();
while(ptrClient=getClient())
{
bool thisClient=(*(ptrClient->getDUID())==*duid);
ptrClient->firstIA();
SPtr<TAddrIA> ptrIA;
while(ptrIA=ptrClient->getIA())
{
SPtr<TAddrAddr> ptrAddr;
ptrIA->firstAddr();
while(ptrAddr=ptrIA->getAddr())
{
if(ptrIA->getIface()==iface)
{
SPtr<TSrvCfgAddrClass> ptrClass;
classes->first();
classNr=0;
while(ptrClass=classes->get())
{
if(ptrClass->addrInPool(ptrAddr->get()))
{
if(thisClient)
clntCnt[classNr]++;
addrCnt[classNr]++;
}
classNr++;
}
}
}
}
}
}
示例3: unknown
/**
* return class, which address belongs to
*
* @param iface
* @param addr
*
* @return pointer to the class (or 0, if no suitable class found)
*/
SPtr<TSrvCfgAddrClass> TSrvCfgMgr::getClassByAddr(int iface, SPtr<TIPv6Addr> addr)
{
this->firstIface();
SPtr<TSrvCfgIface> ptrIface;
ptrIface = this->getIfaceByID(iface);
if (!ptrIface) {
Log(Error) << "Trying to find class on unknown (" << iface <<") interface." << LogEnd;
return 0; // NULL
}
SPtr<TSrvCfgAddrClass> ptrClass;
ptrIface->firstAddrClass();
while (ptrClass = ptrIface->getAddrClass()) {
if (ptrClass->addrInPool(addr))
return ptrClass;
}
return 0; // NULL
}