I am working on a linux based system that has both LAN and WIFI interfaces. But I have to bind my socket with wifi interface only. Is there any general way to find out which interface is wifi, so I can bin my socket with it? If not, is there anyway that I can bind and receive request from both interfaces?
Currently, I am binding using INADDR_ANY. I know how to bind with specific interface like eth0, but I cannot find any way to determine if eth0 is wifi interface; atleast in C. With INADDR_ANY I will receive packets sent to any interface, but my send may try to send it through LAN interface; which is not what I want.
This snippet can help you, it's a more complicated rather I supposed:
Complete file is located here: here