2 * Copyright (c) 2014 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
8 package org.opendaylight.protocol.bgp.linkstate.impl.tlvs;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.protocol.bgp.linkstate.spi.LinkstateTlvParser;
12 import org.opendaylight.protocol.util.ByteBufWriteUtil;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.AreaIdentifier;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev180329.linkstate.object.type.node._case.NodeDescriptors;
15 import org.opendaylight.yangtools.yang.common.QName;
17 public final class AreaIdTlvParser implements LinkstateTlvParser<AreaIdentifier>,
18 LinkstateTlvParser.LinkstateTlvSerializer<AreaIdentifier> {
20 private static final int AREA_ID = 514;
22 public static final QName AREA_ID_QNAME = QName.create(NodeDescriptors.QNAME, "area-id").intern();
25 public void serializeTlvBody(final AreaIdentifier tlv, final ByteBuf body) {
26 ByteBufWriteUtil.writeUnsignedInt(tlv.getValue(), body);
30 public AreaIdentifier parseTlvBody(final ByteBuf value) {
31 return new AreaIdentifier(value.readUnsignedInt());
35 public int getType() {
40 public QName getTlvQName() {