|
Sponge
CS144's user-space TCP library
|
Go to the documentation of this file.
16 for (
auto &
byte : dst) {
21 for (
auto &
byte : src) {
36 for (
auto &
byte : dst) {
41 for (
auto &
byte : src) {
54 for (
auto it = address.
begin(); it != address.
end(); it++) {
57 if (it != address.
end() - 1) {
78 ss <<
"[unknown type " <<
hex << type <<
"!]";
uint16_t u16()
Parse a 16-bit integer in network byte order from the data stream.
static void u8(std::string &s, const uint8_t val)
Write an 8-bit integer into the data stream in network byte order.
static void u16(std::string &s, const uint16_t val)
Write a 16-bit integer into the data stream in network byte order.
ParseResult
The result of parsing or unparsing an IP datagram, TCP segment, Ethernet frame, or ARP message.
uint8_t u8()
Parse an 8-bit integer in network byte order from the data stream.
@ PacketTooShort
Not enough data to finish parsing.
ParseResult get_error() const
Get the current value stored in BaseParser::_error.
size_t size() const
Size of the string.