WpcArpPacket Class Reference
[Classes hierarchy]

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

Inheritance diagram for WpcArpPacket:

WpcPacket

List of all members.

Public Member Functions

 WpcArpPacket (WpcPacket const &packet)
 Creates a WpcArpPacket object as a copy from another.
 WpcArpPacket (int size=sizeof(WPC_ARP_HDR))
 Creates an empty ARP packet.
virtual string & Dump (bool printPayload=true)
 Dumps packet data to string representation.
virtual int PayloadLength ()
 Gets packet payload length.
virtual unsigned char * GetData ()
 Gets a pointer to the data (payload) of the WpcPacket.
unsigned short hwtype ()
 Gets ARP hardware address type.
void hwtype (unsigned short val)
 Sets ARP hardware address type.
unsigned short proto ()
 Gets ARP protocol address type.
void proto (unsigned short val)
 Sets ARP protocol address type.
unsigned char hwlen ()
 Gets ARP hardware address length.
void hwlen (unsigned char val)
 Sets ARP hardware address length.
unsigned char protolen ()
 Gets ARP protocol address length.
void protolen (unsigned char val)
 Sets ARP protocol address length.
unsigned short opcode ()
 Gets ARP opcode.
void opcode (unsigned short val)
 Sets ARP opcode.
WpcMacAddrhwsrc ()
 Gets source hardware address.
void hwsrc (WpcMacAddr &addr)
 Sets source hardware address.
unsigned int protosrc ()
 Gets source protocol address.
void protosrc (unsigned int addr)
 Sets source protocol address.
WpcMacAddrhwdst ()
 Gets destination hardware address.
void hwdst (WpcMacAddr &addr)
 Sets destination hardware address.
unsigned int protodst ()
 Gets destination protocol address.
void protodst (unsigned int addr)
 Sets destination protocol address.

Protected Attributes

WPC_ARP_HDRm_arpHdr
 Maps data to ARP header structure.


Detailed Description

Implements protocol-specific fields for ARP packets.

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

Examples:

wpcPacket.cpp.


Constructor & Destructor Documentation

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

Creates a WpcArpPacket object as a copy from another.

WpcArpPacket::WpcArpPacket ( int  size = sizeof(WPC_ARP_HDR)  ) 

Creates an empty ARP packet.


Member Function Documentation

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

Dumps packet data to string representation.

Reimplemented from WpcPacket.

unsigned char * WpcArpPacket::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 WpcPacket.

void WpcArpPacket::hwdst ( WpcMacAddr addr  ) 

Sets destination hardware address.

WpcMacAddr & WpcArpPacket::hwdst (  ) 

Gets destination hardware address.

void WpcArpPacket::hwlen ( unsigned char  val  ) 

Sets ARP hardware address length.

unsigned char WpcArpPacket::hwlen (  ) 

Gets ARP hardware address length.

void WpcArpPacket::hwsrc ( WpcMacAddr addr  ) 

Sets source hardware address.

WpcMacAddr & WpcArpPacket::hwsrc (  ) 

Gets source hardware address.

void WpcArpPacket::hwtype ( unsigned short  val  ) 

Sets ARP hardware address type.

unsigned short WpcArpPacket::hwtype (  ) 

Gets ARP hardware address type.

void WpcArpPacket::opcode ( unsigned short  val  ) 

Sets ARP opcode.

unsigned short WpcArpPacket::opcode (  ) 

Gets ARP opcode.

int WpcArpPacket::PayloadLength ( void   )  [virtual]

Gets packet payload length.

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

Reimplemented from WpcPacket.

void WpcArpPacket::proto ( unsigned short  val  ) 

Sets ARP protocol address type.

unsigned short WpcArpPacket::proto (  ) 

Gets ARP protocol address type.

void WpcArpPacket::protodst ( unsigned int  addr  ) 

Sets destination protocol address.

unsigned int WpcArpPacket::protodst (  ) 

Gets destination protocol address.

void WpcArpPacket::protolen ( unsigned char  val  ) 

Sets ARP protocol address length.

unsigned char WpcArpPacket::protolen (  ) 

Gets ARP protocol address length.

void WpcArpPacket::protosrc ( unsigned int  addr  ) 

Sets source protocol address.

unsigned int WpcArpPacket::protosrc (  ) 

Gets source protocol address.


Member Data Documentation

Maps data to ARP header structure.



 
©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