# netctlgui: wpasupinteract.h Source File

All Classes Files Functions Variables
wpasupinteract.h
Go to the documentation of this file.
/***************************************************************************
* This file is part of netctl-gui *
* *
* netctl-gui is free software: you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* netctl-gui 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 netctl-gui. If not, see http://www.gnu.org/licenses/ *
***************************************************************************/
#ifndef WPASUPINTERACT_H
#define WPASUPINTERACT_H
#include <QDir>
#include <QMap>
#include <QObject>
class Netctl;
class NetctlProfile;
typedef struct
{
QString name;
QString security;
QString signal;
bool active;
bool exists;
} netctlWifiInfo;
class WpaSup : public QObject
{
Q_OBJECT
public:
explicit WpaSup(const bool debugCmd = false,
const QMap<QString, QString> settings = QMap<QString, QString>());
~WpaSup();
// general information
QString existentProfile(const QString essid);
static QMap<QString, QString> getRecommendedConfiguration();
bool isProfileActive(const QString essid);
bool isProfileExists(const QString essid);
public slots:
// functions
QList<netctlWifiInfo> scanWifi();
bool startWpaSupplicant();
bool stopWpaSupplicant();
private:
Netctl *netctlCommand = nullptr;
NetctlProfile *netctlProfile = nullptr;
bool debug = false;
bool useSuid = true;
QString ctrlDir = QString("/run/wpa_supplicant_netctl-gui");
QString ctrlGroup = QString("users");
QString pidFile = QString("/run/wpa_supplicant_netctl-gui.pid");
QString sudoCommand = QString("/usr/bin/kdesu");
QString wpaCliPath = QString("/usr/bin/wpa_cli");
QString wpaDrivers = QString("nl80211,wext");
QString wpaSupPath = QString("/usr/bin/wpa_supplicant");
// functions
QString getWpaCliOutput(const QString commandLine);
bool waitForProcess(const int sec);
bool wpaCliCall(const QString commandLine);
};
#endif /* WPASUPINTERACT_H */
WpaSup::isProfileExists
bool isProfileExists(const QString essid)
method which checks profile existence by ESSID
netctlWifiInfo::exists
bool exists
Definition: wpasupinteract.h:57
WpaSup::stopWpaSupplicant
bool stopWpaSupplicant()
method which send TERMINATE signal to wpa_supplicant
WpaSup::scanWifi
QList< netctlWifiInfo > scanWifi()
method which scans WiFi networks
WpaSup::WpaSup
WpaSup(const bool debugCmd=false, const QMap< QString, QString > settings=QMap< QString, QString >())
WpaSup class constructor.
netctlWifiInfo::name
QString name
Definition: wpasupinteract.h:53
netctlWifiInfo::security
QString security
Definition: wpasupinteract.h:54
NetctlProfile
The NetctlProfile class interacts with netctl profiles.
Definition: netctlprofile.h:37
WpaSup::isProfileActive
bool isProfileActive(const QString essid)
method which checks profile status by ESSID
Netctl
The Netctl class interacts with netctl.
Definition: netctlinteract.h:59
WpaSup::~WpaSup
~WpaSup()
WpaSup class destructor.
WpaSup::existentProfile
QString existentProfile(const QString essid)
method which gets profile name by ESSID
WpaSup::startWpaSupplicant
bool startWpaSupplicant()
method which calls wpa_supplicant
netctlWifiInfo::signal
QString signal
Definition: wpasupinteract.h:55
WpaSup
The WpaSup class interacts with wpa_supplicant.
Definition: wpasupinteract.h:63
netctlWifiInfo
WiFi information structure.
Definition: wpasupinteract.h:51
netctlWifiInfo::active
bool active
Definition: wpasupinteract.h:56
WpaSup::getRecommendedConfiguration
static QMap< QString, QString > getRecommendedConfiguration()
method which check system configuration and return recommended values to keys