本文整理汇总了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));
}