IPHeader::IPHeader(const std::string& s)
{
- *this = *((IPHeader*)s.c_str());
+ *this = *((IPHeader*)s.data());
}
size_t IPHeader::header_len()
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)