本文整理汇总了C++中SPtr::addClntAddr方法的典型用法代码示例。如果您正苦于以下问题:C++ SPtr::addClntAddr方法的具体用法?C++ SPtr::addClntAddr怎么用?C++ SPtr::addClntAddr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPtr
的用法示例。
在下文中一共展示了SPtr::addClntAddr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addClntAddr
void TSrvCfgMgr::addClntAddr(int iface, SPtr<TIPv6Addr> addr) {
SPtr<TSrvCfgIface> ptrIface;
ptrIface = this->getIfaceByID(iface);
if (!ptrIface) {
Log(Warning) << "Unable to increase address usage: unknown interface (id="
<< iface << ")" << LogEnd;
return;
}
ptrIface->addClntAddr(addr);
}
示例2: setCounters
/**
* sets pool usage counters (used during bringup, after AddrDB is loaded from file)
*
*/
void TSrvCfgMgr::setCounters()
{
int iaCnt = 0, pdCnt = 0;
SrvAddrMgr().firstClient();
SPtr<TAddrClient> client;
SPtr<TSrvCfgIface> iface;
while (client = SrvAddrMgr().getClient()) {
// addresses
SPtr<TAddrIA> ia;
client->firstIA();
while ( ia=client->getIA() ) {
iface = getIfaceByID(ia->getIface());
if (!iface)
continue;
SPtr<TAddrAddr> addr;
ia->firstAddr();
while ( addr=ia->getAddr() ) {
iface->addClntAddr(addr->get(), true/*quiet*/);
iaCnt++;
}
}
// prefixes
client->firstPD();
while (ia = client->getPD() ) {
iface = getIfaceByID(ia->getIface());
if (!iface)
continue;
SPtr<TAddrPrefix> prefix;
ia->firstPrefix();
while ( prefix=ia->getPrefix() ) {
iface->addClntPrefix(prefix->get(), true);
pdCnt++;
}
}
}
Log(Debug) << "Increased pools usage: currently " << iaCnt << " address(es) and " << pdCnt << " prefix(es) are leased." << LogEnd;
}