org.jnetpcap.protocol.tcpip
Enum Tcp.TcpOption.OptionCode

java.lang.Object
  extended by java.lang.Enum<Tcp.TcpOption.OptionCode>
      extended by org.jnetpcap.protocol.tcpip.Tcp.TcpOption.OptionCode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Tcp.TcpOption.OptionCode>
Enclosing class:
Tcp.TcpOption

public static enum Tcp.TcpOption.OptionCode
extends java.lang.Enum<Tcp.TcpOption.OptionCode>

Options (Variable 0-320 bits, divisible by 32) - The length of this field is determined by the data offset field. Options 0 and 1 are a single byte (8 bits) in length. The remaining options indicate the total length of the option (expressed in bytes) in the second byte. Some options may only be sent when SYN is set;

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Enum Constant Summary
ALTERNATE_CHECKSUM
          15,N,...
ALTERNATE_CHECKSUM_REQUEST
          14,3,S (24 bits) - TCP Alternate Checksum Request.
END_OF_OPTION_LIST
          0 (8 bits) - End of options list.
MAXIMUM_SEGMENT_SIZE
          2,4,SS (32 bits) - Maximum segment size (see maximum segment size) [SYN].
NO_OP
          1 (8 bits) - No operation (NOP, Padding) This may be used to align option fields on 32-bit boundaries for better performance.
SACK
          5,N,BBBB,EEEE,...
SACK_PERMITTED
          4,2 (16 bits) - Selective Acknowledgement permitted.
TIMESTAP
          8,10,TTTT,EEEE (80 bits)- Timestamp and echo of previous timestamp.
WINDOW_SCALE
          3,3,S (24 bits) - Window scale (see window scaling for details) [SYN].
 
Field Summary
 int id
          OP CODE for this option.
 
Method Summary
static Tcp.TcpOption.OptionCode valueOf(int id)
          Converts a numerical op code to a enum constant.
static Tcp.TcpOption.OptionCode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Tcp.TcpOption.OptionCode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ALTERNATE_CHECKSUM

public static final Tcp.TcpOption.OptionCode ALTERNATE_CHECKSUM
15,N,... (variable bits) - TCP Alternate Checksum Data.


ALTERNATE_CHECKSUM_REQUEST

public static final Tcp.TcpOption.OptionCode ALTERNATE_CHECKSUM_REQUEST
14,3,S (24 bits) - TCP Alternate Checksum Request. [SYN]


END_OF_OPTION_LIST

public static final Tcp.TcpOption.OptionCode END_OF_OPTION_LIST
0 (8 bits) - End of options list.


MAXIMUM_SEGMENT_SIZE

public static final Tcp.TcpOption.OptionCode MAXIMUM_SEGMENT_SIZE
2,4,SS (32 bits) - Maximum segment size (see maximum segment size) [SYN].


NO_OP

public static final Tcp.TcpOption.OptionCode NO_OP
1 (8 bits) - No operation (NOP, Padding) This may be used to align option fields on 32-bit boundaries for better performance.


SACK

public static final Tcp.TcpOption.OptionCode SACK
5,N,BBBB,EEEE,... (variable bits, N is either 10, 18, 26, or 34)- Selective ACKnowlegement (SACK) These first two bytes are followed by a list of 1-4 blocks being selectively acknowledged, specified as 32-bit begin/end pointers.


SACK_PERMITTED

public static final Tcp.TcpOption.OptionCode SACK_PERMITTED
4,2 (16 bits) - Selective Acknowledgement permitted. [SYN]


TIMESTAP

public static final Tcp.TcpOption.OptionCode TIMESTAP
8,10,TTTT,EEEE (80 bits)- Timestamp and echo of previous timestamp.


WINDOW_SCALE

public static final Tcp.TcpOption.OptionCode WINDOW_SCALE
3,3,S (24 bits) - Window scale (see window scaling for details) [SYN].

Field Detail

id

public final int id
OP CODE for this option.

Method Detail

values

public static Tcp.TcpOption.OptionCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Tcp.TcpOption.OptionCode c : Tcp.TcpOption.OptionCode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Tcp.TcpOption.OptionCode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

valueOf

public static Tcp.TcpOption.OptionCode valueOf(int id)
Converts a numerical op code to a enum constant.

Parameters:
id - numerical constant to convert
Returns:
enum constant