Recognized Extended Administrative Group TLV 33/98033/4
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 21 Oct 2021 13:29:02 +0000 (15:29 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 21 Oct 2021 13:37:19 +0000 (13:37 +0000)
Recognize TLV 1173 and print a milder message when we encounter it.
Also change 'invalid' to 'unrecognized' in the warning we do print
for things we do not recognize.

JIRA: BGPCEP-987
Change-Id: I3eb8f903bbf4842fc00549f2afdc6548f85be6e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/attribute/LinkAttributesParser.java

index 5ba5f2020129ed32b6ecc60cb9ff5e894feacb04..eef30dc890daa30ae1a8966d089bba12d9d2b3ac 100644 (file)
@@ -79,7 +79,7 @@ public final class LinkAttributesParser {
     private static final int LDP_BIT = 0;
     private static final int RSVP_BIT = 1;
 
-    /* Link Attribute TLVs */
+    // Link Attribute TLVs
     private static final int REMOTE_IPV4_ROUTER_ID = 1030;
     private static final int REMOTE_IPV6_ROUTER_ID = 1031;
     private static final int ADMIN_GROUP = 1088;
@@ -97,6 +97,10 @@ public final class LinkAttributesParser {
     private static final int PEER_NODE_SID_CODE = 1101;
     private static final int PEER_ADJ_SID_CODE = 1102;
     private static final int PEER_SET_SID_CODE = 1103;
+
+    // RFC9104 Traffic Engineering Extended Administrative Groups
+    private static final int EXTENDED_ADMIN_GROUP = 1173;
+
     // Performance Metrics
     private static final int LINK_DELAY = 1114;
     private static final int LINK_MIN_MAX_DELAY = 1115;
@@ -106,8 +110,9 @@ public final class LinkAttributesParser {
     private static final int AVAILABLE_BANDWIDTH = 1119;
     private static final int UTILIZED_BANDWIDTH = 1120;
 
-    private LinkAttributesParser() {
 
+    private LinkAttributesParser() {
+        // Hidden on purpose
     }
 
     @FunctionalInterface
@@ -153,6 +158,10 @@ public final class LinkAttributesParser {
                     builder.setAdminGroup(new AdministrativeGroup(readUint32(value)));
                     LOG.debug("Parsed Administrative Group {}", builder.getAdminGroup());
                     break;
+                case EXTENDED_ADMIN_GROUP:
+                    // FIXME: BGPCEP-895: add proper implementation
+                    LOG.info("Support for Extended Administrative Group not implemented, ignoring it");
+                    break;
                 case MAX_BANDWIDTH:
                     builder.setMaxLinkBandwidth(new Bandwidth(ByteArray.readAllBytes(value)));
                     LOG.debug("Parsed Max Bandwidth {}", builder.getMaxLinkBandwidth());
@@ -250,7 +259,7 @@ public final class LinkAttributesParser {
                     LOG.debug("Parsed Utilized Bandwidth {}", builder.getUtilizedBandwidth());
                     break;
                 default:
-                    LOG.warn("TLV {} is not a valid link attribute, ignoring it", key);
+                    LOG.warn("TLV {} is not a recognized link attribute, ignoring it", key);
             }
         }
         if (!srAdjIds.isEmpty()) {