Package org.onlab.packet.dhcp
Class DhcpRelayAgentOption
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.dhcp.DhcpOption
-
- org.onlab.packet.dhcp.DhcpRelayAgentOption
-
- All Implemented Interfaces:
IPacket
public class DhcpRelayAgentOption extends DhcpOption
Representation of DHCP relay agent option (option 82).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDhcpRelayAgentOption.RelayAgentInfoOptions
-
Field Summary
-
Fields inherited from class org.onlab.packet.dhcp.DhcpOption
code, data, DEFAULT_LEN, length, OPT_CODE_LEN, UNSIGNED_BYTE_MASK
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description DhcpRelayAgentOption()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSubOption(DhcpOption subOption)Adds a sub-option for this option.static Deserializer<DhcpOption>deserializer()Deserializer function for DHCP relay agent option.booleanequals(java.lang.Object obj)DhcpOptiongetSubOption(byte code)Gets sub-option from this option by given option code.inthashCode()DhcpOptionremoveSubOption(byte code)Removes a sub-option by given sub-option code.byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.-
Methods inherited from class org.onlab.packet.dhcp.DhcpOption
getCode, getData, getLength, setCode, setData, setLength, toString
-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Method Detail
-
serialize
public byte[] serialize()
Description copied from interface:IPacketSets all payloads parent packet if applicable, then serializes this packet and all payloads.- Specified by:
serializein interfaceIPacket- Overrides:
serializein classDhcpOption- Returns:
- a byte[] containing this packet and payloads
-
deserializer
public static Deserializer<DhcpOption> deserializer()
Deserializer function for DHCP relay agent option.- Returns:
- deserializer function
-
getSubOption
public DhcpOption getSubOption(byte code)
Gets sub-option from this option by given option code.- Parameters:
code- the option code- Returns:
- sub-option of given code; null if there is no sub-option for given code
-
addSubOption
public void addSubOption(DhcpOption subOption)
Adds a sub-option for this option.- Parameters:
subOption- the sub-option
-
removeSubOption
public DhcpOption removeSubOption(byte code)
Removes a sub-option by given sub-option code.- Parameters:
code- the code for sub-option- Returns:
- sub-option removed; null of sub-option not exists
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classDhcpOption
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDhcpOption
-
-