use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi in project bgpcep by opendaylight.
the class LanParser method serializeBody.
@Override
public void serializeBody(final Esi esi, final ByteBuf body) {
Preconditions.checkArgument(esi instanceof LanAutoGeneratedCase, "Unknown esi instance. Passed %s. Needed LanAutoGeneratedCase.", esi.getClass());
final LanAutoGenerated lan = ((LanAutoGeneratedCase) esi).getLanAutoGenerated();
body.writeBytes(IetfYangUtil.INSTANCE.bytesFor(lan.getRootBridgeMacAddress()));
ByteBufWriteUtil.writeUnsignedShort(lan.getRootBridgePriority(), body);
body.writeZero(ZERO_BYTE);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi in project bgpcep by opendaylight.
the class MacParser method serializeBody.
@Override
public void serializeBody(final Esi esi, final ByteBuf body) {
Preconditions.checkArgument(esi instanceof MacAutoGeneratedCase, "Unknown esi instance. Passed %s. Needed MacAutoGeneratedCase.", esi.getClass());
final MacAutoGenerated macAuto = ((MacAutoGeneratedCase) esi).getMacAutoGenerated();
body.writeBytes(IetfYangUtil.INSTANCE.bytesFor(macAuto.getSystemMacAddress()));
ByteBufWriteUtil.writeMedium(macAuto.getLocalDiscriminator().getValue().intValue(), body);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi in project bgpcep by opendaylight.
the class RouterIdParser method serializeBody.
@Override
public void serializeBody(final Esi esi, final ByteBuf body) {
Preconditions.checkArgument(esi instanceof RouterIdGeneratedCase, "Unknown esi instance. Passed %s. Needed RouterIdGeneratedCase.", esi.getClass());
final RouterIdGenerated routerID = ((RouterIdGeneratedCase) esi).getRouterIdGenerated();
ByteBufWriteUtil.writeIpv4Address(routerID.getRouterId(), body);
ByteBufWriteUtil.writeUnsignedInt(routerID.getLocalDiscriminator(), body);
body.writeZero(ZERO_BYTE);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi in project bgpcep by opendaylight.
the class RouterIdParser method serializeEsi.
@Override
public Esi serializeEsi(final ContainerNode esi) {
final RouterIdGeneratedBuilder builder = new RouterIdGeneratedBuilder();
builder.setLocalDiscriminator(extractLD(esi));
builder.setRouterId(extractRD(esi));
return new RouterIdGeneratedCaseBuilder().setRouterIdGenerated(builder.build()).build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev171213.esi.Esi in project bgpcep by opendaylight.
the class ASGenParser method serializeBody.
@Override
public void serializeBody(final Esi esi, final ByteBuf body) {
Preconditions.checkArgument(esi instanceof AsGeneratedCase, "Unknown esi instance. Passed %s. Needed AsGeneratedCase.", esi.getClass());
final AsGenerated asGen = ((AsGeneratedCase) esi).getAsGenerated();
writeUnsignedInt(asGen.getAs().getValue(), body);
writeUnsignedInt(asGen.getLocalDiscriminator(), body);
body.writeZero(ZERO_BYTE);
}
Aggregations