MVPN Extended communities Handlers 53/71253/5
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 24 Apr 2018 08:52:30 +0000 (10:52 +0200)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Fri, 27 Apr 2018 08:13:29 +0000 (10:13 +0200)
- Source AS (2 Oct/4 Oct) Extended community
- Vrf Route Import Extended community

Change-Id: I853b17d0e10362c45aa80b7edfaa8e63a37f2dda
JIRA: BGPCEP-396
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/concepts/src/main/yang/bgp-types.yang
bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/BGPActivator.java [new file with mode: 0644]
bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/extended/community/SourceAS4OctectHandler.java [moved from bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/four/octect/as/specific/SourceAS4OctectHandler.java with 71% similarity]
bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/extended/community/SourceASHandler.java [moved from bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/SourceASHandler.java with 69% similarity]
bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/extended/community/VrfRouteImportHandler.java [moved from bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/VrfRouteImportHandler.java with 68% similarity]
bgp/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator [new file with mode: 0644]
bgp/mvpn/src/main/resources/org/opendaylight/blueprint/bgp-mvpn.xml [new file with mode: 0644]
bgp/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/extended/community/SourceAS4OctectASHandlerTest.java [moved from bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/SourceAS4OctectASHandlerTest.java with 65% similarity]
bgp/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/extended/community/SourceASHandlerTest.java [moved from bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/SourceASHandlerTest.java with 68% similarity]
bgp/mvpn/src/test/java/org/opendaylight/protocol/bgp/mvpn/impl/attributes/extended/community/VrfRouteImportHandlerTest.java [moved from bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/extended/communities/VrfRouteImportHandlerTest.java with 72% similarity]
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/BGPActivator.java

index ece9ceb65fa48b79b02fb640e9019e2feee55341..064364bf3141fac4067ad7189cff077fec9705e4 100644 (file)
@@ -299,14 +299,6 @@ module bgp-types {
                     }
                 }
             }
-            case source-as-extended-community-case {
-                container source-as-extended-community {
-                    reference "https://tools.ietf.org/html/rfc6514#section-6";
-                    leaf global-administrator {
-                        type short-as-number;
-                    }
-                }
-            }
             case inet4-specific-extended-community-case {
                 container inet4-specific-extended-community {
                     uses inet4-specific-extended-community-common;
@@ -390,29 +382,11 @@ module bgp-types {
                     uses as-4-spec-common;
                 }
             }
-            case source-as-4-extended-community-case {
-                container source-as-4-extended-community {
-                    reference "https://tools.ietf.org/html/rfc6514#section-6";
-                    leaf as-number {
-                        description "Carries a 4-octet Autonomous System (AS) number";
-                        reference "https://tools.ietf.org/html/rfc5668#section-2";
-
-                        mandatory true;
-                        type inet:as-number;
-                    }
-                }
-            }
             case encapsulation-case {
                 container encapsulation-extended-community {
                     uses encapsulation-extended-community;
                 }
             }
-            case vrf-route-import-extended-community-case {
-                reference "https://tools.ietf.org/html/rfc6514#section-7";
-                container vrf-route-import-extended-community {
-                    uses inet4-specific-extended-community-common;
-                }
-            }
         }
     }
 
