Global use of table ids from NwConstants.java 46/42946/2
authorSuraj Ranjan <suraj.ranjan@ericsson.com>
Tue, 2 Aug 2016 08:25:44 +0000 (13:55 +0530)
committerSuraj Ranjan <suraj.ranjan@ericsson.com>
Tue, 2 Aug 2016 08:42:18 +0000 (14:12 +0530)
This review includes following things:

1> After merging of https://git.opendaylight.org/gerrit/#/c/42940/, build
of Netvirt started failing. Because ElanStatisticsImpl.java was using one
constant from IfmConstants.java, which was removed in mentioned commit.

2> Removed few table ids from FibConstants.java, NATConstants.java and
VpnSubnetRouteHandler.java then using directly from NwConstants.java.

Change-Id: Ie6d1663113d7f8dcb1965954d51776d98fd73ddb
Signed-off-by: Suraj Ranjan <suraj.ranjan@ericsson.com>
vpnservice/elanmanager/elanmanager-impl/src/main/java/org/opendaylight/netvirt/elan/statisitcs/ElanStatisticsImpl.java
vpnservice/fibmanager/fibmanager-impl/src/main/java/org/opendaylight/netvirt/fibmanager/FibConstants.java
vpnservice/fibmanager/fibmanager-impl/src/main/java/org/opendaylight/netvirt/fibmanager/FibManager.java
vpnservice/fibmanager/fibmanager-impl/src/main/java/org/opendaylight/netvirt/fibmanager/FibRpcServiceImpl.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/ExternalRoutersListener.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NatConstants.java
vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/VpnFloatingIpHandler.java

index 8ad86f1e0db533cc18d1378347c4903b2b2549c8..cfc6d5461f9c5005ce3407e8bb2cab869a57e5a5 100755 (executable)
@@ -111,7 +111,7 @@ public class ElanStatisticsImpl implements ElanStatisticsService {
         BigInteger dpId = interfaceInfo.getDpId();
         List<MatchInfo> matches = null;
         String interfaceName = interfaceInfo.getInterfaceName();
-        if (tableId == IfmConstants.VLAN_INTERFACE_INGRESS_TABLE) {
+        if (tableId == NwConstants.VLAN_INTERFACE_INGRESS_TABLE) {
             VlanInterfaceInfo vlanInterfaceInfo = (VlanInterfaceInfo)interfaceInfo;
             matches = InterfaceServiceUtil.getMatchInfoForVlanLPort(dpId, interfaceInfo.getPortNo(),
                 InterfaceServiceUtil.getVlanId(interfaceName, elanServiceProvider.getBroker()), vlanInterfaceInfo.isVlanTransparent());
index 5d837d98b9342a5ff2593209aabe5e792f56cbb0..4b69d97daff6fafb22fe1e3f637e7cf7bbee73d5 100644 (file)
@@ -10,12 +10,9 @@ package org.opendaylight.netvirt.fibmanager;
 import java.math.BigInteger;
 
 public class FibConstants {
-    static final BigInteger COOKIE_VM_LFIB_TABLE = new BigInteger("8000002", 16);
-    static final BigInteger COOKIE_VM_FIB_TABLE =  new BigInteger("8000003", 16);
     static final BigInteger COOKIE_TUNNEL = new BigInteger("9000000", 16);
     static final int DEFAULT_FIB_FLOW_PRIORITY = 10;
     static final String FLOWID_PREFIX = "L3.";
     static final String VPN_IDPOOL_NAME = "vpnservices";
     static final String SEPARATOR = ".";
-    public static final short L3VPN_SERVICE_IDENTIFIER = 2; // TODO : This should be in just on place
 }
index 7f5f5b216630cd554579d6a723fad8c05ebb1671..e1299d9f904d453a6685d003648a37c506dacccd 100644 (file)
@@ -609,7 +609,7 @@ public class FibManager extends AbstractDataChangeListener<VrfEntry> implements
                     List<ActionInfo> actionsInfos = Arrays.asList(new ActionInfo(ActionType.pop_mpls, new String[]{}));
 
                     BigInteger[] metadata = new BigInteger[] {
-                        MetaDataUtil.getMetaDataForLPortDispatcher(lportTag, FibConstants.L3VPN_SERVICE_IDENTIFIER),
+                        MetaDataUtil.getMetaDataForLPortDispatcher(lportTag, NwConstants.L3VPN_SERVICE_INDEX),
                         MetaDataUtil.getMetaDataMaskForLPortDispatcher()
                     };
                     List<InstructionInfo> instructions =
@@ -667,7 +667,7 @@ public class FibManager extends AbstractDataChangeListener<VrfEntry> implements
 
         BigInteger[] metadata = new BigInteger[] {
                         MetaDataUtil.getMetaDataForLPortDispatcher(otherEndpointlportTag,
-                                                                   FibConstants.L3VPN_SERVICE_IDENTIFIER),
+                                                                   NwConstants.L3VPN_SERVICE_INDEX),
                         MetaDataUtil.getMetaDataMaskForLPortDispatcher()
                     };
         List<Instruction> instructions =
index f2542ec2d92152f727f2f9cabc74aa1fd8adf5d1..bc05d762d2ddab92c32b2ffb53c527f1377fd777 100644 (file)
@@ -162,7 +162,7 @@ public class FibRpcServiceImpl implements FibRpcService {
         int priority = DEFAULT_FIB_FLOW_PRIORITY + prefixLength;
         Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_FIB_TABLE, flowRef,
                 priority, flowRef, 0, 0,
-                COOKIE_VM_FIB_TABLE, matches, null);
+                NwConstants.COOKIE_VM_FIB_TABLE, matches, null);
 
         mdsalManager.removeFlow(dpnId, flowEntity);
 
@@ -181,7 +181,7 @@ public class FibRpcServiceImpl implements FibRpcService {
 
         Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_LFIB_TABLE, flowRef,
                 DEFAULT_FIB_FLOW_PRIORITY, flowRef, 0, 0,
-                COOKIE_VM_LFIB_TABLE, matches, null);
+                NwConstants.COOKIE_VM_LFIB_TABLE, matches, null);
 
         mdsalManager.removeFlow(dpnId, flowEntity);
 
@@ -251,7 +251,7 @@ public class FibRpcServiceImpl implements FibRpcService {
         int priority = DEFAULT_FIB_FLOW_PRIORITY + prefixLength;
         Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_FIB_TABLE, flowRef,
                 priority, flowRef, 0, 0,
-                COOKIE_VM_FIB_TABLE, matches, customInstructions);
+                NwConstants.COOKIE_VM_FIB_TABLE, matches, customInstructions);
 
         mdsalManager.installFlow(dpnId, flowEntity);
 
@@ -276,7 +276,7 @@ public class FibRpcServiceImpl implements FibRpcService {
 
         Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_LFIB_TABLE, flowRef,
                 DEFAULT_FIB_FLOW_PRIORITY, flowRef, 0, 0,
-                COOKIE_VM_LFIB_TABLE, matches, instructions);
+                NwConstants.COOKIE_VM_LFIB_TABLE, matches, instructions);
 
         mdsalManager.installFlow(dpId, flowEntity);
 
index d8e4235ae35636fb42f8d4a9b30d3daca1cad50f..52a94a79a922c2b18e0bd1e8d0f5d11e9f1e9ebf 100644 (file)
@@ -564,7 +564,7 @@ public class ExternalRoutersListener extends AsyncDataTreeChangeListenerBase<Rou
     }
 
     public BigInteger getCookieOutboundFlow(long routerId) {
-        return NatConstants.COOKIE_OUTBOUND_NAPT_TABLE.add(new BigInteger("0110001", 16)).add(
+        return NwConstants.COOKIE_OUTBOUND_NAPT_TABLE.add(new BigInteger("0110001", 16)).add(
                 BigInteger.valueOf(routerId));
     }
 
index 0829b25c0b4530e99db75db2a1df620fcea01d11..1a13692b04f9fcce01400548aa58eb3b57104720 100644 (file)
@@ -23,7 +23,6 @@ public class NatConstants {
     public static final String FLOWID_PREFIX = "L3.";
     public static final int DEFAULT_DNAT_FLOW_PRIORITY = 10;
     public static final long INVALID_ID = -1;
-    public static final BigInteger COOKIE_OUTBOUND_NAPT_TABLE = new BigInteger("8000008", 16);
     public static final short DEFAULT_SNAT_FLOW_PRIORITY = 10;
     public static final short DEFAULT_PSNAT_FLOW_PRIORITY = 5;
     public static final String SNAT_FLOW_NAME = "SNAT";
index 2d73fa44d2c23f05a0f22e5fab9b7fb9577062b1..6bbfdcf1df28bdf02e5d214952a784e5054080d9 100644 (file)
@@ -62,7 +62,6 @@ public class VpnFloatingIpHandler implements FloatingIPHandler {
 
     static final BigInteger COOKIE_TUNNEL = new BigInteger("9000000", 16);
     static final String FLOWID_PREFIX = "NAT.";
-    static final BigInteger COOKIE_VM_LFIB_TABLE = new BigInteger("8000002", 16);
 
     public VpnFloatingIpHandler(VpnRpcService vpnService, IBgpManager bgpManager, FibRpcService fibService) {
         this.vpnService = vpnService;
@@ -312,7 +311,7 @@ public class VpnFloatingIpHandler implements FloatingIPHandler {
 
         Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_LFIB_TABLE, flowRef,
                 10, flowRef, 0, 0,
-                COOKIE_VM_LFIB_TABLE, matches, instructions);
+                NwConstants.COOKIE_VM_LFIB_TABLE, matches, instructions);
 
         mdsalManager.installFlow(dpId, flowEntity);
 
@@ -331,7 +330,7 @@ public class VpnFloatingIpHandler implements FloatingIPHandler {
 
         Flow flowEntity = MDSALUtil.buildFlowNew(NwConstants.L3_LFIB_TABLE, flowRef,
                                                10, flowRef, 0, 0,
-                                               COOKIE_VM_LFIB_TABLE, matches, null);
+                                               NwConstants.COOKIE_VM_LFIB_TABLE, matches, null);
 
         mdsalManager.removeFlow(dpnId, flowEntity);