13#include <netinet/in.h>
14#include <netinet/ip.h>
16#include <netinet/ip_icmp.h>
17#include <boost/shared_ptr.hpp>
29typedef boost::shared_ptr<struct icmp>
ICMPPtr;
113 check_sum_ = check_sum;
141 sequence_ = sequence;
162 return (destination_);
169 destination_ = destination;
216 std::vector<uint8_t> payload_;
The IOAddress class represents an IP addresses (version agnostic)
Embodies an ICMP message.
const isc::asiolink::IOAddress & getDestination() const
Fetches the destination IP address.
uint16_t getChecksum() const
Fetches the checksum.
void setDestination(const isc::asiolink::IOAddress &destination)
Sets the destination IP address.
ICMPMsgType
ICMP message types.
uint8_t getType() const
Fetches the ICMP message type (e.g.
void setPayload(const uint8_t *data, size_t length)
Sets the message payload to the given data.
uint8_t getCode() const
Fetches the ICMP message code.
const isc::asiolink::IOAddress & getSource() const
Fetches the source IP address.
static ICMPMsgPtr unpack(const uint8_t *wire_data, size_t length)
Unpacks an ICMP message from the given wire_data.
uint16_t getId() const
Fetches the message id.
void setChecksum(uint16_t check_sum)
Sets the check sum.
uint16_t getSequence() const
Fetches the message sequence number.
void setSource(const isc::asiolink::IOAddress &source)
Sets the source IP address.
ICMPPtr pack() const
Packs the message into an ICMP structure.
void setId(const uint16_t id)
Sets the message id.
virtual ~ICMPMsg()=default
Destructor.
void setSequence(uint16_t sequence)
Sets the message sequence number.
void setCode(uint8_t code)
Sets the ICMP code.
static uint32_t calcChecksum(const uint8_t *data, size_t length)
Calculates the checksum of the given data buffer.
static constexpr size_t ICMP_HEADER_SIZE
Size in octets of ICMP message header.
void setType(uint8_t msg_type)
Sets the ICMP message type.
const std::vector< uint8_t > & getPayload() const
Fetches the message payload.
boost::shared_ptr< ICMPMsg > ICMPMsgPtr
Shared pointer type for ICMPMsg.
boost::shared_ptr< struct icmp > ICMPPtr
Shared pointer type for struct icmp.
Defines the logger used by the top-level component of kea-lfc.