Class TCPPacket
TCP Packet Class
Inherited Members
Namespace: Cosmos.System.Network.IPv4.TCP
Assembly: Cosmos.System2.dll
Syntax
public class TCPPacket : IPPacket
Constructors
| Improve this Doc View SourceTCPPacket(Address, Address, UInt16, UInt16, UInt64, UInt64, UInt16, Byte, UInt16, UInt16)
Create new instance of the TCPPacket class.
Declaration
public TCPPacket(Address source, Address dest, ushort srcPort, ushort destPort, ulong sequencenumber, ulong acknowledgmentnb, ushort Headerlenght, byte Flags, ushort WSValue, ushort UrgentPointer)
Parameters
Type | Name | Description |
---|---|---|
Address | source | Source address. |
Address | dest | Destination address. |
System.UInt16 | srcPort | Source port. |
System.UInt16 | destPort | Destination port. |
System.UInt64 | sequencenumber | Sequence number. |
System.UInt64 | acknowledgmentnb | Acknowledgment Number. |
System.UInt16 | Headerlenght | TCP Header length. |
System.Byte | Flags | TCP flags. |
System.UInt16 | WSValue | Windows size. |
System.UInt16 | UrgentPointer | Urgent Pointer. |
Exceptions
Type | Condition |
---|---|
System.OverflowException | Thrown if data array length is greater than Int32.MaxValue. |
System.ArgumentException | Thrown if RawData is invalid or null. |
TCPPacket(Address, Address, UInt16, UInt16, UInt64, UInt64, UInt16, Byte, UInt16, UInt16, Byte[])
Create new instance of the TCPPacket class.
Declaration
public TCPPacket(Address source, Address dest, ushort srcPort, ushort destPort, ulong sequencenumber, ulong acknowledgmentnb, ushort Headerlenght, byte Flags, ushort WSValue, ushort UrgentPointer, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
Address | source | Source address. |
Address | dest | Destination address. |
System.UInt16 | srcPort | Source port. |
System.UInt16 | destPort | Destination port. |
System.UInt64 | sequencenumber | Sequence number. |
System.UInt64 | acknowledgmentnb | Acknowledgment Number. |
System.UInt16 | Headerlenght | TCP Header length. |
System.Byte | Flags | TCP flags. |
System.UInt16 | WSValue | Windows size. |
System.UInt16 | UrgentPointer | Urgent Pointer. |
System.Byte[] | data | Raw data. |
Exceptions
Type | Condition |
---|---|
System.OverflowException | Thrown if data array length is greater than Int32.MaxValue. |
System.ArgumentException | Thrown if RawData is invalid or null. |
TCPPacket(Byte[])
Create new instance of the TCPPacket class.
Declaration
public TCPPacket(byte[] rawData)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | rawData | Raw data. |
Properties
| Improve this Doc View SourceAckNumber
Get acknowledge number.
Declaration
public uint AckNumber { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Checksum
Get sequence number.
Declaration
public ushort Checksum { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
DestinationPort
Get destination port.
Declaration
public ushort DestinationPort { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
Options
TCP Options
Declaration
public List<TCPOption> Options { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<TCPOption> |
SequenceNumber
Get sequence number.
Declaration
public uint SequenceNumber { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
SourcePort
Get source port.
Declaration
public ushort SourcePort { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
TCP_DataLength
Get TCP data lenght.
Declaration
public ushort TCP_DataLength { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
TCPFlags
Get sequence number.
Declaration
public byte TCPFlags { get; }
Property Value
Type | Description |
---|---|
System.Byte |
TCPHeaderLength
Get sequence number.
Declaration
public byte TCPHeaderLength { get; }
Property Value
Type | Description |
---|---|
System.Byte |
UrgentPointer
Get sequence number.
Declaration
public ushort UrgentPointer { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
WindowSize
Get sequence number.
Declaration
public ushort WindowSize { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
Methods
| Improve this Doc View SourcegetFlags()
Get string representation of TCP flags.
Declaration
public string getFlags()
Returns
Type | Description |
---|---|
System.String | string value. |
InitializeFields()
Init TCPPacket fields.
Declaration
protected override void InitializeFields()
Overrides
| Improve this Doc View SourceToString()
To string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | string value. |