Search in sources :

Example 1 with RedirectAs4

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.redirect.as4.extended.community.RedirectAs4 in project bgpcep by opendaylight.

the class RedirectAsFourOctetEcHandler method serializeExtendedCommunity.

@Override
public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf byteAggregator) {
    Preconditions.checkArgument(extendedCommunity instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.RedirectAs4ExtendedCommunity, "The extended community %s is not RedirectAs4ExtendedCommunityCase type.", extendedCommunity);
    final RedirectAs4 redirect = ((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.RedirectAs4ExtendedCommunity) extendedCommunity).getRedirectAs4();
    ByteBufWriteUtil.writeUnsignedInt(redirect.getGlobalAdministrator().getValue(), byteAggregator);
    ByteBufWriteUtil.writeUnsignedShort(redirect.getLocalAdministrator(), byteAggregator);
}
Also used : Preconditions(com.google.common.base.Preconditions) RedirectAs4(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.redirect.as4.extended.community.RedirectAs4)

Aggregations

Preconditions (com.google.common.base.Preconditions)1 RedirectAs4 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev171207.redirect.as4.extended.community.RedirectAs4)1