From b2b482c7034e5ff2df798920b54b2cb46b70a0a2 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 19 May 2004 15:13:52 +0000 Subject: (isNetDeviceWirelessAware) introduce it in order to detect whether a network interface support wireless extensions or not --- perl-install/c/stuff.xs.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'perl-install') diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index 4573cdc3f..a80588e6c 100644 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -23,6 +23,8 @@ print ' #include #include #include +#undef __USE_MISC +#include #include #include #include @@ -422,6 +424,24 @@ hasNetDevice(device) OUTPUT: RETVAL + +int +isNetDeviceWirelessAware(device) + char * device + CODE: + struct iwreq ifr; + + int s = socket(AF_INET, SOCK_DGRAM, 0); + + memset(&ifr, 0, sizeof(ifr)); + strncpy(ifr.ifr_name, device, sizeof(ifr.ifr_name)-1); + RETVAL = ioctl(s, SIOCGIWNAME, &ifr) != -1; + close(s); + OUTPUT: + RETVAL + + + char* getNetDriver(char* device) ALIAS: -- cgit v1.2.1