What is the best way to send and receive netlink messages from userspace in C++? I don't want to use C. I'm wanting to connect with the inet_diag module.
Asked
Active
Viewed 1,466 times
2
-
What do you mean you don't want to use C? See here http://stackoverflow.com/questions/3299386/how-to-use-netlink-socket-to-communicate-with-a-kernel-module – Guy Sirton Apr 07 '12 at 20:02
1 Answers
1
"There is no best, you pick the one most suitable for the task at hand." Possible ways:
- DIY construction of NL messages
- Aided construction with libmnl
- libnl3, but the API seems more complex than needed

jørgensen
- 10,149
- 2
- 20
- 27
-
Thanks, I went with libmnl, it is great, except for that I have to compile using C++0x, but that's not too much of a problem! – Thoughtful Dragon Apr 09 '12 at 10:28