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 io.netty.buffer.ByteBuf;
12 import org.opendaylight.protocol.bgp.mvpn.spi.attributes.tunnel.identifier.AbstractTunnelIdentifier;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.PmsiTunnelType;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.TunnelIdentifier;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.BidirPimTree;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi.tunnel.tunnel.identifier.BidirPimTreeBuilder;
18 public final class BidirPimTreeParser extends AbstractTunnelIdentifier<BidirPimTree> {
19 public int getType() {
20 return PmsiTunnelType.BidirPimTree.getIntValue();
24 public int serialize(final BidirPimTree tunnelIdentifier, final ByteBuf buffer) {
25 PAddressPMulticastGroupUtil.serializeSenderPMulticastGroup(tunnelIdentifier.getBidirPimTree(), buffer);
26 return PmsiTunnelType.BidirPimTree.getIntValue();
30 public Class<? extends TunnelIdentifier> getClazz() {
31 return BidirPimTree.class;
35 public BidirPimTree parse(final ByteBuf buffer) {
36 final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel.pmsi
37 .tunnel.tunnel.identifier.bidir.pim.tree.BidirPimTreeBuilder bidirPimTree =
38 new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pmsi.tunnel.rev180329.pmsi.tunnel
39 .pmsi.tunnel.tunnel.identifier.bidir.pim.tree.BidirPimTreeBuilder(PAddressPMulticastGroupUtil
40 .parseSenderPMulticastGroup(buffer));
41 return new BidirPimTreeBuilder().setBidirPimTree(bidirPimTree.build()).build();