#ifdef RATE_CNT
struct ratelimit {
struct bpf_spin_lock lock;
- int64_t sent_bytes;
+ union {
+ int64_t sent_bytes;
+ int64_t sent_packets;
+ } rate;
int64_t sent_time;
};
struct {
} rate_map SEC(".maps");
#endif
+#ifndef HAVE_WRAPPER // Set this to call xdp_drop externally
SEC("xdp_drop")
#endif
+#endif
int xdp_drop_prog(struct xdp_md *ctx)
{
const void *const data_end = (void *)(size_t)ctx->data_end;