mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2026-04-10 06:11:54 +10:00
networking: add networking library
This commit is contained in:
parent
bcc3d4265e
commit
db37dc580a
34 changed files with 3177 additions and 1 deletions
45
src/network/nm/utils.hpp
Normal file
45
src/network/nm/utils.hpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#pragma once
|
||||
|
||||
#include <qcontainerfwd.h>
|
||||
#include <qdbusservicewatcher.h>
|
||||
#include <qobject.h>
|
||||
#include <qqmlintegration.h>
|
||||
|
||||
#include "../wifi.hpp"
|
||||
#include "dbus_types.hpp"
|
||||
#include "enums.hpp"
|
||||
|
||||
namespace qs::network {
|
||||
|
||||
WifiSecurityType::Enum securityFromConnectionSettings(const ConnectionSettingsMap& settings);
|
||||
|
||||
bool deviceSupportsApCiphers(
|
||||
NMWirelessCapabilities::Enum caps,
|
||||
NM80211ApSecurityFlags::Enum apFlags,
|
||||
WifiSecurityType::Enum type
|
||||
);
|
||||
|
||||
// In sync with NetworkManager/libnm-core/nm-utils.c:nm_utils_security_valid()
|
||||
// Given a set of device capabilities, and a desired security type to check
|
||||
// against, determines whether the combination of device, desired security type,
|
||||
// and AP capabilities intersect.
|
||||
bool securityIsValid(
|
||||
WifiSecurityType::Enum type,
|
||||
NMWirelessCapabilities::Enum caps,
|
||||
bool adhoc,
|
||||
NM80211ApFlags::Enum apFlags,
|
||||
NM80211ApSecurityFlags::Enum apWpa,
|
||||
NM80211ApSecurityFlags::Enum apRsn
|
||||
);
|
||||
|
||||
WifiSecurityType::Enum findBestWirelessSecurity(
|
||||
NMWirelessCapabilities::Enum caps,
|
||||
bool adHoc,
|
||||
NM80211ApFlags::Enum apFlags,
|
||||
NM80211ApSecurityFlags::Enum apWpa,
|
||||
NM80211ApSecurityFlags::Enum apRsn
|
||||
);
|
||||
|
||||
QDateTime clockBootTimeToDateTime(qint64 clockBootTime);
|
||||
|
||||
} // namespace qs::network
|
||||
Loading…
Add table
Add a link
Reference in a new issue