use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.StatsReportsMessageBuilder in project bgpcep by opendaylight.
the class StatisticsReportHandler method parseMessageBody.
@Override
public Notification parseMessageBody(final ByteBuf bytes) throws BmpDeserializationException {
final StatsReportsMessageBuilder statReport = new StatsReportsMessageBuilder().setPeerHeader(parsePerPeerHeader(bytes));
final TlvsBuilder tlvsBuilder = new TlvsBuilder();
bytes.skipBytes(Integer.BYTES);
parseTlvs(tlvsBuilder, bytes);
return statReport.setTlvs(tlvsBuilder.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.StatsReportsMessageBuilder in project bgpcep by opendaylight.
the class TestUtil method createStatsReportMsg.
public static StatsReportsMessage createStatsReportMsg(final Ipv4AddressNoZone bgpId) {
final StatsReportsMessageBuilder statsReportMsgBuilder = new StatsReportsMessageBuilder();
statsReportMsgBuilder.setPeerHeader(TestUtil.createPeerHeader(bgpId));
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.stat.TlvsBuilder tlvsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.stat.TlvsBuilder();
tlvsBuilder.setAdjRibsInRoutesTlv(new AdjRibsInRoutesTlvBuilder().setCount(new Gauge64(Uint64.TEN)).build());
tlvsBuilder.setDuplicatePrefixAdvertisementsTlv(new DuplicatePrefixAdvertisementsTlvBuilder().setCount(new Counter32(Uint32.valueOf(16L))).build());
tlvsBuilder.setDuplicateWithdrawsTlv(new DuplicateWithdrawsTlvBuilder().setCount(new Counter32(Uint32.valueOf(11L))).build());
tlvsBuilder.setInvalidatedAsConfedLoopTlv(new InvalidatedAsConfedLoopTlvBuilder().setCount(new Counter32(Uint32.valueOf(55L))).build());
tlvsBuilder.setInvalidatedAsPathLoopTlv(new InvalidatedAsPathLoopTlvBuilder().setCount(new Counter32(Uint32.valueOf(66L))).build());
tlvsBuilder.setInvalidatedClusterListLoopTlv(new InvalidatedClusterListLoopTlvBuilder().setCount(new Counter32(Uint32.valueOf(53L))).build());
tlvsBuilder.setInvalidatedOriginatorIdTlv(new InvalidatedOriginatorIdTlvBuilder().setCount(new Counter32(Uint32.valueOf(70L))).build());
tlvsBuilder.setLocRibRoutesTlv(new LocRibRoutesTlvBuilder().setCount(new Gauge64(Uint64.valueOf(100L))).build());
tlvsBuilder.setRejectedPrefixesTlv(new RejectedPrefixesTlvBuilder().setCount(new Counter32(Uint32.valueOf(8L))).build());
tlvsBuilder.setPerAfiSafiAdjRibInTlv(new PerAfiSafiAdjRibInTlvBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setCount(new Gauge64(Uint64.valueOf(9L))).build());
tlvsBuilder.setPerAfiSafiLocRibTlv(new PerAfiSafiLocRibTlvBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setCount(new Gauge64(Uint64.TEN)).build());
tlvsBuilder.setUpdatesTreatedAsWithdrawTlv(new UpdatesTreatedAsWithdrawTlvBuilder().setCount(new Counter32(Uint32.valueOf(11L))).build());
tlvsBuilder.setPrefixesTreatedAsWithdrawTlv(new PrefixesTreatedAsWithdrawTlvBuilder().setCount(new Counter32(Uint32.valueOf(12L))).build());
tlvsBuilder.setDuplicateUpdatesTlv(new DuplicateUpdatesTlvBuilder().setCount(new Counter32(Uint32.valueOf(13L))).build());
return statsReportMsgBuilder.setTlvs(tlvsBuilder.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev200120.StatsReportsMessageBuilder in project bgpcep by opendaylight.
the class TestUtil method createStatsReportMsg.
public static StatsReportsMessage createStatsReportMsg(final Ipv4Address bgpId) {
final StatsReportsMessageBuilder statsReportMsgBuilder = new StatsReportsMessageBuilder();
statsReportMsgBuilder.setPeerHeader(TestUtil.createPeerHeader(bgpId));
final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.stat.TlvsBuilder tlvsBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev171207.stat.TlvsBuilder();
tlvsBuilder.setAdjRibsInRoutesTlv(new AdjRibsInRoutesTlvBuilder().setCount(new Gauge64(BigInteger.valueOf(10L))).build());
tlvsBuilder.setDuplicatePrefixAdvertisementsTlv(new DuplicatePrefixAdvertisementsTlvBuilder().setCount(new Counter32(16L)).build());
tlvsBuilder.setDuplicateWithdrawsTlv(new DuplicateWithdrawsTlvBuilder().setCount(new Counter32(11L)).build());
tlvsBuilder.setInvalidatedAsConfedLoopTlv(new InvalidatedAsConfedLoopTlvBuilder().setCount(new Counter32(55L)).build());
tlvsBuilder.setInvalidatedAsPathLoopTlv(new InvalidatedAsPathLoopTlvBuilder().setCount(new Counter32(66L)).build());
tlvsBuilder.setInvalidatedClusterListLoopTlv(new InvalidatedClusterListLoopTlvBuilder().setCount(new Counter32(53L)).build());
tlvsBuilder.setInvalidatedOriginatorIdTlv(new InvalidatedOriginatorIdTlvBuilder().setCount(new Counter32(70L)).build());
tlvsBuilder.setLocRibRoutesTlv(new LocRibRoutesTlvBuilder().setCount(new Gauge64(BigInteger.valueOf(100L))).build());
tlvsBuilder.setRejectedPrefixesTlv(new RejectedPrefixesTlvBuilder().setCount(new Counter32(8L)).build());
tlvsBuilder.setPerAfiSafiAdjRibInTlv(new PerAfiSafiAdjRibInTlvBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setCount(new Gauge64(BigInteger.valueOf(9L))).build());
tlvsBuilder.setPerAfiSafiLocRibTlv(new PerAfiSafiLocRibTlvBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setCount(new Gauge64(BigInteger.valueOf(10L))).build());
tlvsBuilder.setUpdatesTreatedAsWithdrawTlv(new UpdatesTreatedAsWithdrawTlvBuilder().setCount(new Counter32(11L)).build());
tlvsBuilder.setPrefixesTreatedAsWithdrawTlv(new PrefixesTreatedAsWithdrawTlvBuilder().setCount(new Counter32(12L)).build());
tlvsBuilder.setDuplicateUpdatesTlv(new DuplicateUpdatesTlvBuilder().setCount(new Counter32(13L)).build());
return statsReportMsgBuilder.setTlvs(tlvsBuilder.build()).build();
}
Aggregations