Packet Class Reference

#include <Packet.h>

Inheritance diagram for Packet:

Inheritance graph
[legend]
Collaboration diagram for Packet:

Collaboration graph
[legend]

List of all members.

Public Types

enum  _PROTOCOL {
  PROTO_NONE, PROTO_DATA_PAYLOAD, PROTO_ETHERNET, PROTO_ARP,
  PROTO_IP, PROTO_IPV6, PROTO_TCP, PROTO_UDP,
  PROTO_ICMP
}
typedef enum Packet::_PROTOCOL PROTOCOL
typedef struct
Packet::_PAYLOAD_BUFFER 
PAYLOAD_BUFFER
typedef struct
Packet::_PAYLOAD_BUFFER
PPAYLOAD_BUFFER

Public Member Functions

 Packet (void)
virtual ~Packet (void)
bool createNextLayer ()
void setSize (unsigned int len)
unsigned int getSize ()
unsigned char * getBuffer ()
virtual bool parsePacket ()=0
virtual void assemblePacket ()=0
virtual string toString ()=0
virtual unsigned int getMinProtocolSize ()=0
PROTOCOL getProtocol ()
PacketgetNextPacket ()
void setNextPacket (Packet *nextpacket)
void setNextProtocol (PROTOCOL proto)
bool getChecksumgood ()
void setChecksumgood (bool good)

Static Public Member Functions

static string getProtocolName (PROTOCOL proto)

Static Protected Member Functions

static unsigned short checksum (unsigned char *databuf, int len)

Protected Attributes

unsigned char * buffer
unsigned int size
unsigned int layersize
PROTOCOL protocol
PROTOCOL nextProtocol
PacketnextPacket
bool checksumgood

Classes

struct  _PAYLOAD_BUFFER


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
PROTO_NONE 
PROTO_DATA_PAYLOAD 
PROTO_ETHERNET 
PROTO_ARP 
PROTO_IP 
PROTO_IPV6 
PROTO_TCP 
PROTO_UDP 
PROTO_ICMP 


Constructor & Destructor Documentation

Packet::Packet ( void   ) 

Packet::~Packet ( void   )  [virtual]


Member Function Documentation

bool Packet::createNextLayer (  ) 

void Packet::setSize ( unsigned int  len  ) 

unsigned int Packet::getSize (  ) 

unsigned char * Packet::getBuffer (  ) 

virtual bool Packet::parsePacket (  )  [pure virtual]

virtual void Packet::assemblePacket (  )  [pure virtual]

virtual string Packet::toString (  )  [pure virtual]

virtual unsigned int Packet::getMinProtocolSize (  )  [pure virtual]

Packet::PROTOCOL Packet::getProtocol (  ) 

Reimplemented in IpPacket.

string Packet::getProtocolName ( PROTOCOL  proto  )  [static]

Packet * Packet::getNextPacket (  ) 

void Packet::setNextPacket ( Packet nextpacket  ) 

void Packet::setNextProtocol ( PROTOCOL  proto  ) 

bool Packet::getChecksumgood (  ) 

void Packet::setChecksumgood ( bool  good  ) 

unsigned short Packet::checksum ( unsigned char *  databuf,
int  len 
) [static, protected]


Member Data Documentation

unsigned char* Packet::buffer [protected]

unsigned int Packet::size [protected]

unsigned int Packet::layersize [protected]

Packet* Packet::nextPacket [protected]

bool Packet::checksumgood [protected]


The documentation for this class was generated from the following files:

Generated on Wed Jun 18 09:40:45 2008 for pktanon by  doxygen 1.5.5