C# 클래스 UdpHeader, Hermod

상속: AProtocolHeader
파일 보기 프로젝트 열기: Vanaheimr/Hermod 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
UdpHeaderLength int
ipv4PacketHeader IPv4Header_old
ipv6PacketHeader Ipv6Header

공개 메소드들

메소드 설명
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.

메소드 상세

Create() 공개 정적인 메소드

public static Create ( byte udpData, int &bytesCopied ) : UdpHeader,
udpData byte
bytesCopied int
리턴 UdpHeader,

GetProtocolPacketBytes() 공개 메소드

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
리턴 byte[]

UdpHeader() 공개 메소드

Simple constructor for the UDP header.
public UdpHeader ( ) : System
리턴 System

프로퍼티 상세

UdpHeaderLength 공개적으로 정적으로 프로퍼티

public static int UdpHeaderLength
리턴 int

ipv4PacketHeader 공개적으로 프로퍼티

public IPv4Header_old ipv4PacketHeader
리턴 IPv4Header_old

ipv6PacketHeader 공개적으로 프로퍼티

public Ipv6Header ipv6PacketHeader
리턴 Ipv6Header