Skip to content
Snippets Groups Projects
Commit a9615f6a authored by Andrew Ferguson's avatar Andrew Ferguson
Browse files

whitespace cleanup

parent f1d5f679
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ import org.openflow.protocol.vendor.OFVendorData;
/**
* Base class for vendor data corresponding to extensions to OpenFlow 1.0.
* Based on org.openflow.vendor.nicira
*
*
* @author Andrew Ferguson (adf@cs.brown.edu)
*/
public class OFOpenFlowVendorData implements OFVendorData {
......@@ -18,13 +18,13 @@ public class OFOpenFlowVendorData implements OFVendorData {
* The value of the integer data type at the beginning of the vendor data
*/
protected int dataType;
/**
* Construct empty (i.e. unspecified data type) OpenFlow vendor data.
*/
public OFOpenFlowVendorData() {
}
/**
* Construct OpenFlow vendor data with the specified data type
* @param dataType the data type value at the beginning of the vendor data.
......@@ -32,7 +32,7 @@ public class OFOpenFlowVendorData implements OFVendorData {
public OFOpenFlowVendorData(int dataType) {
this.dataType = dataType;
}
/**
* Get the data type value at the beginning of the vendor data
* @return the integer data type value
......@@ -40,7 +40,7 @@ public class OFOpenFlowVendorData implements OFVendorData {
public int getDataType() {
return dataType;
}
/**
* Set the data type value
* @param dataType the integer data type value at the beginning of the
......@@ -49,11 +49,11 @@ public class OFOpenFlowVendorData implements OFVendorData {
public void setDataType(int dataType) {
this.dataType = dataType;
}
/**
* Get the length of the vendor data. This implementation will normally
* be the superclass for another class that will override this to return
* the overall vendor data length. This implementation just returns the
* the overall vendor data length. This implementation just returns the
* length of the part that includes the 4-byte integer data type value
* at the beginning of the vendor data.
*/
......
......@@ -15,17 +15,17 @@ public class OFOpenFlowVendorExtensions {
OFBasicVendorId openflowVendorId =
new OFBasicVendorId(OFOpenFlowVendorData.OF_VENDOR_ID, 4);
OFVendorId.registerVendorId(openflowVendorId);
OFBasicVendorDataType queueModifyVendorData =
new OFBasicVendorDataType(OFQueueModifyVendorData.OFP_EXT_QUEUE_MODIFY,
OFQueueModifyVendorData.getInstantiable());
new OFBasicVendorDataType(OFQueueModifyVendorData.OFP_EXT_QUEUE_MODIFY,
OFQueueModifyVendorData.getInstantiable());
openflowVendorId.registerVendorDataType(queueModifyVendorData);
OFBasicVendorDataType queueDeleteVendorData =
new OFBasicVendorDataType(OFQueueDeleteVendorData.OFP_EXT_QUEUE_DELETE,
OFQueueModifyVendorData.getInstantiable());
new OFBasicVendorDataType(OFQueueDeleteVendorData.OFP_EXT_QUEUE_DELETE,
OFQueueModifyVendorData.getInstantiable());
openflowVendorId.registerVendorDataType(queueDeleteVendorData);
initialized = true;
}
}
......@@ -5,7 +5,7 @@ import org.openflow.protocol.vendor.OFVendorData;
/**
* Class that represents the vendor data in the queue delete request
*
*
* @author Andrew Ferguson (adf@cs.brown.edu)
*/
public class OFQueueDeleteVendorData {
......@@ -16,7 +16,7 @@ public class OFQueueDeleteVendorData {
return new OFQueueModifyVendorData();
}
};
/**
* @return a subclass of Instantiable<OFVendorData> that instantiates
* an instance of OFQueueDeleteVendorData.
......@@ -24,7 +24,7 @@ public class OFQueueDeleteVendorData {
public static Instantiable<OFVendorData> getInstantiable() {
return instantiable;
}
/**
* The data type value for a queue delete request
*/
......
......@@ -5,7 +5,7 @@ import org.openflow.protocol.vendor.OFVendorData;
/**
* Class that represents the vendor data in the queue modify request
*
*
* @author Andrew Ferguson (adf@cs.brown.edu)
*/
public class OFQueueModifyVendorData extends OFQueueVendorData {
......@@ -16,7 +16,7 @@ public class OFQueueModifyVendorData extends OFQueueVendorData {
return new OFQueueModifyVendorData();
}
};
/**
* @return a subclass of Instantiable<OFVendorData> that instantiates
* an instance of OFQueueModifyVendorData.
......@@ -24,7 +24,7 @@ public class OFQueueModifyVendorData extends OFQueueVendorData {
public static Instantiable<OFVendorData> getInstantiable() {
return instantiable;
}
/**
* The data type value for a queue modify request
*/
......
......@@ -8,7 +8,7 @@ import org.openflow.protocol.OFPacketQueue;
/**
* Class that represents the vendor data in a queue modify or delete request
*
*
* @author Andrew Ferguson (adf@cs.brown.edu)
*/
public class OFQueueVendorData extends OFOpenFlowVendorData {
......@@ -16,50 +16,50 @@ public class OFQueueVendorData extends OFOpenFlowVendorData {
protected short portNumber;
protected List<OFPacketQueue> queues = new ArrayList<OFPacketQueue>();
/**
* @return the portNumber
*/
public short getPortNumber() {
return portNumber;
}
/**
* @param port the port on which the queue is
*/
public void setPortNumber(short portNumber) {
this.portNumber = portNumber;
}
/**
* @return the queues
*/
public List<OFPacketQueue> getQueues() {
return queues;
}
return queues;
}
/**
* @param queues the queues to modify or delete
*/
public void setQueues(List<OFPacketQueue> queues) {
this.queues = queues;
}
public void setQueues(List<OFPacketQueue> queues) {
this.queues = queues;
}
/**
/**
* @return the total length of the queue modify or delete msg
*/
@Override
public int getLength() {
int queuesLength = 0;
for (OFPacketQueue queue : queues) {
queuesLength += queue.getLength();
}
int queuesLength = 0;
for (OFPacketQueue queue : queues) {
queuesLength += queue.getLength();
}
return MINIMUM_LENGTH + queuesLength;
}
/**
* Read the queue message data from the ChannelBuffer
* @param data the channel buffer from which we're deserializing
......@@ -70,15 +70,15 @@ public class OFQueueVendorData extends OFOpenFlowVendorData {
portNumber = data.readShort();
data.readInt(); // pad
data.readShort(); // pad
int availLength = (length - MINIMUM_LENGTH);
this.queues.clear();
while (availLength > 0) {
OFPacketQueue queue = new OFPacketQueue();
queue.readFrom(data);
queues.add(queue);
availLength -= queue.getLength();
OFPacketQueue queue = new OFPacketQueue();
queue.readFrom(data);
queues.add(queue);
availLength -= queue.getLength();
}
}
......@@ -91,9 +91,9 @@ public class OFQueueVendorData extends OFOpenFlowVendorData {
data.writeShort(this.portNumber);
data.writeInt(0); // pad
data.writeShort(0); // pad
for (OFPacketQueue queue : queues) {
queue.writeTo(data);
queue.writeTo(data);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment