File Information
Library: Net
Package: ICMP
Header: Poco/Net/ICMPv4PacketImpl.h
Description
This class implements the ICMPv4 packet. Parts are based on the original ICMP code by Mike Muuss U. S. Army Ballistic Research Laboratory December, 1983
Inheritance
Direct Base Classes: ICMPPacketImpl
All Base Classes: ICMPPacketImpl
Member Summary
Member Functions: errorDescription, packetSize, time, typeDescription, validReplyID
Inherited Functions: checksum, errorDescription, getDataSize, initPacket, maxPacketSize, nextSequence, packet, packetSize, resetSequence, sequence, setDataSize, time, typeDescription, validReplyID
Nested Classes
struct Header
Types
unused))
typedef poco_static_assert_test < sizeof (POCO_STATIC_ASSERTION_FAILURE < (bool)(__builtin_offsetof (Header, code)== 0x01)>)> poco_static_assert_typedef_51 __attribute__ ((unused));
unused))
typedef poco_static_assert_test < sizeof (POCO_STATIC_ASSERTION_FAILURE < (bool)(__builtin_offsetof (Header, checksum)== 0x02)>)> poco_static_assert_typedef_52 __attribute__ ((unused));
unused))
typedef poco_static_assert_test < sizeof (POCO_STATIC_ASSERTION_FAILURE < (bool)(__builtin_offsetof (Header, id)== 0x04)>)> poco_static_assert_typedef_53 __attribute__ ((unused));
unused))
typedef poco_static_assert_test < sizeof (POCO_STATIC_ASSERTION_FAILURE < (bool)(__builtin_offsetof (Header, seq)== 0x06)>)> poco_static_assert_typedef_54 __attribute__ ((unused));
Enumerations
DestinationUnreachableCode
FRAGMENTATION_NEEDED_AND_DF_SET
DESTINATION_UNREACHABLE_UNKNOWN
DESTINATION_UNREACHABLE_LENGTH
MessageType
ParameterProblemCode
RedirectMessageCode
TimeExceededCode
Constructors
ICMPv4PacketImpl
ICMPv4PacketImpl(
int dataSize = 48
);
Constructor. Creates an ICMPv4PacketImpl.
Destructor
~ICMPv4PacketImpl
~ICMPv4PacketImpl();
Destructor.
Member Functions
errorDescription
virtual std::string errorDescription(
Poco::UInt8 * buffer,
int length,
int & type,
int & code
);
Returns error description string. If supplied buffer contains ICMPv4 echo reply packet, an empty string is returned indicating the absence of error. If type and code of the error can be determined, they are assigned to the type and code respectively.
Buffer includes IP header, ICMP header and data.
packetSize
int packetSize() const;
Returns the total length of packet (header + data);
See also: Poco::Net::ICMPPacketImpl::packetSize()
time
struct timeval time(
Poco::UInt8 * buffer = 0,
int length = 0
) const;
Returns current epoch time if either buffer or length are equal to zero. Otherwise, it extracts the time value from the supplied buffer.
Buffer includes IP header, ICMP header and data.
See also: Poco::Net::ICMPPacketImpl::time()
typeDescription
virtual std::string typeDescription(
int typeId
);
Returns the description of the packet type.
validReplyID
bool validReplyID(
Poco::UInt8 * buffer,
int length
) const;
Returns true if the extracted id is recognized (i.e. equals the process id).
Buffer includes IP header, ICMP header and data.
Variables
DESTINATION_UNREACHABLE_TYPE
static const Poco::UInt8 DESTINATION_UNREACHABLE_TYPE;
MAX_PACKET_SIZE
static const Poco::UInt16 MAX_PACKET_SIZE;
MESSAGE_TYPE
static const std::string MESSAGE_TYPE[MESSAGE_TYPE_LENGTH];
PARAMETER_PROBLEM_TYPE
static const Poco::UInt8 PARAMETER_PROBLEM_TYPE;
REDIRECT_MESSAGE_TYPE
static const Poco::UInt8 REDIRECT_MESSAGE_TYPE;
SOURCE_QUENCH_TYPE
static const Poco::UInt8 SOURCE_QUENCH_TYPE;
TIME_EXCEEDED_TYPE
static const Poco::UInt8 TIME_EXCEEDED_TYPE;