|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.nio.JMemory
org.jnetpcap.nio.JBuffer
org.jnetpcap.packet.JHeader
org.jnetpcap.packet.JSubHeader<Tcp>
org.jnetpcap.protocol.tcpip.Tcp.TcpOption
org.jnetpcap.protocol.tcpip.Tcp.WindowScale
@Header(id=3) public static class Tcp.WindowScale
The window scale extension expands the definition of the TCP window to 32 bits and then uses a scale factor to carry this 32 bit value in the 16 bit Window field of the TCP header (SEG.WND in RFC-793). The scale factor is carried in a new TCP option, Window Scale. This option is sent only in a SYN segment (a segment with the SYN bit on), hence the window scale is fixed in each direction when a connection is opened. (Another design choice would be to specify the window scale in every TCP segment. It would be incorrect to send a window scale option only when the scale factor changed, since a TCP option in an acknowledgement segment will not be delivered reliably (unless the ACK happens to be piggy-backed on data in the other direction). Fixing the scale when the connection is opened has the advantage of lower overhead but the disadvantage that the scale factor cannot be changed during the connection.
| Nested Class Summary |
|---|
| 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.WindowScale()
|
|
| Method Summary | |
|---|---|
int |
scale()
The window scale extension expands the definition of the TCP window to 32 bits and then uses a scale factor to carry this 32 bit value in the 16 bit Window field of the TCP header (SEG.WND in RFC-793). |
void |
scale(int value)
Sets a new scaling factor. |
| 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.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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Tcp.WindowScale()
| Method Detail |
|---|
@Field(offset=16,
length=8)
public int scale()
The three-byte Window Scale option may be sent in a SYN segment by a TCP. It has two purposes: (1) indicate that the TCP is prepared to do both send and receive window scaling, and (2) communicate a scale factor to be applied to its receive window. Thus, a TCP that is prepared to scale windows should send the option, even if its own scale factor is 1. The scale factor is limited to a power of two and encoded logarithmically, so it may be implemented by binary shift operations.
public void scale(int value)
value - value to set in the field
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||