use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project genius by opendaylight.
the class HwVTEPInterfaceConfigUpdateHelper method updateBfdMonitoring.
/*
* BFD monitoring interval and enable/disable attributes can be modified
*/
public static List<ListenableFuture<Void>> updateBfdMonitoring(ManagedNewTransactionRunner txRunner, InstanceIdentifier<Node> globalNodeId, InstanceIdentifier<Node> physicalSwitchId, IfTunnel ifTunnel) {
TunnelsBuilder tunnelsBuilder = new TunnelsBuilder();
InstanceIdentifier<TerminationPoint> localTEPInstanceIdentifier = SouthboundUtils.createTEPInstanceIdentifier(globalNodeId, ifTunnel.getTunnelSource());
InstanceIdentifier<TerminationPoint> remoteTEPInstanceIdentifier = SouthboundUtils.createTEPInstanceIdentifier(globalNodeId, ifTunnel.getTunnelDestination());
InstanceIdentifier<Tunnels> tunnelsInstanceIdentifier = SouthboundUtils.createTunnelsInstanceIdentifier(physicalSwitchId, localTEPInstanceIdentifier, remoteTEPInstanceIdentifier);
LOG.debug("updating bfd monitoring parameters for the hwvtep {}", tunnelsInstanceIdentifier);
tunnelsBuilder.setKey(new TunnelsKey(new HwvtepPhysicalLocatorRef(localTEPInstanceIdentifier), new HwvtepPhysicalLocatorRef(remoteTEPInstanceIdentifier)));
List<BfdParams> bfdParams = new ArrayList<>();
SouthboundUtils.fillBfdParameters(bfdParams, ifTunnel);
tunnelsBuilder.setBfdParams(bfdParams);
return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.merge(LogicalDatastoreType.CONFIGURATION, tunnelsInstanceIdentifier, tunnelsBuilder.build(), WriteTransaction.CREATE_MISSING_PARENTS)));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testMldpmP2MpLsp.
@Test
public void testMldpmP2MpLsp() throws Exception {
final Attributes expected = buildMLDpMp2mPLspAttribute();
final ByteBuf actual = Unpooled.buffer();
this.handler.serializeAttribute(expected, actual);
assertArrayEquals(M_LDP_MP_2_MP_LSP_EXPECTED, ByteArray.readAllBytes(actual));
final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_MP_2_MP_LSP_EXPECTED), null);
assertEquals(expected, actualAttr);
final Attributes actualWrong = this.handler.parseAttributes(Unpooled.wrappedBuffer(M_LDP_MP_2_MP_LSP_WRONG), null);
assertEquals(buildWOTunnelInfAttribute(), actualWrong);
final Attributes wrongAttribute = buildMldpMP2mpLspWrongAttribute();
final ByteBuf actualWrongBuf = Unpooled.buffer();
this.handler.serializeAttribute(wrongAttribute, actualWrongBuf);
assertArrayEquals(NO_TUNNEL_INFORMATION_PRESENT_EXPECTED, ByteArray.readAllBytes(actualWrongBuf));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testRsvpteP2MplspLsp.
@Test
public void testRsvpteP2MplspLsp() throws Exception {
final Attributes expected = buildRsvpTep2MPLspAttribute();
final ByteBuf actual = Unpooled.buffer();
this.handler.serializeAttribute(expected, actual);
assertArrayEquals(RSVP_TE_P2MP_LSP_LSP_EXPECTED, ByteArray.readAllBytes(actual));
final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(RSVP_TE_P2MP_LSP_LSP_EXPECTED), null);
assertEquals(expected, actualAttr);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testPMSITunnelAttributeParser.
@Test
public void testPMSITunnelAttributeParser() {
final PMSITunnelAttributeHandler pmsiHandler = new PMSITunnelAttributeHandler(ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAddressFamilyRegistry());
assertEquals(22, pmsiHandler.getType());
final AttributesBuilder builder = new AttributesBuilder();
final ByteBuf emptyBuffer = Unpooled.buffer();
pmsiHandler.parseAttribute(emptyBuffer, builder);
final Attributes emptyAttributes = new AttributesBuilder().build();
assertEquals(emptyAttributes, builder.build());
pmsiHandler.serializeAttribute(emptyAttributes, emptyBuffer);
assertEquals(Unpooled.buffer(), emptyBuffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testPimSMTree.
@Test
public void testPimSMTree() throws Exception {
final Attributes attributes = buildPimSMTreeAttribute();
final ByteBuf actual = Unpooled.buffer();
this.handler.serializeAttribute(attributes, actual);
assertArrayEquals(PIM_SM_TREE_EXPECTED, ByteArray.readAllBytes(actual));
final Attributes expected = buildPimSMTreeAttribute();
final Attributes actualAttr = this.handler.parseAttributes(Unpooled.wrappedBuffer(PIM_SM_TREE_EXPECTED), null);
assertEquals(expected, actualAttr);
}
Aggregations