OpenNMS API 1.2.9

## org.opennms.protocols.ip
Class IPHeader.Option

    java.lang.Object
      org.opennms.protocols.ip.IPHeader.Option

Direct Known Subclasses:
  IPHeader.EndOfOptions, IPHeader.RouteOption

Enclosing class:
  IPHeader

public abstract static class IPHeader.Option
extends java.lang.Object

The Option class is used as the base class for any options that are at the end of the IP header.

Author:
  Brian Weaver , OpenNMS

Field Summary
`static int` `CODE_END_OF_OPTION_LIST` Defines the code for the End-Of-Options list
`static int` `CODE_LOOSE_SOURCE_ROUTE` Defines the code for the loose source routing option
`static int` `CODE_ROUTE_RECORD` Defines the code for the packet route record option.
`static int` `CODE_STRICT_SOURCE_ROUTE` Defines the code for the strict soruce routing option
`protected int` `m_code` The single byte that defiend the copied bit, class, and code for the option

Constructor Summary
`protected` `IPHeader.Option(byte code)` Class constructor that is only available to the derived classes of the Option class.

Method Summary
`(package private) abstract int` `bytesRequired()` The nubmer of bytes required to represent this option in the IP header
`int` `getOptionClass()` Returns the class for the option.
`int` `getOptionNumber()` Returns the option number for the instance
`boolean` `isOptionCopied()` Returns true if the copy flag is set in the options header
`(package private) abstract int` `writeBytes(byte[] dest, int offset)` Writes the option to the passed array, starting at the defined offset.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_code

    protected int m_code

  The single byte that defiend the copied bit, class, and code for the option

### CODE_END_OF_OPTION_LIST

    public static final int CODE_END_OF_OPTION_LIST

  Defines the code for the End-Of-Options list

  See Also:
    Constant Field Values

### CODE_LOOSE_SOURCE_ROUTE

    public static final int CODE_LOOSE_SOURCE_ROUTE

  Defines the code for the loose source routing option

  See Also:
    Constant Field Values

### CODE_STRICT_SOURCE_ROUTE

    public static final int CODE_STRICT_SOURCE_ROUTE

  Defines the code for the strict soruce routing option

  See Also:
    Constant Field Values

### CODE_ROUTE_RECORD

    public static final int CODE_ROUTE_RECORD

  Defines the code for the packet route record option.

  See Also:
    Constant Field Values

Constructor Detail

### IPHeader.Option

    protected IPHeader.Option(byte code)

  Class constructor that is only available to the derived classes of the Option class.

Parameters:
  `code` - The code for the option.

Method Detail

### bytesRequired

    abstract int bytesRequired()

  The nubmer of bytes required to represent this option in the IP header

  Returns:
    The bytes used by this option

### writeBytes

    abstract int writeBytes(byte[] dest,
                            int offset)

  Writes the option to the passed array, starting at the defined offset. The array must have enough space or an exception is generated.

  Parameters:
    `dest` - The destination to write the data
    `offset` - The offset of the first written byte
  Returns:
    The passed offset plus the number of required bytes.

### getOptionClass

    public int getOptionClass()

  Returns the class for the option.

### getOptionNumber

    public int getOptionNumber()

  Returns the option number for the instance

### isOptionCopied

    public boolean isOptionCopied()

  Returns true if the copy flag is set in the options header

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.