You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aya/aya/src/programs
tyrone-wu 88f5ac3114
aya,obj,int-test: revamp ProgramInfo be more friendly with older kernels
Purpose of this commit is to add detections for whether a field is
available in `ProgramInfo`.
- For `program_type()`, we return the new enum `ProgramType` instead of
  the integer representation.
- For fields that we know cannot be zero, we return `Option<NonZero*>`
  type.
- For `name_as_str()`, it now also uses the feature probe `bpf_name()`
  to detect if field is available or not.
- Two additional feature probes are added for the fields:
  - `prog_info_map_ids()` probe -> `map_ids()` field
  - `prog_info_gpl_compatible()` probe -> `gpl_compatible()` field

With the `prog_info_map_ids()` probe, the previous implementation that
I had for `bpf_prog_get_info_by_fd()` is shortened to use the probe
instead of having to make 2 potential syscalls.

The `test_loaded_at()` test is also moved into info tests since it is
better related to the info tests.

`aya::programs::Programs::prog_type(&self)` now returns `ProgramType`
instead of the generated FFI from aya-obj.

Also previously, `loaded_programs()` could be accessed either through
`aya` or `aya::programs`. To avoid confusion and duplicate export of
the item, the function should now only be exposed through
`aya::programs`.
1 year ago
..
cgroup_device.rs Use MockableFd everywhere 1 year ago
cgroup_skb.rs feat(aya): Rename Bpf to Ebpf 2 years ago
cgroup_sock.rs feat(aya): Rename Bpf to Ebpf 2 years ago
cgroup_sock_addr.rs feat(aya): Rename Bpf to Ebpf 2 years ago
cgroup_sockopt.rs feat(aya): Rename Bpf to Ebpf 2 years ago
cgroup_sysctl.rs feat(aya): Rename Bpf to Ebpf 2 years ago
extension.rs Use MockableFd everywhere 1 year ago
fentry.rs feat(aya): Rename Bpf to Ebpf 2 years ago
fexit.rs feat(aya): Rename Bpf to Ebpf 2 years ago
info.rs aya,obj,int-test: revamp ProgramInfo be more friendly with older kernels 1 year ago
kprobe.rs feat(aya): Rename Bpf to Ebpf 2 years ago
links.rs Use MockableFd everywhere 1 year ago
lirc_mode2.rs Use MockableFd everywhere 1 year ago
lsm.rs feat(aya): Rename Bpf to Ebpf 2 years ago
mod.rs aya,obj,int-test: revamp ProgramInfo be more friendly with older kernels 1 year ago
perf_attach.rs Use MockableFd everywhere 1 year ago
perf_event.rs feat(aya): Rename Bpf to Ebpf 2 years ago
probe.rs Use MockableFd everywhere 1 year ago
raw_trace_point.rs Simplify doctest 1 year ago
sk_lookup.rs feat(aya): Rename Bpf to Ebpf 2 years ago
sk_msg.rs feat(aya): Rename Bpf to Ebpf 2 years ago
sk_skb.rs feat(aya): Rename Bpf to Ebpf 2 years ago
sock_ops.rs feat(aya): Rename Bpf to Ebpf 2 years ago
socket_filter.rs feat(aya): Rename Bpf to Ebpf 2 years ago
tc.rs feat(aya): Rename Bpf to Ebpf 2 years ago
tp_btf.rs feat(aya): Rename Bpf to Ebpf 2 years ago
trace_point.rs Simplify doctest 1 year ago
uprobe.rs aya::programs::uprobe: fix bad variable name 1 year ago
utils.rs integration-test: fix load time and add test 2 years ago
xdp.rs feat(aya): Rename Bpf to Ebpf 2 years ago