Class DHCPOptions
java.lang.Object
com.github.markusbernhardt.proxy.search.wpad.dhcp.DHCPOptions
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
This inner class represent an entry in the Option Table -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
private Map
<Byte, DHCPOptions.DHCPOptionsEntry> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(byte entryCode) Returns true if option code is set in list; false otherwisebyte[]
Converts a linked options list to a byte arrayprivate byte[]
getArrayOption
(int length, int position, byte[] options) Returns the option value of a specified option code in a byte arraybyte[]
getOption
(byte entryCode) Fetches value of option by its option codevoid
internalize
(byte[] optionsArray) Converts an options byte array to a linked listboolean
isEmpty()
Determines if list is emptyvoid
Prints the options linked list: For testing only.void
removeOption
(byte entryCode) Removes option with specified bytecodevoid
setOption
(byte entryCode, byte[] value) Changes an existing option to new value
-
Field Details
-
OPTION_PAD
public static final int OPTION_PAD- See Also:
-
OPTION_NETMASK
public static final int OPTION_NETMASK- See Also:
-
OPTION_TIME_OFFSET
public static final int OPTION_TIME_OFFSET- See Also:
-
OPTION_ROUTERS
public static final int OPTION_ROUTERS- See Also:
-
OPTION_TIME_SERVERS
public static final int OPTION_TIME_SERVERS- See Also:
-
OPTION_NAME_SERVERS
public static final int OPTION_NAME_SERVERS- See Also:
-
OPTION_DNS_SERVERS
public static final int OPTION_DNS_SERVERS- See Also:
-
OPTION_LOG_SERVERS
public static final int OPTION_LOG_SERVERS- See Also:
-
OPTION_COOKIE_SERVERS
public static final int OPTION_COOKIE_SERVERS- See Also:
-
OPTION_LPR_SERVERS
public static final int OPTION_LPR_SERVERS- See Also:
-
OPTION_IMPRESS_SERVERS
public static final int OPTION_IMPRESS_SERVERS- See Also:
-
OPTION_RESSOURCE_LOCATION_SERVERS
public static final int OPTION_RESSOURCE_LOCATION_SERVERS- See Also:
-
OPTION_HOSTNAME
public static final int OPTION_HOSTNAME- See Also:
-
OPTION_BOOT_FILESIZE
public static final int OPTION_BOOT_FILESIZE- See Also:
-
OPTION_MERIT_DUMPFILE
public static final int OPTION_MERIT_DUMPFILE- See Also:
-
OPTION_DOMAIN_NAME
public static final int OPTION_DOMAIN_NAME- See Also:
-
OPTION_SWAP_SERVER
public static final int OPTION_SWAP_SERVER- See Also:
-
OPTION_ROOT_PATH
public static final int OPTION_ROOT_PATH- See Also:
-
OPTION_EXTENSIONS_PATH
public static final int OPTION_EXTENSIONS_PATH- See Also:
-
OPTION_END
public static final int OPTION_END- See Also:
-
OPTION_IP_HOST_FORWARDING_ENABLE
public static final int OPTION_IP_HOST_FORWARDING_ENABLE- See Also:
-
OPTION_IP_HOST_NON_LOCAL_SOURCE_ROUTING_ENABLE
public static final int OPTION_IP_HOST_NON_LOCAL_SOURCE_ROUTING_ENABLE- See Also:
-
OPTION_IP_HOST_POLICY_FILTERS
public static final int OPTION_IP_HOST_POLICY_FILTERS- See Also:
-
OPTION_IP_HOST_MAXIMUM_DATAGRAM_REASSEMBLY_SIZE
public static final int OPTION_IP_HOST_MAXIMUM_DATAGRAM_REASSEMBLY_SIZE- See Also:
-
OPTION_IP_HOST_DEFAULT_TTL
public static final int OPTION_IP_HOST_DEFAULT_TTL- See Also:
-
OPTION_IP_HOST_MTU_AGEING_TIMEOUT
public static final int OPTION_IP_HOST_MTU_AGEING_TIMEOUT- See Also:
-
OPTION_IP_HOST_MTU_PLATEAU_TABLE
public static final int OPTION_IP_HOST_MTU_PLATEAU_TABLE- See Also:
-
OPTION_IP_INTERFACE_MTU
public static final int OPTION_IP_INTERFACE_MTU- See Also:
-
OPTION_IP_INTERFACE_ALL_SUBNETS_LOCAL_ENABLE
public static final int OPTION_IP_INTERFACE_ALL_SUBNETS_LOCAL_ENABLE- See Also:
-
OPTION_IP_INTERFACE_BROADCAST_ADDRESS
public static final int OPTION_IP_INTERFACE_BROADCAST_ADDRESS- See Also:
-
OPTION_IP_INTERFACE_PERFORM_MASK_DISCOVERY_ENABLE
public static final int OPTION_IP_INTERFACE_PERFORM_MASK_DISCOVERY_ENABLE- See Also:
-
OPTION_IP_INTERFACE_MASK_SUPPLIER_ENABLE
public static final int OPTION_IP_INTERFACE_MASK_SUPPLIER_ENABLE- See Also:
-
OPTION_IP_INTERFACE_PERFORM_ROUTER_DISCOVERY_ENABLE
public static final int OPTION_IP_INTERFACE_PERFORM_ROUTER_DISCOVERY_ENABLE- See Also:
-
OPTION_IP_INTERFACE_ROUTER_SOLICITATION_ADDRESS
public static final int OPTION_IP_INTERFACE_ROUTER_SOLICITATION_ADDRESS- See Also:
-
OPTION_IP_INTERFACE_STATIC_ROUTES
public static final int OPTION_IP_INTERFACE_STATIC_ROUTES- See Also:
-
OPTION_LINK_TRAILER_ENCAPSULATION_ENABLE
public static final int OPTION_LINK_TRAILER_ENCAPSULATION_ENABLE- See Also:
-
OPTION_LINK_ARP_CACHE_TIMEOUT
public static final int OPTION_LINK_ARP_CACHE_TIMEOUT- See Also:
-
OPTION_LINK_ETHERNET_ENCAPSULATION_ENABLE
public static final int OPTION_LINK_ETHERNET_ENCAPSULATION_ENABLE- See Also:
-
OPTION_TCP_DEFAULT_TTL
public static final int OPTION_TCP_DEFAULT_TTL- See Also:
-
OPTION_TCP_KEEP_ALIVE_INTERVAL
public static final int OPTION_TCP_KEEP_ALIVE_INTERVAL- See Also:
-
OPTION_TCP_KEEP_ALIVE_GERBAGE_ENABLE
public static final int OPTION_TCP_KEEP_ALIVE_GERBAGE_ENABLE- See Also:
-
OPTION_NIS_DOMAIN
public static final int OPTION_NIS_DOMAIN- See Also:
-
OPTION_NIS_SERVERS
public static final int OPTION_NIS_SERVERS- See Also:
-
OPTION_NTP_SERVERS
public static final int OPTION_NTP_SERVERS- See Also:
-
OPTION_SERVICE_VENDOR_SPECIFIC_INFORMATIONS
public static final int OPTION_SERVICE_VENDOR_SPECIFIC_INFORMATIONS- See Also:
-
OPTION_SERVICE_NETBOIS_NAME_SERVERS
public static final int OPTION_SERVICE_NETBOIS_NAME_SERVERS- See Also:
-
OPTION_SERVICE_NETBOIS_DATAGRAM_DISTRIBUTION_SERVERS
public static final int OPTION_SERVICE_NETBOIS_DATAGRAM_DISTRIBUTION_SERVERS- See Also:
-
OPTION_SERVICE_NETBOIS_NODE_TYPE
public static final int OPTION_SERVICE_NETBOIS_NODE_TYPE- See Also:
-
OPTION_SERVICE_NETBOIS_SCOPE_TYPE
public static final int OPTION_SERVICE_NETBOIS_SCOPE_TYPE- See Also:
-
OPTION_SERVICE_X_FONT_SERVERS
public static final int OPTION_SERVICE_X_FONT_SERVERS- See Also:
-
OPTION_SERVICE_X_DISPLAY_MANAGERS
public static final int OPTION_SERVICE_X_DISPLAY_MANAGERS- See Also:
-
OPTION_DHCP_IP_ADRESS_REQUESTED
public static final int OPTION_DHCP_IP_ADRESS_REQUESTED- See Also:
-
OPTION_DHCP_IP_LEASE_TIME
public static final int OPTION_DHCP_IP_LEASE_TIME- See Also:
-
OPTION_DHCP_OVERLOAD
public static final int OPTION_DHCP_OVERLOAD- See Also:
-
OPTION_DHCP_MESSAGE_TYPE
public static final int OPTION_DHCP_MESSAGE_TYPE- See Also:
-
OPTION_DHCP_SERVER_IDENTIFIER
public static final int OPTION_DHCP_SERVER_IDENTIFIER- See Also:
-
OPTION_DHCP_PARAMETER_REQUEST_LIST
public static final int OPTION_DHCP_PARAMETER_REQUEST_LIST- See Also:
-
OPTION_DHCP_MESSAGE
public static final int OPTION_DHCP_MESSAGE- See Also:
-
OPTION_DHCP_MAXIMUM_MESSAGE_SIZE
public static final int OPTION_DHCP_MAXIMUM_MESSAGE_SIZE- See Also:
-
OPTION_DHCP_RENEWAL_TIME
public static final int OPTION_DHCP_RENEWAL_TIME- See Also:
-
OPTION_DHCP_REBIND_TIME
public static final int OPTION_DHCP_REBIND_TIME- See Also:
-
OPTION_DHCP_CLASS_IDENTIFIER
public static final int OPTION_DHCP_CLASS_IDENTIFIER- See Also:
-
OPTION_DHCP_CLIENT_IDENTIFIER
public static final int OPTION_DHCP_CLIENT_IDENTIFIER- See Also:
-
OPTION_PROXY_AUTODISCOVERY
public static final int OPTION_PROXY_AUTODISCOVERY- See Also:
-
optionsTable
-
-
Constructor Details
-
DHCPOptions
public DHCPOptions()
-
-
Method Details
-
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 codevalue
- 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 contentposition
- Location in array of option nodeoptions
- 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.
-