org.jnetpcap.protocol.network
Class Ip4.IpOption

java.lang.Object
  extended by org.jnetpcap.nio.JMemory
      extended by org.jnetpcap.nio.JBuffer
          extended by org.jnetpcap.packet.JHeader
              extended by org.jnetpcap.packet.JSubHeader<Ip4>
                  extended by org.jnetpcap.protocol.network.Ip4.IpOption
All Implemented Interfaces:
JPayloadAccessor
Direct Known Subclasses:
Ip4.AddressExtension, Ip4.Encode, Ip4.ExperimentalAccessControl, Ip4.ExperimentalFlowControl, Ip4.ExperimentalMeasurement, Ip4.ExtendedIp, Ip4.IMITrafficDescriptor, Ip4.MtuProbe, Ip4.MtuReply, Ip4.NoOp, Ip4.RouterAlert, Ip4.Routing, Ip4.Security, Ip4.SelectiveDirectedBroadcastMode, Ip4.StreamId, Ip4.Timestamp, Ip4.Traceroute
Enclosing class:
Ip4

public abstract static class Ip4.IpOption
extends JSubHeader<Ip4>

Baseclass for all Ip option headers.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static class Ip4.IpOption.CodeClass
          The Enum CodeClass.
static class Ip4.IpOption.OptionCode
          A table of IpOption types and their names.
 
Nested classes/interfaces inherited from class org.jnetpcap.packet.JHeader
JHeader.State
 
Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory
JMemory.Type
 
Field Summary
 
Fields inherited from class org.jnetpcap.packet.JHeader
annotatedHeader, BYTE, EMPTY_HEADER_ARRAY, isSubHeader, packet, state
 
Fields inherited from class org.jnetpcap.nio.JMemory
JNETPCAP_LIBRARY_NAME, MAX_DIRECT_MEMORY_DEFAULT, POINTER
 
Constructor Summary
Ip4.IpOption()
           
 
Method Summary
 int code_Class()
          Code_ class.
 java.lang.String code_ClassDescription()
          Code_ class description.
 Ip4.IpOption.CodeClass code_ClassEnum()
          Code_ class enum.
 int code_Copy()
          Code_ copy.
 java.lang.String code_CopyDescription()
          Code_ copy description.
 int code_Type()
          Code_ type.
 java.lang.String code_TypeDescription()
          Code_ type description.
 int code()
          Gets the Ip4.code field.
 void code(int value)
          Sets the Ip4.code field.
 Ip4.IpOption.OptionCode codeEnum()
          Gets the Ip4.code field.
static int headerLength(JBuffer buffer, int offset)
          Header length.
 void optionCode(Ip4.IpOption.OptionCode value)
          Sets the Ip4.code field.
 
Methods inherited from class org.jnetpcap.packet.JSubHeader
getLength, getOffset, getParent, setLength, setOffset, setParent
 
Methods inherited from class org.jnetpcap.packet.JHeader
decode, decodeHeader, getAnnotatedHeader, getDescription, getFields, getGap, getGapLength, getGapOffset, getHeader, getHeaderLength, getHeaderOffset, getId, getIndex, getName, getNextHeaderId, getNextHeaderOffset, getNicname, getPacket, getPayload, getPayloadLength, getPayloadOffset, getPostfix, getPostfixLength, getPostfixOffset, getPrefix, getPrefixLength, getPrefixOffset, getPreviousHeaderId, getPreviousHeaderOffset, getState, getSubHeaders, hasDescription, hasGap, hasNextHeader, hasPayload, hasPostfix, hasPrefix, hasPreviousHeader, hasSubHeaders, isFragmented, isGapTruncated, isHeaderTruncated, isPayloadTruncated, isPostfixTruncated, isPrefixTruncated, peer, peer, peerPayloadTo, setPacket, setSubHeaders, sizeof, toString, transferPayloadTo, transferPayloadTo, transferPayloadTo, validateHeader
 
