Added a number of container classes that will be used for
Flow Path computation and installation.
diff --git a/src/main/java/net/floodlightcontroller/util/CallerId.java b/src/main/java/net/floodlightcontroller/util/CallerId.java
new file mode 100644
index 0000000..898da31
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/CallerId.java
@@ -0,0 +1,48 @@
+package net.floodlightcontroller.util;
+
+/**
+ * The class representing a Caller ID for an ONOS component.
+ */
+public class CallerId {
+ private String value;
+
+ /**
+ * Default constructor.
+ */
+ public CallerId() {}
+
+ /**
+ * Constructor from a string value.
+ *
+ * @param value the value to use.
+ */
+ public CallerId(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the value of the Caller ID.
+ *
+ * @return the value of the Caller ID.
+ */
+ public String value() { return value; }
+
+ /**
+ * Set the value of the Caller ID.
+ *
+ * @param value the value to set.
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Convert the Caller ID value to a string.
+ *
+ * @return the Caller ID value to a string.
+ */
+ @Override
+ public String toString() {
+ return value;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/DataPath.java b/src/main/java/net/floodlightcontroller/util/DataPath.java
new file mode 100644
index 0000000..2374fbe
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/DataPath.java
@@ -0,0 +1,81 @@
+package net.floodlightcontroller.util;
+
+import java.util.ArrayList;
+
+import net.floodlightcontroller.util.SwitchPort;
+import net.floodlightcontroller.util.FlowEntry;
+
+/**
+ * The class representing the Data Path.
+ */
+public class DataPath {
+ private SwitchPort srcPort; // The source port
+ private SwitchPort dstPort; // The destination port
+ private ArrayList<FlowEntry> flowEntries; // The Flow Entries
+
+ /**
+ * Default constructor.
+ */
+ public DataPath() {
+ }
+
+ /**
+ * Get the data path source port.
+ *
+ * @return the data path source port.
+ */
+ public SwitchPort srcPort() { return srcPort; }
+
+ /**
+ * Set the data path source port.
+ *
+ * @param srcPort the data path source port to set.
+ */
+ public void setSrcPort(SwitchPort srcPort) {
+ this.srcPort = srcPort;
+ }
+
+ /**
+ * Get the data path destination port.
+ *
+ * @return the data path destination port.
+ */
+ public SwitchPort dstPort() { return dstPort; }
+
+ /**
+ * Set the data path destination port.
+ *
+ * @param dstPort the data path destination port to set.
+ */
+ public void setDstPort(SwitchPort dstPort) {
+ this.dstPort = dstPort;
+ }
+
+ /**
+ * Get the data path flow entries.
+ *
+ * @return the data path flow entries.
+ */
+ public ArrayList<FlowEntry> flowEntries() { return flowEntries; }
+
+ /**
+ * Set the data path flow entries.
+ *
+ * @param flowEntries the data path flow entries to set.
+ */
+ public void setFlowEntries(ArrayList<FlowEntry> flowEntries) {
+ this.flowEntries = flowEntries;
+ }
+
+ /**
+ * Convert the data path to a string.
+ *
+ * @return the data path as a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/DataPathEndpoints.java b/src/main/java/net/floodlightcontroller/util/DataPathEndpoints.java
new file mode 100644
index 0000000..5c9e02c
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/DataPathEndpoints.java
@@ -0,0 +1,72 @@
+package net.floodlightcontroller.util;
+
+import net.floodlightcontroller.util.SwitchPort;
+
+/**
+ * The class representing the Data Path Endpoints.
+ */
+public class DataPathEndpoints {
+ private SwitchPort srcPort; // The source port
+ private SwitchPort dstPort; // The destination port
+
+ /**
+ * Default constructor.
+ */
+ public DataPathEndpoints() {
+ }
+
+ /**
+ * Constructor for given source and destination ports.
+ *
+ * @param srcPort the source port to use.
+ * @param dstPort the destination port to use.
+ */
+ public DataPathEndpoints(SwitchPort srcPort, SwitchPort dstPort) {
+ this.srcPort = srcPort;
+ this.dstPort = dstPort;
+ }
+
+ /**
+ * Get the data path source port.
+ *
+ * @return the data path source port.
+ */
+ public SwitchPort srcPort() { return srcPort; }
+
+ /**
+ * Set the data path source port.
+ *
+ * @param srcPort the data path source port to set.
+ */
+ public void setSrcPort(SwitchPort srcPort) {
+ this.srcPort = srcPort;
+ }
+
+ /**
+ * Get the data path destination port.
+ *
+ * @return the data path destination port.
+ */
+ public SwitchPort dstPort() { return dstPort; }
+
+ /**
+ * Set the data path destination port.
+ *
+ * @param dstPort the data path destination port to set.
+ */
+ public void setDstPort(SwitchPort dstPort) {
+ this.dstPort = dstPort;
+ }
+
+ /**
+ * Convert the data path endpoints to a string.
+ *
+ * @return the data path endpoints as a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/Dpid.java b/src/main/java/net/floodlightcontroller/util/Dpid.java
new file mode 100644
index 0000000..3a8d1e8
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/Dpid.java
@@ -0,0 +1,54 @@
+package net.floodlightcontroller.util;
+
+/**
+ * The class representing a network switch DPID.
+ */
+public class Dpid {
+ static public long UNKNOWN = 0;
+
+ private long value;
+
+ /**
+ * Default constructor.
+ */
+ public Dpid() {
+ this.value = Dpid.UNKNOWN;
+ }
+
+ /**
+ * Constructor from a long value.
+ *
+ * @param value the value to use.
+ */
+ public Dpid(long value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the value of the DPID.
+ *
+ * @return the value of the DPID.
+ */
+ public long value() { return value; }
+
+ /**
+ * Set the value of the DPID.
+ *
+ * @param value the value to set.
+ */
+ public void setValue(long value) {
+ this.value = value;
+ }
+
+ /**
+ * Convert the DPID value to a ':' separated hex string.
+ *
+ * @return the DPID value as a ':' separated hex string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/FlowEntry.java b/src/main/java/net/floodlightcontroller/util/FlowEntry.java
new file mode 100644
index 0000000..e9c4bbe
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/FlowEntry.java
@@ -0,0 +1,224 @@
+package net.floodlightcontroller.util;
+
+import net.floodlightcontroller.util.Dpid;
+import net.floodlightcontroller.util.FlowEntryActions;
+import net.floodlightcontroller.util.FlowEntryId;
+import net.floodlightcontroller.util.FlowEntryMatch;
+import net.floodlightcontroller.util.Port;
+
+/**
+ * The Flow Entry state as set by the user (via the ONOS API).
+ */
+enum FlowEntryUserState {
+ FE_USER_UNKNOWN, // Initialization value: state unknown
+ FE_USER_ADD, // Flow entry that is added
+ FE_USER_MODIFY, // Flow entry that is modified
+ FE_USER_DELETE // Flow entry that is deleted
+}
+
+/**
+ * The Flow Entry state as set by the controller.
+ */
+enum FlowEntrySwitchState {
+ FE_SWITCH_UNKNOWN, // Initialization value: state unknown
+ FE_SWITCH_NOT_UPDATED, // Switch not updated with this entry
+ FE_SWITCH_UPDATE_IN_PROGRESS, // Switch update in progress
+ FE_SWITCH_UPDATED, // Switch updated with this entry
+ FE_SWITCH_UPDATE_FAILED // Error updating the switch with this entry
+}
+
+
+/**
+ * The class representing the Flow Entry.
+ *
+ * NOTE: The specification is incomplete. E.g., the entry needs to
+ * support multiple in-ports and multiple out-ports.
+ */
+public class FlowEntry {
+ private FlowEntryId flowEntryId; // The Flow Entry ID
+ private FlowEntryMatch flowEntryMatch; // The Flow Entry Match
+ private FlowEntryActions flowEntryActions; // The Flow Entry Actions
+ private Dpid dpid; // The Switch DPID
+ private Port inPort; // The Switch incoming port
+ private Port outPort; // The Switch outgoing port
+ private FlowEntryUserState flowEntryUserState; // The Flow Entry User state
+ private FlowEntrySwitchState flowEntrySwitchState; // The Flow Entry Switch state
+ // The Flow Entry Error state (if FlowEntrySwitchState is FE_SWITCH_FAILED)
+ private FlowEntryErrorState flowEntryErrorState;
+
+ /**
+ * Default constructor.
+ */
+ public FlowEntry() {
+ flowEntryUserState = FlowEntryUserState.FE_USER_UNKNOWN;
+ flowEntrySwitchState = FlowEntrySwitchState.FE_SWITCH_UNKNOWN;
+ }
+
+ /**
+ * Get the Flow Entry ID.
+ *
+ * @return the Flow Entry ID.
+ */
+ public FlowEntryId flowEntryId() { return flowEntryId; }
+
+ /**
+ * Set the Flow Entry ID.
+ *
+ * @param flowEntryId the Flow Entry ID to set.
+ */
+ public void setFlowEntryId(FlowEntryId flowEntryId) {
+ this.flowEntryId = flowEntryId;
+ }
+
+ /**
+ * Get the Flow Entry Match.
+ *
+ * @return the Flow Entry Match.
+ */
+ public FlowEntryMatch flowEntryMatch() { return flowEntryMatch; }
+
+ /**
+ * Set the Flow Entry Match.
+ *
+ * @param flowEntryMatch the Flow Entry Match to set.
+ */
+ public void setFlowEntryMatch(FlowEntryMatch flowEntryMatch) {
+ this.flowEntryMatch = flowEntryMatch;
+ }
+
+ /**
+ * Get the Flow Entry Actions.
+ *
+ * @return the Flow Entry Actions.
+ */
+ public FlowEntryActions flowEntryActions() { return flowEntryActions; }
+
+ /**
+ * Set the Flow Entry Actions.
+ *
+ * @param flowEntryActions the Flow Entry Actions to set.
+ */
+ public void setFlowEntryActions(FlowEntryActions flowEntryActions) {
+ this.flowEntryActions = flowEntryActions;
+ }
+
+ /**
+ * Get the Switch DPID.
+ *
+ * @return the Switch DPID.
+ */
+ public Dpid dpid() { return dpid; }
+
+ /**
+ * Set the Switch DPID.
+ *
+ * @param dpid the Switch DPID to set.
+ */
+ public void setDpid(Dpid dpid) {
+ this.dpid = dpid;
+ }
+
+ /**
+ * Get the Switch incoming port.
+ *
+ * @return the Switch incoming port.
+ */
+ public Port inPort() { return inPort; }
+
+ /**
+ * Set the Switch incoming port.
+ *
+ * @param inPort the Switch incoming port to set.
+ */
+ public void setInPort(Port inPort) {
+ this.inPort = inPort;
+ }
+
+ /**
+ * Get the Switch outgoing port.
+ *
+ * @return the Switch outgoing port.
+ */
+ public Port outPort() { return outPort; }
+
+ /**
+ * Set the Switch outgoing port.
+ *
+ * @param outPort the Switch outgoing port to set.
+ */
+ public void setOutPort(Port outPort) {
+ this.outPort = outPort;
+ }
+
+ /**
+ * Get the Flow Entry User state.
+ *
+ * @return the Flow Entry User state.
+ */
+ public FlowEntryUserState flowEntryUserState() {
+ return flowEntryUserState;
+ }
+
+ /**
+ * Set the Flow Entry User state.
+ *
+ * @param flowEntryUserState the Flow Entry User state to set.
+ */
+ public void setFlowEntryUserState(FlowEntryUserState flowEntryUserState) {
+ this.flowEntryUserState = flowEntryUserState;
+ }
+
+ /**
+ * Get the Flow Entry Switch state.
+ *
+ * The Flow Entry Error state is used if FlowEntrySwitchState is
+ * FE_SWITCH_FAILED.
+ *
+ * @return the Flow Entry Switch state.
+ */
+ public FlowEntrySwitchState flowEntrySwitchState() {
+ return flowEntrySwitchState;
+ }
+
+ /**
+ * Set the Flow Entry Switch state.
+ *
+ * The Flow Entry Error state is used if FlowEntrySwitchState is
+ * FE_SWITCH_FAILED.
+ *
+ * @param flowEntrySwitchState the Flow Entry Switch state to set.
+ */
+ public void setFlowEntrySwitchState(FlowEntrySwitchState flowEntrySwitchState) {
+ this.flowEntrySwitchState = flowEntrySwitchState;
+ }
+
+ /**
+ * Get the Flow Entry Error state.
+ *
+ * @return the Flow Entry Error state.
+ */
+ public FlowEntryErrorState flowEntryErrorState() {
+ return flowEntryErrorState;
+ }
+
+ /**
+ * Set the Flow Entry Error state.
+ *
+ * @param flowEntryErrorState the Flow Entry Error state to set.
+ */
+ public void setFlowEntryErrorState(FlowEntryErrorState flowEntryErrorState) {
+ this.flowEntryErrorState = flowEntryErrorState;
+ }
+
+ /**
+ * Convert the flow entry to a string.
+ *
+ * @return the flow entry as a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/FlowEntryActions.java b/src/main/java/net/floodlightcontroller/util/FlowEntryActions.java
new file mode 100644
index 0000000..90f42fb
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/FlowEntryActions.java
@@ -0,0 +1,30 @@
+package net.floodlightcontroller.util;
+
+/**
+ * The class representing the Flow Entry set of actions.
+ *
+ * The Flow Entry set of actions need to be applied to each packet.
+ *
+ * NOTE: This is just an empty placeholder (for now). The implied action is
+ * forwarding on a single port.
+ */
+public class FlowEntryActions {
+
+ /**
+ * Default constructor.
+ */
+ public FlowEntryActions() {
+ }
+
+ /**
+ * Convert the set of actions to a string.
+ *
+ * @return the set of actions as a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/FlowEntryErrorState.java b/src/main/java/net/floodlightcontroller/util/FlowEntryErrorState.java
new file mode 100644
index 0000000..63c103d
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/FlowEntryErrorState.java
@@ -0,0 +1,65 @@
+package net.floodlightcontroller.util;
+
+/**
+ * The class representing the Flow Entry error state.
+ */
+public class FlowEntryErrorState {
+ private short type; // The error type (e.g., see OF-1.3.1 spec, pp. 95)
+ private short code; // The error code (e.g., see OF-1.3.1 spec, pp. 95)
+
+ /**
+ * Default constructor.
+ */
+ public FlowEntryErrorState() {
+ this.type = 0;
+ this.code = 0;
+ }
+
+ /**
+ * Constructor for a given error type and code.
+ *
+ * @param type the error type to use.
+ * @param code the error code to use.
+ */
+ public FlowEntryErrorState(short type, short code) {
+ this.type = type;
+ this.code = code;
+ }
+
+ /**
+ * Get the error type.
+ *
+ * @return the error type.
+ */
+ public short type() { return type; }
+
+ /**
+ * Get the error code.
+ *
+ * @return the error code.
+ */
+ public short code() { return code; }
+
+ /**
+ * Set the values of the error type and code.
+ *
+ * @param type the error type to use.
+ * @param code the error code to use.
+ */
+ public void setValue(short type, short code) {
+ this.type = type;
+ this.code = code;
+ }
+
+ /**
+ * Convert the error type and code to a string.
+ *
+ * @return the error type and code as a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/FlowEntryId.java b/src/main/java/net/floodlightcontroller/util/FlowEntryId.java
new file mode 100644
index 0000000..4736ed5
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/FlowEntryId.java
@@ -0,0 +1,52 @@
+package net.floodlightcontroller.util;
+
+/**
+ * The class representing a Flow Entry ID.
+ */
+public class FlowEntryId {
+ private long value;
+
+ /**
+ * Default constructor.
+ */
+ public FlowEntryId() {
+ this.value = 0;
+ }
+
+ /**
+ * Constructor from an integer value.
+ *
+ * @param value the value to use.
+ */
+ public FlowEntryId(long value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the value of the Flow Entry ID.
+ *
+ * @return the value of the Flow Entry ID.
+ */
+ public long value() { return value; }
+
+ /**
+ * Set the value of the Flow Entry ID.
+ *
+ * @param value the value to set.
+ */
+ public void setValue(long value) {
+ this.value = value;
+ }
+
+ /**
+ * Convert the Flow Entry ID value to a string.
+ *
+ * @return the Flow Entry ID value to a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/FlowEntryMatch.java b/src/main/java/net/floodlightcontroller/util/FlowEntryMatch.java
new file mode 100644
index 0000000..a8f43f5
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/FlowEntryMatch.java
@@ -0,0 +1,105 @@
+package net.floodlightcontroller.util;
+
+import net.floodlightcontroller.util.MACAddress;
+import net.floodlightcontroller.util.IPv4Net;
+
+/**
+ * The class representing the Flow Entry Matching filter.
+ *
+ * The Flow Entry matching filter that is used to specify
+ * the network data that would be forwarded on the data path from
+ * the source to the destination. Examples: MAC address (of the
+ * sender), IP prefix that includes the destination's IP address, etc.
+ *
+ * NOTE: The FlowEntryMatch specification below is incomplete: we need
+ * more matching fields, we need to indicate which fields need to be
+ * matched, etc.
+ */
+public class FlowEntryMatch {
+ private MACAddress srcMac; // Matching source MAC address
+ private MACAddress dstMac; // Matching destination MAC address
+ private IPv4Net srcIPv4Net; // Matching source IPv4 prefix
+ private IPv4Net dstIPv4Net; // Matching destination IPv4 prefix
+
+ /**
+ * Default constructor.
+ */
+ public FlowEntryMatch() {
+ }
+
+ /**
+ * Get the matching source MAC address.
+ *
+ * @return the matching source MAC address.
+ */
+ public MACAddress srcMac() { return srcMac; }
+
+ /**
+ * Set the matching source MAC address.
+ *
+ * @param srcMac the matching source MAC address to set.
+ */
+ public void setSrcMac(MACAddress srcMac) {
+ this.srcMac = srcMac;
+ }
+
+ /**
+ * Get the matching destination MAC address.
+ *
+ * @return the matching destination MAC address.
+ */
+ public MACAddress dstMac() { return dstMac; }
+
+ /**
+ * Set the matching destination MAC address.
+ *
+ * @param dstMac the matching destination MAC address to set.
+ */
+ public void setDstMac(MACAddress dstMac) {
+ this.dstMac = dstMac;
+ }
+
+ /**
+ * Get the matching source IPv4 prefix.
+ *
+ * @return the matching source IPv4 prefix.
+ */
+ public IPv4Net srcIPv4Net() { return srcIPv4Net; }
+
+ /**
+ * Set the matching source IPv4 prefix.
+ *
+ * @param srcIPv4Net the matching source IPv4 prefix to set.
+ */
+ public void setSrcIPv4Net(IPv4Net srcIPv4Net) {
+ this.srcIPv4Net = srcIPv4Net;
+ }
+
+ /**
+ * Get the matching destination IPv4 prefix.
+ *
+ * @return the matching destination IPv4 prefix.
+ */
+ public IPv4Net dstIPv4Net() { return dstIPv4Net; }
+
+ /**
+ * Set the matching destination IPv4 prefix.
+ *
+ * @param srcIPv4Net the matching destination IPv4 prefix to set.
+ */
+ public void setDstIPv4Net(IPv4Net dstIPv4Net) {
+ this.dstIPv4Net = dstIPv4Net;
+ }
+
+ /**
+ * Convert the matching filter to a string.
+ *
+ * @return the matching filter as a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/FlowId.java b/src/main/java/net/floodlightcontroller/util/FlowId.java
new file mode 100644
index 0000000..827c1d9
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/FlowId.java
@@ -0,0 +1,52 @@
+package net.floodlightcontroller.util;
+
+/**
+ * The class representing a Flow ID.
+ */
+public class FlowId {
+ private long value;
+
+ /**
+ * Default constructor.
+ */
+ public FlowId() {
+ this.value = 0;
+ }
+
+ /**
+ * Constructor from an integer value.
+ *
+ * @param value the value to use.
+ */
+ public FlowId(long value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the value of the Flow ID.
+ *
+ * @return the value of the Flow ID.
+ */
+ public long value() { return value; }
+
+ /**
+ * Set the value of the Flow ID.
+ *
+ * @param value the value to set.
+ */
+ public void setValue(long value) {
+ this.value = value;
+ }
+
+ /**
+ * Convert the Flow ID value to a string.
+ *
+ * @return the Flow ID value to a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/FlowPath.java b/src/main/java/net/floodlightcontroller/util/FlowPath.java
new file mode 100644
index 0000000..46a1f82
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/FlowPath.java
@@ -0,0 +1,80 @@
+package net.floodlightcontroller.util;
+
+import net.floodlightcontroller.util.CallerId;
+import net.floodlightcontroller.util.DataPath;
+import net.floodlightcontroller.util.FlowId;
+
+/**
+ * The class representing the Flow Path.
+ */
+public class FlowPath {
+ private FlowId flowId; // The Flow ID
+ private CallerId installerId; // The Caller ID of the path installer
+ private DataPath dataPath; // The data path
+
+ /**
+ * Default constructor.
+ */
+ public FlowPath() {
+ }
+
+ /**
+ * Get the flow path Flow ID.
+ *
+ * @return the flow path Flow ID.
+ */
+ public FlowId flowId() { return flowId; }
+
+ /**
+ * Set the flow path Flow ID.
+ *
+ * @param flowId the flow path Flow ID to set.
+ */
+ public void setFlowId(FlowId flowId) {
+ this.flowId = flowId;
+ }
+
+ /**
+ * Get the Caller ID of the flow path installer.
+ *
+ * @return the Caller ID of the flow path installer.
+ */
+ public CallerId installerId() { return installerId; }
+
+ /**
+ * Set the Caller ID of the flow path installer.
+ *
+ * @param installerId the Caller ID of the flow path installer.
+ */
+ public void setInstallerId(CallerId installerId) {
+ this.installerId = installerId;
+ }
+
+ /**
+ * Get the flow path's data path.
+ *
+ * @return the flow path's data path.
+ */
+ public DataPath dataPath() { return dataPath; }
+
+ /**
+ * Set the flow path's data path.
+ *
+ * @param dataPath the flow path's data path to set.
+ */
+ public void setDataPath(DataPath dataPath) {
+ this.dataPath = dataPath;
+ }
+
+ /**
+ * Convert the flow path to a string.
+ *
+ * @return the flow path as a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/IPv4.java b/src/main/java/net/floodlightcontroller/util/IPv4.java
new file mode 100644
index 0000000..b4fc787
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/IPv4.java
@@ -0,0 +1,52 @@
+package net.floodlightcontroller.util;
+
+/**
+ * The class representing an IPv4 address.
+ */
+public class IPv4 {
+ private int value;
+
+ /**
+ * Default constructor.
+ */
+ public IPv4() {
+ this.value = 0;
+ }
+
+ /**
+ * Constructor from an integer value.
+ *
+ * @param value the value to use.
+ */
+ public IPv4(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the value of the IPv4 address.
+ *
+ * @return the value of the IPv4 address.
+ */
+ public int value() { return value; }
+
+ /**
+ * Set the value of the IPv4 address.
+ *
+ * @param value the value to set.
+ */
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Convert the IPv4 value to a '.' separated string.
+ *
+ * @return the IPv4 value as a '.' separated string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/IPv4Net.java b/src/main/java/net/floodlightcontroller/util/IPv4Net.java
new file mode 100644
index 0000000..6c4c651
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/IPv4Net.java
@@ -0,0 +1,66 @@
+package net.floodlightcontroller.util;
+
+import net.floodlightcontroller.util.IPv4;
+
+/**
+ * The class representing an IPv4 network address.
+ */
+public class IPv4Net {
+ private IPv4 address; // The IPv4 address
+ private short prefixLen; // The prefix length
+
+ /**
+ * Default constructor.
+ */
+ public IPv4Net() {
+ this.prefixLen = 0;
+ }
+
+ /**
+ * Constructor for a given address and prefix length.
+ *
+ * @param address the address to use.
+ * @param prefixLen the prefix length to use.
+ */
+ public IPv4Net(IPv4 address, short prefixLen) {
+ this.address = address;
+ this.prefixLen = prefixLen;
+ }
+
+ /**
+ * Get the address value of the IPv4Net address.
+ *
+ * @return the address value of the IPv4Net address.
+ */
+ public IPv4 address() { return address; }
+
+ /**
+ * Get the prefix length value of the IPv4Net address.
+ *
+ * @return the prefix length value of the IPv4Net address.
+ */
+ public short prefixLen() { return prefixLen; }
+
+ /**
+ * Set the value of the IPv4Net address.
+ *
+ * @param address the address to use.
+ * @param prefixLen the prefix length to use.
+ */
+ public void setValue(IPv4 address, short prefixLen) {
+ this.address = address;
+ this.prefixLen = prefixLen;
+ }
+
+ /**
+ * Convert the IPv4Net value to an "address/prefixLen" string.
+ *
+ * @return the IPv4Net value as an "address/prefixLen" string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/IPv6.java b/src/main/java/net/floodlightcontroller/util/IPv6.java
new file mode 100644
index 0000000..dfa071b
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/IPv6.java
@@ -0,0 +1,67 @@
+package net.floodlightcontroller.util;
+
+/**
+ * The class representing an IPv6 address.
+ */
+public class IPv6 {
+ private long valueHigh; // The higher (more significant) 64 bits
+ private long valueLow; // The lower (less significant) 64 bits
+
+ /**
+ * Default constructor.
+ */
+ public IPv6() {
+ this.valueHigh = 0;
+ this.valueLow = 0;
+ }
+
+ /**
+ * Constructor from integer values.
+ *
+ * @param valueHigh the higher (more significant) 64 bits of the address.
+ * @param valueLow the lower (less significant) 64 bits of the address.
+ */
+ public IPv6(long valueHigh, long valueLow) {
+ this.valueHigh = valueHigh;
+ this.valueLow = valueLow;
+ }
+
+ /**
+ * Get the value of the higher (more significant) 64 bits of the address.
+ *
+ * @return the value of the higher (more significant) 64 bits of the
+ * address.
+ */
+ public long valueHigh() { return valueHigh; }
+
+ /**
+ * Get the value of the lower (less significant) 64 bits of the address.
+ *
+ * @return the value of the lower (less significant) 64 bits of the
+ * address.
+ */
+ public long valueLow() { return valueLow; }
+
+ /**
+ * Set the value of the IPv6 address.
+ *
+ * @param valueHigh the higher (more significant) 64 bits of the address.
+ * @param valueLow the lower (less significant) 64 bits of the address.
+ */
+ public void setValue(long valueHigh, long valueLow) {
+ this.valueHigh = valueHigh;
+ this.valueLow = valueLow;
+ }
+
+ /**
+ * Convert the IPv6 value to a ':' separated string.
+ *
+ * @return the IPv6 value as a ':' separated string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/IPv6Net.java b/src/main/java/net/floodlightcontroller/util/IPv6Net.java
new file mode 100644
index 0000000..85de4f7
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/IPv6Net.java
@@ -0,0 +1,66 @@
+package net.floodlightcontroller.util;
+
+import net.floodlightcontroller.util.IPv6;
+
+/**
+ * The class representing an IPv6 network address.
+ */
+public class IPv6Net {
+ private IPv6 address; // The IPv6 address
+ private short prefixLen; // The prefix length
+
+ /**
+ * Default constructor.
+ */
+ public IPv6Net() {
+ this.prefixLen = 0;
+ }
+
+ /**
+ * Constructor for a given address and prefix length.
+ *
+ * @param address the address to use.
+ * @param prefixLen the prefix length to use.
+ */
+ public IPv6Net(IPv6 address, short prefixLen) {
+ this.address = address;
+ this.prefixLen = prefixLen;
+ }
+
+ /**
+ * Get the address value of the IPv6Net address.
+ *
+ * @return the address value of the IPv6Net address.
+ */
+ public IPv6 address() { return address; }
+
+ /**
+ * Get the prefix length value of the IPv6Net address.
+ *
+ * @return the prefix length value of the IPv6Net address.
+ */
+ public short prefixLen() { return prefixLen; }
+
+ /**
+ * Set the value of the IPv6Net address.
+ *
+ * @param address the address to use.
+ * @param prefixLen the prefix length to use.
+ */
+ public void setValue(IPv6 address, short prefixLen) {
+ this.address = address;
+ this.prefixLen = prefixLen;
+ }
+
+ /**
+ * Convert the IPv6Net value to an "address/prefixLen" string.
+ *
+ * @return the IPv6Net value as an "address/prefixLen" string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/Port.java b/src/main/java/net/floodlightcontroller/util/Port.java
new file mode 100644
index 0000000..8fbb727
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/Port.java
@@ -0,0 +1,52 @@
+package net.floodlightcontroller.util;
+
+/**
+ * The class representing a network port of a switch.
+ */
+public class Port {
+ private short value;
+
+ /**
+ * Default constructor.
+ */
+ public Port() {
+ this.value = 0;
+ }
+
+ /**
+ * Constructor from a long value.
+ *
+ * @param value the value to use.
+ */
+ public Port(short value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the value of the port.
+ *
+ * @return the value of the port.
+ */
+ public short value() { return value; }
+
+ /**
+ * Set the value of the port.
+ *
+ * @param value the value to set.
+ */
+ public void setValue(short value) {
+ this.value = value;
+ }
+
+ /**
+ * Convert the port value to a string.
+ *
+ * @return the port value as a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}
diff --git a/src/main/java/net/floodlightcontroller/util/SwitchPort.java b/src/main/java/net/floodlightcontroller/util/SwitchPort.java
new file mode 100644
index 0000000..31061bc
--- /dev/null
+++ b/src/main/java/net/floodlightcontroller/util/SwitchPort.java
@@ -0,0 +1,66 @@
+package net.floodlightcontroller.util;
+
+import net.floodlightcontroller.util.Dpid;
+import net.floodlightcontroller.util.Port;
+
+/**
+ * The class representing a Switch-Port.
+ */
+public class SwitchPort {
+ private Dpid dpid; // The DPID of the switch
+ private Port port; // The port of the switch
+
+ /**
+ * Default constructor.
+ */
+ public SwitchPort() {
+ }
+
+ /**
+ * Constructor for a given DPID and a port.
+ *
+ * @param dpid the DPID to use.
+ * @param port the port to use.
+ */
+ public SwitchPort(Dpid dpid, Port port) {
+ this.dpid = dpid;
+ this.port = port;
+ }
+
+ /**
+ * Get the DPID value of the Switch-Port.
+ *
+ * @return the DPID value of the Switch-Port.
+ */
+ public Dpid dpid() { return dpid; }
+
+ /**
+ * Get the port value of the Switch-Port.
+ *
+ * @return the port value of the Switch-Port.
+ */
+ public Port port() { return port; }
+
+ /**
+ * Set the DPID and port values of the Switch-Port.
+ *
+ * @param dpid the DPID to use.
+ * @param port the port to use.
+ */
+ public void setValue(Dpid dpid, Port port) {
+ this.dpid = dpid;
+ this.port = port;
+ }
+
+ /**
+ * Convert the Switch-Port value to a string.
+ *
+ * @return the Switch-Port value as a string.
+ */
+ @Override
+ public String toString() {
+ String ret = "";
+ // TODO: Implement it!
+ return ret;
+ }
+}