You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
52 lines
1.5 KiB
#ifndef LIBIP_WIRELESS_H
|
|
#define LIBIP_WIRELESS_H
|
|
|
|
#include <QObject>
|
|
#include <QMap>
|
|
#include "libip_global.h"
|
|
|
|
class LIBIP_EXPORT Wireless : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Wireless(QString interface = QString());
|
|
|
|
enum Bands {
|
|
BAND_80211_A = (1 << 0),
|
|
BAND_80211_B = (1 << 1),
|
|
BAND_80211_G = (1 << 2),
|
|
BAND_80211_N = (1 << 3)
|
|
};
|
|
|
|
typedef QFlags<Bands> SupportedBands;
|
|
|
|
const QString& name() const;
|
|
const QMap<int, int>& channelMap() const;
|
|
QList<int> channels() const;
|
|
QList<int> frequencies() const;
|
|
static int ChanToFreq(int in_chan);
|
|
static QString ChanToFreq(QString in_chan, QString outputFormat = QString());
|
|
static int FreqToChan(int in_freq);
|
|
static QString FreqToChan(QString in_freq, QString outputFormat = QString());
|
|
bool isValid() const;
|
|
bool isNL80211() const;
|
|
bool channelSupported(int chan) const;
|
|
bool frequencySupported(int freq) const;
|
|
const SupportedBands supportedBands() const;
|
|
|
|
private:
|
|
QString m_interface;
|
|
QMap<int, int> m_channels;
|
|
bool m_isValid;
|
|
bool m_isNL80211;
|
|
SupportedBands m_supportedBands;
|
|
|
|
static int nl80211_freqlist_cb(struct nl_msg *msg, void *arg);
|
|
static int nl80211_error_cb(struct sockaddr_nl *nla, struct nlmsgerr *err, void *arg);
|
|
static int nl80211_finish_cb(struct nl_msg *msg, void *arg);
|
|
static char* nl80211_find_parent(const char *interface);
|
|
static void nl80211_disconnect(void *handle, struct nl_cache *cache);
|
|
static int nl80211_connect(const char *interface, void **handle, struct nl_cache **cache, void **family);
|
|
};
|
|
|
|
#endif // LIBIP_WIRELESS_H
|
|
|