Driver interfaces for Router IPMac and MPLSMac addresses
diff --git a/src/main/java/net/floodlightcontroller/core/IOF13Switch.java b/src/main/java/net/floodlightcontroller/core/IOF13Switch.java
index 0e379f8..8360374 100644
--- a/src/main/java/net/floodlightcontroller/core/IOF13Switch.java
+++ b/src/main/java/net/floodlightcontroller/core/IOF13Switch.java
@@ -7,10 +7,12 @@
import java.util.Map;
import java.util.Set;
+import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.core.matchaction.MatchActionOperationEntry;
import net.onrc.onos.core.util.Dpid;
import net.onrc.onos.core.util.PortNumber;
+import org.projectfloodlight.openflow.types.MacAddress;
import org.projectfloodlight.openflow.types.TableId;
import com.google.common.primitives.Longs;
@@ -150,7 +152,7 @@
* state. NOTE2: If there were never any groups existing with the neighbor
* dpid that is reachable through this port, then this method performs
* no-operation
- *
+ *
* @param port Port Number to be added to groups
* @return None
*/
@@ -189,4 +191,20 @@
public boolean removeGroup(int groupId);
public Map<String, String> getPublishAttributes();
+
+ /**
+ * Get the specified Router's MAC address to be used for IP flows
+ *
+ * @param dpid Dpid of the router
+ * @return MacAddress of specified router
+ */
+ public MacAddress getRouterIPMac(Dpid dpid);
+
+ /**
+ * Get the specified Router's MAC address to be used for MPLS flows
+ *
+ * @param dpid Dpid of the router
+ * @return MacAddress of specified router
+ */
+ public MacAddress getRouterMPLSMac(Dpid dpid);
}
diff --git a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplDellOSR.java b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplDellOSR.java
index 18b3e59..7327c14 100644
--- a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplDellOSR.java
+++ b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplDellOSR.java
@@ -4,6 +4,7 @@
import net.onrc.onos.core.matchaction.match.Ipv4Match;
import net.onrc.onos.core.matchaction.match.Match;
+import net.onrc.onos.core.util.Dpid;
import net.onrc.onos.core.util.IPv4Net;
import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
@@ -14,6 +15,7 @@
import org.projectfloodlight.openflow.protocol.oxm.OFOxmIpv4DstMasked;
import org.projectfloodlight.openflow.types.EthType;
import org.projectfloodlight.openflow.types.IPv4Address;
+import org.projectfloodlight.openflow.types.MacAddress;
/**
* OFDescriptionStatistics Vendor (Manufacturer Desc.): Dell Make (Hardware
@@ -71,4 +73,13 @@
populateTableMissEntry(aclTableId, true, false, false, -1);
}
+ /* Dell Open Segment Router specific Implementation .
+ * Gets the specified Router's MAC address to be used for MPLS flows
+ * For Dell OSR, the MPLS MAC is IP MAC + 1
+ */
+ @Override
+ public MacAddress getRouterMPLSMac(Dpid dpid) {
+ return MacAddress.of(super.getRouterIPMac(dpid).getLong() + 1);
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplSpringOpenTTP.java b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplSpringOpenTTP.java
index 8a81fab..2f92d49 100644
--- a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplSpringOpenTTP.java
+++ b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplSpringOpenTTP.java
@@ -800,6 +800,22 @@
}
}
+ /* Default implementation of this interface.
+ * Gets the specified Router's MAC address to be used for IP flows
+ * To be overridden depending on the underlying switch type
+ */
+ public MacAddress getRouterIPMac(Dpid dpid) {
+ return getNeighborRouterMacAddress(dpid);
+ }
+
+ /* Default implementation of this interface.
+ * Gets the specified Router's MAC address to be used for MPLS flows
+ * To be overridden depending on the underlying switch type
+ */
+ public MacAddress getRouterMPLSMac(Dpid dpid) {
+ return getNeighborRouterMacAddress(dpid);
+ }
+
private void setNeighbors(List<LinkConfig> linkConfigList) {
for (LinkConfig lg : linkConfigList) {
if (!lg.getType().equals(NetworkConfigManager.PKT_LINK)) {