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


Java BgpAttrNodeIsIsAreaId.of方法代码示例

本文整理汇总了Java中org.onosproject.bgpio.types.attr.BgpAttrNodeIsIsAreaId.of方法的典型用法代码示例。如果您正苦于以下问题:Java BgpAttrNodeIsIsAreaId.of方法的具体用法?Java BgpAttrNodeIsIsAreaId.of怎么用?Java BgpAttrNodeIsIsAreaId.of使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.bgpio.types.attr.BgpAttrNodeIsIsAreaId的用法示例。


在下文中一共展示了BgpAttrNodeIsIsAreaId.of方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bgpTopologyProviderTestAddDevice4

import org.onosproject.bgpio.types.attr.BgpAttrNodeIsIsAreaId; //导入方法依赖的package包/类
/**
 * Validate node is added to the device with all device annotations.
 */
@Test
public void bgpTopologyProviderTestAddDevice4() {
    LinkedList<BgpValueType> subTlvs = new LinkedList<>();
    BgpValueType tlv = new AutonomousSystemTlv(100);
    short deslength = AutonomousSystemTlv.LENGTH;
    short desType = AutonomousSystemTlv.TYPE;

    subTlvs.add(tlv);
    BgpNodeLSIdentifier localNodeDescriptors = new BgpNodeLSIdentifier(new NodeDescriptors(subTlvs, deslength,
                                                                                           desType));
    BgpNodeLSNlriVer4 nodeNlri = new BgpNodeLSNlriVer4(0, (byte) Constants.DIRECT, localNodeDescriptors, false,
                                                       new RouteDistinguisher());

    PathAttrNlriDetails details = new PathAttrNlriDetails();
    details.setIdentifier(0);
    details.setProtocolID(ProtocolType.DIRECT);
    List<BgpValueType> pathAttributes = new LinkedList<>();
    List<BgpValueType> linkStateAttr = new LinkedList<>();
    tlv = BgpAttrNodeFlagBitTlv.of(true, true, true, false);
    linkStateAttr.add(tlv);
    tlv = BgpAttrNodeIsIsAreaId.of(new byte[] {01, 01, 01, 01});
    linkStateAttr.add(tlv);
    tlv = BgpAttrRouterIdV4.of(Ip4Address.valueOf("1.1.1.1"), LinkStateAttributes.ATTR_NODE_IPV4_LOCAL_ROUTER_ID);
    linkStateAttr.add(tlv);
    pathAttributes.add(new LinkStateAttributes(linkStateAttr));
    details.setPathAttribute(pathAttributes);

    for (BgpNodeListener l : controller.nodeListener) {
        l.addNode(nodeNlri, details);

        assertThat(deviceMap.values().iterator().next().annotations().value(BgpTopologyProvider.ABR_BIT),
                is("false"));
        assertThat(deviceMap.values().iterator().next().annotations().value(BgpTopologyProvider.EXTERNAL_BIT),
                is("true"));
        assertThat(deviceMap.values().iterator().next().annotations().value(BgpTopologyProvider.INTERNAL_BIT),
                is("false"));
        assertThat(deviceMap.values().iterator().next().annotations().value(BgpTopologyProvider.PSEUDO),
                is("false"));
        assertThat(deviceMap.values().iterator().next().annotations().value(BgpTopologyProvider.AREAID).getBytes(),
                is(new byte[] {01, 01, 01, 01}));
        assertThat(deviceMap.values().iterator().next().annotations().value(BgpTopologyProvider.LSRID),
                is("1.1.1.1"));

        assertThat(nodeRegistry.connected.size(), is(1));
        l.deleteNode(nodeNlri);
        assertThat(nodeRegistry.connected.size(), is(0));
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:52,代码来源:BgpTopologyProviderTest.java


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