Encapsulates an ICMP destination unreachable message. More...
#include <DwmIpv4IcmpDestinationUnreachable.hh>


Public Types | |
| enum | CodeEnum { e_networkUnreachable = 0, e_hostUnreachable = 1, e_protocolUnreachable = 2, e_portUnreachable = 3, e_tooBig = 4, e_sourceRouteFailed = 5, e_networkUnknown = 6, e_hostUnknown = 7, e_sourceHostIsolated = 8, e_networkProhibited = 9, e_hostProhibited = 10, e_tosNetworkUnreachable = 11, e_tosHostUnreachable = 12, e_communicatonProhibited = 13, e_hostPrecedenceViolation = 14, e_precedenceCutoffInEffect = 15 } |
| Known destination unreachable codes. | |
Public Member Functions | |
| Ipv4IcmpDestinationUnreachable () | |
| Default constructor. | |
| Ipv4IcmpDestinationUnreachable (uint8_t code, uint16_t nexthopMTU, const Ipv4PacketHeader &ipHeader, const std::string &data) | |
Constrct from the given code, nexthopMTU, ipHeader and data. More... | |
| Ipv4IcmpDestinationUnreachable (uint8_t *buf, uint16_t len) | |
| uint16_t | NexthopMTU () const |
| Returns the next hop MTU. | |
| uint16_t | NexthopMTU (uint16_t nexthopMTU) |
| Sets and returns the next hop MTU. | |
| Ipv4PacketHeader | IpHeader () const |
| Returns a copy of the IPv4 packet header. | |
| Ipv4PacketHeader | IpHeader (const Ipv4PacketHeader &ipHeader) |
| Sets the IPv4 packet header and returns a copy of it. | |
| std::string | Data () const |
| Returns the data as a string. | |
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 destination unreachable message.
| Dwm::Ipv4IcmpDestinationUnreachable::Ipv4IcmpDestinationUnreachable | ( | uint8_t | code, |
| uint16_t | nexthopMTU, | ||
| const Ipv4PacketHeader & | ipHeader, | ||
| const std::string & | data | ||
| ) |
Constrct from the given code, nexthopMTU, ipHeader and data.