Skip to content

Libbpf userspace function bpf_program__attach_xdp

0.1.0

Attach a BPF_PROG_TYPE_XDP program to a network interface.

Definition

struct bpf_link * bpf_program__attach_xdp(const struct bpf_program *prog, int ifindex);

Parameters

  • prog: BPF program to attach
  • ifindex: index of the network interface to attach the program to

Return

Reference to the newly created BPF link; or NULL is returned on error, error code is stored in errno

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome