Knocking off tunnel based driver APIs
diff --git a/src/main/java/net/floodlightcontroller/core/IOF13Switch.java b/src/main/java/net/floodlightcontroller/core/IOF13Switch.java
index 81e9fea..4c924cc 100644
--- a/src/main/java/net/floodlightcontroller/core/IOF13Switch.java
+++ b/src/main/java/net/floodlightcontroller/core/IOF13Switch.java
@@ -160,15 +160,6 @@
public TableId getTableId(String tableType);
/**
- * Create a tunnel for policy routing
- *
- * @param tunnelId tunnel ID for the tunnel
- * @param route list of router DPIDs for the tunnel
- * @param ns NeighborSet to get to the first router of the tunnel
- */
- public void createTunnel(String tunnelId, List<String> route, NeighborSet ns);
-
- /**
* Create a group chain with the specified label stack for a given set of
* ports. This API can be used by user to create groups for a tunnel based
* policy routing scenario. NOTE: This API can not be used if a group to be
@@ -186,13 +177,6 @@
public int createGroup(List<Integer> labelStack, List<PortNumber> ports);
/**
- * Remove all groups for the tunnel
- *
- * @param tunnelId tunnel ID to remove
- */
- public void removeTunnel(String tunnelId);
-
- /**
* Remove the specified group
*
* @param groupId group identifier
@@ -200,15 +184,5 @@
*/
public boolean removeGroup(int groupId);
- /**
- * Return the first group ID for the tunnel.
- * If the router is not the source of the tunnel, it returns -1
- *
- * @param tunnelID tunnel ID for the tunnel
- * @param srcDpid source router DPID
- * @return first Group ID for the tunnel or -1 if not found
- */
- public int getTunnelGroupId(String tunnelID);
-
public Map<String, String> getPublishAttributes();
}
diff --git a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
index 0823385..cae7d41 100644
--- a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
+++ b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
@@ -147,7 +147,6 @@
private boolean isEdgeRouter;
private ConcurrentMap<NeighborSet, EcmpInfo> ecmpGroups;
private ConcurrentMap<Integer, EcmpInfo> userDefinedGroups;
- private ConcurrentMap<String, List<Integer>> tunnelGroupIdTable;
private ConcurrentMap<PortNumber, ArrayList<NeighborSet>> portNeighborSetMap;
private AtomicInteger groupid;
private Map<String, String> publishAttributes;
@@ -164,7 +163,6 @@
userDefinedGroups = new ConcurrentHashMap<Integer, EcmpInfo>();
portNeighborSetMap =
new ConcurrentHashMap<PortNumber, ArrayList<NeighborSet>>();
- tunnelGroupIdTable = new ConcurrentHashMap<String, List<Integer>>();
segmentIds = new ArrayList<Integer>();
isEdgeRouter = false;
groupid = new AtomicInteger(0);
@@ -317,7 +315,7 @@
MacAddress.of(srConfig.getRouterMac()),
getNeighborRouterMacAddress(neighborDpid),
port,
- ns.getEdgeLabel());
+ ns.getEdgeLabel(), true, -1);
buckets.add(b);
log.debug("addPortToGroups: Modifying Group on Switch {} "
+ "and Neighborset {} with {}",
@@ -859,7 +857,7 @@
BucketInfo b = new BucketInfo(d,
MacAddress.of(srConfig.getRouterMac()),
getNeighborRouterMacAddress(d), sp,
- ns.getEdgeLabel());
+ ns.getEdgeLabel(), true, -1);
buckets.add(b);
/* Update Port Neighborset map */
@@ -884,22 +882,6 @@
return;
}
- private void createGroupForMplsLabel(int groupId, String nodeId,
- int nextGroupId, boolean bos) {
- List<BucketInfo> buckets = new ArrayList<BucketInfo>();
- BucketInfo bucket = new BucketInfo(nextGroupId,
- Integer.parseInt(nodeId), bos);
- buckets.add(bucket);
- EcmpInfo ecmpInfo = new EcmpInfo(groupId, buckets);
- setEcmpGroup(ecmpInfo);
-// ecmpGroups.put(ns, ecmpInfo);
- log.debug(
- "createGroupForANeighborSet: Creating ecmp group {} in sw {} "
- + "for pushing label {} and group to {}",
- groupId, getStringId(), nodeId, nextGroupId);
- return;
- }
-
/**
* createGroups creates ECMP groups for all ports on this router connected
* to other routers (in the OF network). The information for ports is
@@ -989,26 +971,27 @@
int mplsLabel;
boolean bos;
- BucketInfo(Dpid nDpid, MacAddress smac, MacAddress dmac,
- PortNumber p, int label) {
- neighborDpid = nDpid;
- srcMac = smac;
- dstMac = dmac;
- outport = p;
- mplsLabel = label;
- groupNo = -1;
- }
+ /*
+ BucketInfo(Dpid nDpid, MacAddress smac, MacAddress dmac,
+ PortNumber p, int label) {
+ neighborDpid = nDpid;
+ srcMac = smac;
+ dstMac = dmac;
+ outport = p;
+ mplsLabel = label;
+ groupNo = -1;
+ }
- BucketInfo(int no, int label, boolean b) {
- neighborDpid = null;
- srcMac = null;
- dstMac = null;
- outport = null;
- groupNo = no;
- mplsLabel = label;
- bos = b;
- }
-
+ BucketInfo(int no, int label, boolean b) {
+ neighborDpid = null;
+ srcMac = null;
+ dstMac = null;
+ outport = null;
+ groupNo = no;
+ mplsLabel = label;
+ bos = b;
+ }
+ */
BucketInfo(Dpid nDpid, MacAddress smac, MacAddress dmac,
PortNumber p, int label, boolean bos, int gotoGroupNo) {
neighborDpid = nDpid;
@@ -1353,9 +1336,8 @@
} else if (action instanceof GroupAction) {
int gid = -1;
GroupAction ga = (GroupAction)action;
- if (ga.getTunnelId() != null) {
- List<Integer> groupIds = tunnelGroupIdTable.get(ga.getTunnelId());
- gid = groupIds.get(groupIds.size()-1);
+ if (ga.getGroupId() > 0) {
+ gid = ga.getGroupId();
}
else {
NeighborSet ns = ((GroupAction) action).getDpids();
@@ -1699,57 +1681,6 @@
}
}
- @Override
- @Deprecated
- public void createTunnel(String tunnelId, List<String> route, NeighborSet ns) {
-
- List<Integer> groups = new ArrayList<Integer>();
-
- // create a last group of the group chaining
- int finalGroupId = groupid.incrementAndGet();
- createGroupForANeighborSet(ns, finalGroupId);
- groups.add(Integer.valueOf(finalGroupId));
-
- int groupId = 0;
- int nextGroupId = finalGroupId;
- boolean bos = false;
-
- // process the node ID in order
- for (int i = 0; i < route.size(); i++) {
- String nodeId = route.get(i);
- groupId = groupid.incrementAndGet();
- groups.add(Integer.valueOf(groupId));
- if (i == route.size()-1)
- bos = true;
- createGroupForMplsLabel(groupId, nodeId, nextGroupId, bos);
- nextGroupId = groupId;
- }
- tunnelGroupIdTable.putIfAbsent(tunnelId, groups);
- }
-
- @Override
- public void removeTunnel(String tunnelId) {
- List<Integer> groups = tunnelGroupIdTable.get(tunnelId);
- if (groups == null)
- return;
-
- // we need to delete groups in reverse order
- for (int i = groups.size() - 1; i >= 0; i--) {
- int groupId = groups.get(i);
- deleteGroup(groupId);
- }
- tunnelGroupIdTable.remove(tunnelId);
- }
-
- @Override
- public int getTunnelGroupId(String tunnelId) {
- List<Integer> groups = tunnelGroupIdTable.get(tunnelId);
- if (groups == null)
- return -1;
-
- return groups.get(0);
- }
-
private void createIndirectGroup(int groupId, MacAddress srcMac,
MacAddress dstMac, PortNumber outPort, int gotoGroupNo,
int mplsLabel, boolean bos) {
@@ -1893,6 +1824,22 @@
return innermostGroupId;
}
+ /*
+ @Override
+ public void removeTunnel(String tunnelId) {
+ List<Integer> groups = tunnelGroupIdTable.get(tunnelId);
+ if (groups == null)
+ return;
+
+ // we need to delete groups in reverse order
+ for (int i = groups.size() - 1; i >= 0; i--) {
+ int groupId = groups.get(i);
+ deleteGroup(groupId);
+ }
+ tunnelGroupIdTable.remove(tunnelId);
+ }
+ */
+
/**
* Remove the specified group
*
@@ -1902,6 +1849,7 @@
public boolean removeGroup(int groupId) {
return false;
}
+
@Override
public Map<String, String> getPublishAttributes() {
return publishAttributes;