]> git.llucax.com Git - z.facultad/75.74/practicos.git/blobdiff - practicas/pipi/src/ipheader.cpp
Cosas de Distribuidos I.
[z.facultad/75.74/practicos.git] / practicas / pipi / src / ipheader.cpp
index 0fbfca2cefa4d2e07ca9bf2e55ecc22a2fa78766..60b16831c4ff328dc4570bc7cc381399a15a443b 100644 (file)
@@ -12,7 +12,7 @@ IPHeader::IPHeader(uint8_t version, uint16_t total_len, uint16_t id, bool df,
 
 IPHeader::IPHeader(const std::string& s)
 {
 
 IPHeader::IPHeader(const std::string& s)
 {
-    *this = *((IPHeader*)s.c_str());
+    *this = *((IPHeader*)s.data());
 }
 
 size_t IPHeader::header_len()
 }
 
 size_t IPHeader::header_len()
@@ -44,7 +44,7 @@ void IPHeader::do_checksum()
 std::ostream& operator<<(std::ostream& os, const IPHeader& iph)
 {
     return os
 std::ostream& operator<<(std::ostream& os, const IPHeader& iph)
 {
     return os
-        << "version=" << iph.version
+        << "version=" << unsigned(iph.version)
         << " total_len=" << iph.total_len
         << " id=" << iph.id
         << " DF=" << bool(iph.df)
         << " total_len=" << iph.total_len
         << " id=" << iph.id
         << " DF=" << bool(iph.df)