org.jnetpcap.protocol.tcpip
Class Tcp.AlternateChecksumRequest

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<Tcp>
                  extended by org.jnetpcap.protocol.tcpip.Tcp.TcpOption
                      extended by org.jnetpcap.protocol.tcpip.Tcp.AlternateChecksumRequest
All Implemented Interfaces:
JPayloadAccessor
Enclosing class:
Tcp

@Header(id=14)
public static class Tcp.AlternateChecksumRequest
extends Tcp.TcpOption

The option described in this memo provides a mechanism to negotiate the use of an alternate checksum at connection-establishment time, as well as a mechanism to carry additional checksum information for algorithms that utilize checksums that are longer than 16 bits.

Definition of the option: the TCP Alternate Checksum Request Option may be sent in a SYN segment by a TCP to indicate that the TCP is prepared to both generate and receive checksums based on an alternate algorithm. During communication, the alternate checksum replaces the regular TCP checksum in the checksum field of the TCP header. Should the alternate checksum require more than 2 bytes to transmit, the checksum may either be moved into a TCP Alternate Checksum Data Option and the checksum field of the TCP header be sent as 0, or the data may be split between the header field and the option. Alternate checksums are computed over the same data as the regular TCP checksum.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static class Tcp.AlternateChecksumRequest.Algorithm
          A SYN segment used to originate a connection may contain the Alternate Checksum Request Option, which specifies an alternate checksum-calculation algorithm to be used for the connection.
 
Nested classes/interfaces inherited from class org.jnetpcap.protocol.tcpip.Tcp.TcpOption
Tcp.TcpOption.OptionCode
 
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
Tcp.AlternateChecksumRequest()
           
 
Method Summary
 int algorithm()
          Specifies the checksum algorithm to be used.
 void algorithm(int value)
          Sets a new value for algorithm field.
 Tcp.AlternateChecksumRequest.Algorithm algorithmEnum()
          Returns the algorithm type as enum constant.
 
Methods inherited from class org.jnetpcap.protocol.tcpip.Tcp.TcpOption
code, code, length, length, lengthCheck, lengthDescription
 
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

Tcp.AlternateChecksumRequest

public Tcp.AlternateChecksumRequest()
Method Detail

algorithm

@Field(offset=16,
       length=8)
public int algorithm()
Specifies the checksum algorithm to be used.

Returns:
type of algorithm

algorithmEnum

public Tcp.AlternateChecksumRequest.Algorithm algorithmEnum()
Returns the algorithm type as enum constant.

Returns:
constant representing the algorithm or null if unrecognized

algorithm

public void algorithm(int value)
Sets a new value for algorithm field.

Parameters:
value - new value to set