{
const char *ifname = luaL_checkstring(L, 1);
+#ifdef USE_MADWIFI
if( madwifi_probe(ifname) )
lua_pushstring(L, "madwifi");
+ else
+#endif
- else if( wl_probe(ifname) )
+#ifdef USE_WL
+ if( wl_probe(ifname) )
lua_pushstring(L, "wl");
+ else
+#endif
- else if( wext_probe(ifname) )
+ if( wext_probe(ifname) )
lua_pushstring(L, "wext");
else
return 1;
}
+#ifdef USE_WL
/* Broadcom */
LUA_WRAP_INT(wl,channel)
LUA_WRAP_INT(wl,frequency)
LUA_WRAP_LIST(wl,txpwrlist)
LUA_WRAP_LIST(wl,scanlist)
LUA_WRAP_LIST(wl,freqlist)
+#endif
+#ifdef USE_MADWIFI
/* Madwifi */
LUA_WRAP_INT(madwifi,channel)
LUA_WRAP_INT(madwifi,frequency)
LUA_WRAP_LIST(madwifi,txpwrlist)
LUA_WRAP_LIST(madwifi,scanlist)
LUA_WRAP_LIST(madwifi,freqlist)
+#endif
/* Wext */
LUA_WRAP_INT(wext,channel)
LUA_WRAP_LIST(wext,scanlist)
LUA_WRAP_LIST(wext,freqlist)
+#ifdef USE_WL
/* Broadcom table */
static const luaL_reg R_wl[] = {
LUA_REG(wl,channel),
LUA_REG(wl,mbssid_support),
{ NULL, NULL }
};
+#endif
+#ifdef USE_MADWIFI
/* Madwifi table */
static const luaL_reg R_madwifi[] = {
LUA_REG(madwifi,channel),
LUA_REG(madwifi,mbssid_support),
{ NULL, NULL }
};
+#endif
/* Wext table */
static const luaL_reg R_wext[] = {
LUALIB_API int luaopen_iwinfo(lua_State *L) {
luaL_register(L, IWINFO_META, R_common);
+#ifdef USE_WL
luaL_newmetatable(L, IWINFO_WL_META);
luaL_register(L, NULL, R_wl);
lua_pushvalue(L, -1);
lua_setfield(L, -2, "__index");
lua_setfield(L, -2, "wl");
+#endif
+#ifdef USE_MADWIFI
luaL_newmetatable(L, IWINFO_MADWIFI_META);
luaL_register(L, NULL, R_madwifi);
lua_pushvalue(L, -1);
lua_setfield(L, -2, "__index");
lua_setfield(L, -2, "madwifi");
+#endif
luaL_newmetatable(L, IWINFO_WEXT_META);
luaL_register(L, NULL, R_wext);