Search in sources :

Example 1 with RsvpTeP2mpLps

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.rsvp.te.p2mp.lsp.RsvpTeP2mpLps in project bgpcep by opendaylight.

the class RsvpTeP2MpLspParser method serialize.

@Override
public int serialize(final TunnelIdentifier tunnelIdentifier, final ByteBuf buffer) {
    Preconditions.checkArgument(tunnelIdentifier instanceof RsvpTeP2mpLsp, "The tunnelIdentifier %s is not RsvpTeP2mpLps type.", tunnelIdentifier);
    final RsvpTeP2mpLps rsvpTeP2mpLsp = ((RsvpTeP2mpLsp) tunnelIdentifier).getRsvpTeP2mpLps();
    ByteBufWriteUtil.writeUnsignedInt(rsvpTeP2mpLsp.getP2mpId(), buffer);
    buffer.writeZero(RESERVED);
    ByteBufWriteUtil.writeUnsignedShort(rsvpTeP2mpLsp.getTunnelId(), buffer);
    serializeIpAddress(rsvpTeP2mpLsp.getExtendedTunnelId(), buffer);
    return TunnelType.RSVP_TE_P2MP_LSP.getIntValue();
}
Also used : RsvpTeP2mpLps(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.rsvp.te.p2mp.lsp.RsvpTeP2mpLps) RsvpTeP2mpLsp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.RsvpTeP2mpLsp)

Example 2 with RsvpTeP2mpLps

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.rsvp.te.p2mp.lsp.RsvpTeP2mpLps in project bgpcep by opendaylight.

the class RsvpTeP2MpLspParser method parse.

@Override
public TunnelIdentifier parse(final ByteBuf buffer) {
    final RsvpTeP2mpLpsBuilder rsvpTeP2mpLps = new RsvpTeP2mpLpsBuilder();
    rsvpTeP2mpLps.setP2mpId(buffer.readUnsignedInt());
    buffer.skipBytes(2);
    rsvpTeP2mpLps.setTunnelId(buffer.readUnsignedShort());
    final int ipLength = buffer.readableBytes();
    rsvpTeP2mpLps.setExtendedTunnelId(parseIpAddress(ipLength, buffer));
    return new RsvpTeP2mpLspBuilder().setRsvpTeP2mpLps(rsvpTeP2mpLps.build()).build();
}
Also used : RsvpTeP2mpLspBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.RsvpTeP2mpLspBuilder) RsvpTeP2mpLpsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.rsvp.te.p2mp.lsp.RsvpTeP2mpLpsBuilder)

Example 3 with RsvpTeP2mpLps

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.rsvp.te.p2mp.lsp.RsvpTeP2mpLps in project bgpcep by opendaylight.

the class MldpP2mpLspParser method serialize.

@Override
public int serialize(final TunnelIdentifier tunnelIdentifier, final ByteBuf buffer) {
    Preconditions.checkArgument(tunnelIdentifier instanceof MldpP2mpLsp, "The tunnelIdentifier %s is not RsvpTeP2mpLps type.", tunnelIdentifier);
    final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.mldp.p2mp.lsp.MldpP2mpLsp mldpP2mpLsp = ((MldpP2mpLsp) tunnelIdentifier).getMldpP2mpLsp();
    final ByteBuf opaqueValues = Unpooled.buffer();
    final int addressFamily = getAddressFamilyValue(mldpP2mpLsp.getAddressFamily());
    if (!serializeOpaqueList(mldpP2mpLsp.getOpaqueValue(), opaqueValues) || addressFamily == 0) {
        return NO_TUNNEL_INFORMATION_PRESENT;
    }
    final IpAddress rootNode = mldpP2mpLsp.getRootNodeAddress();
    ByteBufWriteUtil.writeUnsignedByte(P2MP_TYPE, buffer);
    ByteBufWriteUtil.writeUnsignedShort(addressFamily, buffer);
    ByteBufWriteUtil.writeUnsignedByte(getAdressFamilyLength(rootNode), buffer);
    serializeIpAddress(rootNode, buffer);
    ByteBufWriteUtil.writeUnsignedShort(opaqueValues.readableBytes(), buffer);
    buffer.writeBytes(opaqueValues);
    return TunnelType.MLDP_P2MP_LSP.getIntValue();
}
Also used : MldpP2mpLsp(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.MldpP2mpLsp) ByteBuf(io.netty.buffer.ByteBuf) PAddressPMulticastGroupUtil.serializeIpAddress(org.opendaylight.protocol.bgp.evpn.impl.attributes.tunnel.identifier.PAddressPMulticastGroupUtil.serializeIpAddress) PAddressPMulticastGroupUtil.parseIpAddress(org.opendaylight.protocol.bgp.evpn.impl.attributes.tunnel.identifier.PAddressPMulticastGroupUtil.parseIpAddress) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 PAddressPMulticastGroupUtil.parseIpAddress (org.opendaylight.protocol.bgp.evpn.impl.attributes.tunnel.identifier.PAddressPMulticastGroupUtil.parseIpAddress)1 PAddressPMulticastGroupUtil.serializeIpAddress (org.opendaylight.protocol.bgp.evpn.impl.attributes.tunnel.identifier.PAddressPMulticastGroupUtil.serializeIpAddress)1 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)1 MldpP2mpLsp (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.MldpP2mpLsp)1 RsvpTeP2mpLsp (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.RsvpTeP2mpLsp)1 RsvpTeP2mpLspBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.RsvpTeP2mpLspBuilder)1 RsvpTeP2mpLps (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.rsvp.te.p2mp.lsp.RsvpTeP2mpLps)1 RsvpTeP2mpLpsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev160812.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.rsvp.te.p2mp.lsp.RsvpTeP2mpLpsBuilder)1