42 #ifndef _DWMIPV4ICMPECHOREPLY_HH_ 43 #define _DWMIPV4ICMPECHOREPLY_HH_ 102 std::string
Data()
const;
107 std::string
Data(
const std::string & data);
114 template <
typename T>
119 Reallocate(dataLen + 8);
120 std::ostringstream os;
122 memcpy((
char *)_data.second + 8, os.str().c_str(), dataLen);
134 template <
typename T>
139 std::istringstream is(std::string((
char *)_data.second + 8,
159 #endif // _DWMIPV4ICMPECHOREPLY_HH_ This class abstracts a UNIX socket descriptor.
Definition: DwmSocket.hh:62
Base class for ICMP messages.
Definition: DwmIpv4IcmpMessage.hh:60
uint16_t Identifier() const
Returns the identifier.
This class encapsulates an IPv4 address.
Definition: DwmIpv4Address.hh:62
Encapsulates an IPv4 ICMP echo reply.
Definition: DwmIpv4IcmpEchoReply.hh:62
Ipv4IcmpEchoReply()
Default constructor.
bool SetData(const T &data)
Sets the data to the given data.
Definition: DwmIpv4IcmpEchoReply.hh:115
Dwm::Socket class definition.
static std::ostream & Write(std::ostream &os, char c)
Writes c to os. Returns os.
static std::istream & Read(std::istream &is, char &c)
Reads c from is. Returns is.
Definition: DwmBZ2IO.hh:67
std::string Data() const
Returns the data as a string.
Dwm::IO class definition.
Dwm::Ipv4IcmpMessage class definition.
Dwm::Ipv4Address class definition.
uint16_t SequenceNumber() const
Returns the sequence number.
static uint32_t StreamedLength(char c)
Returns the number of bytes that would be written if we called Write() for a char.
Definition: DwmIO.hh:92
bool GetData(T &data) const
Copies the encapsulated data into data.
Definition: DwmIpv4IcmpEchoReply.hh:135
bool RecvFrom(Socket &s, Ipv4Address &source)
Receives the echo reply from the given Socket s.