Yang changes for Inter DC connectivity using BGPVPNv6 09/52509/9
authorJulien Courtat <julien.courtat@6wind.com>
Fri, 24 Feb 2017 10:46:31 +0000 (11:46 +0100)
committerSam Hague <shague@redhat.com>
Thu, 16 Mar 2017 15:12:21 +0000 (15:12 +0000)
This patchset includes the yang changes required to implement
Spec to support IPv6 Inter DC L3VPN connectivity using BGPVPN [1].

[1] https://git.opendaylight.org/gerrit/#/c/50359

Change-Id: I70fb5460bde2a852dc965525fb37ae8003bea109
Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpConfigurationManager.java
vpnservice/bgpmanager/bgpmanager-impl/src/main/java/org/opendaylight/netvirt/bgpmanager/BgpManager.java
vpnservice/model-bgp/src/main/yang/ebgp.yang

index 0b5dd520ad25ef8f2fe899ea998fa6e641abf4f6..2c53455e25d1dab6a5a5d9e84f3ba18c45215449 100755 (executable)
@@ -1830,14 +1830,16 @@ public class BgpConfigurationManager {
     }
 
     public synchronized void addPrefix(String rd, String macAddress, String pfx, List<String> nhList,
-              VrfEntry.EncapType encapType, int lbl, long l3vni, String gatewayMac) {
+              VrfEntry.EncapType encapType, int lbl, long l3vni, String gatewayMac, int addressFamily) {
         for (String nh : nhList) {
             Ipv4Address nexthop = nh != null ? new Ipv4Address(nh) : null;
             Long label = (long) lbl;
+            Long afi = (long) addressFamily;
             InstanceIdentifier<Networks> iid = InstanceIdentifier.builder(Bgp.class)
                     .child(Networks.class, new NetworksKey(pfx, rd)).build();
             NetworksBuilder networksBuilder = new NetworksBuilder().setRd(rd).setPrefixLen(pfx).setNexthop(nexthop)
-                                                .setLabel(label).setEthtag(BgpConstants.DEFAULT_ETH_TAG);
+                                                .setLabel(label).setEthtag(BgpConstants.DEFAULT_ETH_TAG)
+                                                .setAfi(afi);
             buildVpnEncapSpecificInfo(networksBuilder, encapType, label, l3vni, macAddress, gatewayMac);
             update(iid, networksBuilder.build());
         }
@@ -1938,7 +1940,7 @@ public class BgpConfigurationManager {
         delete(iid);
     }
 
-    public synchronized void delPrefix(String rd, String pfx) {
+    public synchronized void delPrefix(String rd, String pfx, int afi) {
         InstanceIdentifier.InstanceIdentifierBuilder<Networks> iib =
                 InstanceIdentifier.builder(Bgp.class)
                         .child(Networks.class, new NetworksKey(pfx, rd));
index 44f17bf2a0e953c81f41ee7c0fc178d6da059031..820405d230dcce4b3fb19e068323d8ad1a0ae6ae 100644 (file)
@@ -112,7 +112,7 @@ public class BgpManager implements AutoCloseable, IBgpManager {
         fibDSWriter.addFibEntryToDS(rd, macAddress, prefix, nextHopList,
                 encapType, vpnLabel, l3vni, gatewayMac, origin);
         bcm.addPrefix(rd, macAddress, prefix, nextHopList,
-                encapType, vpnLabel, l3vni, gatewayMac);
+                encapType, vpnLabel, l3vni, gatewayMac, 1 /* TODO FIX afi */);
     }
 
     @Override
@@ -125,7 +125,7 @@ public class BgpManager implements AutoCloseable, IBgpManager {
     @Override
     public void deletePrefix(String rd, String prefix) {
         fibDSWriter.removeFibEntryFromDS(rd, prefix);
-        bcm.delPrefix(rd, prefix);
+        bcm.delPrefix(rd, prefix, 1 /* TODO FIX afi */);
     }
 
     @Override
@@ -133,7 +133,7 @@ public class BgpManager implements AutoCloseable, IBgpManager {
                                 VrfEntry.EncapType encapType, int vpnLabel, long l3vni,
                                 String gatewayMac) throws Exception {
         bcm.addPrefix(rd, macAddress, prefix, nextHopList,
-                encapType, vpnLabel, l3vni, gatewayMac);
+                encapType, vpnLabel, l3vni, gatewayMac, 1 /* TODO FIX afi */);
     }
 
     @Override
@@ -142,14 +142,14 @@ public class BgpManager implements AutoCloseable, IBgpManager {
                                 String gatewayMac) throws Exception {
         LOG.info("ADVERTISE: Adding Prefix rd {} prefix {} nexthop {} label {}", rd, prefix, nextHop, vpnLabel);
         bcm.addPrefix(rd, macAddress, prefix, Collections.singletonList(nextHop), encapType,
-                vpnLabel, l3vni, gatewayMac);
+                vpnLabel, l3vni, gatewayMac, 1 /* TODO FIX afi */);
         LOG.info("ADVERTISE: Added Prefix rd {} prefix {} nexthop {} label {}", rd, prefix, nextHop, vpnLabel);
     }
 
     @Override
     public void withdrawPrefix(String rd, String prefix) {
         LOG.info("WITHDRAW: Removing Prefix rd {} prefix {}", rd, prefix);
-        bcm.delPrefix(rd, prefix);
+        bcm.delPrefix(rd, prefix, 1 /* TODO FIX afi */);
         LOG.info("WITHDRAW: Removed Prefix rd {} prefix {}", rd, prefix);
     }
 
index c0dfccfb66c6e31dee07f308291de742a1099dc4..2468e39bab825df0c713be393b5d37bf7656ca4b 100644 (file)
@@ -159,6 +159,9 @@ module ebgp {
     leaf prefix-len {
       type string;
     }
+    leaf afi {
+      type uint32;
+    }
     leaf macaddress {
       description "Mac address of the advertised host.";
       type string;
@@ -327,4 +330,4 @@ module ebgp {
     default "l3";
   }
  } // bgp
-}
\ No newline at end of file
+}