C# 클래스 NetworkPackets.IPPacket

상속: NetworkPacket
파일 보기 프로젝트 열기: pstjuste/brunet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
BroadcastAddress MemBlock
DestinationIP MemBlock
Protocol Protocols
SourceIP MemBlock
ZeroAddress MemBlock

공개 메소드들

메소드 설명
GenerateChecksum ( MemBlock header ) : ushort

Generates an 16-bit IP (UDP, TCP) checksum based upon header and optional extra memory blocks placed into args.

IPPacket ( ) : Brunet
IPPacket ( MemBlock Packet ) : Brunet

Takes in a MemBlock and parses it into IP Header fields

IPPacket ( Protocols Protocol, MemBlock SourceIP, MemBlock DestinationIP, ICopyable Payload ) : Brunet

Takes in the IP Header fields and a payload to create an IP Packet. Unlisted fields are generated by this constructor automatically.

IPPacket ( Protocols Protocol, MemBlock SourceIP, MemBlock DestinationIP, MemBlock hdr, ICopyable Payload ) : Brunet

Takes in the IP Header fields and a payload to create an IP Packet. Unlisted fields are generated by this constructor automatically.

MakePseudoHeader ( MemBlock source_address, MemBlock destination_address, byte protocol, ushort length ) : MemBlock
Translate ( MemBlock Packet, MemBlock SourceIP, MemBlock DestinationIP ) : MemBlock

If we're not creating a packet from scratch, this will keep its integrity and transform UDP and TCP headers as well (due to their checksums being dependent on source and destination ip addresses.

비공개 메소드들

메소드 설명
ChecksumTest ( ) : void

메소드 상세

GenerateChecksum() 공개 정적인 메소드

Generates an 16-bit IP (UDP, TCP) checksum based upon header and optional extra memory blocks placed into args.
public static GenerateChecksum ( MemBlock header ) : ushort
header MemBlock The Header to base the checksum on.
리턴 ushort

IPPacket() 공개 메소드

public IPPacket ( ) : Brunet
리턴 Brunet

IPPacket() 공개 메소드

Takes in a MemBlock and parses it into IP Header fields
public IPPacket ( MemBlock Packet ) : Brunet
Packet MemBlock The IP Packet to parse.
리턴 Brunet

IPPacket() 공개 메소드

Takes in the IP Header fields and a payload to create an IP Packet. Unlisted fields are generated by this constructor automatically.
public IPPacket ( Protocols Protocol, MemBlock SourceIP, MemBlock DestinationIP, ICopyable Payload ) : Brunet
Protocol Protocols The type of payload
SourceIP MemBlock The packets originating ip address
DestinationIP MemBlock The destination for the packet
Payload ICopyable The data stored in the IP Packet
리턴 Brunet

IPPacket() 공개 메소드

Takes in the IP Header fields and a payload to create an IP Packet. Unlisted fields are generated by this constructor automatically.
public IPPacket ( Protocols Protocol, MemBlock SourceIP, MemBlock DestinationIP, MemBlock hdr, ICopyable Payload ) : Brunet
Protocol Protocols The type of payload
SourceIP MemBlock The packets originating ip address
DestinationIP MemBlock The destination for the packet
hdr MemBlock The original header of the IPPacket
Payload ICopyable The data stored in the IP Packet
리턴 Brunet

MakePseudoHeader() 공개 정적인 메소드

public static MakePseudoHeader ( MemBlock source_address, MemBlock destination_address, byte protocol, ushort length ) : MemBlock
source_address MemBlock
destination_address MemBlock
protocol byte
length ushort
리턴 MemBlock

Translate() 공개 정적인 메소드

If we're not creating a packet from scratch, this will keep its integrity and transform UDP and TCP headers as well (due to their checksums being dependent on source and destination ip addresses.
public static Translate ( MemBlock Packet, MemBlock SourceIP, MemBlock DestinationIP ) : MemBlock
Packet MemBlock The packet to translate.
SourceIP MemBlock The new source ip.
DestinationIP MemBlock The new destination ip.
리턴 MemBlock

프로퍼티 상세

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

The default broadcast (multicast) address
public static MemBlock BroadcastAddress
리턴 MemBlock

DestinationIP 공개적으로 프로퍼티

The IP Address where the packet is going
public MemBlock DestinationIP
리턴 MemBlock

Protocol 공개적으로 프로퍼티

The protocol for this packet.
public Protocols Protocol
리턴 Protocols

SourceIP 공개적으로 프로퍼티

The IP Address where the packet originated
public MemBlock SourceIP
리턴 MemBlock

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

The zero address
public static MemBlock ZeroAddress
리턴 MemBlock