+#ifdef RATE_CNT
+struct ratelimit {
+ struct bpf_spin_lock lock;
+ union {
+ int64_t sent_bytes;
+ int64_t sent_packets;
+ } rate;
+ int64_t sent_time;
+};
+struct {
+ __uint(type, BPF_MAP_TYPE_ARRAY);
+ __uint(max_entries, RATE_CNT);
+ __u32 *key;
+ struct ratelimit *value;
+} rate_map SEC(".maps");
+#endif
+
+#ifndef HAVE_WRAPPER // Set this to call xdp_drop externally