C# Class SharpPcap.Packets.IPv4Packet

Inheritance: EthernetPacket
显示文件 Open project: Zepheus/Fiesta_Utils Class Usage Examples

Public Properties

Property Type Description
ipVersion int

Protected Properties

Property Type Description
_ipOffset int

Public Methods

Method Description
ComputeIPChecksum ( ) : int

Same as computeIPChecksum(true);

ComputeIPChecksum ( bool update ) : int

Computes the IP checksum, optionally updating the IP checksum header.

IPv4Packet ( int lLen, byte bytes ) : System

Create a new IP packet.

IPv4Packet ( int lLen, byte bytes, Timeval tv ) : System

Create a new IP packet.

IsValidTransportLayerChecksum ( bool pseudoIPHeader ) : bool
OnOffsetChanged ( ) : void

should be overriden by upper classes

ToColoredString ( bool colored ) : System.String

Generate string with contents describing this IP packet.

ToColoredVerboseString ( bool colored ) : System.String

Convert this IP packet to a more verbose string.

ToString ( ) : System.String

Convert this IP packet to a readable string.

Protected Methods

Method Description
AttachPseudoIPHeader ( byte origHeader ) : byte[]
SetChecksum ( int cs, int checkSumOffset ) : void

Sets the IP header checksum.

SetTransportLayerChecksum ( int cs, int csPos ) : void

Method Details

AttachPseudoIPHeader() protected method

protected AttachPseudoIPHeader ( byte origHeader ) : byte[]
origHeader byte
return byte[]

ComputeIPChecksum() public method

Same as computeIPChecksum(true);
public ComputeIPChecksum ( ) : int
return int

ComputeIPChecksum() public method

Computes the IP checksum, optionally updating the IP checksum header.
public ComputeIPChecksum ( bool update ) : int
update bool Specifies whether or not to update the IP checksum /// header after computing the checksum. A value of true indicates /// the header should be updated, a value of false indicates it /// should not be updated. ///
return int

IPv4Packet() public method

Create a new IP packet.
public IPv4Packet ( int lLen, byte bytes ) : System
lLen int
bytes byte
return System

IPv4Packet() public method

Create a new IP packet.
public IPv4Packet ( int lLen, byte bytes, Timeval tv ) : System
lLen int
bytes byte
tv SharpPcap.Packets.Util.Timeval
return System

IsValidTransportLayerChecksum() public method

public IsValidTransportLayerChecksum ( bool pseudoIPHeader ) : bool
pseudoIPHeader bool
return bool

OnOffsetChanged() public method

should be overriden by upper classes
public OnOffsetChanged ( ) : void
return void

SetChecksum() protected method

Sets the IP header checksum.
protected SetChecksum ( int cs, int checkSumOffset ) : void
cs int
checkSumOffset int
return void

SetTransportLayerChecksum() protected method

protected SetTransportLayerChecksum ( int cs, int csPos ) : void
cs int
csPos int
return void

ToColoredString() public method

Generate string with contents describing this IP packet.
public ToColoredString ( bool colored ) : System.String
colored bool whether or not the string should contain ansi /// color escape sequences. ///
return System.String

ToColoredVerboseString() public method

Convert this IP packet to a more verbose string.
public ToColoredVerboseString ( bool colored ) : System.String
colored bool
return System.String

ToString() public method

Convert this IP packet to a readable string.
public ToString ( ) : System.String
return System.String

Property Details

_ipOffset protected_oe property

protected int _ipOffset
return int

ipVersion public_oe static_oe property

public static int ipVersion
return int