Package org.onlab.packet.dhcp
Class Dhcp6Option
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.dhcp.Dhcp6Option
-
- All Implemented Interfaces:
IPacket
- Direct Known Subclasses:
Dhcp6ClientDataOption
,Dhcp6ClientIdOption
,Dhcp6CLTOption
,Dhcp6IaAddressOption
,Dhcp6IaNaOption
,Dhcp6IaPdOption
,Dhcp6IaPrefixOption
,Dhcp6IaTaOption
,Dhcp6InterfaceIdOption
,Dhcp6LeaseQueryOption
,Dhcp6RelayOption
public class Dhcp6Option extends BasePacket
Representation of an DHCPv6 Option. Base on RFC-3315.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_LEN
protected static int
UNSIGNED_SHORT_MASK
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description Dhcp6Option()
Default constructor.Dhcp6Option(Dhcp6Option dhcp6Option)
Constructs a DHCPv6 option based on information from other DHCPv6 option.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<Dhcp6Option>
deserializer()
Gets deserializer of DHCPv6 option.boolean
equals(java.lang.Object obj)
short
getCode()
Gets the code of this option.byte[]
getData()
Gets the data of this option.short
getLength()
Gets the length of this option.protected com.google.common.base.MoreObjects.ToStringHelper
getToStringHelper()
int
hashCode()
byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.void
setCode(short code)
Sets the code of this option.void
setData(byte[] data)
Sets the data of this option.void
setLength(short length)
Sets length of this option.java.lang.String
toString()
-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
DEFAULT_LEN
public static final int DEFAULT_LEN
- See Also:
- Constant Field Values
-
UNSIGNED_SHORT_MASK
protected static final int UNSIGNED_SHORT_MASK
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Dhcp6Option
public Dhcp6Option()
Default constructor.
-
Dhcp6Option
public Dhcp6Option(Dhcp6Option dhcp6Option)
Constructs a DHCPv6 option based on information from other DHCPv6 option.- Parameters:
dhcp6Option
- other DHCPv6 option
-
-
Method Detail
-
setCode
public void setCode(short code)
Sets the code of this option.- Parameters:
code
- the code to set
-
setData
public void setData(byte[] data)
Sets the data of this option.- Parameters:
data
- the data to set
-
setLength
public void setLength(short length)
Sets length of this option.- Parameters:
length
- the length to set
-
getCode
public short getCode()
Gets the code of this option.- Returns:
- the code
-
getLength
public short getLength()
Gets the length of this option.- Returns:
- the length of this option
-
getData
public byte[] getData()
Gets the data of this option.- Returns:
- the data of this option
-
deserializer
public static Deserializer<Dhcp6Option> deserializer()
Gets deserializer of DHCPv6 option.- Returns:
- the deserializer of DHCPv6 option
-
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
-
getToStringHelper
protected com.google.common.base.MoreObjects.ToStringHelper getToStringHelper()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBasePacket
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classBasePacket
-
-