当前位置: 首页>>代码示例>>Java>>正文


Java OspfAreaImpl.addLsa方法代码示例

本文整理汇总了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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:OspfInterfaceChannelHandlerTest.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:33,代码来源:OspfNbrImplTest.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:OspfInterfaceChannelHandlerTest.java


注:本文中的org.onosproject.ospf.controller.area.OspfAreaImpl.addLsa方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。