Encapsulates an ICMP source quench message. More...
#include <DwmIpv4IcmpSourceQuench.hh>
Public Member Functions | |
Ipv4IcmpSourceQuench () | |
Constructor. | |
Ipv4IcmpSourceQuench (const Ipv4PacketHeader &ipHeader, const std::string &data) | |
Construct from an IP header and data. | |
Ipv4IcmpSourceQuench (uint8_t *buf, uint16_t len) | |
Construct from a pointer to an ICMP source quence message inside an existing IP packet, and the length of the message. More... | |
Ipv4PacketHeader | IpHeader () const |
Returns a copy of the contained IP header. | |
Ipv4PacketHeader | IpHeader (const Ipv4PacketHeader &ipHeader) |
Sets the contained IP header. | |
std::string | Data () const |
Returns the contained data beyond the contained IP header. | |
![]() | |
Ipv4IcmpMessage () | |
Default constructor. | |
~Ipv4IcmpMessage () | |
Destructor. | |
uint8_t | Type () const |
Returns the ICMP message type. | |
uint8_t | Type (uint8_t type) |
Sets and returns the ICMP message type. | |
uint8_t | Code () const |
Returns the ICMP message code. | |
uint8_t | Code (uint8_t code) |
Sets and returns the ICMP message code. | |
uint16_t | Checksum () |
Returns the ICMP checksum. | |
void | SetChecksum () |
Computes and sets the checksum. | |
std::istream & | Read (std::istream &is, uint16_t len) |
Reads the message of length len from an istream. More... | |
std::ostream & | Write (std::ostream &os) const |
Writes the message to an ostream. Returns the ostream. | |
ssize_t | Read (int fd, uint16_t len) |
Reads the message of length len from a file descriptor. More... | |
ssize_t | Write (int fd) const |
Writes the message to a file descriptor. More... | |
size_t | Read (FILE *f, uint16_t len) |
Reads the message of length len from a FILE. More... | |
size_t | Write (FILE *f) const |
Writes the message to a FILE. Returns 1 on success, 0 on failure. | |
int | Read (gzFile gzf, uint16_t len) |
Reads the message of length len from a gzFile. More... | |
int | Write (gzFile gzf) const |
Writes the message to a gzFile. More... | |
int | BZRead (BZFILE *bzf, uint16_t len) |
Reads the message of length len from a BZFILE. More... | |
int | BZWrite (BZFILE *bzf) const |
Writes the message to a BZFILE. More... | |
uint32_t | StreamedLength () const |
Returns the number of bytes that would be written if we called one of the Write() members. More... | |
bool | operator== (const Ipv4IcmpMessage &msg) const |
operator == | |
![]() | |
virtual | ~Writable () |
Destructor. | |
![]() | |
virtual | ~GZWritable () |
destructor | |
Additional Inherited Members | |
![]() | |
void | Free () |
void | Allocate (uint16_t len) |
void | Reallocate (uint16_t len) |
![]() | |
std::pair< uint16_t, uint8_t * > | _data |
bool | _ownData |
Encapsulates an ICMP source quench message.
See RFC792, RFC1016 and RFC1122.
Dwm::Ipv4IcmpSourceQuench::Ipv4IcmpSourceQuench | ( | uint8_t * | buf, |
uint16_t | len | ||
) |
Construct from a pointer to an ICMP source quence message inside an existing IP packet, and the length of the message.
We don't deep copy, so buf
must be around until the new Ipv4IcmpSourceQuench object is no longer needed.