libbpf-bootstrap icon indicating copy to clipboard operation
libbpf-bootstrap copied to clipboard

Discussion about socket examples

Open JackyYin opened this issue 3 years ago • 2 comments

Greeting,

Thanks for the hard work and great examples.

Since there are more and more SEC types now supported by the kernel: https://github.com/libbpf/libbpf/blob/4eb6485c08867edaa5a0a81c64ddb23580420340/src/libbpf.c#L9002-L9081

I think it would be great if we could cover more SEC types.

I wonder if I can add an example about SEC(socket), which can get an insight about how to retrieve data from __sk_buff, maybe start from most used UDP and TCP on top of IP protocol.

Do you think it's a good idea?

JackyYin avatar May 27 '22 08:05 JackyYin

Sure, sounds like a good idea, if you can keep it simple and not require extra tools (like iproute2) to run it to get some data/output and that won't cause host system misbehaving (e.g., if you start dropping packets). Please give it a try!

anakryiko avatar Jun 01 '22 17:06 anakryiko

Sorry for being late, finally open a PR for porting some simple idea, please see: #97. Thanks you very much!

JackyYin avatar Jul 31 '22 10:07 JackyYin

Addressed by https://github.com/libbpf/libbpf-bootstrap/pull/97

anakryiko avatar Aug 21 '22 04:08 anakryiko