Fix checkstyle whitespace issues - WHITESPACE ONLY
Change-Id: Ic205c1afd639c6008d61d9de95cb764eeb6238ca
diff --git a/src/main/java/net/onrc/onos/core/packet/TCP.java b/src/main/java/net/onrc/onos/core/packet/TCP.java
index 7eb78bd..ec74f46 100644
--- a/src/main/java/net/onrc/onos/core/packet/TCP.java
+++ b/src/main/java/net/onrc/onos/core/packet/TCP.java
@@ -1,26 +1,25 @@
/**
-* Copyright 2011, Big Switch Networks, Inc.
-* Originally created by David Erickson, Stanford University
-*
-* Licensed under the Apache License, Version 2.0 (the "License"); you may
-* not use this file except in compliance with the License. You may obtain
-* a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-* License for the specific language governing permissions and limitations
-* under the License.
-**/
+ * Copyright 2011, Big Switch Networks, Inc.
+ * Originally created by David Erickson, Stanford University
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ **/
package net.onrc.onos.core.packet;
import java.nio.ByteBuffer;
/**
- *
* @author shudong.zhou@bigswitch.com
*/
public class TCP extends BasePacket {
@@ -71,71 +70,86 @@
public short getChecksum() {
return checksum;
}
-
+
public int getSequence() {
return this.sequence;
}
+
public TCP setSequence(int seq) {
this.sequence = seq;
return this;
}
+
public int getAcknowledge() {
return this.acknowledge;
}
+
public TCP setAcknowledge(int ack) {
this.acknowledge = ack;
return this;
}
+
public byte getDataOffset() {
return this.dataOffset;
}
+
public TCP setDataOffset(byte offset) {
this.dataOffset = offset;
return this;
}
+
public short getFlags() {
return this.flags;
}
+
public TCP setFlags(short flags) {
this.flags = flags;
return this;
}
+
public short getWindowSize() {
return this.windowSize;
}
+
public TCP setWindowSize(short windowSize) {
this.windowSize = windowSize;
return this;
}
+
public short getTcpChecksum() {
return this.checksum;
}
+
public TCP setTcpChecksum(short checksum) {
this.checksum = checksum;
return this;
}
-
+
@Override
public void resetChecksum() {
this.checksum = 0;
super.resetChecksum();
}
-
+
public short getUrgentPointer(short urgentPointer) {
return this.urgentPointer;
}
+
public TCP setUrgentPointer(short urgentPointer) {
- this.urgentPointer= urgentPointer;
+ this.urgentPointer = urgentPointer;
return this;
}
+
public byte[] getOptions() {
return this.options;
}
+
public TCP setOptions(byte[] options) {
this.options = options;
this.dataOffset = (byte) ((20 + options.length + 3) >> 2);
return this;
}
+
/**
* @param checksum the checksum to set
*/
@@ -147,8 +161,8 @@
/**
* Serializes the packet. Will compute and set the following fields if they
* are set to specific values at the time serialize is called:
- * -checksum : 0
- * -length : 0
+ * -checksum : 0
+ * -length : 0
*/
public byte[] serialize() {
int length;
@@ -184,7 +198,7 @@
bb.put(payloadData);
if (this.parent != null && this.parent instanceof IPv4)
- ((IPv4)this.parent).setProtocol(IPv4.PROTOCOL_TCP);
+ ((IPv4) this.parent).setProtocol(IPv4.PROTOCOL_TCP);
// compute checksum if needed
if (this.checksum == 0) {
@@ -245,15 +259,15 @@
TCP other = (TCP) obj;
// May want to compare fields based on the flags set
return (checksum == other.checksum) &&
- (destinationPort == other.destinationPort) &&
- (sourcePort == other.sourcePort) &&
- (sequence == other.sequence) &&
- (acknowledge == other.acknowledge) &&
- (dataOffset == other.dataOffset) &&
- (flags == other.flags) &&
- (windowSize == other.windowSize) &&
- (urgentPointer == other.urgentPointer) &&
- (dataOffset == 5 || options.equals(other.options));
+ (destinationPort == other.destinationPort) &&
+ (sourcePort == other.sourcePort) &&
+ (sequence == other.sequence) &&
+ (acknowledge == other.acknowledge) &&
+ (dataOffset == other.dataOffset) &&
+ (flags == other.flags) &&
+ (windowSize == other.windowSize) &&
+ (urgentPointer == other.urgentPointer) &&
+ (dataOffset == 5 || options.equals(other.options));
}
@Override
@@ -271,7 +285,7 @@
this.urgentPointer = bb.getShort();
if (this.dataOffset > 5) {
int optLength = (dataOffset << 2) - 20;
- if (bb.limit() < bb.position()+optLength) {
+ if (bb.limit() < bb.position() + optLength) {
optLength = bb.limit() - bb.position();
}
try {
@@ -281,9 +295,9 @@
this.options = null;
}
}
-
+
this.payload = new Data();
- this.payload = payload.deserialize(data, bb.position(), bb.limit()-bb.position());
+ this.payload = payload.deserialize(data, bb.position(), bb.limit() - bb.position());
this.payload.setParent(this);
return this;
}