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();
}
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();
}
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();
}
Aggregations