net.dhcp
Class DHCPOptions

java.lang.Object
  extended by net.dhcp.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.

Version:
1.1.1 9/06/1999
Author:
Jason Goldschmidt

Constructor Summary
DHCPOptions()
           
 
Method Summary
 boolean contains(byte entryCode)
           
 byte[] externalize()
          Converts a linked options list to a byte array
 byte[] getOption(byte entryCode)
          Fetches value of option by its option code
 void internalize(byte[] optionsArray)
          Converts an options byte array to a linked list
 boolean isEmpty()
          Determines if list is empty
 void printList()
          Prints the options linked list: For testing only.
 void removeOption(byte entryCode)
          Removes option with specified bytecode
 void setOption(byte entryCode, byte[] value)
          Changes an existing option to new value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)

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

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.