diff --git a/bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/BGPActivator.java b/bgp/mvpn/src/main/java/org/opendaylight/protocol/bgp/mvpn/impl/BGPActivator.java
new file mode 100644 (file)
index 0000000..3dcd245
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.protocol.bgp.mvpn.impl;
+
+import com.google.common.annotations.VisibleForTesting;
+import java.util.ArrayList;
+import java.util.List;
+import org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community.SourceAS4OctectHandler;
+import org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community.SourceASHandler;
+import org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community.VrfRouteImportHandler;
+import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAs4ExtendedCommunityCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAsExtendedCommunityCase;
+
+/**
+ * Registers NLRI, Attributes, Extended communities Handlers.
+ *
+ * @author Claudio D. Gasparini
+ */
+public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
+    @VisibleForTesting
+    static final int MVPN_SAFI = 5;
+
+    private static void registerAttributesHandler(
+            final BGPExtensionProviderContext context,
+            final List<AutoCloseable> regs) {
+        //TODO
+    }
+
+    private static void registerNlriHandler(
+            final BGPExtensionProviderContext context,
+            final List<AutoCloseable> regs) {
+        //TODO
+    }
+
+    private static void registerExtendedCommunities(final BGPExtensionProviderContext context,
+            final List<AutoCloseable> regs) {
+
+        final VrfRouteImportHandler vrfRouteImportHandler = new VrfRouteImportHandler();
+        regs.add(context.registerExtendedCommunityParser(vrfRouteImportHandler.getType(true),
+                vrfRouteImportHandler.getSubType(), vrfRouteImportHandler));
+        regs.add(context.registerExtendedCommunitySerializer(SourceAsExtendedCommunityCase.class,
+                vrfRouteImportHandler));
+
+        final SourceAS4OctectHandler source4ASHandler = new SourceAS4OctectHandler();
+        regs.add(context.registerExtendedCommunityParser(source4ASHandler.getType(true),
+                source4ASHandler.getSubType(), source4ASHandler));
+        regs.add(context.registerExtendedCommunitySerializer(SourceAs4ExtendedCommunityCase.class, source4ASHandler));
+
+        final SourceASHandler sourceASHandler = new SourceASHandler();
+        regs.add(context.registerExtendedCommunityParser(sourceASHandler.getType(true),
+                sourceASHandler.getSubType(), sourceASHandler));
+        regs.add(context.registerExtendedCommunitySerializer(SourceAsExtendedCommunityCase.class, sourceASHandler));
+    }
+
+    @Override
+    protected List<AutoCloseable> startImpl(final BGPExtensionProviderContext context) {
+        final List<AutoCloseable> regs = new ArrayList<>();
+        registerNlriHandler(context, regs);
+        registerExtendedCommunities(context, regs);
+        registerAttributesHandler(context, regs);
+        return regs;
+    }
+}
@@ -1,22 +1,22 @@
 /*
- *  Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
  *
- *  This program and the accompanying materials are made available under the
- *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
- *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific;
+package org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community;
 
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.Abstract4OctetAsExtendedCommunity;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAs4ExtendedCommunityCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAs4ExtendedCommunityCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.source.as._4.extended.community._case.SourceAs4ExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAs4ExtendedCommunityCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAs4ExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.source.as._4.extended.community._case.SourceAs4ExtendedCommunityBuilder;
 
 public final class SourceAS4OctectHandler extends Abstract4OctetAsExtendedCommunity {
     private static final short SUBTYPE = 209;
@@ -1,24 +1,24 @@
 /*
- *  Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
  *
- *  This program and the accompanying materials are made available under the
- *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
- *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities;
+package org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community;
 
 import com.google.common.base.Preconditions;
 import com.google.common.primitives.Ints;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.AbstractTwoOctetAsExtendedCommunity;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAsExtendedCommunityCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAsExtendedCommunityCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.source.as.extended.community._case.SourceAsExtendedCommunity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.source.as.extended.community._case.SourceAsExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.ShortAsNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAsExtendedCommunityCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAsExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.source.as.extended.community._case.SourceAsExtendedCommunity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.source.as.extended.community._case.SourceAsExtendedCommunityBuilder;
 
 public final class SourceASHandler extends AbstractTwoOctetAsExtendedCommunity {
     private static final short SUBTYPE = 9;
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
  *
- *  This program and the accompanying materials are made available under the
- *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
- *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities;
+package org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community;
 
 import static org.opendaylight.protocol.bgp.parser.spi.extended.community.Inet4SpecificExtendedCommunityCommonUtil.parseCommon;
 import static org.opendaylight.protocol.bgp.parser.spi.extended.community.Inet4SpecificExtendedCommunityCommonUtil.serializeCommon;
@@ -14,11 +14,11 @@ import static org.opendaylight.protocol.bgp.parser.spi.extended.community.Inet4S
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.AbstractIpv4ExtendedCommunity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.VrfRouteImportExtendedCommunityCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.VrfRouteImportExtendedCommunityCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.vrf.route._import.extended.community._case.VrfRouteImportExtendedCommunity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.vrf.route._import.extended.community._case.VrfRouteImportExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.VrfRouteImportExtendedCommunityCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.VrfRouteImportExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.vrf.route._import.extended.community._case.VrfRouteImportExtendedCommunity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.vrf.route._import.extended.community._case.VrfRouteImportExtendedCommunityBuilder;
 
 public final class VrfRouteImportHandler extends AbstractIpv4ExtendedCommunity {
     private static final short SUBTYPE = 11;
diff --git a/bgp/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator b/bgp/mvpn/src/main/resources/META-INF/services/org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator
new file mode 100644 (file)
index 0000000..78fd9ec
--- /dev/null
@@ -0,0 +1,6 @@
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0 which accompanies this distribution,
+# and is available at http://www.eclipse.org/legal/epl-v10.html
+org.opendaylight.protocol.bgp.mvpn.impl.BGPActivator
diff --git a/bgp/mvpn/src/main/resources/org/opendaylight/blueprint/bgp-mvpn.xml b/bgp/mvpn/src/main/resources/org/opendaylight/blueprint/bgp-mvpn.xml
new file mode 100644 (file)
index 0000000..5294a02
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+           xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0">
+
+  <bean id="BGPActivator" class="org.opendaylight.protocol.bgp.mvpn.impl.BGPActivator"/>
+
+  <service ref="BGPActivator" interface="org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator"
+          odl:type="org.opendaylight.protocol.bgp.mvpn.impl.BGPActivator"/>
+</blueprint>
\ No newline at end of file
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
  *
- *  This program and the accompanying materials are made available under the
- *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
- *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities;
+package org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community;
 
 import static org.junit.Assert.assertEquals;
 
@@ -14,18 +14,15 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.SourceAS4OctectHandler;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAs4ExtendedCommunityCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAs4ExtendedCommunityCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.source.as._4.extended.community._case.SourceAs4ExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.As4GenericSpecExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAs4ExtendedCommunityCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAs4ExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.source.as._4.extended.community._case.SourceAs4ExtendedCommunityBuilder;
 
 public class SourceAS4OctectASHandlerTest {
-    private static final byte[] INPUT = {
-            0, 0, 0, 20, 0, 0
-    };
+    private static final byte[] INPUT = {0, 0, 0, 20, 0, 0};
     private final SourceAS4OctectHandler handler = new SourceAS4OctectHandler();
 
 
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
  *
- *  This program and the accompanying materials are made available under the
- *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
- *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities;
+package org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community;
 
 import static org.junit.Assert.assertEquals;
 
@@ -14,17 +14,15 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Assert;
 import org.junit.Test;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAsExtendedCommunityCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.SourceAsExtendedCommunityCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.source.as.extended.community._case.SourceAsExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.ShortAsNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.As4GenericSpecExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAsExtendedCommunityCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAsExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.source.as.extended.community._case.SourceAsExtendedCommunityBuilder;
 
 public class SourceASHandlerTest {
-    private static final byte[] INPUT = {
-            0, 1, 0, 0, 0, 0
-    };
+    private static final byte[] INPUT = {0, 1, 0, 0, 0, 0};
 
     private final SourceASHandler handler = new SourceASHandler();
 
@@ -1,12 +1,12 @@
 /*
- *  Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
  *
- *  This program and the accompanying materials are made available under the
- *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
- *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities;
+package org.opendaylight.protocol.bgp.mvpn.impl.attributes.extended.community;
 
 import static org.junit.Assert.assertEquals;
 
@@ -15,18 +15,16 @@ import io.netty.buffer.Unpooled;
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.VrfRouteImportExtendedCommunityCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.VrfRouteImportExtendedCommunityCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev180417.bgp.rib.route.attributes.extended.communities.extended.community.vrf.route._import.extended.community._case.VrfRouteImportExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.As4GenericSpecExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.VrfRouteImportExtendedCommunityCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.VrfRouteImportExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.vrf.route._import.extended.community._case.VrfRouteImportExtendedCommunityBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.inet4.specific.extended.community.common.Inet4SpecificExtendedCommunityCommonBuilder;
 
 public class VrfRouteImportHandlerTest {
 
-    private static final byte[] INPUT = {
-            12, 51, 2, 5, 21, 45
-    };
+    private static final byte[] INPUT = {12, 51, 2, 5, 21, 45};
     private final VrfRouteImportHandler handler = new VrfRouteImportHandler();
 
     @Test
index 63665f08915668b78ae6494927898ad49ffcae4b..460fa89ecf494a85fdc7c379c4b4c3e2327c6f5b 100755 (executable)
@@ -48,12 +48,9 @@ import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communi
 import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.RouteOriginIpv4EcHandler;
 import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.RouteTargetAsTwoOctetEcHandler;
 import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.RouteTargetIpv4EcHandler;
-import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.SourceASHandler;
-import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.VrfRouteImportHandler;
 import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.Generic4OctASEcHandler;
 import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.RouteOrigin4OctectASEcHandler;
 import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.RouteTarget4OctectASEcHandler;
-import org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific.SourceAS4OctectHandler;
 import org.opendaylight.protocol.bgp.parser.spi.AbstractBGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.AddressFamilyRegistry;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
@@ -103,8 +100,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteOriginIpv4Case;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteTargetExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.RouteTargetIpv4Case;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAs4ExtendedCommunityCase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.SourceAsExtendedCommunityCase;
 
 public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
 
@@ -329,22 +324,5 @@ public final class BGPActivator extends AbstractBGPExtensionProviderActivator {
         regs.add(context.registerExtendedCommunityParser(encapsulationECHandler.getType(true), encapsulationECHandler.getSubType(),
                 encapsulationECHandler));
         regs.add(context.registerExtendedCommunitySerializer(EncapsulationCase.class, encapsulationECHandler));
-
-
-        final SourceAS4OctectHandler source4ASHandler = new SourceAS4OctectHandler();
-        regs.add(context.registerExtendedCommunityParser(source4ASHandler.getType(true),
-                source4ASHandler.getSubType(), source4ASHandler));
-        regs.add(context.registerExtendedCommunitySerializer(SourceAs4ExtendedCommunityCase.class, source4ASHandler));
-
-        final SourceASHandler sourceASHandler = new SourceASHandler();
-        regs.add(context.registerExtendedCommunityParser(sourceASHandler.getType(true),
-                sourceASHandler.getSubType(), sourceASHandler));
-        regs.add(context.registerExtendedCommunitySerializer(SourceAsExtendedCommunityCase.class, sourceASHandler));
-
-        final VrfRouteImportHandler vrfRouteImportHandler = new VrfRouteImportHandler();
-        regs.add(context.registerExtendedCommunityParser(vrfRouteImportHandler.getType(true),
-                vrfRouteImportHandler.getSubType(), vrfRouteImportHandler));
-        regs.add(context.registerExtendedCommunitySerializer(SourceAsExtendedCommunityCase.class,
-                vrfRouteImportHandler));
     }
 }