use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address in project bgpcep by opendaylight.
the class BmpMockUtil method createPeerUp.
static PeerUpNotification createPeerUp(final Ipv4Address peerIp, final InetAddress localAddress) {
final PeerUpNotificationBuilder msgBuilder = new PeerUpNotificationBuilder();
msgBuilder.setLocalAddress(new IpAddress(new Ipv4Address(localAddress.getHostAddress())));
msgBuilder.setLocalPort(PEER_PORT);
msgBuilder.setRemotePort(PEER_PORT);
msgBuilder.setReceivedOpen(new ReceivedOpenBuilder(createOpen(peerIp)).build());
msgBuilder.setSentOpen(new SentOpenBuilder(createOpen(new Ipv4Address(localAddress.getHostAddress()))).build());
msgBuilder.setPeerHeader(createPeerHeader(peerIp, AdjRibInType.PrePolicy));
return msgBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address in project bgpcep by opendaylight.
the class TestUtil method createAttributes.
private static Attributes createAttributes() {
final List<AsNumber> asSequences = Lists.newArrayList(new AsNumber(72L), new AsNumber(82L), new AsNumber(92L));
final List<Segments> segments = Lists.newArrayList();
final SegmentsBuilder segmentsBuild = new SegmentsBuilder();
segmentsBuild.setAsSequence(asSequences).build();
final AttributesBuilder attribBuilder = new AttributesBuilder().setAggregator(new AggregatorBuilder().setAsNumber(new AsNumber(72L)).setNetworkAddress(new Ipv4Address(IPV4_ADDRESS_20)).build()).setAigp(new AigpBuilder().setAigpTlv(new AigpTlvBuilder().setMetric(new AccumulatedIgpMetric(BigInteger.ONE)).build()).build()).setAsPath(new AsPathBuilder().setSegments(segments).build()).setAtomicAggregate(new AtomicAggregateBuilder().build()).setClusterId(new ClusterIdBuilder().setCluster(Lists.newArrayList(new ClusterIdentifier(IPV4_ADDRESS_30), new ClusterIdentifier(IPV4_ADDRESS_40))).build()).setCNextHop(new Ipv4NextHopCaseBuilder().setIpv4NextHop(new Ipv4NextHopBuilder().setGlobal(IPV4_ADDRESS_100).build()).build()).setCommunities(createCommunities()).setLocalPref(new LocalPrefBuilder().setPref(2L).build()).setMultiExitDisc(new MultiExitDiscBuilder().setMed(123L).build()).setOrigin(new OriginBuilder().setValue(BgpOrigin.Igp).build()).setOriginatorId(new OriginatorIdBuilder().setOriginator(IPV4_ADDRESS_12).build()).setUnrecognizedAttributes(new ArrayList<>());
return attribBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address in project bgpcep by opendaylight.
the class TestUtil method createRouteMirrorMsg.
public static RouteMirroringMessage createRouteMirrorMsg(final Ipv4Address bgpId) {
final RouteMirroringMessageBuilder routeMirrorMsgBuilder = new RouteMirroringMessageBuilder().setPeerHeader(createPeerHeader(bgpId));
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.mirror.TlvsBuilder tlvsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.mirror.TlvsBuilder();
tlvsBuilder.setMirrorInformationTlv(new MirrorInformationTlvBuilder().setCode(MirrorInformationCode.forValue(1)).build());
routeMirrorMsgBuilder.setTlvs(tlvsBuilder.build());
return routeMirrorMsgBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address in project bgpcep by opendaylight.
the class BmpMockSession method advertizePeers.
private void advertizePeers(final InetSocketAddress localAddress) {
channel.writeAndFlush(BmpMockUtil.createInitiation());
Ipv4Address peerAddress = PEER_ADDRESS;
for (int i = 0; i < this.peersCount; i++) {
channel.writeAndFlush(BmpMockUtil.createPeerUp(peerAddress, localAddress.getAddress()));
LOG.debug("BMP router {} advertized peer {}", channel.localAddress(), peerAddress);
advertizeRoutes(this.prePolicyRoutesCount, AdjRibInType.PrePolicy, channel, peerAddress);
advertizeRoutes(this.postPolicyRoutesCount, AdjRibInType.PostPolicy, channel, peerAddress);
peerAddress = incrementIpv4Address(peerAddress);
}
}
use of org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address in project bgpcep by opendaylight.
the class BmpMockSession method advertizeRoutes.
private static void advertizeRoutes(final int count, final AdjRibInType type, final Channel channel, final Ipv4Address peerAddress) {
Ipv4Prefix prefix = PREFIX;
for (int i = 0; i < count; i++) {
channel.writeAndFlush(BmpMockUtil.createRouteMonitoring(peerAddress, type, prefix));
prefix = incrementIpv4Prefix(prefix);
}
}
Aggregations