import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.path.attribute.link.state.attribute.PrefixAttributesCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.path.attribute.link.state.attribute.prefix.attributes._case.PrefixAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.path.attribute.link.state.attribute.prefix.attributes._case.PrefixAttributesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.prefix.state.IgpBits;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.prefix.state.IgpBitsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.prefix.state.SrBindingSidLabels;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.prefix.state.SrPrefix;
private static final int FLAGS_SIZE = 8;
private static final int UP_DOWN_BIT = 0;
+ private static final int OSPF_NO_UNICAST = 1;
+ private static final int OSPF_LOCAL_ADDRESS = 2;
+ private static final int OSPF_PROPAGATE_ADDRESS = 3;
/* Prefix Attribute TLVs */
private static final int IGP_FLAGS = 1152;
case IGP_FLAGS:
final BitArray flags = BitArray.valueOf(value, FLAGS_SIZE);
final boolean upDownBit = flags.get(UP_DOWN_BIT);
- builder.setIgpBits(new IgpBitsBuilder().setUpDown(new UpDown(upDownBit)).build());
+ final boolean ospfNoUnicast = flags.get(OSPF_NO_UNICAST);
+ final boolean ospfLocalAddress = flags.get(OSPF_LOCAL_ADDRESS);
+ final boolean ospfPropagateAddress = flags.get(OSPF_PROPAGATE_ADDRESS);
+ builder.setIgpBits(new IgpBitsBuilder().setUpDown(new UpDown(upDownBit))
+ .setIsIsUpDown(upDownBit)
+ .setOspfNoUnicast(ospfNoUnicast)
+ .setOspfLocalAddress(ospfLocalAddress)
+ .setOspfPropagateNssa(ospfPropagateAddress)
+ .build());
LOG.debug("Parsed IGP flag (up/down bit) : {}", upDownBit);
break;
case ROUTE_TAG:
final PrefixAttributes prefixAtrributes = prefixAttributesCase.getPrefixAttributes();
if (prefixAtrributes.getIgpBits() != null) {
final BitArray igpBit = new BitArray(FLAGS_SIZE);
- igpBit.set(UP_DOWN_BIT, prefixAtrributes.getIgpBits().getUpDown().isUpDown());
+ final IgpBits igpBits = prefixAtrributes.getIgpBits();
+ igpBit.set(UP_DOWN_BIT, igpBits.getUpDown().isUpDown() || igpBits.isIsIsUpDown());
+ igpBit.set(OSPF_NO_UNICAST, igpBits.isOspfNoUnicast());
+ igpBit.set(OSPF_LOCAL_ADDRESS, igpBits.isOspfLocalAddress());
+ igpBit.set(OSPF_PROPAGATE_ADDRESS, igpBits.isOspfPropagateNssa());
TlvUtil.writeTLV(IGP_FLAGS, Unpooled.wrappedBuffer(igpBit.array()), byteAggregator);
}
serializeRouteTags(prefixAtrributes.getRouteTags(), byteAggregator);
// FIXME : use codec
private static int domProtocolIdValue(final String protocolId) {
switch (protocolId) {
- case "unknown":
- return ProtocolId.Unknown.getIntValue();
case "isis-level1":
return ProtocolId.IsisLevel1.getIntValue();
case "isis-level2":
return ProtocolId.Direct.getIntValue();
case "static":
return ProtocolId.Static.getIntValue();
+ case "ospf-v3":
+ return ProtocolId.OspfV3.getIntValue();
case "rsvp-te":
return ProtocolId.RsvpTe.getIntValue();
case "bgp-epe":
}
identity linkstate-address-family {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2";
base bgp-t:address-family;
}
identity linkstate-subsequent-address-family {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2";
base bgp-t:subsequent-address-family;
}
typedef nlri-type {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2";
type enumeration {
enum node {
value 1;
value 4;
}
enum ipv4-te-lsp {
+ status deprecated;
reference "http://tools.ietf.org/html/draft-ietf-idr-te-lsp-distribution-03#section-4.1";
value 5;
}
enum ipv6-te-lsp {
+ status deprecated;
reference "http://tools.ietf.org/html/draft-ietf-idr-te-lsp-distribution-03#section-4.1";
value 6;
}
}
typedef protocol-id {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2";
type enumeration {
- enum unknown {
- value 0;
- }
enum isis-level1 {
value 1;
}
enum static {
value 5;
}
- enum rsvp-te {
- reference "http://tools.ietf.org/html/draft-ietf-idr-te-lsp-distribution-03#section-2.1";
+ enum ospf-v3 {
value 6;
}
enum bgp-epe {
- reference "https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-00#section-4";
+ reference "https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-05#section-4";
value 7;
}
+ enum rsvp-te {
+ status deprecated;
+ reference "http://tools.ietf.org/html/draft-ietf-idr-te-lsp-distribution-03#section-2.1";
+ value 8; // rsvp-te protocol-id TBD by IANA
+ }
enum segment-routing {
+ status deprecated;
reference "http://tools.ietf.org/html/draft-ietf-idr-te-lsp-distribution-03#section-2.1";
- value 8; // segment-routing protocol-id TBD by IANA
+ value 9; // segment-routing protocol-id TBD by IANA
}
}
}
typedef ospf-route-type {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.3.1";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.3.1";
type enumeration {
enum intra-area {
value 1;
}
typedef domain-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.1.4";
type uint32;
}
typedef area-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.1.4";
type uint32;
}
}
typedef ospf-interface-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.1.4";
type uint32;
}
typedef topology-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.5";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.1.5";
type uint16 {
range "0..4095";
}
grouping isis-router-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.1.4";
leaf iso-system-id {
type netc:iso-system-identifier;
mandatory true;
}
grouping isis-lan-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.1.4";
container is-is-router-identifier {
uses isis-router-identifier;
}
}
grouping ospf-router-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.1.4";
leaf ospf-router-id {
type uint32;
mandatory true;
}
grouping ospf-v2-lan-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.1.4";
uses ospf-router-identifier;
leaf ipv4-address {
type ipv4-interface-identifier;
}
grouping ospf-v3-lan-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.2.1.4";
uses ospf-router-identifier;
leaf lan-interface {
type ospf-interface-identifier;
type topology-identifier;
}
leaf ospf-route-type {
- when "../../protocol-id = 'ospf'";
+ when "../../protocol-id[ .='ospf' or .='ospf-v3' ]";
type ospf-route-type;
}
leaf ip-reachability-information {
}
typedef node-flag-bits {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.1.1";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.3.1.1";
type bits {
bit overload {
position 0;
}
typedef isis-area-identifier {
- reference "https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.1.2";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.3.1.2";
type binary {
length "1..20";
}
}
typedef ipv4-router-identifier {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.3.1.4";
type inet:ipv4-address;
}
typedef ipv6-router-identifier {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.1.4";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.3.1.4";
type inet:ipv6-address;
}
grouping node-state {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.1";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.3.1";
leaf-list topology-identifier {
type topology-identifier;
}
}
typedef route-tag {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.3.2";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.3.3.2";
+ description "Carries original IGP TAGs of the prefix.";
type binary {
length "4";
}
}
typedef extended-route-tag {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.3.3";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.3.3.3";
+ description "Carries IS-IS Extended Route Tags of the prefix.";
type binary {
length "8";
}
}
grouping igp-bits {
- reference "http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.3.3.1";
+ reference "https://tools.ietf.org/html/rfc7752#section-3.3.3.1";
leaf up-down {
+ status deprecated;
type bits {
bit up-down {
position 0;
}
}
}
+ leaf is-is-up-down {
+ type boolean;
+ }
+ leaf ospf-no-unicast {
+ type boolean;
+ }
+ leaf ospf-local-address {
+ type boolean;
+ }
+ leaf ospf-propagate-nssa {
+ type boolean;
+ }
}
grouping prefix-state {
}
}
case te-lsp-attributes-case {
+ status deprecated;
description "LSP Object";
reference "http://tools.ietf.org/html/draft-ietf-idr-te-lsp-distribution-03#section-2.2";
container te-lsp-attributes {
description
"This module contains the base data concepts contained
- in draft-gredler-idr-bgp-ls-segment-routing-ext-00.
+ in draft-gredler-idr-bgp-ls-segment-routing-ext-02.
Copyright (c)2015 Cisco Systems, Inc. All rights reserved.
}
typedef algorithm {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.1.2";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.1.2";
type enumeration {
enum shortest-path-first {
value 0;
}
typedef weight {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.2";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.2";
type uint8;
}
grouping sid-label-index {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.3.4.2";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.4";
choice sid-label-index {
case local-label-case {
leaf local-label {
}
grouping sr-capabilities-tlv {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.1.1";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.1.1";
leaf mpls-ipv4 {
type boolean;
}
}
grouping ospf-adj-flags {
- reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-05#section-7.1";
+ reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-08#section-7.1";
leaf backup {
type boolean;
}
uses ospf-adj-flags;
}
case isis-adj-flags-case {
- reference "https://tools.ietf.org/html/draft-ietf-isis-segment-routing-extensions-05#section-2.2.1";
+ reference "https://tools.ietf.org/html/draft-ietf-isis-segment-routing-extensions-06#section-2.2.1";
uses ospf-adj-flags;
leaf address-family {
type boolean;
}
grouping adj-sid-tlv {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.2.1";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.2.1";
uses adj-flags;
leaf weight {
type weight;
}
grouping lan-adj-sid-tlv {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.2.2";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.2.2";
uses adj-flags;
leaf weight {
type weight;
}
grouping prefix-sid-tlv {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.3.1";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.1";
choice flags {
case isis-prefix-flags-case {
- reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-05#section-5";
+ reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-08#section-5";
uses prefix-flags;
leaf readvertisement {
type boolean;
}
grouping binding-sub-tlvs {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.3.4";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.4";
choice binding-sub-tlv {
case prefix-sid-case {
uses prefix-sid-tlv;
}
grouping isis-binding-flags {
- reference "https://tools.ietf.org/html/draft-ietf-isis-segment-routing-extensions-05#section-2.4";
+ reference "https://tools.ietf.org/html/draft-ietf-isis-segment-routing-extensions-06#section-2.4";
leaf address-family {
type boolean;
}
}
grouping ospf-binding-flags {
- reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-05#section-6";
+ reference "https://tools.ietf.org/html/draft-ietf-ospf-segment-routing-extensions-08#section-6";
leaf mirroring {
type boolean;
}
}
grouping binding-sid-tlv {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.3.3";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.3";
leaf weight {
type weight;
}
}
grouping range-tlv {
- reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-00#section-2.3.2";
+ reference "https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-02#section-2.3.2";
leaf inter-area {
type boolean;
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.path.attribute.link.state.attribute.node.attributes._case.NodeAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.path.attribute.link.state.attribute.prefix.attributes._case.PrefixAttributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.linkstate.path.attribute.link.state.attribute.te.lsp.attributes._case.TeLspAttributes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.prefix.state.IgpBits;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationLinkstateCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.linkstate._case.DestinationLinkstateBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.AttributesBuilder;
4, 0x0b, 0, 2, 0, 1 // sr-algorythms
};
- private static final byte[] P4_ATTR = { 0x04, (byte) 0x80, 0, 0x01, (byte) 0x80, 0x04, (byte) 0x81, 0, 0x08, 0x12, 0x34, 0x56, 0x78,
+ private static final byte[] P4_ATTR = { 0x04, (byte) 0x80, 0, 0x01, (byte) 0xF0, 0x04, (byte) 0x81, 0, 0x08, 0x12, 0x34, 0x56, 0x78,
0x10, 0x30, 0x50, 0x70, 0x04, (byte) 0x82, 0, 0x08, 0x12, 0x34, 0x56, 0x78, 0x10, 0x30, 0x50, 0x70,
0x04, (byte) 0x83, 0, 0x04, 0, 0, 0, 0x0a, 0x04, (byte) 0x84, 0, 0x04, 0x0a, 0x19, 0x02, 0x1b,
4, (byte)0x86, 0,8, (byte)0xf0, 0, 0,0, 1,2,3,4, // prefix-sid tlv
assertFalse(ls.getSrRange().isInterArea());
assertEquals(1, ls.getSrRange().getSubTlvs().size());
assertNotNull(ls.getSrBindingSidLabels());
- assertTrue(ls.getIgpBits().getUpDown().isUpDown());
+ final IgpBits ispBits = ls.getIgpBits();
+ assertTrue(ispBits.getUpDown().isUpDown());
+ assertTrue(ispBits.isIsIsUpDown());
+ assertTrue(ispBits.isOspfNoUnicast());
+ assertTrue(ispBits.isOspfLocalAddress());
+ assertTrue(ispBits.isOspfPropagateNssa());
assertEquals(2, ls.getRouteTags().size());
assertArrayEquals(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 }, ls.getRouteTags().get(0).getValue());
assertEquals(1, ls.getExtendedTags().size());
private final byte[] teLspNlri = new byte[] { (byte) 0x00, (byte) 0x05, //NLRI Type Te-IPV4
(byte) 0x00, (byte) 0x12, // length
- (byte) 0x06, //Protocol-ID
+ (byte) 0x08, //Protocol-ID
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01, // Identifier
(byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, //IPv4 Tunnel Sender Address
(byte) 0x00, (byte) 0x01, //Tunnel ID
switch (value.getProtocolId()) {
case Direct:
case Static:
- case Unknown:
- break;
case IsisLevel1:
case IsisLevel2:
ilab.addAugmentation(
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.isis.topology.rev131021.IgpLinkAttributes1.class,
isisLinkAttributes(ld.getMultiTopologyId(), la));
break;
+ case OspfV3:
case Ospf:
ilab.addAugmentation(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.ospf.topology.rev131021.IgpLinkAttributes1.class,
ospfLinkAttributes(ld.getMultiTopologyId(), la));
switch (value.getProtocolId()) {
case Direct:
case Static:
- case Unknown:
- break;
case IsisLevel1:
case IsisLevel2:
inab.addAugmentation(
case IsisLevel1:
case IsisLevel2:
case Static:
- case Unknown:
- break;
case Ospf:
if (pa != null && pa.getOspfForwardingAddress() != null) {
pb.addAugmentation(