source: trunk/package/iwinfo/src/include/iwinfo/nl80211.h @ 29403

Last change on this file since 29403 was 29403, checked in by jow, 5 years ago

[package] add libiwinfo (moved from LuCI trunk)

File size: 3.5 KB
Line 
1/*
2 * iwinfo - Wireless Information Library - NL80211 Headers
3 *
4 *   Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
5 *
6 * The iwinfo library is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * The iwinfo library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with the iwinfo library. If not, see http://www.gnu.org/licenses/.
17 */
18
19#ifndef __IWINFO_NL80211_H_
20#define __IWINFO_NL80211_H_
21
22#include <errno.h>
23#include <fcntl.h>
24#include <unistd.h>
25#include <string.h>
26#include <dirent.h>
27#include <signal.h>
28#include <sys/un.h>
29#include <netlink/netlink.h>
30#include <netlink/genl/genl.h>
31#include <netlink/genl/family.h>
32#include <netlink/genl/ctrl.h>
33
34#include "iwinfo.h"
35#include "iwinfo/utils.h"
36#include "iwinfo/api/nl80211.h"
37
38struct nl80211_state {
39        struct nl_sock *nl_sock;
40        struct nl_cache *nl_cache;
41        struct genl_family *nl80211;
42};
43
44struct nl80211_msg_conveyor {
45        struct nl_msg *msg;
46        struct nl_cb *cb;
47};
48
49struct nl80211_rssi_rate {
50        int16_t rate;
51        int8_t  rssi;
52};
53
54struct nl80211_array_buf {
55        void *buf;
56        int count;
57};
58
59int nl80211_probe(const char *ifname);
60int nl80211_get_mode(const char *ifname, char *buf);
61int nl80211_get_ssid(const char *ifname, char *buf);
62int nl80211_get_bssid(const char *ifname, char *buf);
63int nl80211_get_country(const char *ifname, char *buf);
64int nl80211_get_channel(const char *ifname, int *buf);
65int nl80211_get_frequency(const char *ifname, int *buf);
66int nl80211_get_txpower(const char *ifname, int *buf);
67int nl80211_get_bitrate(const char *ifname, int *buf);
68int nl80211_get_signal(const char *ifname, int *buf);
69int nl80211_get_noise(const char *ifname, int *buf);
70int nl80211_get_quality(const char *ifname, int *buf);
71int nl80211_get_quality_max(const char *ifname, int *buf);
72int nl80211_get_encryption(const char *ifname, char *buf);
73int nl80211_get_assoclist(const char *ifname, char *buf, int *len);
74int nl80211_get_txpwrlist(const char *ifname, char *buf, int *len);
75int nl80211_get_scanlist(const char *ifname, char *buf, int *len);
76int nl80211_get_freqlist(const char *ifname, char *buf, int *len);
77int nl80211_get_countrylist(const char *ifname, char *buf, int *len);
78int nl80211_get_hwmodelist(const char *ifname, int *buf);
79int nl80211_get_mbssid_support(const char *ifname, int *buf);
80void nl80211_close(void);
81
82static const struct iwinfo_ops nl80211_ops = {
83        .channel        = nl80211_get_channel,
84        .frequency      = nl80211_get_frequency,
85        .txpower        = nl80211_get_txpower,
86        .bitrate        = nl80211_get_bitrate,
87        .signal         = nl80211_get_signal,
88        .noise          = nl80211_get_noise,
89        .quality        = nl80211_get_quality,
90        .quality_max    = nl80211_get_quality_max,
91        .mbssid_support = nl80211_get_mbssid_support,
92        .hwmodelist     = nl80211_get_hwmodelist,
93        .mode           = nl80211_get_mode,
94        .ssid           = nl80211_get_ssid,
95        .bssid          = nl80211_get_bssid,
96        .country        = nl80211_get_country,
97        .encryption     = nl80211_get_encryption,
98        .assoclist      = nl80211_get_assoclist,
99        .txpwrlist      = nl80211_get_txpwrlist,
100        .scanlist       = nl80211_get_scanlist,
101        .freqlist       = nl80211_get_freqlist,
102        .countrylist    = nl80211_get_countrylist,
103        .close          = nl80211_close
104};
105
106#endif
Note: See TracBrowser for help on using the repository browser.