org.jnetpcap.protocol.vpn
Class L2TP

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.protocol.vpn.L2TP
All Implemented Interfaces:
JPayloadAccessor

@Header
public class L2TP
extends JHeader

Layer 2 Tunneling Protocol header definition.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
 
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
static int FLAG_L
          The Constant FLAG_L.
static int FLAG_O
          The Constant FLAG_O.
static int FLAG_P
          The Constant FLAG_P.
static int FLAG_S
          The Constant FLAG_S.
static int FLAG_T
          The Constant FLAG_T.
static int ID
          The Constant ID.
static int MASK_FLAGS
          The Constant MASK_FLAGS.
static int MASK_VERSION
          The Constant MASK_VERSION.
 
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
L2TP()
           
 
Method Summary
 void decodeHeader()
          Decode header.
 int flags()
          Flags.
 boolean hasLength()
          Checks for length.
 boolean hasN()
          Checks for n.
 boolean hasOffset()
          Checks for offset.
static int headerLength(JBuffer buffer, int offset)
          Header length.
 int length()
          Length.
 int lengthOffset()
          Length offset.
 int nr()
          Nr.
 int nrOffset()
          Nr offset.
 int ns()
          Ns.
 int nsOffset()
          Ns offset.
 int offset()
          Offset.
 int offsetOffset()
          Offset offset.
 int pad()
          Pad.
 int padOffset()
          Pad offset.
 int sessionId()
          Session id.
 int sessionIdOffset()
          Session id offset.
 int tunnelId()
          Tunnel id.
 int tunnelIdOffset()
          Tunnel id offset.
 int version()
          Version.
 
Methods inherited from class org.jnetpcap.packet.JHeader
decode, getAnnotatedHeader, getDescription, getFields, getGap, getGapLength, getGapOffset, getHeader, getHeaderLength, getHeaderOffset, getId, getIndex, getLength, getName, getNextHeaderId, getNextHeaderOffset, getNicname, getOffset, getPacket, getParent, 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
 

Field Detail

FLAG_L

public static final int FLAG_L
The Constant FLAG_L.

See Also:
Constant Field Values

FLAG_O

public static final int FLAG_O
The Constant FLAG_O.

See Also:
Constant Field Values

FLAG_P

public static final int FLAG_P
The Constant FLAG_P.

See Also:
Constant Field Values

FLAG_S

public static final int FLAG_S
The Constant FLAG_S.

See Also:
Constant Field Values

FLAG_T

public static final int FLAG_T
The Constant FLAG_T.

See Also:
Constant Field Values

ID

public static final int ID
The Constant ID.

See Also:
Constant Field Values

MASK_VERSION

public static final int MASK_VERSION
The Constant MASK_VERSION.

See Also:
Constant Field Values

MASK_FLAGS

public static final int MASK_FLAGS
The Constant MASK_FLAGS.

See Also:
Constant Field Values
Constructor Detail

L2TP

public L2TP()
Method Detail

headerLength

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

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

decodeHeader

public void decodeHeader()
Decode header.

Overrides:
decodeHeader in class JHeader
See Also:
JHeader.decodeHeader()

flags

@Field(offset=0,
       length=12,
       format="%x")
public int flags()
Flags.

Returns:
the int

hasLength

@Dynamic(value=CHECK)
public boolean hasLength()
Checks for length.

Returns:
true, if successful

hasN

@Dynamic(value=CHECK)
public boolean hasN()
Checks for n.

Returns:
true, if successful

hasOffset

@Dynamic(value=CHECK)
public boolean hasOffset()
Checks for offset.

Returns:
true, if successful

lengthOffset

@Dynamic(value=OFFSET)
public int lengthOffset()
Length offset.

Returns:
the int

length

@Field(length=16)
public int length()
Length.

Returns:
the int

nrOffset

@Dynamic(value=OFFSET)
public int nrOffset()
Nr offset.

Returns:
the int

nr

@Field(length=16)
public int nr()
Nr.

Returns:
the int

nsOffset

@Dynamic(value=OFFSET)
public int nsOffset()
Ns offset.

Returns:
the int

ns

@Field(length=16)
public int ns()
Ns.

Returns:
the int

offsetOffset

@Dynamic(value=OFFSET)
public int offsetOffset()
Offset offset.

Returns:
the int

offset

@Field(length=16)
public int offset()
Offset.

Returns:
the int

padOffset

@Dynamic(value=OFFSET)
public int padOffset()
Pad offset.

Returns:
the int

pad

@Field(length=16)
public int pad()
Pad.

Returns:
the int

sessionIdOffset

@Dynamic(value=OFFSET)
public int sessionIdOffset()
Session id offset.

Returns:
the int

sessionId

@Field(length=16)
public int sessionId()
Session id.

Returns:
the int

tunnelIdOffset

@Dynamic(value=OFFSET)
public int tunnelIdOffset()
Tunnel id offset.

Returns:
the int

tunnelId

@Field(length=16)
public int tunnelId()
Tunnel id.

Returns:
the int

version

@Field(offset=13,
       length=3)
public int version()
Version.

Returns:
the int