2 * Copyright (c) 2015 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.rsvp.parser.spi.subobjects;
10 import io.netty.buffer.ByteBuf;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.UnnumberedCase;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.UnnumberedCaseBuilder;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.unnumbered._case.Unnumbered;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.unnumbered._case.UnnumberedBuilder;
15 import org.opendaylight.yangtools.yang.common.netty.ByteBufUtils;
17 public final class UnnumberedInterfaceSubobjectUtils {
18 private UnnumberedInterfaceSubobjectUtils() {
22 public static UnnumberedCase parseUnnumeredInterface(final ByteBuf buffer) {
23 return new UnnumberedCaseBuilder()
24 .setUnnumbered(new UnnumberedBuilder()
25 .setRouterId(ByteBufUtils.readUint32(buffer))
26 .setInterfaceId(ByteBufUtils.readUint32(buffer))
31 public static void serializeUnnumeredInterface(final Unnumbered unnumbered, final ByteBuf body) {
32 ByteBufUtils.writeMandatory(body, unnumbered.getRouterId(), "RouterId");
33 ByteBufUtils.writeMandatory(body, unnumbered.getInterfaceId(), "InterfaceId");