pub struct Program { /* private fields */ }
Expand description

Represents a loaded Program.

This struct is not safe to clone because the underlying libbpf resource cannot currently be protected from data races.

If you attempt to attach a Program with the wrong attach method, the attach_* method will fail with the appropriate error.

Implementations

Name of the section this Program belongs to.

Returns a file descriptor to the underlying program.

Returns flags that have been set for the program.

Pin this program to bpffs.

Unpin this program from bpffs

Auto-attach based on prog section

Attach this program to a cgroup.

Attach this program to a perf event.

Attach this program to a userspace probe.

Attach this program to a kernel probe.

Attach this program to a kernel tracepoint.

Attach this program to a raw kernel tracepoint.

Attach to an LSM hook

Attach a verdict/parser to a sockmap/sockhash

Attach this program to XDP

Attach this program to netns-based programs

Returns the number of instructions that form the program.

Please see note in OpenProgram::insn_cnt.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.