2 * iwinfo - Wireless Information Library - NL80211 Headers
4 * Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
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.
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.
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/.
19 #ifndef __IWINFO_NL80211_H_
20 #define __IWINFO_NL80211_H_
29 #include <netlink/netlink.h>
30 #include <netlink/genl/genl.h>
31 #include <netlink/genl/family.h>
32 #include <netlink/genl/ctrl.h>
35 #include "iwinfo/utils.h"
36 #include "iwinfo/api/nl80211.h"
38 struct nl80211_state
{
39 struct nl_sock
*nl_sock
;
40 struct nl_cache
*nl_cache
;
41 struct genl_family
*nl80211
;
42 struct genl_family
*nlctrl
;
45 struct nl80211_msg_conveyor
{
50 struct nl80211_event_conveyor
{
55 struct nl80211_group_conveyor
{
60 struct nl80211_rssi_rate
{
65 struct nl80211_array_buf
{
70 int nl80211_probe(const char *ifname
);
71 int nl80211_get_mode(const char *ifname
, int *buf
);
72 int nl80211_get_ssid(const char *ifname
, char *buf
);
73 int nl80211_get_bssid(const char *ifname
, char *buf
);
74 int nl80211_get_country(const char *ifname
, char *buf
);
75 int nl80211_get_channel(const char *ifname
, int *buf
);
76 int nl80211_get_frequency(const char *ifname
, int *buf
);
77 int nl80211_get_frequency_offset(const char *ifname
, int *buf
);
78 int nl80211_get_txpower(const char *ifname
, int *buf
);
79 int nl80211_get_txpower_offset(const char *ifname
, int *buf
);
80 int nl80211_get_bitrate(const char *ifname
, int *buf
);
81 int nl80211_get_signal(const char *ifname
, int *buf
);
82 int nl80211_get_noise(const char *ifname
, int *buf
);
83 int nl80211_get_quality(const char *ifname
, int *buf
);
84 int nl80211_get_quality_max(const char *ifname
, int *buf
);
85 int nl80211_get_encryption(const char *ifname
, char *buf
);
86 int nl80211_get_phyname(const char *ifname
, char *buf
);
87 int nl80211_get_assoclist(const char *ifname
, char *buf
, int *len
);
88 int nl80211_get_txpwrlist(const char *ifname
, char *buf
, int *len
);
89 int nl80211_get_scanlist(const char *ifname
, char *buf
, int *len
);
90 int nl80211_get_freqlist(const char *ifname
, char *buf
, int *len
);
91 int nl80211_get_countrylist(const char *ifname
, char *buf
, int *len
);
92 int nl80211_get_hwmodelist(const char *ifname
, int *buf
);
93 int nl80211_get_mbssid_support(const char *ifname
, int *buf
);
94 int nl80211_get_hardware_id(const char *ifname
, char *buf
);
95 int nl80211_get_hardware_name(const char *ifname
, char *buf
);
96 void nl80211_close(void);
98 static const struct iwinfo_ops nl80211_ops
= {
100 .probe
= nl80211_probe
,
101 .channel
= nl80211_get_channel
,
102 .frequency
= nl80211_get_frequency
,
103 .frequency_offset
= nl80211_get_frequency_offset
,
104 .txpower
= nl80211_get_txpower
,
105 .txpower_offset
= nl80211_get_txpower_offset
,
106 .bitrate
= nl80211_get_bitrate
,
107 .signal
= nl80211_get_signal
,
108 .noise
= nl80211_get_noise
,
109 .quality
= nl80211_get_quality
,
110 .quality_max
= nl80211_get_quality_max
,
111 .mbssid_support
= nl80211_get_mbssid_support
,
112 .hwmodelist
= nl80211_get_hwmodelist
,
113 .mode
= nl80211_get_mode
,
114 .ssid
= nl80211_get_ssid
,
115 .bssid
= nl80211_get_bssid
,
116 .country
= nl80211_get_country
,
117 .hardware_id
= nl80211_get_hardware_id
,
118 .hardware_name
= nl80211_get_hardware_name
,
119 .encryption
= nl80211_get_encryption
,
120 .phyname
= nl80211_get_phyname
,
121 .assoclist
= nl80211_get_assoclist
,
122 .txpwrlist
= nl80211_get_txpwrlist
,
123 .scanlist
= nl80211_get_scanlist
,
124 .freqlist
= nl80211_get_freqlist
,
125 .countrylist
= nl80211_get_countrylist
,
126 .close
= nl80211_close