Class DHCPOptions


  • public class DHCPOptions
    extends java.lang.Object
    This class represents a linked list of options for a DHCP message. Its purpose is to ease option handling such as add, remove or change.
    • Field Detail

      • OPTION_RESSOURCE_LOCATION_SERVERS

        public static final int OPTION_RESSOURCE_LOCATION_SERVERS
        See Also:
        Constant Field Values
      • OPTION_IP_HOST_FORWARDING_ENABLE

        public static final int OPTION_IP_HOST_FORWARDING_ENABLE
        See Also:
        Constant Field Values
      • OPTION_IP_HOST_NON_LOCAL_SOURCE_ROUTING_ENABLE

        public static final int OPTION_IP_HOST_NON_LOCAL_SOURCE_ROUTING_ENABLE
        See Also:
        Constant Field Values
      • OPTION_IP_HOST_POLICY_FILTERS

        public static final int OPTION_IP_HOST_POLICY_FILTERS
        See Also:
        Constant Field Values
      • OPTION_IP_HOST_MAXIMUM_DATAGRAM_REASSEMBLY_SIZE

        public static final int OPTION_IP_HOST_MAXIMUM_DATAGRAM_REASSEMBLY_SIZE
        See Also:
        Constant Field Values
      • OPTION_IP_HOST_DEFAULT_TTL

        public static final int OPTION_IP_HOST_DEFAULT_TTL
        See Also:
        Constant Field Values
      • OPTION_IP_HOST_MTU_AGEING_TIMEOUT

        public static final int OPTION_IP_HOST_MTU_AGEING_TIMEOUT
        See Also:
        Constant Field Values
      • OPTION_IP_HOST_MTU_PLATEAU_TABLE

        public static final int OPTION_IP_HOST_MTU_PLATEAU_TABLE
        See Also:
        Constant Field Values
      • OPTION_IP_INTERFACE_MTU

        public static final int OPTION_IP_INTERFACE_MTU
        See Also:
        Constant Field Values
      • OPTION_IP_INTERFACE_ALL_SUBNETS_LOCAL_ENABLE

        public static final int OPTION_IP_INTERFACE_ALL_SUBNETS_LOCAL_ENABLE
        See Also:
        Constant Field Values
      • OPTION_IP_INTERFACE_BROADCAST_ADDRESS

        public static final int OPTION_IP_INTERFACE_BROADCAST_ADDRESS
        See Also:
        Constant Field Values
      • OPTION_IP_INTERFACE_PERFORM_MASK_DISCOVERY_ENABLE

        public static final int OPTION_IP_INTERFACE_PERFORM_MASK_DISCOVERY_ENABLE
        See Also:
        Constant Field Values
      • OPTION_IP_INTERFACE_MASK_SUPPLIER_ENABLE

        public static final int OPTION_IP_INTERFACE_MASK_SUPPLIER_ENABLE
        See Also:
        Constant Field Values
      • OPTION_IP_INTERFACE_PERFORM_ROUTER_DISCOVERY_ENABLE

        public static final int OPTION_IP_INTERFACE_PERFORM_ROUTER_DISCOVERY_ENABLE
        See Also:
        Constant Field Values
      • OPTION_IP_INTERFACE_ROUTER_SOLICITATION_ADDRESS

        public static final int OPTION_IP_INTERFACE_ROUTER_SOLICITATION_ADDRESS
        See Also:
        Constant Field Values
      • OPTION_IP_INTERFACE_STATIC_ROUTES

        public static final int OPTION_IP_INTERFACE_STATIC_ROUTES
        See Also:
        Constant Field Values
      • OPTION_LINK_TRAILER_ENCAPSULATION_ENABLE

        public static final int OPTION_LINK_TRAILER_ENCAPSULATION_ENABLE
        See Also:
        Constant Field Values
      • OPTION_LINK_ARP_CACHE_TIMEOUT

        public static final int OPTION_LINK_ARP_CACHE_TIMEOUT
        See Also:
        Constant Field Values
      • OPTION_LINK_ETHERNET_ENCAPSULATION_ENABLE

        public static final int OPTION_LINK_ETHERNET_ENCAPSULATION_ENABLE
        See Also:
        Constant Field Values
      • OPTION_TCP_KEEP_ALIVE_INTERVAL

        public static final int OPTION_TCP_KEEP_ALIVE_INTERVAL
        See Also:
        Constant Field Values
      • OPTION_TCP_KEEP_ALIVE_GERBAGE_ENABLE

        public static final int OPTION_TCP_KEEP_ALIVE_GERBAGE_ENABLE
        See Also:
        Constant Field Values
      • OPTION_SERVICE_VENDOR_SPECIFIC_INFORMATIONS

        public static final int OPTION_SERVICE_VENDOR_SPECIFIC_INFORMATIONS
        See Also:
        Constant Field Values
      • OPTION_SERVICE_NETBOIS_NAME_SERVERS

        public static final int OPTION_SERVICE_NETBOIS_NAME_SERVERS
        See Also:
        Constant Field Values
      • OPTION_SERVICE_NETBOIS_DATAGRAM_DISTRIBUTION_SERVERS

        public static final int OPTION_SERVICE_NETBOIS_DATAGRAM_DISTRIBUTION_SERVERS
        See Also:
        Constant Field Values
      • OPTION_SERVICE_NETBOIS_NODE_TYPE

        public static final int OPTION_SERVICE_NETBOIS_NODE_TYPE
        See Also:
        Constant Field Values
      • OPTION_SERVICE_NETBOIS_SCOPE_TYPE

        public static final int OPTION_SERVICE_NETBOIS_SCOPE_TYPE
        See Also:
        Constant Field Values
      • OPTION_SERVICE_X_FONT_SERVERS

        public static final int OPTION_SERVICE_X_FONT_SERVERS
        See Also:
        Constant Field Values
      • OPTION_SERVICE_X_DISPLAY_MANAGERS

        public static final int OPTION_SERVICE_X_DISPLAY_MANAGERS
        See Also:
        Constant Field Values
      • OPTION_DHCP_IP_ADRESS_REQUESTED

        public static final int OPTION_DHCP_IP_ADRESS_REQUESTED
        See Also:
        Constant Field Values
      • OPTION_DHCP_IP_LEASE_TIME

        public static final int OPTION_DHCP_IP_LEASE_TIME
        See Also:
        Constant Field Values
      • OPTION_DHCP_MESSAGE_TYPE

        public static final int OPTION_DHCP_MESSAGE_TYPE
        See Also:
        Constant Field Values
      • OPTION_DHCP_SERVER_IDENTIFIER

        public static final int OPTION_DHCP_SERVER_IDENTIFIER
        See Also:
        Constant Field Values
      • OPTION_DHCP_PARAMETER_REQUEST_LIST

        public static final int OPTION_DHCP_PARAMETER_REQUEST_LIST
        See Also:
        Constant Field Values
      • OPTION_DHCP_MAXIMUM_MESSAGE_SIZE

        public static final int OPTION_DHCP_MAXIMUM_MESSAGE_SIZE
        See Also:
        Constant Field Values
      • OPTION_DHCP_RENEWAL_TIME

        public static final int OPTION_DHCP_RENEWAL_TIME
        See Also:
        Constant Field Values
      • OPTION_DHCP_REBIND_TIME

        public static final int OPTION_DHCP_REBIND_TIME
        See Also:
        Constant Field Values
      • OPTION_DHCP_CLASS_IDENTIFIER

        public static final int OPTION_DHCP_CLASS_IDENTIFIER
        See Also:
        Constant Field Values
      • OPTION_DHCP_CLIENT_IDENTIFIER

        public static final int OPTION_DHCP_CLIENT_IDENTIFIER
        See Also:
        Constant Field Values
      • OPTION_PROXY_AUTODISCOVERY

        public static final int OPTION_PROXY_AUTODISCOVERY
        See Also:
        Constant Field Values
    • Constructor Detail

      • DHCPOptions

        public DHCPOptions()
    • Method Detail

      • removeOption

        public void removeOption​(byte entryCode)
        Removes option with specified bytecode
        Parameters:
        entryCode - The code of option to be removed
      • contains

        public boolean contains​(byte entryCode)
        Returns true if option code is set in list; false otherwise
        Parameters:
        entryCode - The node's option code
        Returns:
        true if option is set, otherwise false
      • isEmpty

        public boolean isEmpty()
        Determines if list is empty
        Returns:
        true if there are no options set, otherwise false
      • getOption

        public byte[] getOption​(byte entryCode)
        Fetches value of option by its option code
        Parameters:
        entryCode - The node's option code
        Returns:
        byte array containing the value of option entryCode. null is returned if option is not set.
      • setOption

        public void setOption​(byte entryCode,
                              byte[] value)
        Changes an existing option to new value
        Parameters:
        entryCode - The node's option code
        value - Content of node option
      • getArrayOption

        private byte[] getArrayOption​(int length,
                                      int position,
                                      byte[] options)
        Returns the option value of a specified option code in a byte array
        Parameters:
        length - Length of option content
        position - Location in array of option node
        options - The byte array of options
        Returns:
        byte array containing the value for the option
      • internalize

        public void internalize​(byte[] optionsArray)
        Converts an options byte array to a linked list
        Parameters:
        optionsArray - The byte array representation of the options list
      • externalize

        public byte[] externalize()
        Converts a linked options list to a byte array
        Returns:
        array representation of optionsTable
      • printList

        public void printList()
        Prints the options linked list: For testing only.