/**
* This interface defines an abstraction of an Open Flow Switch.
- *
+ *
*/
public interface ISwitch {
/**
* Gets a unique XID.
- *
+ *
* @return XID
*/
public int getNextXid();
/**
* Returns the Switch's ID.
- *
+ *
* @return the Switch's ID
*/
public Long getId();
/**
* Returns the Switch's table numbers supported by datapath
- *
+ *
* @return the tables
*/
public Byte getTables();
/**
* Returns the Switch's bitmap of supported ofp_action_type
- *
+ *
* @return the actions
*/
public Integer getActions();
/**
* Returns the Switch's bitmap of supported ofp_capabilities
- *
+ *
* @return the capabilities
*/
public Integer getCapabilities();
/**
* Returns the Switch's buffering capacity in Number of Pkts
- *
+ *
* @return the buffers
*/
public Integer getBuffers();
/**
* Returns the Date when the switch was connected.
- *
+ *
* @return Date The date when the switch was connected
*/
public Date getConnectedDate();
* should be used for non-critical messages such as statistics request,
* discovery packets, etc. An unique XID is generated automatically and
* inserted into the message.
- *
+ *
* @param msg
* The OF message to be sent
* @return The XID used
* priority. It will be served after high priority messages. The method
* should be used for non-critical messages such as statistics request,
* discovery packets, etc. The specified XID is inserted into the message.
- *
+ *
* @param msg
* The OF message to be Sent
* @param xid
* method should be used for critical messages such as hello, echo reply
* etc. An unique XID is generated automatically and inserted into the
* message.
- *
+ *
* @param msg
* The OF message to be sent
* @return The XID used
* priority. It will be served first before normal priority messages. The
* method should be used for critical messages such as hello, echo reply
* etc. The specified XID is inserted into the message.
- *
+ *
* @param msg
* The OF message to be sent
+ * @param xid
+ * The XID to be used in the message
* @return The XID used
*/
public Integer asyncFastSend(OFMessage msg, int xid);
/**
* Sends the OF message followed by a Barrier Request with a unique XID
* which is automatically generated, and waits for a result from the switch.
- *
+ *
* @param msg
* The message to be sent
* @return An Object which has one of the followings instances/values:
/**
* Returns a map containing all OFPhysicalPorts of this switch.
- *
+ *
* @return The Map of OFPhysicalPort
*/
public Map<Short, OFPhysicalPort> getPhysicalPorts();
/**
* Returns a Set containing all port IDs of this switch.
- *
+ *
* @return The Set of port ID
*/
public Set<Short> getPorts();
/**
* Returns OFPhysicalPort of the specified portNumber of this switch.
- *
+ *
* @param portNumber
* The port ID
* @return OFPhysicalPort for the specified PortNumber
/**
* Returns the bandwidth of the specified portNumber of this switch.
- *
+ *
* @param portNumber
* the port ID
* @return bandwidth
/**
* Returns True if the port is enabled,
- *
+ *
* @param portNumber
+ * the port ID
* @return True if the port is enabled
*/
public boolean isPortEnabled(short portNumber);
/**
* Returns True if the port is enabled.
- *
+ *
* @param port
+ * the OpenFlow port
* @return True if the port is enabled
*/
public boolean isPortEnabled(OFPhysicalPort port);
/**
* Returns a list containing all enabled ports of this switch.
- *
+ *
* @return: List containing all enabled ports of this switch
*/
public List<OFPhysicalPort> getEnabledPorts();
/**
* Sends OFStatisticsRequest with a unique XID generated automatically and
* waits for a result from the switch.
- *
+ *
* @param req
* the OF Statistic Request to be sent
* @return Object has one of the following instances/values::
/**
* Returns true if the switch has reached the operational state (has sent
* FEATURE_REPLY to the controller).
- *
+ *
* @return true if the switch is operational
*/
public boolean isOperational();
* Send Barrier message synchronously. The caller will be blocked until the
* Barrier reply arrives.
*/
- Object syncSendBarrierMessage();
+ public Object syncSendBarrierMessage();
/**
* Send Barrier message asynchronously. The caller is not blocked. The
* Barrier message will be sent in a transmit thread which will be blocked
* until the Barrier reply arrives.
*/
- Object asyncSendBarrierMessage();
+ public Object asyncSendBarrierMessage();
+
+ /**
+ * Send a FLOW_MOD message with a wildcard match and action=DELETE.
+ */
+ public void deleteAllFlows();
}