Commit 72e02475 authored by Brickner_cp's avatar Brickner_cp

Improve TCP documentation (use the same field overview format used in Datagrams in TCP options).

parent f6130fc7
......@@ -23,6 +23,7 @@ namespace PcapDotNet.Packets.Transport
/// | 128 | Checksum | Urgent Pointer |
/// +-----+-----------------------------------------------------------------------------+------------------+
/// | 160 | Options + Padding |
/// | ... | |
/// +-----+------------------------------------------------------------------------------------------------+
/// </pre>
/// </summary>
......
......@@ -13,9 +13,16 @@ namespace PcapDotNet.Packets.Transport
/// <para>
/// The format of the TCP Alternate Checksum Data Option is:
/// <pre>
/// +---------+---------+---------+ +---------+
/// | Kind=15 |Length=N | data | ... | data |
/// +---------+---------+---------+ +---------+
/// +-----+--------+
/// | Bit | 0-7 |
/// +-----+--------+
/// | 0 | Kind |
/// +-----+--------+
/// | 8 | Length |
/// +-----+--------+
/// | 16 | Data |
/// | ... | |
/// +-----+--------+
/// </pre>
/// </para>
///
......
......@@ -6,9 +6,15 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// TCP Alternate Checksum Request Option (RFC 1146).
/// <pre>
/// +----------+----------+----------+
/// | Kind=14 | Length=3 | chksum |
/// +----------+----------+----------+
/// +-----+----------+
/// | Bit | 0-7 |
/// +-----+----------+
/// | 0 | Kind |
/// +-----+----------+
/// | 8 | Length |
/// +-----+----------+
/// | 16 | Checksum |
/// +-----+----------+
/// </pre>
///
/// <para>
......
......@@ -13,15 +13,20 @@ namespace PcapDotNet.Packets.Transport
/// <para>
/// The format of the TCP Authentication Option is:
/// <pre>
/// +------------+------------+------------+------------+
/// | Kind=29 | Length=N | KeyId | RNextKeyId |
/// +------------+------------+------------+------------+
/// | MAC ...
/// +-----------------------------------...
///
/// ...-----------------+
/// ... MAC (con't) |
/// ...-----------------+
/// +-----+------------+
/// | Bit | 0-7 |
/// +-----+------------+
/// | 0 | Kind |
/// +-----+------------+
/// | 8 | Length |
/// +-----+------------+
/// | 16 | KeyId |
/// +-----+------------+
/// | 24 | RNextKeyId |
/// +-----+------------+
/// | 32 | MAC |
/// | ... | |
/// +-----+------------+
/// </pre>
/// </para>
///
......@@ -41,7 +46,7 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// The minimum number of bytes this option takes.
/// </summary>
public const int OptionMinimumLength = OptionHeaderLength + 2;
public const int OptionMinimumLength = OptionHeaderLength + sizeof(byte) + sizeof(byte);
/// <summary>
/// The minimum number of bytes this option's value takes.
......
......@@ -5,10 +5,14 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// CC Option (RFC 1644).
/// <pre>
/// +--------+--------+--------+--------+--------+--------+
/// |00001011|00000110| Connection Count: SEG.CC |
/// +--------+--------+--------+--------+--------+--------+
/// Kind=11 Length=6
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// | 16 | Connection |
/// | | Count |
/// +-----+---------------+
/// </pre>
///
/// <para>
......
......@@ -5,10 +5,14 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// CC.ECHO Option (RFC 1644).
/// <pre>
/// +--------+--------+--------+--------+--------+--------+
/// |00001101|00000110| Connection Count: SEG.CC |
/// +--------+--------+--------+--------+--------+--------+
/// Kind=13 Length=6
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// | 16 | Connection |
/// | | Count |
/// +-----+---------------+
/// </pre>
///
/// <para>
......
......@@ -5,10 +5,14 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// CC.NEW Option (RFC 1644).
/// <pre>
/// +--------+--------+--------+--------+--------+--------+
/// |00001100|00000110| Connection Count: SEG.CC |
/// +--------+--------+--------+--------+--------+--------+
/// Kind=12 Length=6
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// | 16 | Connection |
/// | | Count |
/// +-----+---------------+
/// </pre>
///
/// <para>
......
......@@ -6,9 +6,14 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// TCP Echo Option:
/// <pre>
/// +--------+--------+--------+--------+--------+--------+
/// | Kind=6 | Length | 4 bytes of info to be echoed |
/// +--------+--------+--------+--------+--------+--------+
/// +-----+------+----------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+----------+
/// | 0 | Kind | Length |
/// +-----+------+----------+
/// | 16 | 4 bytes of info |
/// | | to be echoed |
/// +-----+-----------------+
/// </pre>
///
/// <para>
......
......@@ -6,9 +6,14 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// TCP Echo Reply Option:
/// <pre>
/// +--------+--------+--------+--------+--------+--------+
/// | Kind=7 | Length | 4 bytes of echoed info |
/// +--------+--------+--------+--------+--------+--------+
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// | 16 | 4 bytes of |
/// | | echoed info |
/// +-----+---------------+
/// </pre>
///
/// <para>
......
......@@ -6,10 +6,13 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// Maximum Segment Size (RFC 793)
/// <pre>
/// +--------+--------+---------+--------+
/// |00000010|00000100| max seg size |
/// +--------+--------+---------+--------+
/// Kind=2 Length=4
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// | 16 | max seg size |
/// +-----+---------------+
/// </pre>
///
/// <para>
......
......@@ -9,17 +9,20 @@ namespace PcapDotNet.Packets.Transport
{
/// <summary>
/// <pre>
/// +---------+---------+-------------------+
/// | Kind=19 |Length=18| MD5 digest... |
/// +---------+---------+-------------------+
/// | |
/// +---------------------------------------+
/// | |
/// +---------------------------------------+
/// | |
/// +-------------------+-------------------+
/// | |
/// +-------------------+
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// | 16 | MD5 digest |
/// | | |
/// | | |
/// | | |
/// | | |
/// | | |
/// | | |
/// | | |
/// +-----+---------------+
/// </pre>
///
/// <para>
......
......@@ -7,15 +7,23 @@ using PcapDotNet.Packets.Ip;
namespace PcapDotNet.Packets.Transport
{
/// <summary>
/// RFC 5841.
/// TCP Mood Option:
/// <pre>
/// +---------+--------+------------+
/// | Kind=25 | Length | ASCII Mood |
/// +---------+--------+------------+
/// +-----+--------+
/// | Bit | 0-7 |
/// +-----+--------+
/// | 0 | Kind |
/// +-----+--------+
/// | 8 | Length |
/// +-----+--------+
/// | 16 | ASCII |
/// | ... | Mood |
/// +-----+--------+
/// </pre>
///
/// <para>
/// It is proposed that option 25 (released 2000-12-18) be used to define packet mood.
/// It is proposed that option 25 (released 2000-12-18) be used to define packet mood.
/// This option would have a length value of 4 or 5 bytes.
/// All the simple emotions described as expressible via this mechanism can be displayed with two or three 7-bit, ASCII-encoded characters.
/// Multiple mood options may appear in a TCP header, so as to express more complex moods than those defined here (for instance if a packet were happy and surprised).
......
......@@ -6,9 +6,11 @@ namespace PcapDotNet.Packets.Transport
/// <summary>
/// TCP POC-permitted Option (RFC 1693)
/// <pre>
/// +-----------+-------------+
/// | Kind=9 | Length=2 |
/// +-----------+-------------+
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// </pre>
/// </summary>
[TcpOptionTypeRegistration(TcpOptionType.PartialOrderConnectionPermitted)]
......
......@@ -8,10 +8,15 @@ namespace PcapDotNet.Packets.Transport
/// TCP POC-service-profile Option (RFC 1693).
///
/// <pre>
/// 1 bit 1 bit 6 bits
/// +----------+----------+------------+----------+--------+
/// | Kind=10 | Length=3 | Start_flag | End_flag | Filler |
/// +----------+----------+------------+----------+--------+
/// +-----+------------+----------+--------+
/// | Bit | 0 | 1 | 2-7 |
/// +-----+------------+----------+--------+
/// | 0 | Kind |
/// +-----+--------------------------------+
/// | 8 | Length |
/// +-----+------------+----------+--------+
/// | 16 | Start_flag | End_flag | Filler |
/// +-----+------------+----------+--------+
/// </pre>
///
/// <para>
......
......@@ -8,24 +8,29 @@ using PcapDotNet.Packets.Ip;
namespace PcapDotNet.Packets.Transport
{
/// <summary>
/// RFC 2018.
/// The SACK option is to be used to convey extended acknowledgment information from the receiver to the sender over an established TCP connection.
///
/// <pre>
/// +--------+--------+
/// | Kind=5 | Length |
/// +--------+--------+--------+--------+
/// | Left Edge of 1st Block |
/// +--------+--------+--------+--------+
/// | Right Edge of 1st Block |
/// +--------+--------+--------+--------+
/// | |
/// / . . . /
/// | |
/// +--------+--------+--------+--------+
/// | Left Edge of nth Block |
/// +--------+--------+--------+--------+
/// | Right Edge of nth Block |
/// +--------+--------+--------+--------+
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// | 16 | Left Edge of |
/// | | 1st Block |
/// +-----+---------------+
/// | 48 | Right Edge of |
/// | | 1st Block |
/// +-----+---------------+
/// ...
/// +-----+---------------+
/// | | Left Edge of |
/// | | nth Block |
/// +-----+---------------+
/// | | Right Edge of |
/// | | nth Block |
/// +-----+---------------+
/// </pre>
///
/// <para>
......
......@@ -10,9 +10,11 @@ namespace PcapDotNet.Packets.Transport
/// It MUST NOT be sent on non-SYN segments.
///
/// <pre>
/// +---------+---------+
/// | Kind=4 | Length=2|
/// +---------+---------+
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// </pre>
/// </summary>
[TcpOptionTypeRegistration(TcpOptionType.SelectiveAcknowledgmentPermitted)]
......
......@@ -4,12 +4,20 @@ using PcapDotNet.Packets.Ip;
namespace PcapDotNet.Packets.Transport
{
/// <summary>
/// RFC 1323.
/// TCP Timestamps Option (TSopt):
/// <pre>
/// +-------+-------+---------------------+---------------------+
/// |Kind=8 | 10 | TS Value (TSval) |TS Echo Reply (TSecr)|
/// +-------+-------+---------------------+---------------------+
/// 1 1 4 4
/// +-----+------+--------+
/// | Bit | 0-7 | 8-15 |
/// +-----+------+--------+
/// | 0 | Kind | Length |
/// +-----+------+--------+
/// | 16 | TS Value |
/// | | (TSval) |
/// +-----+---------------+
/// | 48 | TS Echo Reply |
/// | | (TSecr) |
/// +-----+---------------+
/// </pre>
///
/// <para>
......
......@@ -12,9 +12,15 @@ namespace PcapDotNet.Packets.Transport
/// The scale factor is limited to a power of two and encoded logarithmically, so it may be implemented by binary shift operations.
///
/// <pre>
/// +---------+---------+---------+
/// | Kind=3 |Length=3 |shift.cnt|
/// +---------+---------+---------+
/// +-----+-----------+
/// | Bit | 0-7 |
/// +-----+-----------+
/// | 0 | Kind |
/// +-----+-----------+
/// | 8 | Length |
/// +-----+-----------+
/// | 16 | shift.cnt |
/// +-----+-----------+
/// </pre>
///
/// <para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment