{"id":16409797,"url":"https://github.com/hyperized/bpf","last_synced_at":"2025-07-30T14:39:01.016Z","repository":{"id":85138588,"uuid":"213900144","full_name":"hyperized/bpf","owner":"hyperized","description":"Go utility library for bpf devices","archived":false,"fork":false,"pushed_at":"2020-05-18T09:07:14.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-06T00:29:21.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperized.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-09T11:28:38.000Z","updated_at":"2020-05-18T09:07:17.000Z","dependencies_parsed_at":"2023-06-18T10:50:03.393Z","dependency_job_id":null,"html_url":"https://github.com/hyperized/bpf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperized%2Fbpf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperized%2Fbpf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperized%2Fbpf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperized%2Fbpf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperized","download_url":"https://codeload.github.com/hyperized/bpf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240405077,"owners_count":19796122,"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":[],"created_at":"2024-10-11T06:21:31.561Z","updated_at":"2025-02-24T02:23:26.883Z","avatar_url":"https://github.com/hyperized.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bpf/files [![GoDoc](https://godoc.org/github.com/hyperized/bpf/file?status.svg)](https://godoc.org/github.com/hyperized/bpf/file)\n\nUtility library for bpf files.\n\nUseful for BSD: Darwin, Dragonfly, FreeBSD, NetBSD \u0026 OpenBSD\n\n## Files\n\nExample implementation:\n\n```go\npackage main\n\nimport (\n\t\"github.com/hyperized/bpf/file\"\n\t\"log\"\n)\n\nfunc main() {\n\t// Use logging, off by default\n\tbpf, err := file.GetBpfDevice(true)\n\tdefer func() {\n\t\tif err := bpf.Close(); err != nil {\n\t\t\tlog.Printf(err.Error())\n\t\t}\n\t}()\n\n\t// Showing off methods available\n\tif bpf != nil {\n\t\tlog.Println(bpf.File())\n\t\tlog.Println(bpf.Path())\n\t\tlog.Println(bpf.FileDescriptor())\n\t} else {\n\t\tlog.Println(err)\n\t}\n\n\t// Open new bpf device, this will be a new one, since the previous one is already open\n\tbpf2, err := file.GetBpfDevice(true)\n\tdefer func() {\n\t\tif err := bpf2.Close(); err != nil {\n\t\t\tlog.Printf(err.Error())\n\t\t}\n\t}()\n\n\tlog.Println(bpf2.Path())\n}\n\n```\n\nResults in:\n\n```\n2019/10/09 14:35:40 github.com/hyperized/bpf/files: /dev/bpf0 cannot be accessed, skipping\n2019/10/09 14:35:40 github.com/hyperized/bpf/files: /dev/bpf1 cannot be accessed, skipping\n2019/10/09 14:35:40 github.com/hyperized/bpf/files: using /dev/bpf10\n2019/10/09 14:35:40 \u0026{0xc0000221e0}\n2019/10/09 14:35:40 /dev/bpf10\n2019/10/09 14:35:40 3\n2019/10/09 14:35:40 github.com/hyperized/bpf/files: /dev/bpf0 cannot be accessed, skipping\n2019/10/09 14:35:40 github.com/hyperized/bpf/files: /dev/bpf1 cannot be accessed, skipping\n2019/10/09 14:35:40 github.com/hyperized/bpf/files: /dev/bpf10 cannot be accessed, skipping\n2019/10/09 14:35:40 github.com/hyperized/bpf/files: using /dev/bpf100\n2019/10/09 14:35:40 /dev/bpf100\n2019/10/09 14:35:40 github.com/hyperized/bpf/files: closing /dev/bpf100\n2019/10/09 14:35:40 github.com/hyperized/bpf/files: closing /dev/bpf10\n```\n\n## Author\n\nGerben Geijteman \u003cgerben@hyperized.net\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperized%2Fbpf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperized%2Fbpf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperized%2Fbpf/lists"}