本文整理汇总了C++中SPtr::appendRelay方法的典型用法代码示例。如果您正苦于以下问题:C++ SPtr::appendRelay方法的具体用法?C++ SPtr::appendRelay怎么用?C++ SPtr::appendRelay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPtr
的用法示例。
在下文中一共展示了SPtr::appendRelay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupRelay
bool TSrvIfaceMgr::setupRelay(std::string name, int ifindex, int underIfindex,
SPtr<TSrvOptInterfaceID> interfaceID) {
SPtr<TSrvIfaceIface> under = (Ptr*)this->getIfaceByID(underIfindex);
if (!under) {
Log(Crit) << "Unable to setup " << name << "/" << ifindex
<< " relay: underlaying interface with id=" << underIfindex
<< " is not present in the system or does not support IPv6." << LogEnd;
return false;
}
if (!under->flagUp()) {
Log(Crit) << "Unable to setup " << name << "/" << ifindex
<< " relay: underlaying interface " << under->getName() << "/" << underIfindex
<< " is down." << LogEnd;
return false;
}
SPtr<TSrvIfaceIface> relay = new TSrvIfaceIface((const char*)name.c_str(), ifindex,
IF_UP | IF_RUNNING | IF_MULTICAST, // flags
0, // MAC
0, // MAC length
0,0, // link address
0,0, // global addresses
0); // hardware type
relay->setUnderlaying(under);
this->IfaceLst.append((Ptr*)relay);
if (!under->appendRelay(relay, interfaceID)) {
Log(Crit) << "Unable to setup " << name << "/" << ifindex
<< " relay: underlaying interface " << under->getName() << "/" << underIfindex
<< " already has " << HOP_COUNT_LIMIT << " relays defined." << LogEnd;
return false;
}
Log(Notice) << "Relay " << name << "/" << ifindex << " (underlaying " << under->getName()
<< "/" << under->getID() << ") has been configured." << LogEnd;
return true;
}