WpcIcmpPacket Class Reference
[Classes hierarchy]

Implements protocol-specific fields for ICMP packets. More...

Inheritance diagram for WpcIcmpPacket:

WpcIpPacket WpcPacket

List of all members.

Public Member Functions

 WpcIcmpPacket (WpcPacket const &packet)
 Creates a WpcIcmpPacket object as a copy from another.
 WpcIcmpPacket (int size=sizeof(WPC_ICMP_HDR))
 Creates an empty ICMP packet.
virtual string & Dump (bool printPayload=true)
 Dumps packet data to string representation.
virtual bool ReadyToSend (WpcAdapter *adapter=NULL)
 Prepare data to send.
virtual int PayloadLength ()
 Gets packet payload length.
virtual unsigned char * GetData ()
 Gets a pointer to the data (payload) of the WpcPacket.
unsigned char type ()
 Gets ICMP type.
void type (unsigned char val)
 Sets ICMP type.
unsigned char code ()
 Gets operation code.
void code (unsigned char val)
 Sets operation code.
unsigned short chksum ()
 Gets checksum.
void chksum (unsigned short val)
 Sets checksum.
unsigned short id ()
 Gets id.
void id (unsigned short val)
 Sets id.
unsigned short sequence ()
 Gets sequence number.
void sequence (unsigned short val)
 Sets sequence number.

Protected Attributes

WPC_ICMP_HDRm_icmpHdr


Detailed Description

Implements protocol-specific fields for ICMP packets.

All properties to access ICMP-header fields are have one important issue:

Examples:

wpcPacket.cpp.


Constructor & Destructor Documentation

WpcIcmpPacket::WpcIcmpPacket ( WpcPacket const &  packet  )  [inline]

Creates a WpcIcmpPacket object as a copy from another.

WpcIcmpPacket::WpcIcmpPacket ( int  size = sizeof(WPC_ICMP_HDR)  )  [inline]

Creates an empty ICMP packet.


Member Function Documentation

void WpcIcmpPacket::chksum ( unsigned short  val  ) 

Sets checksum.

Reimplemented from WpcIpPacket.

unsigned short WpcIcmpPacket::chksum (  ) 

Gets checksum.

Reimplemented from WpcIpPacket.

void WpcIcmpPacket::code ( unsigned char  val  ) 

Sets operation code.

unsigned char WpcIcmpPacket::code (  ) 

Gets operation code.

string & WpcIcmpPacket::Dump ( bool  printPayload = true  )  [virtual]

Dumps packet data to string representation.

Reimplemented from WpcIpPacket.

unsigned char * WpcIcmpPacket::GetData (  )  [virtual]

Gets a pointer to the data (payload) of the WpcPacket.

Returns:
pointer to the packet payload, or NULL if the packet size less than header size

Reimplemented from WpcIpPacket.

void WpcIcmpPacket::id ( unsigned short  val  ) 

Sets id.

Reimplemented from WpcIpPacket.

unsigned short WpcIcmpPacket::id (  ) 

Gets id.

Reimplemented from WpcIpPacket.

int WpcIcmpPacket::PayloadLength ( void   )  [virtual]

Gets packet payload length.

Returns:
Packet payload length, or NULL if the packet size less than header size

Reimplemented from WpcIpPacket.

bool WpcIcmpPacket::ReadyToSend ( WpcAdapter adapter = NULL  )  [virtual]

Prepare data to send.

Calculate IP checksum.

Returns:
true if packet is ready to send false otherwise

Todo:
implement TCP checksum calculation and options processing

Reimplemented from WpcIpPacket.

void WpcIcmpPacket::sequence ( unsigned short  val  ) 

Sets sequence number.

unsigned short WpcIcmpPacket::sequence (  ) 

Gets sequence number.

void WpcIcmpPacket::type ( unsigned char  val  ) 

Sets ICMP type.

unsigned char WpcIcmpPacket::type (  ) 

Gets ICMP type.


Member Data Documentation



 
©2009 Positive Technologies
 
Generated on Fri May 22 18:17:01 2009 for wpcObj by 
 
 
1.5.7
 
Get wpcObj at SourceForge.net. Fast, secure and Free Open Source software downloads