import java.util.LinkedList;
import java.util.List;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.openflow.protocol.OFPacketOut;
import org.openflow.protocol.OFPort;
import org.openflow.protocol.OFVendor;
/**
* This class is used to create IPv6 Vendor Extension messages. Specfically, It
* defines the methods used in creation of Vendor specific IPv6 Flow Mod message.
- *
+ *
*
*/
public class V6FlowMod extends OFVendor implements Cloneable {
private static int IPV6_EXT_MIN_HDR_LEN = 36;
/**
- * Constructor for the V6FlowMod class. Initializes OFVendor (parent class)
+ * Constructor for the V6FlowMod class. Initializes OFVendor (parent class)
* fields by calling the parent class' constructor.
*/
public V6FlowMod() {
/**
* This method sets the match fields of V6FlowMod object
- * @param match V6Match object for this V6FlowMod message
+ * @param match V6Match object for this V6FlowMod message
*/
public void setMatch(V6Match match) {
this.match = match;
/**
* Sets the list of actions V6FlowMod message
- * @param actions a list of ordered OFAction objects
+ * @param actions a list of ordered OFAction objects
*/
public void setActions(List<OFAction> actions) {
this.actions = actions;
/**
* Sets the priority field of V6FlowMod message
- * @param priority Priority of the message
+ * @param priority Priority of the message
*/
public void setPriority(short priority) {
this.priority = priority;
/**
* Sets the cookie field of V6FlowMod message
- * @param cookie Cookie of the message
+ * @param cookie Cookie of the message
*/
public void setCookie(long cookie) {
this.cookie = cookie;
/**
* Sets the command field of V6FlowMod message
- * @param command Command type of the message (ADD or DELETE)
+ * @param command Command type of the message (ADD or DELETE)
*/
public V6FlowMod setCommand(short command) {
this.command = command;
/**
* Sets the outPort field of V6FlowMod message
- * @param outPort outPort of the message
+ * @param outPort outPort of the message
*/
public V6FlowMod setOutPort(OFPort port) {
this.outPort = port.getValue();
/**
* Sets the idle_timeout of V6FlowMod message
- * @param idleTimeout idle timeout for this message
+ * @param idleTimeout idle timeout for this message
*/
public void setIdleTimeout(short idleTimeout) {
this.idleTimeout = idleTimeout;
/**
* Sets the hardTimeout field of V6FlowMod message
- * @param hardTimeout hard timeout of the message
+ * @param hardTimeout hard timeout of the message
*/
public void setHardTimeout(short hardTimeout) {
this.hardTimeout = hardTimeout;
/**
* Returns the Flow Mod message subtype for V6FlowMod message
- * @return message subtype
+ * @return message subtype
*/
private int getIPv6ExtensionFlowModAddSubType() {
return IPV6EXT_ADD_FLOW_MSG_TYPE;
}
-
+
/**
* Returns the minimum header size for V6Flow Message type
- * @return minimum header size
+ * @return minimum header size
*/
public int getV6FlowModMinHdrSize() {
return IPV6_EXT_MIN_HDR_LEN;
}
-
+
/**
* Sets the Vendor type in OFVendor message
*/
public void setVendor() {
super.setVendor(V6StatsRequest.NICIRA_VENDOR_ID);
}
-
+
/**
* Get flags
* @return
public void setFlags(short flags) {
this.flags = flags;
}
-
+
/**
* This method forms the Vendor extension IPv6 Flow Mod message.It uses the
- * fields in V6FlowMod class, and writes the data according to vendor
+ * fields in V6FlowMod class, and writes the data according to vendor
* extension format. The fields include flow properties (cookie, timeout,
- * priority, etc), flow match, and action list. It also takes care of
+ * priority, etc), flow match, and action list. It also takes care of
* required padding.
*/
/**
* Forms the clone of V6FlowMod Object. If Object is returned
- * successfully, then returns the cloned object. Throws an
+ * successfully, then returns the cloned object. Throws an
* exception if cloning is not supported.
*/
@Override
V6FlowMod v6flowMod = (V6FlowMod) super.clone();
v6flowMod.setMatch(neoMatch);
List<OFAction> neoActions = new LinkedList<OFAction>();
- for (OFAction action : this.actions)
+ for (OFAction action : this.actions) {
neoActions.add((OFAction) action.clone());
+ }
v6flowMod.setActions(neoActions);
return v6flowMod;
} catch (CloneNotSupportedException e) {
}
}
- /**
- * Prints the contents of V6FlowMod in a string format.
- */
@Override
public String toString() {
- return "V6FlowMod[" + ReflectionToStringBuilder.toString(this) + "]";
+ return "V6FlowMod [match=" + match + ", cookie=" + cookie
+ + ", command=" + command + ", idleTimeout=" + idleTimeout
+ + ", hardTimeout=" + hardTimeout + ", priority=" + priority
+ + ", bufferId=" + bufferId + ", outPort=" + outPort
+ + ", flags=" + flags + ", actions=" + actions + ", match_len="
+ + match_len + ", actions_len=" + actions_len + ", pad_size="
+ + pad_size + "]";
}
}