2 * Copyright (c) 2018 AT&T Intellectual Property. 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.nlri;
11 import io.netty.buffer.ByteBuf;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.NlriType;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.mvpn.MvpnChoice;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.mvpn.mvpn.choice.SourceTreeJoinCase;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.mvpn.mvpn.choice.SourceTreeJoinCaseBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.mvpn.mvpn.choice.source.tree.join._case.SourceTreeJoinBuilder;
19 * https://tools.ietf.org/html/rfc6514#section-4.6.
21 * @author Claudio D. Gasparini
23 public final class SourceTreeJoinHandler extends AbstractMvpnNlri<SourceTreeJoinCase> {
25 public int getType() {
26 return NlriType.SourceTreeJoin.getIntValue();
31 public SourceTreeJoinCase parseMvpn(final ByteBuf buffer) {
32 return new SourceTreeJoinCaseBuilder().setSourceTreeJoin(
33 new SourceTreeJoinBuilder().setCMulticast(CMulticastUtil.parseCMulticastGrouping(buffer))
38 protected ByteBuf serializeBody(final SourceTreeJoinCase mvpn) {
39 return CMulticastUtil.serializeCMulticast(mvpn.getSourceTreeJoin().getCMulticast());
43 public Class<? extends MvpnChoice> getClazz() {
44 return SourceTreeJoinCase.class;