2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.protocol.bgp.mvpn.impl.attributes.tunnel.identifier;
11 import static org.opendaylight.protocol.bgp.mvpn.impl.attributes.tunnel.identifier.PAddressPMulticastGroupUtil.parseIpAddress;
12 import static org.opendaylight.protocol.bgp.mvpn.impl.attributes.tunnel.identifier.PAddressPMulticastGroupUtil.serializeIpAddress;
14 import io.netty.buffer.ByteBuf;
15 import org.opendaylight.protocol.bgp.mvpn.spi.attributes.tunnel.identifier.AbstractTunnelIdentifier;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.PmsiTunnelType;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.TunnelIdentifier;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.IngressReplication;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.IngressReplicationBuilder;
21 public final class IngressReplicationParser extends AbstractTunnelIdentifier<IngressReplication> {
23 public int serialize(final IngressReplication tunnelIdentifier, final ByteBuf buffer) {
24 final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi
25 .tunnel.tunnel.identifier.ingress.replication.IngressReplication ingressReplication =
26 tunnelIdentifier.getIngressReplication();
27 serializeIpAddress(ingressReplication.getReceivingEndpointAddress(), buffer);
32 public Class<? extends TunnelIdentifier> getClazz() {
33 return IngressReplication.class;
37 public IngressReplication parse(final ByteBuf buffer) {
38 final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi
39 .tunnel.tunnel.identifier.ingress.replication.IngressReplication builder =
40 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel
41 .pmsi.tunnel.tunnel.identifier.ingress.replication.IngressReplicationBuilder()
42 .setReceivingEndpointAddress(parseIpAddress(buffer.readableBytes(), buffer)).build();
43 return new IngressReplicationBuilder().setIngressReplication(builder).build();
47 public int getType() {
48 return PmsiTunnelType.IngressReplication.getIntValue();