|
Sponge
CS144's user-space TCP library
|
Go to the documentation of this file.
20 cout <<
"\n\n***\n*** Got packet:\n***\n";
25 cout <<
"attempting to parse as ipv4 datagram... ";
31 cout <<
"success! totlen=" << ip_dgram.
header().
len <<
", IPv4 header contents:\n";
35 cout <<
"\nNot TCP, skipping.\n";
39 cout <<
"\nAttempting to parse as a TCP segment... ";
48 cout <<
"success! payload len=" << tcp_seg.
payload().
size() <<
", TCP header contents:\n";
std::string read(const size_t limit=std::numeric_limits< size_t >::max())
Read up to limit bytes.
ParseResult parse(const Buffer buffer, const uint32_t datagram_layer_checksum=0)
Parse the segment from a string.
ParseResult parse(const Buffer buffer)
Parse the segment from a string.
size_t size() const
Size of the string.
const Buffer & payload() const
A FileDescriptor to a Linux TUN device.
void hexdump(const uint8_t *data, const size_t len, const size_t indent)
const IPv4Header & header() const
const TCPHeader & header() const
const BufferList & payload() const