fujita / libbpf-async

BPF library for Async Rust, complementary for libbpf-rs.
BSD 2-Clause "Simplified" License
18 stars 5 forks source link

Read unfixed length from ringbuf #5

Open Icegrave0391 opened 2 years ago

Icegrave0391 commented 2 years ago

Hi, is it possible to read an unfixed length packet from the ringbuf?

For example, my packet has the format: [ <content: sizeof(size)> ] and its size can not be determined before running. I tried to call rb.read() two times but it seems that those two read() calls will consume two different packets.

fujita commented 2 years ago

rb.read() should read the length of the buffer.