I have a program that has two separate sections: one of them should be executed when the network interface is wireless LAN and the other one when it’s a wired LAN connection. How can I know that inside of my program? What function should I use to get that information?
Share
You can use the iwconfig command from the command line:
If you need to use it from C, as @opaque’s link above explains, get the sources or use strace to see which ioctls() you need to use:
See SIOCGIWNAME usage: