Théophile Bastian
0b8cf0edc1
Those packets are probably packets truncated because the buffer is not large enough.
14 lines
348 B
C++
14 lines
348 B
C++
#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; }
|
|
};
|
|
|
|
/** Parse an IPv6 header, filling `header`. Returns `true` on success. */
|
|
bool parse_ipv6_header(const char* data, size_t len, IPv6Header& header);
|