本文整理汇总了Java中org.onosproject.ospf.controller.OspfController类的典型用法代码示例。如果您正苦于以下问题:Java OspfController类的具体用法?Java OspfController怎么用?Java OspfController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OspfController类属于org.onosproject.ospf.controller包,在下文中一共展示了OspfController类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildLsaLists
import org.onosproject.ospf.controller.OspfController; //导入依赖的package包/类
/**
* Builds all LSA lists with LSA details.
*/
private void buildLsaLists() {
this.ospfController = get(OspfController.class);
List<OspfProcess> listOfProcess = ospfController.getAllConfiguredProcesses();
Iterator<OspfProcess> itrProcess = listOfProcess.iterator();
while (itrProcess.hasNext()) {
OspfProcess ospfProcess = itrProcess.next();
if (process.equalsIgnoreCase(ospfProcess.processId())) {
List<OspfArea> listAreas = ospfProcess.areas();
Iterator<OspfArea> itrArea = listAreas.iterator();
while (itrArea.hasNext()) {
OspfArea area = itrArea.next();
List<LsaHeader> lsas = area.database()
.getAllLsaHeaders(false, area.isOpaqueEnabled());
List<LsaHeader> tmpLsaList = new ArrayList<>(lsas);
log.debug("OSPFController::size of database::" + (lsas != null ? lsas.size() : null));
Iterator<LsaHeader> itrLsaHeader = tmpLsaList.iterator();
areaList.add(area);
if (itrLsaHeader != null) {
while (itrLsaHeader.hasNext()) {
LsaHeader header = itrLsaHeader.next();
populateLsaLists(header, area);
}
}
}
}
}
}
示例2: buildNeighborInformation
import org.onosproject.ospf.controller.OspfController; //导入依赖的package包/类
/**
* Builds OSPF neighbor information.
*/
private void buildNeighborInformation() {
try {
this.ospfController = get(OspfController.class);
List<OspfProcess> listOfProcess = ospfController.getAllConfiguredProcesses();
boolean flag = false;
printNeighborsFormat();
Iterator<OspfProcess> itrProcess = listOfProcess.iterator();
while (itrProcess.hasNext()) {
OspfProcess process = itrProcess.next();
List<OspfArea> listAreas = process.areas();
Iterator<OspfArea> itrArea = listAreas.iterator();
while (itrArea.hasNext()) {
OspfArea area = itrArea.next();
List<OspfInterface> itrefaceList = area.ospfInterfaceList();
for (OspfInterface interfc : itrefaceList) {
List<OspfNbr> nghbrList = new ArrayList<>(interfc.listOfNeighbors().values());
for (OspfNbr neigbor : nghbrList) {
print("%-20s%-20s%-20s%-20s%-20s\n", neigbor.neighborId(), neigbor.routerPriority(),
neigbor.getState() + "/" + checkDrBdrOther(neigbor.neighborIpAddr().toString(),
neigbor.neighborDr().toString(),
neigbor.neighborBdr().toString()),
neigbor.neighborIpAddr().toString(), interfc.ipAddress());
}
}
}
}
} catch (Exception ex) {
print("Error occured while Ospf controller getting called" + ex.getMessage());
}
}
示例3: isValid
import org.onosproject.ospf.controller.OspfController; //导入依赖的package包/类
@Override
public boolean isValid() {
this.ospfController = DefaultServiceDirectory.getService(OspfController.class);
return true;
}
示例4: setOspfController
import org.onosproject.ospf.controller.OspfController; //导入依赖的package包/类
public void setOspfController(OspfController ospfController) {
this.ospfController = ospfController;
}