-
Hi,
Now I'm trying to do the same in Go using cilium/ebpf. Reading the docs I think tha the equivalent portion for LOADING ebpf kernel program is the auto-generated (by "go generate") function:
My understanding is that next step, ATTACHING requires manual writing a snippet like:
is that correct?
what am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You're correct, there currently isn't an API to automatically attach programs. The reason is that not all program types carry all the necessary information in the ELF. For example, we can't know which interface to attach an XDP program to. In your case, would something like the following work?
|
Beta Was this translation helpful? Give feedback.
-
thanks, good to know that!
right - I need to try to get rid of that prefix.
Right... it's not the most elegant way at all... but it's simple and works fine for me Thanks! |
Beta Was this translation helpful? Give feedback.
You're correct, there currently isn't an API to automatically attach programs. The reason is that not all program types carry all the necessary information in the ELF. For example, we can't know which interface to attach an XDP program to.
In your case, would something like the following work?