42 #ifndef _DWMIPV4ICMPMESSAGE_HH_ 43 #define _DWMIPV4ICMPMESSAGE_HH_ 82 uint8_t
Type(uint8_t type);
92 uint8_t
Code(uint8_t code);
108 std::istream &
Read(std::istream & is, uint16_t len);
113 std::ostream &
Write(std::ostream & os)
const;
119 ssize_t
Read(
int fd, uint16_t len);
125 ssize_t
Write(
int fd)
const;
131 size_t Read(FILE *f, uint16_t len);
136 size_t Write(FILE *f)
const;
142 int Read(gzFile gzf, uint16_t len);
148 int Write(gzFile gzf)
const;
154 int BZRead(BZFILE *bzf, uint16_t len);
160 int BZWrite(BZFILE *bzf)
const;
174 std::pair<uint16_t, uint8_t *> _data;
178 void Allocate(uint16_t len);
179 void Reallocate(uint16_t len);
184 #endif // _DWMIPV4ICMPMESSAGE_HH_ This class is a pure virtual class, defining an interface for classes that can write their contents t...
Definition: DwmGZWritable.hh:57
Base class for ICMP messages.
Definition: DwmIpv4IcmpMessage.hh:60
Dwm::Writable pure virtual class definition.
std::istream & Read(std::istream &is, uint16_t len)
Reads the message of length len from an istream.
uint16_t Checksum()
Returns the ICMP checksum.
int BZRead(BZFILE *bzf, uint16_t len)
Reads the message of length len from a BZFILE.
std::ostream & Write(std::ostream &os) const
Writes the message to an ostream. Returns the ostream.
uint32_t StreamedLength() const
Returns the number of bytes that would be written if we called one of the Write() members...
Dwm::BZ2Writable pure virtual class definition.
bool operator==(const Ipv4IcmpMessage &msg) const
operator ==
Definition: DwmBZ2IO.hh:67
int BZWrite(BZFILE *bzf) const
Writes the message to a BZFILE.
~Ipv4IcmpMessage()
Destructor.
Ipv4IcmpMessage()
Default constructor.
void SetChecksum()
Computes and sets the checksum.
This class defines an interface for classes that can write their contents to an ostream, file descriptor or FILE pointer.
Definition: DwmWritable.hh:58
This class is a pure virtual class, defining an interface for classes that can write their contents t...
Definition: DwmBZ2Writable.hh:57
Dwm::GZWritable pure virtual class definition.
uint8_t Type() const
Returns the ICMP message type.
uint8_t Code() const
Returns the ICMP message code.