{"id":17936938,"url":"https://github.com/gamemann/xdp-playground","last_synced_at":"2025-08-15T16:31:25.889Z","repository":{"id":259787872,"uuid":"879403205","full_name":"gamemann/xdp-playground","owner":"gamemann","description":"Stores XDP programs and loaders I use for testing/helping others with (e)BPF and XDP.","archived":false,"fork":false,"pushed_at":"2024-11-14T22:04:16.000Z","size":14,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T15:24:51.575Z","etag":null,"topics":["basic","bpf","ebpf","go","golang-loader","libbpf","playground","testing","xdp","xdp-loader","xdp-tools"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gamemann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-27T20:06:00.000Z","updated_at":"2025-05-21T07:10:32.000Z","dependencies_parsed_at":"2024-10-28T01:58:26.283Z","dependency_job_id":"ad7f5e23-1365-4d58-b884-8d0c4400f5bd","html_url":"https://github.com/gamemann/xdp-playground","commit_stats":null,"previous_names":["gamemann/xdp-playground"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gamemann/xdp-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2Fxdp-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2Fxdp-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2Fxdp-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2Fxdp-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gamemann","download_url":"https://codeload.github.com/gamemann/xdp-playground/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamemann%2Fxdp-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270599482,"owners_count":24613973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic","bpf","ebpf","go","golang-loader","libbpf","playground","testing","xdp","xdp-loader","xdp-tools"],"created_at":"2024-10-28T22:05:24.139Z","updated_at":"2025-08-15T16:31:25.633Z","avatar_url":"https://github.com/gamemann.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository contains smaller XDP/(e)BPF programs I've made for testing and helping others. With that said, it also utilizes multiple loaders.\n\nThis is a work-in-progress and will work on it over time.\n\n## Prerequisite\n### XDP-Tools\nYou must install [XDP-Tools](https://github.com/xdp-project/xdp-tools). I've added two useful chains in the [`Makefile`](./Makefile) for doing so.\n\n```bash\n# Install required packages via Apt on Debian/Ubuntu.\nsudo apt install -y m4 gcc-multilib lib32z1-dev libelf-dev libpcap-dev\n\n# Build XDP-Tools and LibBPF.\nmake xdp-tools\n\n# Install XDP-Tools and LibBPF (must be executed as root via sudo or as root user).\nsudo make xdp-tools-install\n```\n\n### Make, Clang, Etc.\nYou'll also want to make sure you have `make` and `clang` installed. I typically use the following packages.\n\n```bash\n# Install packages via Debian/Ubuntu.\nsudo apt install -y build-essential clang make\n```\n\n## Building\nYou may build all source files via the `make` command. All XDP/BPF programs are stored in the [`build/xdp`](./build/xdp/) directory after building and loaders are stored in [`build/loader`](./build/loader/).\n\n## Loaders\n### Go\nThis is a loader made in Go that uses [`dropbox/goebpf`](https://github.com/dropbox/goebpf) to load the BPF and XDP programs.\n\n**NOTE** - The section name of the XDP program needs to be `xdp` in order to load.\n\n#### Building\nI recommend using `make` in the root of this repository to build this tool. The executable will be stored in the [`build/loader/`](../../../build/loader/) directory.\n\n#### Command Line Usage\nThe following command line arguments are supported.\n\n| Name | Flags | Default | Description |\n| ---- | ----- | ------- | ----------- |\n| Path | `-p --path` | `\"\"` | The path to the BPF object file (XDP programs in this repository stored in [`build/xdp/`](../../../build/xdp)). |\n| Function | `-f --func` | `\"xdp_prog\"` | The name of the XDP function (is always `xdp_prog` for programs inside of this repository) |\n| Interface | `-i --interface` | `\"\"` | The network interface name to attach the XDP program to. |\n| Help | `-h --help` | N/A | Prints the help menu. |\n\n#### Running\nYou must run this program as root. Here are a couple of examples when executing from the root of this repository.\n\n```bash\n# Load basic pass on enp1s0 interface.\nsudo ./build/loader/loader_go -p ./build/xdp/xdp_basic_pass.o -i enp1s0\n\n# Load basic printk on enp1s0 interface.\nsudo ./build/loader/loader_go -p ./build/xdp/xdp_basic_printk.o -i enp1s0\n```\n\n### Rust\n*To Do...*\n\n## Credits\n* [Christian Deacon](https://github.com/gamemann)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamemann%2Fxdp-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamemann%2Fxdp-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamemann%2Fxdp-playground/lists"}