Struct libbpf_rs::Link [−][src]
pub struct Link { /* fields omitted */ }
Expand description
Represents an attached Program
.
This struct is used to model ownership. The underlying program will be detached when this object is dropped if nothing else is holding a reference count.
Implementations
Replace the underlying prog with prog
.
Release “ownership” of underlying BPF resource (typically, a BPF program attached to some BPF hook, e.g., tracepoint, kprobe, etc). Disconnected links, when destructed through bpf_link__destroy() call won’t attempt to detach/unregisted that BPF resource. This is useful in situations where, say, attached BPF program has to outlive userspace program that attached it in the system. Depending on type of BPF program, though, there might be additional steps (like pinning BPF program in BPF FS) necessary to ensure exit of userspace program doesn’t trigger automatic detachment and clean up inside the kernel.