Package org.onlab.packet.dhcp
Class DhcpOption
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.dhcp.DhcpOption
-
- All Implemented Interfaces:
IPacket
- Direct Known Subclasses:
DhcpRelayAgentOption
public class DhcpOption extends BasePacket
Default DHCP option.
-
-
Field Summary
Fields Modifier and Type Field Description protected byte
code
protected byte[]
data
static int
DEFAULT_LEN
protected byte
length
static int
OPT_CODE_LEN
protected static int
UNSIGNED_BYTE_MASK
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description DhcpOption()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<DhcpOption>
deserializer()
Deserializer function for DHCP option.boolean
equals(Object obj)
byte
getCode()
byte[]
getData()
byte
getLength()
int
hashCode()
byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.DhcpOption
setCode(byte code)
DhcpOption
setData(byte[] data)
DhcpOption
setLength(byte length)
String
toString()
-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
OPT_CODE_LEN
public static final int OPT_CODE_LEN
- See Also:
- Constant Field Values
-
DEFAULT_LEN
public static final int DEFAULT_LEN
- See Also:
- Constant Field Values
-
UNSIGNED_BYTE_MASK
protected static final int UNSIGNED_BYTE_MASK
- See Also:
- Constant Field Values
-
code
protected byte code
-
length
protected byte length
-
data
protected byte[] data
-
-
Method Detail
-
serialize
public byte[] serialize()
Description copied from interface:IPacket
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.- Returns:
- a byte[] containing this packet and payloads
-
deserializer
public static Deserializer<DhcpOption> deserializer()
Deserializer function for DHCP option.- Returns:
- deserializer function
-
getCode
public byte getCode()
- Returns:
- the code
-
setCode
public DhcpOption setCode(byte code)
- Parameters:
code
- the code to set- Returns:
- this
-
getLength
public byte getLength()
- Returns:
- the length
-
setLength
public DhcpOption setLength(byte length)
- Parameters:
length
- the length to set- Returns:
- this
-
getData
public byte[] getData()
- Returns:
- the data
-
setData
public DhcpOption setData(byte[] data)
- Parameters:
data
- the data to set- Returns:
- this
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBasePacket
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classBasePacket
-
-