- Added a function to return tunnel info
 - Change the tunnel ID type to characters (not only the integer)

Change-Id: I9f6689001a8b0dd653455f5b268f385dd6169537
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 4e11b28..88fd21c 100644
--- a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
+++ b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
@@ -143,6 +143,7 @@
     private boolean isEdgeRouter;
     private int sid;
     private ConcurrentMap<NeighborSet, EcmpInfo> ecmpGroups;
+    private ConcurrentMap<String, List<Integer>> tunnelGroups;
     private ConcurrentMap<PortNumber, ArrayList<NeighborSet>> portNeighborSetMap;
     private AtomicInteger groupid;
 
@@ -159,6 +160,7 @@
         ecmpGroups = new ConcurrentHashMap<NeighborSet, EcmpInfo>();
         portNeighborSetMap =
                 new ConcurrentHashMap<PortNumber, ArrayList<NeighborSet>>();
+        tunnelGroups = new ConcurrentHashMap<String, List<Integer>>();
         segmentIds = new ArrayList<Integer>();
         isEdgeRouter = false;
         groupid = new AtomicInteger(0);
@@ -1641,7 +1643,7 @@
         }
     }
 
-    public int createTunnel(int tunnelId, List<String> route, NeighborSet ns) {
+    public int createTunnel(String tunnelId, List<String> route, NeighborSet ns) {
 
         // create a last group of the group chaining
         int finalGroupId = groupid.incrementAndGet();
@@ -1650,17 +1652,20 @@
         int groupId = 0;
         int nextGroupId = finalGroupId;
         boolean bos = false;
+        List<Integer> groups = new ArrayList<Integer>();
 
-        // process the node ID in reverse order
+        // 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;
         }
 
+        tunnelGroups.putIfAbsent(tunnelId, groups);
         return groupId;
     }