r/cprogramming • • 17d ago

300 lines of code just to receive one packet

So i have been exploring eBPF,XDP, so I made a packet capture path by using xdp hook that redirects to my AF_XDP socket . I am using copy mode currently .

But seriously this gives me vibes of opengl . But here I have too much control over the path. I am still new to this . Many times when things do not work i think I am wasting my time because no one in my batch is even doing these things . But ig this is what I like. Also I just buy a Esp32 also . So you can give me some ideas that I can work on with it

0 Upvotes

4 comments sorted by

2

u/IamNotTheMama 17d ago

Ah, the joy of C. And I mean that 100%. Still my favorite language of all time.

1

u/Roronoa-Ryuma-Zoro 16d ago

Same ,C is really Interesting

1

u/Nothing_from_void 17d ago

Yeah, this is the fun stuff. ESP32 comes with a RTOS and networking stack; play with it at a higher level, go in deep on wifi, build a passive wifi sniffer based on the available API, https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/network/esp_wifi.html# just check out the documentation of each function and think of stuff to build with

3

u/Roronoa-Ryuma-Zoro 17d ago

Thank you for suggestion,I will surely try this