2020-06-05 16:14:17 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
|
|
struct IPv6Header {
|
|
|
|
in6_addr source;
|
|
|
|
in6_addr dest;
|
2020-06-16 20:24:59 +02:00
|
|
|
uint16_t payload_length;
|
|
|
|
|
|
|
|
uint16_t packet_length() const { return payload_length + 40; }
|
2020-06-05 16:14:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Parse an IPv6 header, filling `header`. Returns `true` on success. */
|
|
|
|
bool parse_ipv6_header(const char* data, size_t len, IPv6Header& header);
|