Skip to content

Commit d1f29be

Browse files
committed
link: explain relationship with bpf_link_type
1 parent 4005fa6 commit d1f29be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ARCHITECTURE.md

+6
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,9 @@ tend to use bpf_link to do so. Older hooks unfortunately use a combination of
7878
syscalls, netlink messages, etc. Adding support for a new link type should not
7979
pull in large dependencies like netlink, so XDP programs or tracepoints are
8080
out of scope.
81+
82+
Each bpf_link_type has one corresponding Go type, e.g. `link.tracing` corresponds
83+
to BPF_LINK_TRACING. In general, these types should be unexported as long as they
84+
don't export methods outside of the Link interface. Each Go type may have multiple
85+
exported constructors. For example `AttachTracing` and `AttachLSM` create a
86+
tracing link, but are distinct functions since they may require different arguments.

0 commit comments

Comments
 (0)