{"id":15282524,"url":"https://github.com/libbpf/libbpf-sys","last_synced_at":"2025-05-14T19:02:22.891Z","repository":{"id":38381906,"uuid":"216094551","full_name":"libbpf/libbpf-sys","owner":"libbpf","description":"Rust bindings to libbpf from the Linux kernel","archived":false,"fork":false,"pushed_at":"2025-03-09T14:13:20.000Z","size":235,"stargazers_count":220,"open_issues_count":5,"forks_count":49,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T13:04:10.339Z","etag":null,"topics":["bpf","ebpf","linux","rust","xdp"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/libbpf-sys/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libbpf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-10-18T19:34:24.000Z","updated_at":"2025-04-05T16:27:05.000Z","dependencies_parsed_at":"2023-11-21T04:22:33.325Z","dependency_job_id":"9f3fba2a-da25-43a6-bc0b-ed7af7f69e28","html_url":"https://github.com/libbpf/libbpf-sys","commit_stats":{"total_commits":104,"total_committers":21,"mean_commits":"4.9523809523809526","dds":0.625,"last_synced_commit":"196c3cdbf0f38d04e0640e4e03e8b3d231b74c12"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libbpf%2Flibbpf-sys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libbpf%2Flibbpf-sys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libbpf%2Flibbpf-sys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libbpf%2Flibbpf-sys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libbpf","download_url":"https://codeload.github.com/libbpf/libbpf-sys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741147,"owners_count":21154249,"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","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":["bpf","ebpf","linux","rust","xdp"],"created_at":"2024-09-30T14:26:42.255Z","updated_at":"2025-04-13T15:51:28.211Z","avatar_url":"https://github.com/libbpf.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# libbpf-sys [![Build status](https://github.com/libbpf/libbpf-sys/workflows/CI/badge.svg)](https://github.com/libbpf/libbpf-sys/actions?query=workflow%3A%22CI%22) [![crates.io version number badge](https://img.shields.io/crates/v/libbpf-sys.svg)](https://crates.io/crates/libbpf-sys)\n\n**Rust bindings to _libbpf_ from the Linux kernel**\n\n**Maintainer:** Alex Forster \\\u003calex@alexforster.com\\\u003e\u003cbr/\u003e\n**License:** `BSD-2-Clause`\n\n_libbpf-sys_ is the packaged result of using _bindgen_ to automatically generate Rust FFI bindings to _libbpf_ from the Linux kernel.\n\n**Warning:** this crate does not provide a high-level or \"safe\" API wrapper around _libbpf_. If you are looking for an easier way to use _libbpf_, check out these other crates that implement higher-level APIs using _libbpf-sys_...\n\n * **afxdp:** a Rust interface for AF_XDP – [GitHub](https://github.com/aterlo/afxdp-rs) | [Crates.io](https://crates.io/crates/afxdp)\n * **libbpf-cargo:** Cargo plugin to build bpf programs – [GitHub](https://github.com/libbpf/libbpf-rs) | [Crates.io](https://crates.io/crates/libbpf-cargo)\n * **libbpf-rs:** a safe, idiomatic, and opinionated wrapper around libbpf-sys – [GitHub](https://github.com/libbpf/libbpf-rs) | [Crates.io](https://crates.io/crates/libbpf-rs)\n * **rebpf:** write and load eBPF programs in Rust – [GitHub](https://github.com/uccidibuti/rebpf) | [Crates.io](https://crates.io/crates/rebpf)\n * **xsk-rs:** a Rust interface for Linux AF_XDP sockets – [Github](https://github.com/DouglasGray/xsk-rs) | [Crates.io](https://crates.io/crates/xsk-rs)\n\nThe community is encouraged to build higher-level crates using _libbpf-sys_. Please let me know if you do!\n\n### Building\n\nAs part of the `cargo build` process, an included copy of _libbpf_ is compiled and statically linked into the resulting binary. This means that, in order to build a project that depends on this crate, your system must provide a working C compiler toolchain (GCC and Clang should both work). Additionally, your system must provide development headers for _zlib_ and _libelf_, and they must be discoverable via _pkgconfig_.\n\nBuilding on a fresh Debian/Ubuntu installation:\n\n```sh\n$ apt-get install git rustc cargo build-essential pkgconf zlib1g-dev libelf-dev\n$ git clone --recurse-submodules https://github.com/libbpf/libbpf-sys.git \u0026\u0026 cd libbpf-sys\n$ cargo build\n```\n\nBuilding on a fresh RHEL/Fedora installation:\n\n```sh\n$ yum install git rust cargo gcc make pkgconf zlib-devel elfutils-libelf-devel\n$ git clone --recurse-submodules https://github.com/libbpf/libbpf-sys.git \u0026\u0026 cd libbpf-sys\n$ cargo build\n```\n\n#### Environment Variables\n\n- `LIBBPF_SYS_EXTRA_CFLAGS` can be used to pass extra cflags when vendoring libbpf, libz or libelf.\n- `LIBBPF_SYS_LIBRARY_PATH`: colon separated paths for the linker to find native libs.\n\n### Distribution\n\nWhen you add this crate as a dependency to your project, your resulting binaries will dynamically link with `libz` and `libelf`. This means that the systems where you run your binaries must have these libraries installed.\n\n### Versioning\n\nBecause the API of this crate is automatically generated from _libbpf_ sources, it uses a versioning scheme based on the version of _libbpf_ that it provides.\n\nThe \"Major.Minor\" semver numbers correspond exactly to the _libbpf_ version that each release provides. For example, the `0.6.x` releases of this crate provides the API for the _libbpf v0.6.x_ releases.\n\nIn order to allow for human error, the \"Patch\" semver number is used by this crate and does not necessarily match the provided _libbpf_ version. For example, both the `0.6.1` and `0.6.2` releases of this crate contain bindings to _libbpf v0.6.1_, but the later release contains bugfixes and/or enhancements to the crate itself.\n\nThe exact version of _libbpf_ that is provided by any given release can be found in the \"Build Metadata\" semver section, which comes after the `+` in the version string. For example, `0.6.2+v0.6.1` indicates that the crate version is `0.6.2` and the upstream _libbpf_ version is `v0.6.1`.\n\n### Licensing and Dependencies\n\nThis crate is released under the BSD 2-Clause license, and is careful to avoid infecting users with viral licenses.\n\nIt currently depends on the following third-party libraries:\n\n|            | Website                                                       | License                                  | Linkage |\n|------------|---------------------------------------------------------------|------------------------------------------|---------|\n| **libbpf** | [github.com/libbpf/libbpf](https://github.com/libbpf/libbpf/) | `LGPL-2.1-only OR BSD-2-Clause`          | Static  |\n| **libelf** | [sourceware.org/elfutils](https://sourceware.org/elfutils/)   | `LGPL-2.1-or-later OR LGPL-3.0-or-later` | Dynamic |\n| **zlib**   | [zlib.net](https://www.zlib.net/)                             | `Zlib`                                   | Dynamic |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibbpf%2Flibbpf-sys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibbpf%2Flibbpf-sys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibbpf%2Flibbpf-sys/lists"}