I have an embedded system that can be considered as an access point. There is a program that works in this system and performs some network communication with devices connected to this access point. It sends UDP packets containing some diagnostic information (data structure) and receiving commands. The problem is that sometimes some fields of this outgoing data structure are not filled with data (for example, there are zeros or some kind of garbage). I need these fields to be filled out correctly every time, and I know what values should be placed there.
Another task that I need to perform is to filter out incoming packets arriving in this program (I know which ports it listens to) - usually I just need to transfer them, but sometimes (for example, when I get some information from sensors) completely replace them with the new packages that I would generate.
I have a few ideas that are different from cleverly using iptables and pcap to write my own kernel module. I do not have my own built-in applications, so I can not embed this functionality in my code. Performance is important here, and I would like to hear your suggestions: what should I go for? Writing my own kernel modules seems to be the best solution for me, but I have no experience with network hacking, so maybe there are other ways that are better suited for this problem. Any feedback would be highly appreciated!
source
share