本文整理汇总了Java中org.onosproject.ospf.controller.area.OspfAreaImpl.addLsa方法的典型用法代码示例。如果您正苦于以下问题:Java OspfAreaImpl.addLsa方法的具体用法?Java OspfAreaImpl.addLsa怎么用?Java OspfAreaImpl.addLsa使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.onosproject.ospf.controller.area.OspfAreaImpl
的用法示例。
在下文中一共展示了OspfAreaImpl.addLsa方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createOspfArea
import org.onosproject.ospf.controller.area.OspfAreaImpl; //导入方法依赖的package包/类
/**
* Utility for test method.
*/
private OspfAreaImpl createOspfArea() throws Exception {
OspfAreaAddressRangeImpl ospfAreaAddressRange;
ospfAreaAddressRange = createOspfAreaAddressRange();
addressRanges.add(ospfAreaAddressRange);
OspfAreaImpl ospfArea = new OspfAreaImpl();
ospfArea.setAreaId(ip4Address5);
ospfArea.setExternalRoutingCapability(true);
OspfInterfaceImpl ospfInterface = createOspfInterface();
ospfInterfaces.add(ospfInterface);
ospfArea.setOspfInterfaceList(ospfInterfaces);
RouterLsa routerLsa = new RouterLsa();
routerLsa.setLsType(1);
routerLsa.setLinkStateId(string1);
routerLsa.setAdvertisingRouter(ip4Address2);
ospfArea.addLsa(routerLsa, false, ospfInterface);
ospfArea.setRouterId(ip4Address4);
return ospfArea;
}
示例2: createOspfArea
import org.onosproject.ospf.controller.area.OspfAreaImpl; //导入方法依赖的package包/类
/**
* Utility for test method.
*/
private OspfAreaImpl createOspfArea() throws UnknownHostException {
OspfAreaAddressRangeImpl ospfAreaAddressRange;
ospfAreaAddressRange = createOspfAreaAddressRange();
addressRanges.add(ospfAreaAddressRange);
OspfAreaImpl ospfArea = new OspfAreaImpl();
ospfArea.setAreaId(Ip4Address.valueOf("10.226.165.164"));
ospfArea.setExternalRoutingCapability(true);
OspfInterfaceImpl ospfInterface = createOspfInterface();
ospfInterfaces.add(ospfInterface);
ospfArea.setOspfInterfaceList(ospfInterfaces);
RouterLsa routerLsa = new RouterLsa();
routerLsa.setLsType(1);
routerLsa.setLinkStateId("2.2.2.2");
routerLsa.setAdvertisingRouter(Ip4Address.valueOf("2.2.2.2"));
OpaqueLsaHeader opaqueLsaHeader = new OpaqueLsaHeader();
OpaqueLsa10 opaqueLsa10 = new OpaqueLsa10(opaqueLsaHeader);
opaqueLsa10.setLsType(OspfLsaType.AREA_LOCAL_OPAQUE_LSA.value());
opaqueLsa10.setLinkStateId("2.2.2.2");
opaqueLsa10.setAdvertisingRouter(Ip4Address.valueOf("2.2.2.2"));
try {
ospfArea.addLsa(routerLsa, false, ospfInterface);
ospfArea.addLsa(opaqueLsa10, false, ospfInterface);
} catch (Exception e) {
System.out.println("ospfAreaImpl createOspfArea");
}
ospfArea.setRouterId(Ip4Address.valueOf("111.111.111.111"));
return ospfArea;
}
示例3: createOspfInterface
import org.onosproject.ospf.controller.area.OspfAreaImpl; //导入方法依赖的package包/类
/**
* Utility for test method.
*/
private OspfInterfaceImpl createOspfInterface() throws Exception {
ospfInterface = new OspfInterfaceImpl();
LsaHeader lsaHeader = new LsaHeader();
lsaHeader.setLsType(OspfLsaType.ROUTER.value());
RouterLsa routerLsa = new RouterLsa();
OspfAreaImpl ospfArea = new OspfAreaImpl();
ospfArea.addLsa(routerLsa, true, ospfInterface);
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, ip4Address5,
ip4Address6, 2, topologyForDeviceAndLink);
ospfNbr.setState(OspfNeighborState.EXSTART);
ospfNbr.setNeighborId(ip4Address7);
this.ospfInterface = new OspfInterfaceImpl();
this.ospfInterface.setIpAddress(ip4Address5);
this.ospfInterface.setIpNetworkMask(subnetAddress);
this.ospfInterface.setBdr(ip4Address4);
this.ospfInterface.setDr(ip4Address4);
this.ospfInterface.setHelloIntervalTime(20);
this.ospfInterface.setInterfaceType(2);
this.ospfInterface.setReTransmitInterval(2000);
this.ospfInterface.setMtu(6500);
this.ospfInterface.setRouterDeadIntervalTime(1000);
this.ospfInterface.setRouterPriority(1);
this.ospfInterface.setInterfaceType(1);
this.ospfInterface.setInterfaceIndex(1);
this.ospfInterface.addNeighbouringRouter(ospfNbr);
this.ospfInterface.setOspfArea(ospfArea);
return this.ospfInterface;
}