|
Sponge
CS144's user-space TCP library
|
Go to the documentation of this file.
14 _payload = p.buffer();
16 if (_payload.size() != _header.payload_length()) {
24 if (_payload.size() != _header.payload_length()) {
25 throw runtime_error(
"IPv4Datagram::serialize: payload is wrong size");
30 const string header_zero_checksum = header_out.
serialize();
34 check.
add(header_zero_checksum);
void add(std::string_view data)
void append(const BufferList &other)
Append a BufferList.
A reference-counted discontiguous string that can discard bytes from the front.
A reference-counted read-only string that can discard bytes from the front.
ParseResult
The result of parsing or unparsing an IP datagram, TCP segment, Ethernet frame, or ARP message.
ParseResult parse(const Buffer buffer)
Parse the segment from a string.
The internet checksum algorithm.
@ PacketTooShort
Not enough data to finish parsing.
BufferList serialize() const
Serialize the segment to a string.