Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::Net::ICMPv4PacketImpl Class Reference

#include <ICMPv4PacketImpl.h>

Inheritance diagram for Poco::Net::ICMPv4PacketImpl:

Poco::Net::ICMPPacketImpl

List of all members.


Detailed Description

This class implements the ICMPv4 packet. Parts are based on original ICMP code by Mike Muuss U. S. Army Ballistic Research Laboratory December, 1983

Definition at line 52 of file ICMPv4PacketImpl.h.


Public Types

enum  DestinationUnreachableCode {
  NET_UNREACHABLE, HOST_UNREACHABLE, PROTOCOL_UNREACHABLE, PORT_UNREACHABLE,
  FRAGMENTATION_NEEDED_AND_DF_SET, SOURCE_ROUTE_FAILED, DESTINATION_UNREACHABLE_UNKNOWN, DESTINATION_UNREACHABLE_LENGTH
}
enum  MessageType {
  ECHO_REPLY, ICMP_1, ICMP_2, DESTINATION_UNREACHABLE,
  SOURCE_QUENCH, REDIRECT, ICMP_6, ICMP_7,
  ECHO, ICMP_9, ICMP_10, TIME_EXCEEDED,
  PARAMETER_PROBLEM, TIMESTAMP, TIMESTAMP_REPLY, INFORMATION_REQUEST,
  INFORMATION_REPLY, MESSAGE_TYPE_UNKNOWN, MESSAGE_TYPE_LENGTH
}
enum  ParameterProblemCode { POINTER_INDICATES_THE_ERROR, PARAMETER_PROBLEM_UNKNOWN, PARAMETER_PROBLEM_LENGTH }
enum  RedirectMessageCode {
  REDIRECT_NETWORK, REDIRECT_HOST, REDIRECT_SERVICE_NETWORK, REDIRECT_SERVICE_HOST,
  REDIRECT_MESSAGE_UNKNOWN, REDIRECT_MESSAGE_LENGTH
}
enum  TimeExceededCode { TIME_TO_LIVE, FRAGMENT_REASSEMBLY, TIME_EXCEEDED_UNKNOWN, TIME_EXCEEDED_LENGTH }

Public Member Functions

virtual std::string errorDescription (Poco::UInt8 *buffer, int length)
int getDataSize () const
 Sets data size.
 ICMPv4PacketImpl (int dataSize=48)
virtual int maxPacketSize () const
const Poco::UInt8 * packet (bool init=true)
 Destructor.
int packetSize () const
 Destructor.
Poco::UInt16 sequence () const
 Returns the maximum permitted size of packet in number of octets.
void setDataSize (int dataSize)
 Returns the most recent sequence number generated.
struct timeval time (Poco::UInt8 *buffer=0, int length=0) const
 Returns the total length of packet (header + data);.
virtual std::string typeDescription (int typeId)
virtual bool validReplyID (unsigned char *buffer, int length) const =0
bool validReplyID (Poco::UInt8 *buffer, int length) const
 ~ICMPv4PacketImpl ()
 Constructor. Creates an ICMPv4PacketImpl.

Static Public Attributes

static const Poco::UInt8 DESTINATION_UNREACHABLE_TYPE = 3
static const Poco::UInt16 MAX_PACKET_SIZE
 Returns the description of the packet type.
static const Poco::UInt16 MAX_SEQ_VALUE = 65535
static const std::string MESSAGE_TYPE [MESSAGE_TYPE_LENGTH]
static const Poco::UInt8 PARAMETER_PROBLEM_TYPE = 12
static const Poco::UInt8 REDIRECT_MESSAGE_TYPE = 5
static const Poco::UInt8 SOURCE_QUENCH_TYPE = 4
static const Poco::UInt8 TIME_EXCEEDED_TYPE = 11

Protected Member Functions

Poco::UInt16 checksum (Poco::UInt16 *addr, Poco::Int32 len)
Poco::UInt16 nextSequence ()
void resetSequence ()
 Increments sequence number and returns the new value.

Private Member Functions

Poco::UInt8 * data (Poco::UInt8 *buffer, int length) const
Header * header (Poco::UInt8 *buffer, int length) const
void initPacket ()
 Resets the sequence to zero.

Private Attributes

Poco::UInt16 _seq
 Calculates the checksum for supplied buffer.

Static Private Attributes

static const std::string DESTINATION_UNREACHABLE_CODE [DESTINATION_UNREACHABLE_LENGTH]
static const std::string PARAMETER_PROBLEM_CODE [PARAMETER_PROBLEM_LENGTH]
static const std::string REDIRECT_MESSAGE_CODE [REDIRECT_MESSAGE_LENGTH]
static const std::string TIME_EXCEEDED_CODE [TIME_EXCEEDED_LENGTH]

Classes

struct  Header

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

Generated by  Doxygen 1.6.0   Back to index