Encapsulates an ICMP source quench message. More...
#include <DwmIpv4IcmpRedirect.hh>


Public Types | |
| enum | CodeEnum { e_networkRedirect = 0, e_hostRedirect = 1, e_tosNetworkRedirect = 2, e_tosHostRedirect = 3 } |
| Known redirect codes. | |
Public Member Functions | |
| Ipv4IcmpRedirect () | |
| Constructor. | |
| Ipv4IcmpRedirect (uint8_t code, const Ipv4Address &ipAddr, const Ipv4PacketHeader &ipHeader, const std::string &data) | |
| Construct from a redirect IP address, IP header and data. | |
| Ipv4IcmpRedirect (uint8_t *buf, uint16_t len) | |
| Construct from a pointer to an ICMP redirect message inside an existing IP packet, and the length of the message. More... | |
| Ipv4Address | IpAddr () const |
| Returns a copy of the contained redirect IP address. | |
| Ipv4Address | IpAddr (const Ipv4Address &ipAddr) |
| Sets the contained redirect IP address. | |
| 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. | |
Public Member Functions inherited from Dwm::Ipv4IcmpMessage | |
| 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 == | |
Public Member Functions inherited from Dwm::Writable | |
| virtual | ~Writable () |
| Destructor. | |
Public Member Functions inherited from Dwm::GZWritable | |
| virtual | ~GZWritable () |
| destructor | |
Additional Inherited Members | |
Protected Member Functions inherited from Dwm::Ipv4IcmpMessage | |
| void | Free () |
| void | Allocate (uint16_t len) |
| void | Reallocate (uint16_t len) |
Protected Attributes inherited from Dwm::Ipv4IcmpMessage | |
| std::pair< uint16_t, uint8_t * > | _data |
| bool | _ownData |
Encapsulates an ICMP source quench message.
See RFC792, RFC1016 and RFC1122.
| Dwm::Ipv4IcmpRedirect::Ipv4IcmpRedirect | ( | uint8_t * | buf, |
| uint16_t | len | ||
| ) |
Construct from a pointer to an ICMP redirect 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 Ipv4IcmpRedirect object is no longer needed.