I'm writing a small program to allow my Linux illiterate wife to obtain system/network diagnostics for our 'net connection on Linux (Redhat 7). I am wanting to provide such things as IP address (ifconfig eth1 basically).
I am writing this in C as an exercise for myself to learn C a little more in depth than the books I have (they only seem to go into Console and File IO and not networking detail).
I understand that running a system("blah") command is not the right way to do it, and execve doesn't seem to produce the desired results (as it exits after execution instead of returning to my program) so I think I need to grab the IP from the system, by using ioctl() but I've not got any idea how to do this, and don't understand the man page as it seems rather vague.
If you can provide any help towards this I would be very grateful,