Class UDPPacket
UDPPacket class.
Inherited Members
Namespace: Cosmos.System.Network.IPv4
Assembly: Cosmos.System2.dll
Syntax
public class UDPPacket : IPPacket
Constructors
| Improve this Doc View SourceUDPPacket(Address, Address, UInt16, UInt16, Byte[])
Create new inctanse of the UDPPacket class.
Declaration
public UDPPacket(Address source, Address dest, ushort srcPort, ushort destPort, 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.Byte[] | data | Data array. |
UDPPacket(Byte[])
Create new inctanse of the UDPPacket class.
Declaration
public UDPPacket(byte[] rawData)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | rawData | Raw data. |
Properties
| Improve this Doc View SourceDestinationPort
Get destination port.
Declaration
public ushort DestinationPort { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
SourcePort
Get source port.
Declaration
public ushort SourcePort { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
UDP_DataLength
Get UDP data lenght.
Declaration
public ushort UDP_DataLength { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
UDP_Length
Get UDP length.
Declaration
public ushort UDP_Length { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
Methods
| Improve this Doc View SourceCheck(Byte[], UInt16, Int32)
Calculate CRC.
Declaration
protected static ushort Check(byte[] buffer, ushort offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | Buffer. |
System.UInt16 | offset | Offset. |
System.Int32 | length | Length. |
Returns
Type | Description |
---|---|
System.UInt16 | ushort value. |
CheckCRC(UDPPacket)
Check CRC.
Declaration
public static bool CheckCRC(UDPPacket packet)
Parameters
Type | Name | Description |
---|---|---|
UDPPacket | packet | Packer to be checked. |
Returns
Type | Description |
---|---|
System.Boolean | bool value. |
initFields()
Init UDPPacket fields.
Declaration
protected override void initFields()
Overrides
| Improve this Doc View SourceMakeHeader(Byte[], Byte[], UInt16, UInt16, UInt16, Byte[])
Make header.
Declaration
public static byte[] MakeHeader(byte[] sourceIP, byte[] destIP, UInt16 udpLen, UInt16 sourcePort, UInt16 destPort, byte[] UDP_Data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | sourceIP | Source IP. |
System.Byte[] | destIP | Destination IP. |
UInt16 | udpLen | UDP length. |
UInt16 | sourcePort | Source port. |
UInt16 | destPort | Destination port. |
System.Byte[] | UDP_Data | UDP data. |
Returns
Type | Description |
---|---|
System.Byte[] | byte array value. |
ToString()
To string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | string value. |
Overrides
| Improve this Doc View SourceVMTInclude()
Work around to make VMT scanner include the initFields method
Declaration
public static void VMTInclude()