Skip to content

Commit

Permalink
codegen: cgroup_iter_order NFPROTO* nf_inet_hooks
Browse files Browse the repository at this point in the history
Adds the following to codegen:
- `bpf_cgroup_iter_order`: used in `bpf_link_info.iter.group.order`
- `NFPROTO_*`: used in `bpf_link_info.netfilter.pf`
- `nf_inet_hooks`: used in `bpf_link_info.netfilter.hooknum`

Include `linux/netfilter.h` in `linux_wrapper.h` for `NFPROTO_*` and
`nf_inet_hooks` to generate.
  • Loading branch information
tyrone-wu authored and alessandrod committed Oct 11, 2024
1 parent 0e70838 commit 366c599
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions aya-obj/include/linux_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <linux/bpf.h>
#include <linux/btf.h>
#include <linux/if_link.h>
#include <linux/netfilter.h>
#include <linux/perf_event.h>
#include <linux/pkt_cls.h>
#include <linux/pkt_sched.h>
Expand Down
10 changes: 9 additions & 1 deletion xtask/src/codegen/aya.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ fn codegen_bindings(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyh
// NETLINK
"ifinfomsg",
"tcmsg",
// ITER
"bpf_cgroup_iter_order",
// NETFILTER
"nf_inet_hooks",
];

let vars = [
Expand Down Expand Up @@ -161,6 +165,8 @@ fn codegen_bindings(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyh
"TC_H_MIN_EGRESS",
// Ringbuf
"BPF_RINGBUF_.*",
// NETFILTER
"NFPROTO_.*",
];

let dir = PathBuf::from("aya-obj");
Expand Down Expand Up @@ -211,7 +217,9 @@ fn codegen_bindings(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyh
.constified_enum("BTF_VAR_.*")
.constified_enum("IFLA_.*")
.constified_enum("TCA_.*")
.constified_enum("BPF_RINGBUF_.*");
.constified_enum("BPF_RINGBUF_.*")
// NETFILTER
.constified_enum("NFPROTO_.*");
}

for x in &types {
Expand Down

0 comments on commit 366c599

Please sign in to comment.