Recognized Extended Administrative Group TLV 23/97823/1
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:30 +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 217cb49d2f04696f8515534d7bf51edb656c1208..9ebf36e94667b09b9d2049f38524eb31afe6441e 100644 (file)
@@ -76,7 +76,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;
@@ -94,6 +94,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;
@@ -103,8 +107,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
@@ -150,6 +155,10 @@ public final class LinkAttributesParser {
                     builder.setAdminGroup(new AdministrativeGroup(ByteBufUtils.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());
@@ -245,7 +254,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()) {