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 bytecodeprotected byte[]datastatic intDEFAULT_LENprotected bytelengthstatic intOPT_CODE_LENprotected static intUNSIGNED_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.booleanequals(Object obj)bytegetCode()byte[]getData()bytegetLength()inthashCode()byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.DhcpOptionsetCode(byte code)DhcpOptionsetData(byte[] data)DhcpOptionsetLength(byte length)StringtoString()-
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:IPacketSets 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:
hashCodein classBasePacket
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classBasePacket
-
-