Fix checkstyle whitespace issues - WHITESPACE ONLY
Change-Id: Ic205c1afd639c6008d61d9de95cb764eeb6238ca
diff --git a/src/main/java/net/onrc/onos/core/packet/DHCP.java b/src/main/java/net/onrc/onos/core/packet/DHCP.java
index 16cc22f..ee3052b 100644
--- a/src/main/java/net/onrc/onos/core/packet/DHCP.java
+++ b/src/main/java/net/onrc/onos/core/packet/DHCP.java
@@ -1,19 +1,19 @@
/**
-* 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;
@@ -24,7 +24,6 @@
import java.util.ListIterator;
/**
- *
* @author David Erickson (daviderickson@cs.stanford.edu)
*/
public class DHCP extends BasePacket {
@@ -52,7 +51,6 @@
* ------------------------------------------
* | options (312) |
* ------------------------------------------
- *
*/
// Header + magic without options
public static int MIN_HEADER_LENGTH = 240;
@@ -60,30 +58,30 @@
public static byte OPCODE_REPLY = 0x2;
public static byte HWTYPE_ETHERNET = 0x1;
-
+
public enum DHCPOptionCode {
- OptionCode_SubnetMask ((byte)1),
- OptionCode_RequestedIP ((byte)50),
- OptionCode_LeaseTime ((byte)51),
- OptionCode_MessageType ((byte)53),
- OptionCode_DHCPServerIp ((byte)54),
- OptionCode_RequestedParameters ((byte)55),
- OptionCode_RenewalTime ((byte)58),
- OPtionCode_RebindingTime ((byte)59),
- OptionCode_ClientID ((byte)61),
- OptionCode_END ((byte)255);
-
+ OptionCode_SubnetMask((byte) 1),
+ OptionCode_RequestedIP((byte) 50),
+ OptionCode_LeaseTime((byte) 51),
+ OptionCode_MessageType((byte) 53),
+ OptionCode_DHCPServerIp((byte) 54),
+ OptionCode_RequestedParameters((byte) 55),
+ OptionCode_RenewalTime((byte) 58),
+ OPtionCode_RebindingTime((byte) 59),
+ OptionCode_ClientID((byte) 61),
+ OptionCode_END((byte) 255);
+
protected byte value;
-
+
private DHCPOptionCode(byte value) {
this.value = value;
}
-
+
public byte getValue() {
return value;
}
}
-
+
protected byte opCode;
protected byte hardwareType;
protected byte hardwareAddressLength;
@@ -279,9 +277,10 @@
this.clientHardwareAddress = clientHardwareAddress;
return this;
}
-
+
/**
* Gets a specific DHCP option parameter
+ *
* @param opetionCode The option code to get
* @return The value of the option if it exists, null otherwise
*/
@@ -322,7 +321,7 @@
}
return null;
}
-
+
/**
* @return the serverName
*/
@@ -364,14 +363,14 @@
if (option.getCode() == 0 || option.getCode() == 255) {
optionsLength += 1;
} else {
- optionsLength += 2 + (int)(0xff & option.getLength());
+ optionsLength += 2 + (int) (0xff & option.getLength());
}
}
int optionsPadLength = 0;
if (optionsLength < 60)
optionsPadLength = 60 - optionsLength;
- byte[] data = new byte[240+optionsLength+optionsPadLength];
+ byte[] data = new byte[240 + optionsLength + optionsPadLength];
ByteBuffer bb = ByteBuffer.wrap(data);
bb.put(this.opCode);
bb.put(this.hardwareType);
@@ -417,7 +416,7 @@
} else {
byte[] bytes = null;
try {
- bytes = string.getBytes("ascii");
+ bytes = string.getBytes("ascii");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Failure encoding server name", e);
}
@@ -438,7 +437,7 @@
if (bb.remaining() < MIN_HEADER_LENGTH) {
return this;
}
-
+
this.opCode = bb.get();
this.hardwareType = bb.get();
this.hardwareAddressLength = bb.get();
@@ -483,13 +482,13 @@
} else {
// Skip the invalid option and set the END option
code = 0xff;
- option.setCode((byte)code);
+ option.setCode((byte) code);
option.setLength((byte) 0);
}
} else {
// Skip the invalid option and set the END option
code = 0xff;
- option.setCode((byte)code);
+ option.setCode((byte) code);
option.setLength((byte) 0);
}
}