diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-02 20:48:08 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-02 20:48:08 +0000 |
commit | 89d48861e000a60cc6bd411c3a94ee6fdc3896d2 (patch) | |
tree | 71f04fc6e6f0045a4546984eda703f4c9a94ade1 /contrib/package/iwinfo/src/iwinfo_lualib.h | |
parent | 714727c3445dc692b9923bcd3ca5b7565b906912 (diff) |
libiwinfo: major changes
- move own headers to include/iwinfo/ and shipped ones to include/iwinfo/api/
- split into libiwinfo and libiwinfo-lua which contains only the binding
- provide a public api for libiwinfo
- install development headers and shared objects
Diffstat (limited to 'contrib/package/iwinfo/src/iwinfo_lualib.h')
-rw-r--r-- | contrib/package/iwinfo/src/iwinfo_lualib.h | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_lualib.h b/contrib/package/iwinfo/src/iwinfo_lualib.h deleted file mode 100644 index 43b80cc912..0000000000 --- a/contrib/package/iwinfo/src/iwinfo_lualib.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * iwinfo - Wireless Information Library - Lua Headers - * - * Copyright (C) 2009 Jo-Philipp Wich <xm@subsignal.org> - * - * The iwinfo library is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * The iwinfo library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with the iwinfo library. If not, see http://www.gnu.org/licenses/. - */ - -#ifndef __IWINFO_LUALUB_H_ -#define __IWINFO_LUALIB_H_ - -#include <lua.h> -#include <lualib.h> -#include <lauxlib.h> - -#include "iwinfo.h" -#include "iwinfo_wext_scan.h" - - -const char *IWINFO_CIPHER_NAMES[] = { - "NONE", - "WEP40", - "TKIP", - "WRAP", - "CCMP", - "WEP104", - "AES-OCB", - "CKIP", -}; - -const char *IWINFO_KMGMT_NAMES[] = { - "NONE", - "802.1X", - "PSK", -}; - -const char *IWINFO_AUTH_NAMES[] = { - "OPEN", - "SHARED", -}; - - -#define IWINFO_META "iwinfo" -#define IWINFO_WEXT_META "iwinfo.wext" - -#ifdef USE_WL -#define IWINFO_WL_META "iwinfo.wl" -#endif - -#ifdef USE_MADWIFI -#define IWINFO_MADWIFI_META "iwinfo.madwifi" -#endif - -#ifdef USE_NL80211 -#define IWINFO_NL80211_META "iwinfo.nl80211" -#endif - - -#define LUA_REG(type,op) \ - { #op, iwinfo_L_##type##_##op } - -#define LUA_WRAP_INT(type,op) \ - static int iwinfo_L_##type##_##op(lua_State *L) \ - { \ - const char *ifname = luaL_checkstring(L, 1); \ - int rv; \ - if( !type##_get_##op(ifname, &rv) ) \ - lua_pushnumber(L, rv); \ - else \ - lua_pushnil(L); \ - return 1; \ - } - -#define LUA_WRAP_STRING(type,op) \ - static int iwinfo_L_##type##_##op(lua_State *L) \ - { \ - const char *ifname = luaL_checkstring(L, 1); \ - char rv[IWINFO_BUFSIZE]; \ - memset(rv, 0, IWINFO_BUFSIZE); \ - if( !type##_get_##op(ifname, rv) ) \ - lua_pushstring(L, rv); \ - else \ - lua_pushnil(L); \ - return 1; \ - } - -#define LUA_WRAP_LIST(type,op) \ - static int iwinfo_L_##type##_##op(lua_State *L) \ - { \ - return iwinfo_L_##op(L, type##_get_##op); \ - } - -#endif - |