mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
[package] iwinfo: add initial hardware detection capabilities
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29421 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -95,7 +95,26 @@ struct iwinfo_iso3166_label {
|
||||
uint8_t name[28];
|
||||
};
|
||||
|
||||
struct iwinfo_hardware_id {
|
||||
uint16_t vendor_id;
|
||||
uint16_t device_id;
|
||||
uint16_t subsystem_vendor_id;
|
||||
uint16_t subsystem_device_id;
|
||||
};
|
||||
|
||||
struct iwinfo_hardware_entry {
|
||||
const char *vendor_name;
|
||||
const char *device_name;
|
||||
uint16_t vendor_id;
|
||||
uint16_t device_id;
|
||||
uint16_t subsystem_vendor_id;
|
||||
uint16_t subsystem_device_id;
|
||||
int16_t txpower_offset;
|
||||
int16_t frequency_offset;
|
||||
};
|
||||
|
||||
extern const struct iwinfo_iso3166_label IWINFO_ISO3166_NAMES[];
|
||||
extern const struct iwinfo_hardware_entry IWINFO_HARDWARE_ENTRIES[];
|
||||
|
||||
|
||||
struct iwinfo_ops {
|
||||
@@ -113,6 +132,8 @@ struct iwinfo_ops {
|
||||
int (*ssid)(const char *, char *);
|
||||
int (*bssid)(const char *, char *);
|
||||
int (*country)(const char *, char *);
|
||||
int (*hardware_id)(const char *, char *);
|
||||
int (*hardware_name)(const char *, char *);
|
||||
int (*encryption)(const char *, char *);
|
||||
int (*assoclist)(const char *, char *, int *);
|
||||
int (*txpwrlist)(const char *, char *, int *);
|
||||
|
||||
@@ -71,11 +71,10 @@
|
||||
return 1; \
|
||||
}
|
||||
|
||||
#define LUA_WRAP_LIST(type,op) \
|
||||
#define LUA_WRAP_STRUCT(type,op) \
|
||||
static int iwinfo_L_##type##_##op(lua_State *L) \
|
||||
{ \
|
||||
return iwinfo_L_##op(L, type##_get_##op); \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ int madwifi_get_freqlist(const char *ifname, char *buf, int *len);
|
||||
int madwifi_get_countrylist(const char *ifname, char *buf, int *len);
|
||||
int madwifi_get_hwmodelist(const char *ifname, int *buf);
|
||||
int madwifi_get_mbssid_support(const char *ifname, int *buf);
|
||||
int madwifi_get_hardware_id(const char *ifname, char *buf);
|
||||
int madwifi_get_hardware_name(const char *ifname, char *buf);
|
||||
void madwifi_close(void);
|
||||
|
||||
static const struct iwinfo_ops madwifi_ops = {
|
||||
@@ -63,6 +65,8 @@ static const struct iwinfo_ops madwifi_ops = {
|
||||
.ssid = madwifi_get_ssid,
|
||||
.bssid = madwifi_get_bssid,
|
||||
.country = madwifi_get_country,
|
||||
.hardware_id = madwifi_get_hardware_id,
|
||||
.hardware_name = madwifi_get_hardware_name,
|
||||
.encryption = madwifi_get_encryption,
|
||||
.assoclist = madwifi_get_assoclist,
|
||||
.txpwrlist = madwifi_get_txpwrlist,
|
||||
|
||||
@@ -77,6 +77,8 @@ int nl80211_get_freqlist(const char *ifname, char *buf, int *len);
|
||||
int nl80211_get_countrylist(const char *ifname, char *buf, int *len);
|
||||
int nl80211_get_hwmodelist(const char *ifname, int *buf);
|
||||
int nl80211_get_mbssid_support(const char *ifname, int *buf);
|
||||
int nl80211_get_hardware_id(const char *ifname, char *buf);
|
||||
int nl80211_get_hardware_name(const char *ifname, char *buf);
|
||||
void nl80211_close(void);
|
||||
|
||||
static const struct iwinfo_ops nl80211_ops = {
|
||||
@@ -94,6 +96,8 @@ static const struct iwinfo_ops nl80211_ops = {
|
||||
.ssid = nl80211_get_ssid,
|
||||
.bssid = nl80211_get_bssid,
|
||||
.country = nl80211_get_country,
|
||||
.hardware_id = nl80211_get_hardware_id,
|
||||
.hardware_name = nl80211_get_hardware_name,
|
||||
.encryption = nl80211_get_encryption,
|
||||
.assoclist = nl80211_get_assoclist,
|
||||
.txpwrlist = nl80211_get_txpwrlist,
|
||||
|
||||
@@ -37,4 +37,6 @@ int iwinfo_ifmac(const char *ifname);
|
||||
|
||||
void iwinfo_close(void);
|
||||
|
||||
struct iwinfo_hardware_entry * iwinfo_hardware(struct iwinfo_hardware_id *id);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -47,6 +47,8 @@ int wext_get_freqlist(const char *ifname, char *buf, int *len);
|
||||
int wext_get_countrylist(const char *ifname, char *buf, int *len);
|
||||
int wext_get_hwmodelist(const char *ifname, int *buf);
|
||||
int wext_get_mbssid_support(const char *ifname, int *buf);
|
||||
int wext_get_hardware_id(const char *ifname, char *buf);
|
||||
int wext_get_hardware_name(const char *ifname, char *buf);
|
||||
void wext_close(void);
|
||||
|
||||
static const struct iwinfo_ops wext_ops = {
|
||||
@@ -64,6 +66,8 @@ static const struct iwinfo_ops wext_ops = {
|
||||
.ssid = wext_get_ssid,
|
||||
.bssid = wext_get_bssid,
|
||||
.country = wext_get_country,
|
||||
.hardware_id = wext_get_hardware_id,
|
||||
.hardware_name = wext_get_hardware_name,
|
||||
.encryption = wext_get_encryption,
|
||||
.assoclist = wext_get_assoclist,
|
||||
.txpwrlist = wext_get_txpwrlist,
|
||||
|
||||
@@ -47,6 +47,8 @@ int wl_get_freqlist(const char *ifname, char *buf, int *len);
|
||||
int wl_get_countrylist(const char *ifname, char *buf, int *len);
|
||||
int wl_get_hwmodelist(const char *ifname, int *buf);
|
||||
int wl_get_mbssid_support(const char *ifname, int *buf);
|
||||
int wl_get_hardware_id(const char *ifname, char *buf);
|
||||
int wl_get_hardware_name(const char *ifname, char *buf);
|
||||
void wl_close(void);
|
||||
|
||||
static const struct iwinfo_ops wl_ops = {
|
||||
@@ -64,6 +66,8 @@ static const struct iwinfo_ops wl_ops = {
|
||||
.ssid = wl_get_ssid,
|
||||
.bssid = wl_get_bssid,
|
||||
.country = wl_get_country,
|
||||
.hardware_id = wl_get_hardware_id,
|
||||
.hardware_name = wl_get_hardware_name,
|
||||
.encryption = wl_get_encryption,
|
||||
.assoclist = wl_get_assoclist,
|
||||
.txpwrlist = wl_get_txpwrlist,
|
||||
|
||||
Reference in New Issue
Block a user