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


Java IsIsPseudonode.of方法代码示例

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


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

示例1: testBgpUpdateMessage3

import org.onosproject.bgpio.types.IsIsPseudonode; //导入方法依赖的package包/类
/**
 * Peer1 has Link NLRI (MpReach).
 */
@Test
public void testBgpUpdateMessage3() throws InterruptedException, TestUtilsException {
    // Initiate the connections
    peer1.peerChannelHandler.asNumber = 200;
    peer1.peerChannelHandler.version = 4;
    peer1.peerChannelHandler.holdTime = 120;

    short afi = 16388;
    byte res = 0;
    byte safi = 71;

    bgpControllerImpl.getConfig().setLsCapability(true);
    BgpValueType tempTlv1 = new MultiProtocolExtnCapabilityTlv(afi, res, safi);
    peer1.peerChannelHandler.capabilityTlv.add(tempTlv1);
    peer1.connectFrom(connectToSocket, new InetSocketAddress("127.0.0.10", 0));
    TimeUnit.MILLISECONDS.sleep(1000);

    //Get peer1
    BgpId bgpId = new BgpId(IpAddress.valueOf("127.0.0.10"));
    BgpPeerImpl peer = (BgpPeerImpl) bgpControllerImpl.getPeer(bgpId);

    LinkedList<BgpValueType> localNodeSubTlvs = new LinkedList<>();
    LinkedList<BgpValueType> remoteNodeSubTlvs = new LinkedList<>();
    BgpValueType tlv = AutonomousSystemTlv.of(2222);
    localNodeSubTlvs.add(tlv);
    remoteNodeSubTlvs.add(tlv);
    tlv = BgpLSIdentifierTlv.of(33686018);
    localNodeSubTlvs.add(tlv);
    remoteNodeSubTlvs.add(tlv);
    byte[] isoNodeID = new byte[] {0x19, 0x00, (byte) 0x95, 0x02, 0x50, 0x21 };
    tlv = IsIsPseudonode.of(isoNodeID, (byte) 0x03);
    localNodeSubTlvs.add(tlv);
    isoNodeID = new byte[] {0x19, 0x00, (byte) 0x95, 0x02, 0x50, 0x21 };
    tlv = IsIsNonPseudonode.of(isoNodeID);
    remoteNodeSubTlvs.add(tlv);
    NodeDescriptors localNodeDes = new NodeDescriptors(localNodeSubTlvs, (short) 0x1b, (short) 256);
    NodeDescriptors remoteNodeDes = new NodeDescriptors(remoteNodeSubTlvs, (short) 0x1a, (short) 0x101);
    LinkedList<BgpValueType> linkDescriptor = new LinkedList<>();
    tlv = IPv4AddressTlv.of(Ip4Address.valueOf("2.2.2.2"), (short) 0x103);
    linkDescriptor.add(tlv);

    BgpLinkLSIdentifier key = new BgpLinkLSIdentifier(localNodeDes, remoteNodeDes, linkDescriptor);
    TimeUnit.MILLISECONDS.sleep(200);
    AdjRibIn adj = peer.adjRib();

    //In Adj-RIB, linkTree should contain specified key
    assertThat(adj.linkTree().containsKey(key), is(true));

    BgpLocalRibImpl obj = (BgpLocalRibImpl) bgpControllerImpl.bgpLocalRib();
    TimeUnit.MILLISECONDS.sleep(200);

    //In Local-RIB, linkTree should contain specified key
    assertThat(obj.linkTree().containsKey(key), is(true));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:58,代码来源:BgpControllerImplTest.java


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