|
Sponge
CS144's user-space TCP library
|
Go to the documentation of this file.
21 _payload = p.buffer();
26 return payload().str().size() + (header().syn ? 1 : 0) + (header().fin ? 1 : 0);
void add(std::string_view data)
BufferList serialize(const uint32_t datagram_layer_checksum=0) const
Serialize the segment to a string.
void append(const BufferList &other)
Append a BufferList.
A reference-counted discontiguous string that can discard bytes from the front.
@ BadChecksum
Bad checksum.
A reference-counted read-only string that can discard bytes from the front.
ParseResult parse(const Buffer buffer, const uint32_t datagram_layer_checksum=0)
Parse the segment from a string.
ParseResult
The result of parsing or unparsing an IP datagram, TCP segment, Ethernet frame, or ARP message.
The internet checksum algorithm.
size_t length_in_sequence_space() const
Segment's length in sequence space.