Class DhcpRelayAgentOption

  • All Implemented Interfaces:
    IPacket

    public class DhcpRelayAgentOption
    extends DhcpOption
    Representation of DHCP relay agent option (option 82).
    • Constructor Detail

      • DhcpRelayAgentOption

        public DhcpRelayAgentOption()
    • 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.
        Specified by:
        serialize in interface IPacket
        Overrides:
        serialize in class DhcpOption
        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:
        equals in class DhcpOption