<< " Destination Net Unreachable" << endl;
}
+/**
+ * @brief Read the ICMP packet from the @c istream.
+ *
+ * @param is The input stream.
+ *
+ * @return @c true if the read was successful, or @c false if an error occurred.
+ */
bool Icmpv4Packet::read( istream &is )
{
is.clear();
is >> *this;
- return is.fail();
+ return !is.fail();
}
+/**
+ * @brief Write the ICMP packet to the @c ostream.
+ *
+ * @param os The output stream.
+ *
+ * @return @c true if the write was successful, or @c false if an error occurred.
+ */
bool Icmpv4Packet::write( ostream &os ) const
{
os.clear();
os << *this;
- return os.fail();
+ return !os.fail();
}
istream& operator>>(
<< " Destination Net Unreachable" << endl;
}
+/**
+ * @brief Read the ICMP packet from the @c istream.
+ *
+ * @param is The input stream.
+ *
+ * @return @c true if the read was successful, or @c false if an error occurred.
+ */
bool Icmpv6Packet::read( istream &is )
{
is.clear();
is >> *this;
- return is.fail();
+ return !is.fail();
}
+/**
+ * @brief Write the ICMP packet to the @c ostream.
+ *
+ * @param os The output stream.
+ *
+ * @return @c true if the write was successful, or @c false if an error occurred.
+ */
bool Icmpv6Packet::write( ostream &os ) const
{
os.clear();
os << *this;
- return os.fail();
+ return !os.fail();
}
istream& operator>>(
*
* @param is The input stream.
*
- * @return @c true if the read was successful, or @c false if an error occured.
+ * @return @c true if the read was successful, or @c false if an error occurred.
*/
bool TcpIpv4Segment::read( istream &is )
{
is >> *this;
- return is.fail();
+ return !is.fail();
}
/**
*
* @param os The output stream.
*
- * @return @c true if the write was successful, or @c false if an error occured.
+ * @return @c true if the write was successful, or @c false if an error occurred.
*/
bool TcpIpv4Segment::write( ostream &os ) const
{
os << *this;
- return os.fail();
+ return !os.fail();
}
istream& operator>>(
*
* @param is The input stream.
*
- * @return @c true if the read was successful, or @c false if an error occured.
+ * @return @c true if the read was successful, or @c false if an error occurred.
*/
bool TcpIpv6Segment::read( istream &is )
{
is >> *this;
- return is.fail();
+ return !is.fail();
}
/**
*
* @param os The output stream.
*
- * @return @c true if the write was successful, or @c false if an error occured.
+ * @return @c true if the write was successful, or @c false if an error occurred.
*/
bool TcpIpv6Segment::write( ostream &os ) const
{
os << *this;
- return os.fail();
+ return !os.fail();
}
istream& operator>>(