Skip to content

Instantly share code, notes, and snippets.

@garyachy
Last active May 18, 2019 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garyachy/8da478ae35d44c28ac336b75c0ab7b6b to your computer and use it in GitHub Desktop.
Save garyachy/8da478ae35d44c28ac336b75c0ab7b6b to your computer and use it in GitHub Desktop.
eBPF application example
#include <linux/bpf.h>
#ifndef __section
# define __section(NAME) \
__attribute__((section(NAME), used))
#endif
__section("prog")
int xdp_drop(struct xdp_md *ctx)
{
return XDP_DROP;
}
char __license[] __section("license") = "GPL";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment