congestvpn/ip_header.hpp

15 lines
348 B
C++
Raw Permalink Normal View History

2020-06-05 16:14:17 +02:00
#pragma once
#include <netinet/in.h>
struct IPv6Header {
in6_addr source;
in6_addr dest;
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);