Library: Net
Package: ICMP
Header: Poco/Net/ICMPv4PacketImpl.h
This class implements the ICMPv4 packet. Parts are based on original ICMP code by Mike Muuss U. S. Army Ballistic Research Laboratory December, 1983
Direct Base Classes: ICMPPacketImpl
All Base Classes: ICMPPacketImpl
Member Functions: errorDescription, packetSize, time, typeDescription, validReplyID
Inherited Functions: checksum, errorDescription, getDataSize, initPacket, maxPacketSize, nextSequence, packet, packetSize, resetSequence, sequence, setDataSize, time, typeDescription, validReplyID
FRAGMENTATION_NEEDED_AND_DF_SET
DESTINATION_UNREACHABLE_UNKNOWN
DESTINATION_UNREACHABLE_LENGTH
ICMPv4PacketImpl(
int dataSize = 48
);
Constructor. Creates an ICMPv4PacketImpl.
~ICMPv4PacketImpl();
Destructor.
virtual std::string errorDescription(
Poco::UInt8 * buffer,
int length
);
Returns error description string. If supplied buffer contains ICMPv4 echo reply packet, an empty string is returned indicating the absence of error.
Buffer includes IP header, ICMP header and data.
int packetSize() const;
Returns the total length of packet (header + data);
See also: Poco::Net::ICMPPacketImpl::packetSize()
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()
virtual std::string typeDescription(
int typeId
);
Returns the description of the packet type.
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.
static const Poco::UInt8 DESTINATION_UNREACHABLE_TYPE;
static const Poco::UInt16 MAX_PACKET_SIZE;
static const std::string MESSAGE_TYPE[MESSAGE_TYPE_LENGTH];
static const Poco::UInt8 PARAMETER_PROBLEM_TYPE;
static const Poco::UInt8 REDIRECT_MESSAGE_TYPE;
static const Poco::UInt8 SOURCE_QUENCH_TYPE;
static const Poco::UInt8 TIME_EXCEEDED_TYPE;