C# Class UdpHeader, Hermod

Inheritance: AProtocolHeader
Afficher le fichier Open project: Vanaheimr/Hermod Class Usage Examples

Méthodes publiques

Свойство Type Description
UdpHeaderLength int
ipv4PacketHeader IPv4Header_old
ipv6PacketHeader Ipv6Header

Méthodes publiques

Méthode Description
Create ( byte udpData, int &bytesCopied ) : UdpHeader,

GetProtocolPacketBytes ( byte payLoad ) : byte[]

This method builds the byte array representation of the UDP header as it would appear on the wire. To do this it must build the IPv4 or IPv6 pseudo header in order to calculate the checksum on the packet. This requires knowledge of the IPv4 or IPv6 header so one of these must be set before a UDP packet can be set. The IPv4 pseudo header consists of: 4-byte source IP address 4-byte destination address 1-byte zero field 1-byte protocol field 2-byte UDP length 2-byte source port 2-byte destination port 2-byte UDP packet length 2-byte UDP checksum (zero) UDP payload (padded to the next 16-bit boundary) The IPv6 pseudo header consists of: 16-byte source address 16-byte destination address 4-byte payload length 3-byte zero pad 1-byte protocol value 2-byte source port 2-byte destination port 2-byte UDP length 2-byte UDP checksum (zero) UDP payload (padded to the next 16-bit boundary)

UdpHeader ( ) : System

Simple constructor for the UDP header.

Method Details

Create() public static méthode

public static Create ( byte udpData, int &bytesCopied ) : UdpHeader,
udpData byte
bytesCopied int
Résultat UdpHeader,

GetProtocolPacketBytes() public méthode

This method builds the byte array representation of the UDP header as it would appear on the wire. To do this it must build the IPv4 or IPv6 pseudo header in order to calculate the checksum on the packet. This requires knowledge of the IPv4 or IPv6 header so one of these must be set before a UDP packet can be set. The IPv4 pseudo header consists of: 4-byte source IP address 4-byte destination address 1-byte zero field 1-byte protocol field 2-byte UDP length 2-byte source port 2-byte destination port 2-byte UDP packet length 2-byte UDP checksum (zero) UDP payload (padded to the next 16-bit boundary) The IPv6 pseudo header consists of: 16-byte source address 16-byte destination address 4-byte payload length 3-byte zero pad 1-byte protocol value 2-byte source port 2-byte destination port 2-byte UDP length 2-byte UDP checksum (zero) UDP payload (padded to the next 16-bit boundary)
public GetProtocolPacketBytes ( byte payLoad ) : byte[]
payLoad byte Payload that follows the UDP header
Résultat byte[]

UdpHeader() public méthode

Simple constructor for the UDP header.
public UdpHeader ( ) : System
Résultat System

Property Details

UdpHeaderLength public_oe static_oe property

public static int UdpHeaderLength
Résultat int

ipv4PacketHeader public_oe property

public IPv4Header_old ipv4PacketHeader
Résultat IPv4Header_old

ipv6PacketHeader public_oe property

public Ipv6Header ipv6PacketHeader
Résultat Ipv6Header