Methods inherited from class org.jnetpcap.nio.JBuffer
findUTF8String, getByte, getByteArray, getByteArray, getByteArray, getDouble, getFloat, getInt, getLong, getShort, getUByte, getUInt, getUShort, getUTF8Char, getUTF8String, getUTF8String, getUTF8String, getUTF8String, isReadonly, order, order, peer, peer, peer, peer, setByte, setByteArray, setByteBuffer, setDouble, setFloat, setInt, setLong, setShort, setShort0, setUByte, setUInt, setUShort, transferFrom, transferFrom, transferFrom, transferTo, transferTo, transferTo
 
Methods inherited from class org.jnetpcap.nio.JMemory
availableDirectMemory, check, cleanup, createReference, isInitialized, isJMemoryBasedOwner, isOwner, maxDirectMemory, peer, reservedDirectMemory, setSize, size, softDirectMemory, toDebugString, toHexdump, toHexdump, totalActiveAllocated, totalAllocateCalls, totalAllocated, totalAllocatedSegments0To255Bytes, totalAllocatedSegments256OrAbove, totalDeAllocateCalls, totalDeAllocated, transferFrom, transferFrom, transferFromDirect, transferOwnership, transferTo, transferTo, transferTo, transferTo, transferTo, transferTo0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Ip4.IpOption

public Ip4.IpOption()
Method Detail

headerLength

@HeaderLength
public static int headerLength(JBuffer buffer,
                                            int offset)
Header length.

Parameters:
buffer - the buffer
offset - the offset
Returns:
the int

code

@Field(offset=0,
       length=8,
       format="%d")
public int code()
Gets the Ip4.code field. Specifies the optional header type.

Header Spec

Protocol Header: Ip4
Protocol Family: Networking
OSI Layer: 3
Field Property: constant offset
Field Offset: getUByte(0) & 0x1F

Header Diagram

 +------+-----------------+
 | CODE | optional header |
 +------+-----------------+
 

Returns:
code field value

code

@FieldSetter
public void code(int value)
Sets the Ip4.code field. Specifies the optional header type.

Header Spec

Protocol Header: Ip4
Protocol Family: Networking
OSI Layer: 3
Field Property: constant offset
Field Offset: getUByte(0) & 0x1F

Header Diagram

 +------+-----------------+
 | CODE | optional header |
 +------+-----------------+
 

Parameters:
value - new code value

code_Copy

@Field(parent="code",
       offset=7,
       length=1,
       display="copy",
       format="%d")
public int code_Copy()
Code_ copy.

Returns:
the int

code_CopyDescription

@Dynamic(value=DESCRIPTION)
public java.lang.String code_CopyDescription()
Code_ copy description.

Returns:
the string

code_Class

@Field(parent="code",
       offset=5,
       length=2,
       display="class",
       format="%d")
public int code_Class()
Code_ class.

Returns:
the int

code_ClassEnum

public Ip4.IpOption.CodeClass code_ClassEnum()
Code_ class enum.

Returns:
the code class

code_ClassDescription

@Dynamic(value=DESCRIPTION)
public java.lang.String code_ClassDescription()
Code_ class description.

Returns:
the string

code_Type

@Field(parent="code",
       offset=0,
       length=5,
       display="type",
       format="%d")
public int code_Type()
Code_ type.

Returns:
the int

code_TypeDescription

@Dynamic(value=DESCRIPTION)
public java.lang.String code_TypeDescription()
Code_ type description.

Returns:
the string

codeEnum

public Ip4.IpOption.OptionCode codeEnum()
Gets the Ip4.code field. Specifies the optional header type.

Header Spec

Protocol Header: Ip4
Protocol Family: Networking
OSI Layer: 3
Field Property: constant offset
Field Offset: getUByte(0) & 0x1F

Header Diagram

 +------+-----------------+
 | CODE | optional header |
 +------+-----------------+
 

Returns:
code field value

optionCode

public void optionCode(Ip4.IpOption.OptionCode value)
Sets the Ip4.code field. Specifies the optional header type.

Header Spec

Protocol Header: Ip4
Protocol Family: Networking
OSI Layer: 3
Field Property: constant offset
Field Offset: getUByte(0) & 0x1F

Header Diagram

 +------+-----------------+
 | CODE | optional header |
 +------+-----------------+
 

Parameters:
value - new code value