#include <linux/icmpv6.h>
#include <arpa/inet.h>
-#define NULL (void*)0
+#include "siphash.h"
/* IP flags. */
#define IP_CE 0x8000 /* Flag: "Congestion" */
#ifdef RATE_CNT
struct ratelimit {
struct bpf_spin_lock lock;
- union {
- int64_t sent_bytes;
- int64_t sent_packets;
- } rate;
+ int64_t sent_rate;
int64_t sent_time;
};
struct {
// map_check_btf as of Linux 5.10).
// This isn't exactly accurate, but at least its faster.
struct percpu_ratelimit {
- union {
- int64_t sent_bytes;
- int64_t sent_packets;
- } rate;
+ int64_t sent_rate;
int64_t sent_time;
};