Commit 7b243afc authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

nsiproxy.sys: Detect wireless interface type on Linux.

parent ad3a0b76
...@@ -7975,6 +7975,12 @@ then : ...@@ -7975,6 +7975,12 @@ then :
printf "%s\n" "#define HAVE_LINUX_UCDROM_H 1" >>confdefs.h printf "%s\n" "#define HAVE_LINUX_UCDROM_H 1" >>confdefs.h
fi fi
ac_fn_c_check_header_compile "$LINENO" "linux/wireless.h" "ac_cv_header_linux_wireless_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_wireless_h" = xyes
then :
printf "%s\n" "#define HAVE_LINUX_WIRELESS_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "lwp.h" "ac_cv_header_lwp_h" "$ac_includes_default" ac_fn_c_check_header_compile "$LINENO" "lwp.h" "ac_cv_header_lwp_h" "$ac_includes_default"
if test "x$ac_cv_header_lwp_h" = xyes if test "x$ac_cv_header_lwp_h" = xyes
then : then :
......
...@@ -423,6 +423,7 @@ AC_CHECK_HEADERS(\ ...@@ -423,6 +423,7 @@ AC_CHECK_HEADERS(\
linux/serial.h \ linux/serial.h \
linux/types.h \ linux/types.h \
linux/ucdrom.h \ linux/ucdrom.h \
linux/wireless.h \
lwp.h \ lwp.h \
mach-o/loader.h \ mach-o/loader.h \
mach/mach.h \ mach/mach.h \
......
...@@ -62,6 +62,10 @@ ...@@ -62,6 +62,10 @@
#include <net/if_types.h> #include <net/if_types.h>
#endif #endif
#ifdef HAVE_LINUX_WIRELESS_H
#include <linux/wireless.h>
#endif
#include <pthread.h> #include <pthread.h>
#define NONAMELESSUNION #define NONAMELESSUNION
...@@ -173,6 +177,21 @@ static NTSTATUS if_get_physical( const char *name, UINT *type, IF_PHYSICAL_ADDRE ...@@ -173,6 +177,21 @@ static NTSTATUS if_get_physical( const char *name, UINT *type, IF_PHYSICAL_ADDRE
if (*type == MIB_IF_TYPE_OTHER && !ioctl( fd, SIOCGIFFLAGS, &ifr ) && ifr.ifr_flags & IFF_POINTOPOINT) if (*type == MIB_IF_TYPE_OTHER && !ioctl( fd, SIOCGIFFLAGS, &ifr ) && ifr.ifr_flags & IFF_POINTOPOINT)
*type = MIB_IF_TYPE_PPP; *type = MIB_IF_TYPE_PPP;
#ifdef HAVE_LINUX_WIRELESS_H
if (*type == MIB_IF_TYPE_ETHERNET)
{
struct iwreq pwrq;
memset( &pwrq, 0, sizeof(pwrq) );
memcpy( pwrq.ifr_name, name, size );
if (ioctl( fd, SIOCGIWNAME, &pwrq ) != -1)
{
TRACE( "iface %s, wireless protocol %s.\n", debugstr_a(name), debugstr_a(pwrq.u.name) );
*type = IF_TYPE_IEEE80211;
}
}
#endif
err: err:
close( fd ); close( fd );
return ret; return ret;
......
...@@ -195,6 +195,9 @@ ...@@ -195,6 +195,9 @@
/* Define to 1 if you have the <linux/videodev2.h> header file. */ /* Define to 1 if you have the <linux/videodev2.h> header file. */
#undef HAVE_LINUX_VIDEODEV2_H #undef HAVE_LINUX_VIDEODEV2_H
/* Define to 1 if you have the <linux/wireless.h> header file. */
#undef HAVE_LINUX_WIRELESS_H
/* Define to 1 if you have the <lwp.h> header file. */ /* Define to 1 if you have the <lwp.h> header file. */
#undef HAVE_LWP_H #undef HAVE_LWP_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment