PiPedal 1.2.33 initial commit
This commit is contained in:
@@ -24,7 +24,7 @@ jobs:
|
||||
run: |
|
||||
npm view npm get version of @babel/plugin-proposal-private-property-in-object version command
|
||||
sudo apt-get update
|
||||
sudo apt install gcc-10 g++-10
|
||||
sudo apt install gcc-12 g++-12
|
||||
sudo apt-get install liblilv-dev libboost-dev libjack-jackd2-dev libnl-3-dev libnl-genl-3-dev libsystemd-dev catch
|
||||
sudo apt install libasound2-dev
|
||||
sudo apt install libwebsocketpp-dev authbind
|
||||
|
||||
Vendored
+43
-6
@@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
"name": "(gdb) generic",
|
||||
"type": "cppdbg",
|
||||
@@ -35,6 +36,37 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "(gdb) pipedal_nm_p2pd",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
// Resolved by CMake Tools:
|
||||
"program": "${command:cmake.launchTargetPath}",
|
||||
"args": [
|
||||
"--loglevel",
|
||||
"trace",
|
||||
"--systemd-console"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [
|
||||
{
|
||||
// add the directory where our target was built to the PATHs
|
||||
// it gets resolved by CMake Tools:
|
||||
"name": "PATH",
|
||||
"value": "$PATH:${command:cmake.launchTargetDirectory}"
|
||||
}
|
||||
],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"name": "(gdb) pipedald",
|
||||
@@ -79,7 +111,8 @@
|
||||
//"[Dev]" -- all dev-machine tests.
|
||||
//"[json_variants]" // subtest of your choice, or none to run all of the tests.
|
||||
//"[inverting_mutex_test]"
|
||||
"[utf8_to_utf32]"
|
||||
// "[utf8_to_utf32]"
|
||||
"[wifi_channels_test]"
|
||||
],
|
||||
|
||||
"stopAtEntry": false,
|
||||
@@ -188,9 +221,12 @@
|
||||
///"args": [ "[lv2host_leak]" ],
|
||||
|
||||
"args": [
|
||||
"../../../debian/copyrights-base",
|
||||
"--projectCopyright",
|
||||
"debian/copyright",
|
||||
"--output",
|
||||
"../../../debian/copyrights"
|
||||
"/tmp/copyrights.txt",
|
||||
"liblilv-0-0", "lv2-dev", "libsdbus-c++-dev", "librsvg2-2", "libpango-1.0-0", "libx11-6", "libxrandr2"
|
||||
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
@@ -229,10 +265,11 @@
|
||||
// Resolved by CMake Tools:
|
||||
"program": "${command:cmake.launchTargetPath}",
|
||||
"args": [
|
||||
"--get-current-port"
|
||||
"--nosudo", // run without sudo (which will fail because of perms, but allow us to debug deeper into install code.)
|
||||
//"--get-current-port"
|
||||
// "--uninstall"
|
||||
//"--enable-p2p" , "--nopkexec"
|
||||
//,"CA", "PiPedalTest","12345678","1"
|
||||
//"--enable-p2p" , "CA", "PiPedalTest","12345678","14"
|
||||
"--list-p2p-channels"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}",
|
||||
|
||||
Vendored
+5
-1
@@ -92,7 +92,11 @@
|
||||
"util": "cpp",
|
||||
"charconv": "cpp",
|
||||
"valarray": "cpp",
|
||||
"hash_map": "cpp"
|
||||
"hash_map": "cpp",
|
||||
"nm-device-wifi-p2p.h": "c",
|
||||
"strstream": "cpp",
|
||||
"p2p_i.h": "c",
|
||||
"p2p.h": "c"
|
||||
},
|
||||
"cSpell.words": [
|
||||
"Guitarix",
|
||||
|
||||
+20
-12
@@ -1,10 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
project(pipedal
|
||||
VERSION 1.1.31
|
||||
VERSION 1.2.33
|
||||
DESCRIPTION "PiPedal Guitar Effect Pedal For Raspberry Pi"
|
||||
HOMEPAGE_URL "https://rerdavies.github.io/pipedal"
|
||||
)
|
||||
set (DISPLAY_VERSION "v1.1.31")
|
||||
set (DISPLAY_VERSION "v1.2.31beta1")
|
||||
|
||||
set (CMAKE_INSTALL_PREFIX "/usr/")
|
||||
|
||||
@@ -16,13 +16,21 @@ enable_testing()
|
||||
|
||||
add_subdirectory("submodules/pipedal_p2pd")
|
||||
|
||||
add_subdirectory("PiPedalCommon")
|
||||
|
||||
add_subdirectory("react")
|
||||
|
||||
add_subdirectory("src")
|
||||
|
||||
install (TARGETS pipedal_p2pd DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
|
||||
add_subdirectory("NetworkManagerP2P")
|
||||
|
||||
|
||||
install (TARGETS pipedal_p2pd DESTINATION ${CMAKE_INSTALL_PREFIX}/sbin
|
||||
)
|
||||
|
||||
install (TARGETS pipedal_nm_p2pd DESTINATION ${CMAKE_INSTALL_PREFIX}/sbin
|
||||
)
|
||||
|
||||
# select LV2 source directory for the current build architecture
|
||||
|
||||
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
@@ -67,27 +75,27 @@ install (DIRECTORY ${LV2_SOURCE_DIRECTORY}
|
||||
install(CODE
|
||||
[[
|
||||
file(GET_RUNTIME_DEPENDENCIES
|
||||
EXECUTABLES ${CMAKE_INSTALL_PREFIX}/bin/pipedald ${CMAKE_INSTALL_PREFIX}/bin/pipedalconfig
|
||||
EXECUTABLES
|
||||
${CMAKE_INSTALL_PREFIX}/sbin/pipedaladmind
|
||||
${CMAKE_INSTALL_PREFIX}/sbin/pipedald
|
||||
${CMAKE_INSTALL_PREFIX}/sbin/pipedal_nm_p2pd
|
||||
${CMAKE_INSTALL_PREFIX}/sbin/pipedal_p2pd
|
||||
${CMAKE_INSTALL_PREFIX}/bin/pipedalconfig
|
||||
)
|
||||
]]
|
||||
)
|
||||
|
||||
# Should be done by install.sh instead of here so that we can build the package without root permissions.
|
||||
# install(
|
||||
# CODE "execute_process(COMMAND ${CMAKE_INSTALL_PREFIX}/bin/pipedalconfig --install)"
|
||||
# )
|
||||
|
||||
|
||||
set(CPACK_GENERATOR "DEB")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Robin Davies<rerdavies@gmail.com>") # required
|
||||
set(CPACK_PACKAGE_VENDOR "Robin Davies")
|
||||
set(CPACK_PACKAGE_DESCRIPTION "IoT guitar effect pedal for Raspberry Pi, with phone-friendly web interface.")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IoT guitar effect for Raspberry Pi")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IoT guitar effect pedal for Raspberry Pi")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION sound)
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
|
||||
#set(CPACK_DEBIAN_PACKAGE_DEPENDS "jackd2, hostapd, dnsmasq" )
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "lv2-dev, hostapd, dnsmasq, authbind" )
|
||||
#set(CPACK_DEBIAN_PACKAGE_DEPENDS "jackd2, hostapd, dhcpcd, dnsmasq" )
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "lv2-dev, hostapd, dhcpcd,dnsmasq, authbind" )
|
||||
#set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX /usr)
|
||||
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory("src")
|
||||
@@ -0,0 +1,25 @@
|
||||
The pipedal_nm_p2pd service manages PiPedal P2P connections on Debian bookworm or later distros.
|
||||
|
||||
Debian Bookworm switchs the entire network stack from the deprecated dhcpcd/NetworkManager
|
||||
stack to the current NetworkManager stack. Unfortunately, NetworkManager does not
|
||||
provide support for P2P Wi-fi direct.
|
||||
|
||||
NetworkManager P2P support is abysmal, providing no support whatsoever
|
||||
for P2P GOs. Furthermore, a bug in NetworkManager prevents anyone else from providing a P2P GO
|
||||
solution through wpas_supplicant. Specifically, NetworkManager call RemoveInterface on any P2P
|
||||
group that it didn't start itself, even if p2p-dev-wlan-0 is marked as unmanaged.
|
||||
|
||||
The solution: Configure NetworkManager to mark wlan0 as an unmanaged interface. This allows
|
||||
the pipedal_nm_p2pd service to manage p2p sessions via wpa_supplicant without interference from
|
||||
NetworkManager. Unfortunately, that means that PiPedal can't run wi-fi connections anymore when
|
||||
running Wifi p2p connections. If the NetworkManager project provides sensible support
|
||||
for p2p in future, we will look at it again.
|
||||
|
||||
This project uses DBus interfaces, which is a significant improvement on the use of
|
||||
wpa_cli sockets in the old pipedal_p2pd module.
|
||||
|
||||
Dependent packages:
|
||||
|
||||
|
||||
sudo apt install libsdbus-c++-dev
|
||||
sudo apt install libsdbus-c++-bin
|
||||
@@ -0,0 +1,57 @@
|
||||
cmake_minimum_required(VERSION 3.19.0)
|
||||
|
||||
|
||||
# specify the C++ standard
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)# apt get lbsdbus-c++-dev
|
||||
|
||||
find_package(sdbus-c++ REQUIRED)
|
||||
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_check_modules(SYSTEMD "systemd")
|
||||
if(!SYSTEMD_FOUND)
|
||||
message(ERROR "libsystemd-dev package not installed.")
|
||||
else()
|
||||
message(STATUS "SYSTEMD_LIBRARIES: ${SYSTEMD_LIBRARIES}")
|
||||
message(STATUS "SYSTEMD_INCLUDE_DIRS: ${SYSTEMD_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
|
||||
if (CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
message(STATUS "Debug build")
|
||||
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG" )
|
||||
endif()
|
||||
|
||||
|
||||
message(STATUS "NMPIPEDAL CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
|
||||
# Use the sdbus-c++ target in SDBusCpp namespace
|
||||
add_executable(pipedal_nm_p2pd
|
||||
Install.cpp Install.hpp
|
||||
NMP2pSettings.cpp NMP2pSettings.hpp
|
||||
SignalHandler.cpp SignalHandler.hpp
|
||||
WpaInterfaces.hpp WpaInterfaces.cpp
|
||||
NetworkManagerInterfaces.hpp NetworkManagerInterfaces.cpp
|
||||
NMManager.hpp
|
||||
NMManager.cpp
|
||||
P2PManager.hpp P2PManager.cpp
|
||||
DBusEvent.hpp DBusEvent.cpp
|
||||
DBusDispatcher.hpp DBusDispatcher.cpp
|
||||
DBusLog.hpp DBusLog.cpp
|
||||
DBusVariantHelper.hpp DBusVariantHelper.cpp
|
||||
ss.hpp
|
||||
dbus/hpp/org.freedesktop.NetworkManager.hpp
|
||||
main.cpp
|
||||
CommandLineParser.hpp
|
||||
Sudo.hpp Sudo.cpp
|
||||
)
|
||||
target_link_libraries(pipedal_nm_p2pd PRIVATE PiPedalCommon SDBusCpp::sdbus-c++ systemd )
|
||||
|
||||
target_compile_definitions(pipedal_nm_p2pd PRIVATE USE_NETWORK_MANAGER)
|
||||
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
// Copyright (c) 2022 Robin Davies
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
// this software and associated documentation files (the "Software"), to deal in
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
// the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
|
||||
class CommandLineException : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
using base = std::runtime_error;
|
||||
CommandLineException(const std::string &error)
|
||||
: base(error)
|
||||
{
|
||||
}
|
||||
};
|
||||
class CommandLineParser
|
||||
{
|
||||
private:
|
||||
class OptionBase
|
||||
{
|
||||
std::string option;
|
||||
|
||||
public:
|
||||
OptionBase(const std::string &option_)
|
||||
: option(option_)
|
||||
{
|
||||
}
|
||||
virtual ~OptionBase()
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
const std::string &GetName() const { return option; }
|
||||
|
||||
public:
|
||||
bool Matches(const std::string &text) const
|
||||
{
|
||||
return option == text;
|
||||
}
|
||||
virtual int Execute(int argcRemaining, const char **argvRemaining) = 0;
|
||||
};
|
||||
std::vector<OptionBase *> options;
|
||||
|
||||
class BooleanOption : public OptionBase
|
||||
{
|
||||
|
||||
bool *pOutput;
|
||||
bool value;
|
||||
|
||||
public:
|
||||
BooleanOption(const std::string &name, bool *pOutput, bool value)
|
||||
: OptionBase(name),
|
||||
pOutput(pOutput),
|
||||
value(value)
|
||||
{
|
||||
}
|
||||
virtual int Execute(int argcRemaining, const char **argvRemaining)
|
||||
{
|
||||
*pOutput = value;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class Option : public OptionBase
|
||||
{
|
||||
|
||||
T *pOutput;
|
||||
|
||||
public:
|
||||
Option(const std::string &name, T *pOutput)
|
||||
: OptionBase(name),
|
||||
pOutput(pOutput)
|
||||
{
|
||||
}
|
||||
virtual int Execute(int argcRemaining, const char **argvRemaining)
|
||||
{
|
||||
if (argcRemaining == 0)
|
||||
{
|
||||
throw CommandLineException("Expecting a parameter for option " + GetName());
|
||||
}
|
||||
std::stringstream s(argvRemaining[0]);
|
||||
try
|
||||
{
|
||||
s >> *pOutput;
|
||||
if (s.fail() || !s.eof())
|
||||
{
|
||||
throw std::exception();
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
throw CommandLineException("Argument for option " + GetName() + " is not in the correct format.");
|
||||
}
|
||||
return 1; // consumed one argument.
|
||||
}
|
||||
};
|
||||
|
||||
class StringOption : public OptionBase
|
||||
{
|
||||
|
||||
std::string name;
|
||||
std::string *pOutput;
|
||||
|
||||
public:
|
||||
StringOption(const std::string &name, std::string *pOutput)
|
||||
: OptionBase(name),
|
||||
pOutput(pOutput)
|
||||
{
|
||||
}
|
||||
virtual int Execute(int argcRemaining, const char **argvRemaining)
|
||||
{
|
||||
if (argcRemaining == 0 || argvRemaining[0][0] == '-')
|
||||
{
|
||||
throw CommandLineException("Expecting a parameter for option " + GetName());
|
||||
}
|
||||
*pOutput = argvRemaining[0];
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
int ProcessOption(const std::string &text, int argsRemaining, char *argv[])
|
||||
{
|
||||
for (auto option : options)
|
||||
{
|
||||
if (option->Matches(text))
|
||||
{
|
||||
return option->Execute(argsRemaining, (const char**)argv);
|
||||
}
|
||||
}
|
||||
std::stringstream s;
|
||||
s << "Invalid option: " << text;
|
||||
throw CommandLineException(s.str());
|
||||
}
|
||||
|
||||
std::vector<std::string> args;
|
||||
|
||||
public:
|
||||
~CommandLineParser()
|
||||
{
|
||||
for (auto item : options)
|
||||
{
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
|
||||
void AddOption(const std::string &shortOption, const std::string &longOption, bool *pResult)
|
||||
{
|
||||
if (shortOption.length() != 0)
|
||||
{
|
||||
auto option = "-" + longOption;
|
||||
options.push_back(new BooleanOption(option, pResult, true));
|
||||
options.push_back(new BooleanOption(option + "+", pResult, true));
|
||||
options.push_back(new BooleanOption(option + "-", pResult, false));
|
||||
}
|
||||
if (longOption.length() != 0)
|
||||
{
|
||||
auto option = "--" + longOption;
|
||||
options.push_back(new BooleanOption(option, pResult, true));
|
||||
options.push_back(new BooleanOption(option + "+", pResult, true));
|
||||
options.push_back(new BooleanOption(option + "-", pResult, false));
|
||||
}
|
||||
}
|
||||
|
||||
void AddOption(const std::string &option, bool *pResult)
|
||||
{
|
||||
options.push_back(new BooleanOption(option, pResult, true));
|
||||
options.push_back(new BooleanOption(option + "+", pResult, true));
|
||||
options.push_back(new BooleanOption(option + "-", pResult, false));
|
||||
}
|
||||
|
||||
void AddOption(const std::string &shortOption, const std::string &longOption, std::string *pResult)
|
||||
{
|
||||
options.push_back(new StringOption("-" + shortOption, pResult));
|
||||
options.push_back(new StringOption("--" + longOption, pResult));
|
||||
}
|
||||
|
||||
void AddOption(const std::string &option, std::string *pResult)
|
||||
{
|
||||
options.push_back(new StringOption(option, pResult));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void AddOption(const std::string &shortOption, const std::string &longOption, T *pResult)
|
||||
{
|
||||
if (shortOption.length() != 0)
|
||||
options.push_back(new Option<T>("-" + shortOption, pResult));
|
||||
if (longOption.length() != 0)
|
||||
options.push_back(new Option<T>("--" + longOption, pResult));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void AddOption(const std::string &option, T *pResult)
|
||||
{
|
||||
options.push_back(new Option<T>(option, pResult));
|
||||
}
|
||||
bool Parse(int argc, char **argv)
|
||||
{
|
||||
for (int i = 1; i < argc; ++i)
|
||||
{
|
||||
const char *arg = argv[i];
|
||||
if (arg[0] == '-')
|
||||
{
|
||||
int argsConsumed = ProcessOption(arg, argc - i - 1, argv + i + 1);
|
||||
i += argsConsumed;
|
||||
}
|
||||
else
|
||||
{
|
||||
args.push_back(std::string(arg));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const std::vector<std::string> &Arguments() { return args; }
|
||||
};
|
||||
@@ -0,0 +1,273 @@
|
||||
#include "DBusDispatcher.hpp"
|
||||
#include "DBusLog.hpp"
|
||||
#include <sdbus-c++/IConnection.h>
|
||||
#include <poll.h>
|
||||
#include <sys/eventfd.h>
|
||||
#include "ss.hpp"
|
||||
#include <chrono>
|
||||
#include <cassert>
|
||||
|
||||
DBusDispatcher::DBusDispatcher(bool systemBus)
|
||||
{
|
||||
// SignalStop requires this to be true.
|
||||
|
||||
if (systemBus)
|
||||
{
|
||||
busConnection = sdbus::createSystemBusConnection();
|
||||
}
|
||||
else
|
||||
{
|
||||
busConnection = sdbus::createSessionBusConnection();
|
||||
}
|
||||
}
|
||||
DBusDispatcher::~DBusDispatcher()
|
||||
{
|
||||
Stop();
|
||||
busConnection = nullptr;
|
||||
}
|
||||
|
||||
DBusDispatcher::PostHandle DBusDispatcher::Post(DBusDispatcher::PostCallback &&fn)
|
||||
{
|
||||
auto nextHandle = NextHandle();
|
||||
{
|
||||
std::lock_guard lock{postMutex};
|
||||
this->postedEvents.push_back(CallbackEntry{std::move(fn), clock::time_point::min(), nextHandle});
|
||||
}
|
||||
WakeThread();
|
||||
return nextHandle;
|
||||
}
|
||||
|
||||
bool DBusDispatcher::CancelPost(DBusDispatcher::PostHandle handle)
|
||||
{
|
||||
{
|
||||
std::lock_guard lock{postMutex};
|
||||
for (auto i = postedEvents.begin(); i != postedEvents.end(); ++i)
|
||||
{
|
||||
if (i->handle == handle)
|
||||
{
|
||||
postedEvents.erase(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DBusDispatcher::PostHandle DBusDispatcher::PostDelayed(const clock::duration &delay, PostCallback &&fn)
|
||||
{
|
||||
PostHandle nextHandle = NextHandle();
|
||||
{
|
||||
std::lock_guard lock{postMutex};
|
||||
|
||||
this->postedEvents.emplace_back(
|
||||
CallbackEntry{
|
||||
std::move(fn),
|
||||
clock::now() + delay,
|
||||
nextHandle});
|
||||
}
|
||||
WakeThread();
|
||||
return nextHandle;
|
||||
}
|
||||
|
||||
void DBusDispatcher::Run()
|
||||
{
|
||||
this->eventFd = eventfd(0, 0);
|
||||
this->serviceThread = std::thread(
|
||||
[this]()
|
||||
{ this->ThreadProc(); });
|
||||
}
|
||||
|
||||
void DBusDispatcher::WakeThread()
|
||||
{
|
||||
uint64_t val = 1;
|
||||
if (eventFd != -1)
|
||||
{
|
||||
write(eventFd, &val, sizeof(val));
|
||||
}
|
||||
}
|
||||
void DBusDispatcher::ThreadProc()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
while (true)
|
||||
{
|
||||
bool idle;
|
||||
bool quitting;
|
||||
while (true)
|
||||
{
|
||||
idle = true;
|
||||
quitting = false;
|
||||
|
||||
while (busConnection->processPendingRequest())
|
||||
{
|
||||
idle = false;
|
||||
}
|
||||
{
|
||||
// process one event.
|
||||
PostCallback callback;
|
||||
auto now = clock::now();
|
||||
{
|
||||
std::lock_guard lock{postMutex};
|
||||
for (auto iter = postedEvents.begin(); iter != postedEvents.end(); ++iter)
|
||||
{
|
||||
if (now >= iter->time)
|
||||
{
|
||||
callback = std::move(iter->callback);
|
||||
postedEvents.erase(iter);
|
||||
idle = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
quitting = this->stopping; // transfer with the mutex held.
|
||||
}
|
||||
if (callback)
|
||||
{
|
||||
callback();
|
||||
}
|
||||
}
|
||||
if (idle)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (idle && signalStopRequested)
|
||||
{
|
||||
signalStopRequested = false;
|
||||
if (!signalStopExecuted) // only ever do this once.
|
||||
{
|
||||
signalStopExecuted = true;
|
||||
std::atomic_thread_fence(std::memory_order::acquire);
|
||||
signalStopCallback();
|
||||
signalStopCallback = std::function<void(void)>();
|
||||
this->stopping = true;
|
||||
idle = false;
|
||||
}
|
||||
}
|
||||
if (idle)
|
||||
{
|
||||
if (quitting)
|
||||
{
|
||||
if (postedEvents.size() == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
sdbus::IConnection::PollData pollData = busConnection->getEventLoopPollData();
|
||||
|
||||
struct pollfd pollFds[2];
|
||||
|
||||
pollFds[0].fd = pollData.fd;
|
||||
pollFds[0].events = pollData.events;
|
||||
pollFds[0].revents = 0;
|
||||
pollFds[1].fd = this->eventFd;
|
||||
pollFds[1].events = POLLIN;
|
||||
pollFds[1].revents = 0;
|
||||
int pollTimeout = pollData.getPollTimeout();
|
||||
int eventTimeout = GetEventTimeoutMs();
|
||||
if (eventTimeout != -1 && eventTimeout < pollTimeout)
|
||||
{
|
||||
pollTimeout = eventTimeout;/*+-*/
|
||||
}
|
||||
if (pollTimeout > 250 || pollTimeout == -1)
|
||||
{
|
||||
pollTimeout = 250; // poll for quit every 250 ms.
|
||||
}
|
||||
if (pollTimeout != 0)
|
||||
{
|
||||
poll(pollFds, 2, pollTimeout);
|
||||
|
||||
if (pollFds[1].revents & POLLIN) // received a wakup event?
|
||||
{
|
||||
uint64_t counter;
|
||||
read(pollFds[1].fd, &counter, sizeof(counter)); // reset the wakeup event.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
std::string msg = SS("Abnormal termination. " << e.what());
|
||||
LogError("DBusDispatcher", "ThreadProc", msg);
|
||||
}
|
||||
isFinished = true;
|
||||
LogTrace("DBusDispatcher", "ThreadProc", "Service thread terminated.");
|
||||
}
|
||||
|
||||
void DBusDispatcher::Wait()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!threadJoined)
|
||||
{
|
||||
threadJoined = true;
|
||||
serviceThread.join();
|
||||
}
|
||||
}
|
||||
catch (const std::exception &)
|
||||
{
|
||||
}
|
||||
if (eventFd != -1)
|
||||
{
|
||||
close(eventFd);
|
||||
eventFd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
bool DBusDispatcher::IsFinished()
|
||||
{
|
||||
return isFinished;
|
||||
}
|
||||
void DBusDispatcher::Stop()
|
||||
{
|
||||
if (!closed)
|
||||
{
|
||||
closed = true;
|
||||
|
||||
this->stopping = true;
|
||||
WakeThread();
|
||||
Wait();
|
||||
}
|
||||
}
|
||||
|
||||
void DBusDispatcher::SignalStop(std::function<void(void)> &&callback)
|
||||
{
|
||||
this->signalStopCallback = std::move(callback);
|
||||
std::atomic_thread_fence(::std::memory_order::release);
|
||||
this->signalStopRequested = true;
|
||||
}
|
||||
|
||||
int DBusDispatcher::GetEventTimeoutMs()
|
||||
{
|
||||
std::lock_guard lock{postMutex};
|
||||
|
||||
clock::time_point nextTime = clock::time_point::max();
|
||||
for (const auto &event : this->postedEvents)
|
||||
{
|
||||
if (event.time == clock::time_point::min())
|
||||
return 0;
|
||||
if (event.time < nextTime)
|
||||
{
|
||||
nextTime = event.time;
|
||||
}
|
||||
}
|
||||
if (nextTime == clock::time_point::max())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
auto clockDuration = nextTime - clock::now();
|
||||
auto durationMs = std::chrono::duration_cast<std::chrono::milliseconds>(clockDuration);
|
||||
auto ticks = durationMs.count();
|
||||
if (ticks > 250)
|
||||
return 250;
|
||||
if (ticks < 0)
|
||||
return 0;
|
||||
return (int)ticks;
|
||||
}
|
||||
|
||||
bool DBusDispatcher::IsStopping()
|
||||
{
|
||||
std::lock_guard lock{postMutex};
|
||||
return stopping;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
#include <atomic>
|
||||
|
||||
namespace sdbus {
|
||||
class IConnection;
|
||||
};
|
||||
|
||||
|
||||
class DBusDispatcher {
|
||||
DBusDispatcher(const DBusDispatcher&) = delete;
|
||||
public:
|
||||
DBusDispatcher(bool systemBus = true);
|
||||
~DBusDispatcher();
|
||||
|
||||
void Run();
|
||||
// Stop everything, shutting down gracefully.
|
||||
void Stop();
|
||||
void Wait();
|
||||
bool IsFinished();
|
||||
|
||||
// Stop, but don't wait. Suitable for use in a signal handler.
|
||||
// The callback is executed by the dispatcher thread, and can therefore call non-signal-safe functions.
|
||||
void SignalStop(std::function<void(void)> &&callback);
|
||||
|
||||
bool IsStopping();
|
||||
|
||||
using PostHandle = uint64_t;
|
||||
using PostCallback = std::function<void()>;
|
||||
PostHandle Post(PostCallback&&fn);
|
||||
|
||||
using clock = std::chrono::steady_clock;
|
||||
|
||||
template<class REP,class PERIOD>
|
||||
DBusDispatcher::PostHandle PostDelayed(const std::chrono::duration<REP,PERIOD>&delay,PostCallback&&fn)
|
||||
{
|
||||
return PostDelayed(
|
||||
std::chrono::duration_cast<clock::duration,REP,PERIOD>(delay),
|
||||
std::move(fn));
|
||||
}
|
||||
|
||||
DBusDispatcher::PostHandle PostDelayed(const clock::duration&delay,PostCallback&&fn);
|
||||
|
||||
bool CancelPost(DBusDispatcher::PostHandle handle);
|
||||
|
||||
sdbus::IConnection&Connection() { return *busConnection;}
|
||||
|
||||
private:
|
||||
std::atomic<bool> isFinished;
|
||||
std::atomic<bool> signalStopRequested;
|
||||
bool signalStopExecuted = false;
|
||||
std::function<void(void)> signalStopCallback;
|
||||
uint64_t NextHandle() {
|
||||
return nextHandle.fetch_add(1);
|
||||
}
|
||||
int GetEventTimeoutMs();
|
||||
std::atomic<PostHandle> nextHandle;
|
||||
int eventFd = -1;
|
||||
bool closed = false;
|
||||
void ThreadProc();
|
||||
void WakeThread();
|
||||
std::unique_ptr<sdbus::IConnection> busConnection;
|
||||
|
||||
struct CallbackEntry {
|
||||
PostCallback callback;
|
||||
clock::time_point time;
|
||||
PostHandle handle;
|
||||
};
|
||||
|
||||
std::atomic<bool> stopping;
|
||||
|
||||
std::vector<CallbackEntry> postedEvents;
|
||||
bool threadJoined;
|
||||
std::thread serviceThread;
|
||||
std::mutex postMutex;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
#include "DBusEvent.hpp"
|
||||
|
||||
|
||||
|
||||
namespace impl {
|
||||
std::atomic<uint64_t> NextHandle;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
#include <functional>
|
||||
#include <atomic>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
#include <memory>
|
||||
|
||||
namespace impl {
|
||||
extern std::atomic<uint64_t> NextHandle;
|
||||
}
|
||||
|
||||
template <typename... ARG_TYPES>
|
||||
class DBusEvent {
|
||||
public:
|
||||
using Callback=std::function<void (ARG_TYPES...)>;
|
||||
using Handle=uint64_t;
|
||||
|
||||
Handle add(Callback&&cb)
|
||||
{
|
||||
auto handle = impl::NextHandle.fetch_add(1,std::memory_order::acq_rel);
|
||||
{
|
||||
std::lock_guard<std::mutex> lock{m};
|
||||
callbacks[handle] = std::make_shared<Callback>(std::move(cb));
|
||||
}
|
||||
return handle;
|
||||
}
|
||||
void remove(Handle h)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock{m};
|
||||
callbacks.erase(h);
|
||||
}
|
||||
|
||||
void fire(ARG_TYPES...args)
|
||||
{
|
||||
std::vector<std::shared_ptr<Callback>> cbs;
|
||||
cbs.reserve(callbacks.size());
|
||||
{
|
||||
std::lock_guard<std::mutex> lock{m};
|
||||
for (const auto &cb: callbacks)
|
||||
{
|
||||
cbs.push_back(cb.second);
|
||||
}
|
||||
}
|
||||
for (auto&cb: cbs)
|
||||
{
|
||||
(*cb)(args...);
|
||||
}
|
||||
{
|
||||
// destruct shared_ptrs with mutex held.
|
||||
std::lock_guard<std::mutex> lock{m};
|
||||
cbs.clear();
|
||||
}
|
||||
}
|
||||
private:
|
||||
std::map<Handle,std::shared_ptr<Callback>> callbacks;
|
||||
std::mutex m;
|
||||
};
|
||||
@@ -0,0 +1,238 @@
|
||||
#include "DBusLog.hpp"
|
||||
#include <memory>
|
||||
#include "ss.hpp"
|
||||
#include <systemd/sd-journal.h>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include "ss.hpp"
|
||||
#include <chrono>
|
||||
|
||||
|
||||
namespace impl {
|
||||
std::mutex logMutex;
|
||||
DBusLogLevel dbusLogLevel = DBusLogLevel::Info;
|
||||
|
||||
}
|
||||
|
||||
static std::string getDateTime()
|
||||
{
|
||||
auto now = std::chrono::system_clock::now();
|
||||
time_t in_time_t = std::chrono::system_clock::to_time_t(now);
|
||||
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()) % 1000;
|
||||
std::stringstream ss;
|
||||
ss << std::put_time(std::localtime(&in_time_t),"%Y-%m-%d %H:%M:%S");
|
||||
ss << '.' << std::setfill('0') << std::setw(3) << ms.count();
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
class ConsoleDBusLogger : public IDBusLogger {
|
||||
|
||||
public:
|
||||
void LogError(const std::string&message) {
|
||||
std::cout << getDateTime() << " error: " << message << std::endl;
|
||||
}
|
||||
void LogWarning(const std::string&message){
|
||||
std::cout << getDateTime() << " warning: " << message << std::endl;
|
||||
}
|
||||
void LogInfo(const std::string&message) {
|
||||
std::cout << getDateTime() << " info: " << message << std::endl;
|
||||
}
|
||||
void LogDebug(const std::string&message) {
|
||||
std::cout << getDateTime() << " debug: " << message << std::endl;
|
||||
}
|
||||
void LogTrace(const std::string&message) {
|
||||
std::cout << getDateTime() << " trace: " << message << std::endl;
|
||||
}
|
||||
|
||||
};
|
||||
class FileDBusLogger : public IDBusLogger {
|
||||
|
||||
public:
|
||||
FileDBusLogger(const std::filesystem::path&path)
|
||||
{
|
||||
f.open(path);
|
||||
if (!f)
|
||||
{
|
||||
throw std::runtime_error(SS("Can't open file " << path));
|
||||
}
|
||||
}
|
||||
void LogError(const std::string&message) {
|
||||
f << "error: " << message << std::endl;
|
||||
}
|
||||
void LogWarning(const std::string&message){
|
||||
f << "warning: " << message << std::endl;
|
||||
}
|
||||
void LogInfo(const std::string&message) {
|
||||
f << "info: " << message << std::endl;
|
||||
}
|
||||
void LogDebug(const std::string&message) {
|
||||
f << "debug: " << message << std::endl;
|
||||
}
|
||||
void LogTrace(const std::string&message) {
|
||||
f << "trace: " << message << std::endl;
|
||||
}
|
||||
private:
|
||||
std::ofstream f;
|
||||
};
|
||||
|
||||
class SystemdDBusLogger : public IDBusLogger {
|
||||
|
||||
public:
|
||||
void LogError(const std::string&message) {
|
||||
sd_journal_print(LOG_ERR,"%s",message.c_str());
|
||||
|
||||
}
|
||||
void LogWarning(const std::string&message){
|
||||
sd_journal_print(LOG_WARNING,"%s",message.c_str());
|
||||
}
|
||||
void LogInfo(const std::string&message) {
|
||||
sd_journal_print(LOG_INFO,"%s",message.c_str());
|
||||
|
||||
}
|
||||
void LogDebug(const std::string&message) {
|
||||
sd_journal_print(LOG_DEBUG,"%s",message.c_str());
|
||||
}
|
||||
void LogTrace(const std::string&message) {
|
||||
// no trace level. just log as debug.
|
||||
sd_journal_print(LOG_DEBUG,"%s",message.c_str());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
static std::vector<std::unique_ptr<IDBusLogger>> loggers;
|
||||
|
||||
|
||||
|
||||
void SetDBusLogLevel(DBusLogLevel level)
|
||||
{
|
||||
impl::dbusLogLevel = level;
|
||||
}
|
||||
|
||||
void LogError(const std::string&path,const char*method,const std::string&message)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Error) return;
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogError(SS(path<< "::" << method << ": "<< message));
|
||||
}
|
||||
}
|
||||
void LogInfo(const std::string&path,const char*method,const std::string&message)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Info) return;
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogInfo(SS(path<< "::" << method<< ": " << message));
|
||||
}
|
||||
}
|
||||
|
||||
void LogDebug(const std::string&path,const char*method,const std::string&message)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Debug) return;
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogDebug(SS(path<< "::" << method << ": "<< message));
|
||||
}
|
||||
}
|
||||
|
||||
void LogDebug(const std::string&path,const char*method,const std::function<std::string ()> &text)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Debug) return;
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogDebug(SS(path<< "::" << method << ": " << text()));
|
||||
}
|
||||
}
|
||||
|
||||
void LogTrace(const std::string&path,const char*method,const std::function<std::string ()> &text)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Trace) return;
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogTrace(SS(path<< "::" << method << ": " << text()));
|
||||
}
|
||||
}
|
||||
void LogWarning(const std::string&path,const char*method,const std::function<std::string ()> &text)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Warning) return;
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
std::string message = text();
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogWarning(SS(path<< "::" << method << ": " << message));
|
||||
}
|
||||
}
|
||||
void LogInfo(const std::string&path,const char*method,const std::function<std::string ()> &text)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Info) return;
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
std::string message = text();;
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogInfo(SS(path<< "::" << method << ": " << message));
|
||||
}
|
||||
}
|
||||
void LogError(const std::string&path,const char*method,const std::function<std::string ()> &text)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Error) return;
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogError(SS(path<< "::" << method << ": " << text()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LogWarning(const std::string&path,const char*method,const std::string&message)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Warning) return;
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogWarning(SS(path<< "::" << method << ": " << message));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LogTrace(const std::string&path,const char*method,const std::string&message)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Trace) return;
|
||||
|
||||
std::lock_guard<std::mutex> lock{impl::logMutex};
|
||||
for (auto &logger: loggers)
|
||||
{
|
||||
logger->LogTrace(SS(path<< "::" << method << ": " << message));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SetDBusConsoleLogger()
|
||||
{
|
||||
loggers.clear();
|
||||
loggers.push_back(std::make_unique<ConsoleDBusLogger>());
|
||||
}
|
||||
void AddDBusConsoleLogger()
|
||||
{
|
||||
loggers.push_back(std::make_unique<ConsoleDBusLogger>());
|
||||
}
|
||||
void SetDBusSystemdLogger()
|
||||
{
|
||||
loggers.clear();
|
||||
loggers.push_back(std::make_unique<SystemdDBusLogger>());
|
||||
|
||||
}
|
||||
void SetDBusFileLogger(const std::filesystem::path &path)
|
||||
{
|
||||
loggers.clear();
|
||||
loggers.push_back(std::make_unique<FileDBusLogger>(path));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
#include <mutex>
|
||||
#include <filesystem>
|
||||
|
||||
enum class DBusLogLevel {
|
||||
Trace,
|
||||
Debug,
|
||||
Info,
|
||||
Warning,
|
||||
Error,
|
||||
None
|
||||
};
|
||||
|
||||
namespace impl {
|
||||
extern std::mutex logMutex;
|
||||
extern DBusLogLevel dbusLogLevel;
|
||||
}
|
||||
extern void SetDBusLogLevel(DBusLogLevel level);
|
||||
inline DBusLogLevel GetDBusLogLevel() {
|
||||
return impl::dbusLogLevel;
|
||||
}
|
||||
inline bool IsDBusLoggingEnabled(DBusLogLevel level) {
|
||||
return level >= impl::dbusLogLevel;
|
||||
}
|
||||
|
||||
class IDBusLogger {
|
||||
public:
|
||||
IDBusLogger() {}
|
||||
virtual ~IDBusLogger() { }
|
||||
virtual void LogError(const std::string&message) = 0;
|
||||
virtual void LogWarning(const std::string&message) = 0;
|
||||
virtual void LogInfo(const std::string&message) = 0;
|
||||
virtual void LogDebug(const std::string&message) = 0;
|
||||
virtual void LogTrace(const std::string&message) = 0;
|
||||
|
||||
};
|
||||
|
||||
void SetDBusConsoleLogger();
|
||||
void AddDBusConsoleLogger();
|
||||
void SetDBusSystemdLogger();
|
||||
void SetDBusFileLogger(const std::filesystem::path &path);
|
||||
|
||||
extern void LogError(const std::string&path,const char*method,const std::string&message);
|
||||
extern void LogInfo(const std::string&path,const char*method,const std::string&message);
|
||||
extern void LogDebug(const std::string&path,const char*method,const std::string&message);
|
||||
extern void LogWarning(const std::string&path,const char*method,const std::string&message);
|
||||
extern void LogTrace(const std::string&path,const char*method,const std::string&message);
|
||||
|
||||
extern void LogTrace(const std::string&path,const char*method,const std::function<std::string ()> &text);
|
||||
extern void LogDebug(const std::string&path,const char*method,const std::function<std::string ()> &text);
|
||||
extern void LogInfo(const std::string&path,const char*method,const std::function<std::string ()> &text);
|
||||
extern void LogWarning(const std::string&path,const char*method,const std::function<std::string ()> &text);
|
||||
extern void LogError(const std::string&path,const char*method,const std::function<std::string ()> &text);
|
||||
|
||||
|
||||
|
||||
class DBusLog {
|
||||
protected:
|
||||
DBusLog(const std::string &path)
|
||||
:path(path)
|
||||
{
|
||||
}
|
||||
protected:
|
||||
void LogError(const char*tag,const std::string&message)
|
||||
{
|
||||
::LogError(path,tag,message);
|
||||
}
|
||||
void LogWarning(const char *tag, const std::string&message)
|
||||
{
|
||||
::LogWarning(path,tag,message);
|
||||
}
|
||||
void LogDebug(const char*tag, const std::string &text)
|
||||
{
|
||||
::LogDebug(path,tag,text);
|
||||
}
|
||||
void LogDebug(const char*tag, const std::function<std::string ()> &text)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Debug) return;
|
||||
::LogDebug(path,tag,text());
|
||||
}
|
||||
void LogTrace(const char*tag, const std::string &text)
|
||||
{
|
||||
::LogTrace(path,tag,text);
|
||||
}
|
||||
void LogTrace(const char*tag, const std::function<std::string ()> &text)
|
||||
{
|
||||
if (impl::dbusLogLevel > DBusLogLevel::Trace) return;
|
||||
::LogTrace(path,tag,text());
|
||||
}
|
||||
private:
|
||||
std::string path;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
#include "DBusVariantHelper.hpp"
|
||||
#include <sdbus-c++/Types.h>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
//std::ostream &operator<<(std::ostream &s, const std::map<std::string, sdbus::Variant> &properties)
|
||||
std::ostream&operator<<(std::ostream&s, const sdbus::Variant&v)
|
||||
{
|
||||
// clang-format off
|
||||
#define HANDLE_VARIANT_TYPE(type) \
|
||||
if (v.containsValueOfType<type>()) \
|
||||
{ \
|
||||
s << v.get<type>(); \
|
||||
}
|
||||
|
||||
HANDLE_VARIANT_TYPE(std::string)
|
||||
else if (v.containsValueOfType<uint8_t>())
|
||||
{
|
||||
uint8_t value = v.get<uint8_t>();
|
||||
s << (int)value;
|
||||
}
|
||||
else HANDLE_VARIANT_TYPE(uint32_t)
|
||||
else HANDLE_VARIANT_TYPE(int32_t)
|
||||
else HANDLE_VARIANT_TYPE(uint64_t)
|
||||
else HANDLE_VARIANT_TYPE(int64_t)
|
||||
else HANDLE_VARIANT_TYPE(uint16_t)
|
||||
else HANDLE_VARIANT_TYPE(int16_t)
|
||||
else HANDLE_VARIANT_TYPE(bool)
|
||||
else HANDLE_VARIANT_TYPE(sdbus::Variant)
|
||||
else if (v.containsValueOfType<sdbus::ObjectPath>())
|
||||
{
|
||||
auto objectPath = v.get<sdbus::ObjectPath>();
|
||||
s << '[' << objectPath.c_str() << ']';
|
||||
}
|
||||
else if (v.containsValueOfType<std::vector<sdbus::Variant>>())
|
||||
{
|
||||
auto values = v.get<std::vector<sdbus::Variant>>();
|
||||
{
|
||||
s << '[';
|
||||
bool first = true;
|
||||
for (const sdbus::ObjectPath&value: values)
|
||||
{
|
||||
if (!first) s << ", ";
|
||||
first = false;
|
||||
s << value.c_str();
|
||||
}
|
||||
s << ']';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (v.containsValueOfType<std::vector<sdbus::ObjectPath>>())
|
||||
{
|
||||
auto paths = v.get<std::vector<sdbus::ObjectPath> >();
|
||||
{
|
||||
s << '[';
|
||||
bool first = true;
|
||||
for (const sdbus::ObjectPath&path: paths)
|
||||
{
|
||||
if (!first) s << ", ";
|
||||
first = false;
|
||||
s << path.c_str();
|
||||
}
|
||||
s << ']';
|
||||
|
||||
}
|
||||
}
|
||||
else if (v.containsValueOfType<std::vector<uint8_t>>())
|
||||
{
|
||||
std::vector<uint8_t> bytes = v.get<std::vector<uint8_t>>();
|
||||
s << '[';
|
||||
bool first = true;
|
||||
for (uint8_t byte: bytes)
|
||||
{
|
||||
if (!first) s << ", ";
|
||||
first = false;
|
||||
s << (int)byte;
|
||||
|
||||
}
|
||||
s << ']';
|
||||
|
||||
}
|
||||
else if (v.containsValueOfType<std::vector<std::vector<uint8_t>>>())
|
||||
{
|
||||
auto arrayOfArrays = v.get<std::vector<std::vector<uint8_t>>>();
|
||||
s << '[';
|
||||
bool first = true;
|
||||
for (const auto& array: arrayOfArrays)
|
||||
{
|
||||
if (!first) s << ", ";
|
||||
first = false;
|
||||
bool first2 = true;
|
||||
for (auto byte: array)
|
||||
{
|
||||
if (!first2) s << ", ";
|
||||
first2 = false;
|
||||
s << byte;
|
||||
|
||||
}
|
||||
}
|
||||
s << ']';
|
||||
|
||||
}
|
||||
else if (v.containsValueOfType<std::map<std::string,sdbus::Variant>>())
|
||||
{
|
||||
std::map<std::string,sdbus::Variant> map = v.get<std::map<std::string,sdbus::Variant>>();
|
||||
s << "{";
|
||||
bool first = true;
|
||||
for (const auto &[key, value]: map)
|
||||
{
|
||||
if (!first) s << ",";
|
||||
first = false;
|
||||
s << '\"' << key << "\": " << value;
|
||||
}
|
||||
s << "}";
|
||||
} else if (v.containsValueOfType<std::map<std::string,std::vector<uint8_t>>>())
|
||||
{
|
||||
std::map<std::string,std::vector<uint8_t>> values
|
||||
= v.get<std::map<std::string,std::vector<uint8_t>>>();
|
||||
s << '{';
|
||||
bool first = true;
|
||||
for (const auto &[key,bytes]: values)
|
||||
{
|
||||
if (!first) s << ',';
|
||||
first = false;
|
||||
s << "{\"" << key << "\": [";
|
||||
bool first2 = true;
|
||||
for (auto b : bytes)
|
||||
{
|
||||
if (!first2) s << ',';
|
||||
first2 = false;
|
||||
s << b;
|
||||
}
|
||||
s << "]";
|
||||
}
|
||||
s << '}';
|
||||
|
||||
}
|
||||
|
||||
// else HANDLE_VARIANT_TYPE(float)
|
||||
// else HANDLE_VARIANT_TYPE(double)
|
||||
// else HANDLE_VARIANT_TYPE(uint64_t)
|
||||
// else HANDLE_VARIANT_TYPE(int64_t)
|
||||
// else HANDLE_VARIANT_TYPE(char)
|
||||
// else HANDLE_VARIANT_TYPE(uint8_t)
|
||||
// else HANDLE_VARIANT_TYPE(int8_t)
|
||||
else
|
||||
{
|
||||
s << "UNKNOWN VALUE OF TYPE " << v.peekValueType();
|
||||
}
|
||||
#undef HANDLE_VARIANT_TYPE
|
||||
// clang-format on
|
||||
return s;
|
||||
}
|
||||
std::ostream&operator<<(std::ostream&s,const std::map<std::string, sdbus::Variant>& properties)
|
||||
{
|
||||
|
||||
s << "{";
|
||||
bool first = true;
|
||||
for (const auto &property : properties)
|
||||
{
|
||||
if (!first)
|
||||
{
|
||||
s << ", ";
|
||||
}
|
||||
first = false;
|
||||
s << '"' << property.first << "\": ";
|
||||
|
||||
const sdbus::Variant &v = property.second;
|
||||
s << v;
|
||||
}
|
||||
|
||||
s << "}";
|
||||
return s;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <ostream>
|
||||
|
||||
namespace sdbus {
|
||||
class Variant;
|
||||
}
|
||||
|
||||
extern std::ostream&operator<<(std::ostream&s, const sdbus::Variant&v);
|
||||
extern std::ostream&operator<<(std::ostream&s,const std::map<std::string, sdbus::Variant>& properties);
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "DnsMasqService.hpp"
|
||||
#include "SysExec.hpp"
|
||||
#include "ss.hpp"
|
||||
|
||||
|
||||
void DnsMasqService::Start(const std::string&confFile, const std::string&wlan)
|
||||
{
|
||||
std::string exec = SS("dnsmasq --conf-file=" << confFile << " --interface=p2p-"<< wlan << "-*");
|
||||
|
||||
this->pid = (int64_t)pipedal::sysExecAsync(exec);
|
||||
}
|
||||
void DnsMasqService::Stop()
|
||||
{
|
||||
if (this->pid != -1)
|
||||
{
|
||||
pipedal::sysExecTerminate(pid,1000,500);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
class DnsMasqService {
|
||||
public:
|
||||
void Start(const std::string&confFile, const std::string&wlan);
|
||||
void Stop();
|
||||
private:
|
||||
int64_t pid = -1;
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "Install.hpp"
|
||||
#include "Sudo.hpp"
|
||||
#include "cassert"
|
||||
#include "DBusLog.hpp"
|
||||
|
||||
int InstallService()
|
||||
{
|
||||
assert(IsSudo());
|
||||
LogInfo("","InstallService","");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
int UninstallService()
|
||||
{
|
||||
assert(IsSudo());
|
||||
LogInfo("","Uninstall","");
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
extern int InstallService();
|
||||
extern int UninstallService();
|
||||
@@ -0,0 +1,359 @@
|
||||
#include "NMManager.hpp"
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include "NetworkManagerInterfaces.hpp"
|
||||
#include "WpaInterfaces.hpp"
|
||||
#include "DBusLog.hpp"
|
||||
#include "NMP2pSettings.hpp"
|
||||
#include "ss.hpp"
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
class NMManagerImpl : public NMManager
|
||||
{
|
||||
public:
|
||||
NMManagerImpl();
|
||||
virtual ~NMManagerImpl();
|
||||
virtual void Init();
|
||||
virtual void Run();
|
||||
virtual void Stop();
|
||||
|
||||
private:
|
||||
void MaybeStartWpas();
|
||||
void MaybeStopWpas();
|
||||
using PostCallback = DBusDispatcher::PostCallback;
|
||||
void Post(PostCallback &&callback);
|
||||
|
||||
void OnWpaInterfaceAdded(const sdbus::ObjectPath &path);
|
||||
void OnWpaInterfaceRemoved(const sdbus::ObjectPath &path);
|
||||
void StartConnection(const std::vector<uint8_t> &peerAddress);
|
||||
|
||||
private:
|
||||
void InitWpaP2PDevice(WpaP2PDevice::ptr &&device);
|
||||
void InitWpaP2PGoDevice(WpaP2PDevice::ptr &&device);
|
||||
P2pSettings settings;
|
||||
DBusDispatcher dispatcher;
|
||||
WpaSupplicant::ptr wpaSupplicant;
|
||||
WpaP2PDevice::ptr wpaP2PDevice;
|
||||
WpaP2PDevice::ptr wpaP2PGoDevice;
|
||||
WpaGroup::ptr wpaGroup;
|
||||
Device::ptr nmDevice;
|
||||
std::string groupPath;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
NMManager::NMManager()
|
||||
{
|
||||
}
|
||||
NMManager::~NMManager()
|
||||
{
|
||||
}
|
||||
|
||||
NMManagerImpl::NMManagerImpl()
|
||||
: dispatcher(true)
|
||||
{
|
||||
}
|
||||
|
||||
void NMManagerImpl::InitWpaP2PGoDevice(WpaP2PDevice::ptr &&device)
|
||||
{
|
||||
if (this->wpaP2PGoDevice)
|
||||
return;
|
||||
this->wpaP2PGoDevice = std::move(device);
|
||||
}
|
||||
void NMManagerImpl::InitWpaP2PDevice(WpaP2PDevice::ptr &&device)
|
||||
{
|
||||
if (this->wpaP2PDevice)
|
||||
return;
|
||||
|
||||
// make sure the NetworkManager and wpa_supplicant objects are for the same device.
|
||||
std::string wpaInterfaceName = device->Ifname();
|
||||
std::string nmInterface = nmDevice->Interface();
|
||||
if (nmInterface != "p2p-dev-" + wpaInterfaceName)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this->wpaP2PDevice = std::move(device);
|
||||
|
||||
std::map<std::string, sdbus::Variant> deviceConfig;
|
||||
deviceConfig["DeviceName"] = SS(settings.device_name());
|
||||
deviceConfig["PrimaryDeviceType"] = std::vector<uint8_t>{0x00, 0x01, 0x00, 0x50, 0xF2, 0x04, 0x00, 0x01};
|
||||
deviceConfig["PersistentReconnect"] = false;
|
||||
deviceConfig["SsidPostfix"] = SS("-" << settings.device_name());
|
||||
deviceConfig["GOIntent"] = (uint32_t)15;
|
||||
// deviceConfig["PersistentReconnect"] = (uint32_t)2;
|
||||
// deviceConfig["ListenRegClass"] = (uint32_t)81;
|
||||
// deviceConfig["ListenChannel"] = (uint32_t)settings.listen_channel();
|
||||
// deviceConfig["OperRegClass"] = (uint32_t)81;
|
||||
// deviceConfig["OperChannel"] = (uint32_t)settings.op_channel(); // ch 1
|
||||
|
||||
deviceConfig["IpAddrGo"] = std::vector<uint8_t>{172, 23, 0, 1};
|
||||
deviceConfig["IpAddrMask"] = std::vector<uint8_t>{255, 255, 255, 0};
|
||||
deviceConfig["IpAddrStart"] = std::vector<uint8_t>{172, 23, 0, 10};
|
||||
deviceConfig["IpAddrEnd"] = std::vector<uint8_t>{172, 23, 0, 250};
|
||||
|
||||
|
||||
wpaP2PDevice->P2PDeviceConfig(deviceConfig);
|
||||
|
||||
{
|
||||
WpaWPS::ptr wpsDevice = WpaWPS::Create(dispatcher.Connection(), wpaP2PDevice->getObjectPath());
|
||||
wpsDevice->DeviceName(settings.device_name());
|
||||
wpsDevice->Manufacturer(settings.manufacturer());
|
||||
wpsDevice->ModelName(settings.model_name());
|
||||
wpsDevice->ModelNumber(settings.model_number());
|
||||
wpsDevice->SerialNumber(settings.serial_number());
|
||||
wpsDevice->DeviceType(settings.device_type());
|
||||
}
|
||||
|
||||
wpaP2PDevice->OnGroupStarted.add(
|
||||
[this](const std::map<std::string, sdbus::Variant> &)
|
||||
{
|
||||
try
|
||||
{
|
||||
Post([this]()
|
||||
{
|
||||
LogDebug("NMManager", "OnGroupStarted", "GroupStarted");
|
||||
auto group = this->wpaP2PDevice->Group();
|
||||
if (!group.empty())
|
||||
{
|
||||
wpaGroup = WpaGroup::Create(dispatcher.Connection(),group);
|
||||
wpaGroup->OnPeerJoined.add([this](const sdbus::ObjectPath&path) {
|
||||
Post([this,path]()
|
||||
{
|
||||
try {
|
||||
LogDebug("NMManager","OnPeerJoined",path.c_str());
|
||||
} catch (const std::exception&e)
|
||||
{
|
||||
LogError("NMManager","OnPeerJoined",e.what());
|
||||
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
wpaGroup->OnPeerDisconnected.add([this](const sdbus::ObjectPath&path){
|
||||
Post([this,path](){
|
||||
LogDebug("NMManager","OnPeerDisconnected",path.c_str());
|
||||
});
|
||||
});
|
||||
} });
|
||||
wpaP2PDevice->OnGONegotiationFailure.add(
|
||||
[this](const std::map<std::string, sdbus::Variant> &info)
|
||||
{
|
||||
LogInfo(wpaP2PDevice->getObjectPath().c_str(), "OnGoNegotiationFailure", "P2P GO negotiation failed.");
|
||||
});
|
||||
wpaP2PDevice->OnGroupFormationFailure.add(
|
||||
[this](const std::string &reason)
|
||||
{
|
||||
LogInfo(wpaP2PDevice->getObjectPath().c_str(), "OnGroupFormationFailure",
|
||||
SS("Group formation failed. " << reason));
|
||||
});
|
||||
}
|
||||
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
LogError("P2pManager", "OnGroupStarted", e.what());
|
||||
}
|
||||
});
|
||||
|
||||
// std::map<std::string,sdbus::Variant> startParams;
|
||||
// startParams["Role"] = "registrar";
|
||||
// startParams["Pin"] = settings.pin();
|
||||
// wpsDevice->Start(startParams);
|
||||
|
||||
wpaP2PDevice->OnGroupFormationFailure.add(
|
||||
[this](const std::string &reason)
|
||||
{
|
||||
Post([this]()
|
||||
{
|
||||
if (this->wpaP2PDevice)
|
||||
{
|
||||
try {
|
||||
} catch (const std::exception&e)
|
||||
{
|
||||
LogError("NMManager","OnGroupFormationFailure", SS("Listen failed: " << e.what()));
|
||||
}
|
||||
} });
|
||||
});
|
||||
wpaP2PDevice->OnGONegotiationFailure.add(
|
||||
[this](const std::map<std::string, sdbus::Variant> &info)
|
||||
{
|
||||
Post([this]()
|
||||
{
|
||||
if (this->wpaP2PDevice)
|
||||
{
|
||||
try {
|
||||
} catch (const std::exception&e)
|
||||
{
|
||||
LogError("NMManager","OnGONegotiationFailure", SS("Listen failed: " << e.what()));
|
||||
}
|
||||
} });
|
||||
});
|
||||
|
||||
wpaP2PDevice->OnProvisionDiscoveryRequestDisplayPin.add(
|
||||
[this](const sdbus::ObjectPath &peer_object, const std::string &pin)
|
||||
{
|
||||
LogTrace("NMManager", "InitWpaP2PDevice",
|
||||
SS("OnProvisionDiscoveryRequestDisplayPin - " << peer_object.c_str() << " pin: " << pin));
|
||||
|
||||
Post(
|
||||
[this, peer_object]()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!this->wpaP2PDevice)
|
||||
return;
|
||||
WpaPeer::ptr peer = WpaPeer::Create(dispatcher.Connection(), peer_object);
|
||||
std::vector<uint8_t> deviceAddress = peer->DeviceAddress();
|
||||
StartConnection(deviceAddress);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
LogError(
|
||||
"NMManagerImpl", "OnProvisionDiscoveryRequestDisplayPin",
|
||||
SS("Connection not started. " << e.what()));
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
{
|
||||
this->wpaP2PDevice->Listen((int32_t)5000);
|
||||
|
||||
std::map<std::string, sdbus::Variant> listenArgs;
|
||||
listenArgs["interval"] = (int32_t)5000; // listen for...
|
||||
listenArgs["period"] = (int32_t)100; // check every...
|
||||
this->wpaP2PDevice->ExtendedListen(listenArgs);
|
||||
LogInfo(this->wpaP2PDevice->getObjectPath(), "InitWpaP2PDevice", "Listening");
|
||||
};
|
||||
}
|
||||
void NMManagerImpl::MaybeStartWpas()
|
||||
{
|
||||
if (!wpaSupplicant)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
for (const auto &interfacePath : wpaSupplicant->Interfaces())
|
||||
{
|
||||
try
|
||||
{
|
||||
auto p2pDevice = WpaP2PDevice::Create(dispatcher.Connection(), interfacePath);
|
||||
// must be for the same wpa instance as network manager device.
|
||||
|
||||
std::string role = p2pDevice->Role();
|
||||
if (role == "GO")
|
||||
{
|
||||
this->InitWpaP2PGoDevice(std::move(p2pDevice));
|
||||
}
|
||||
else if (role == "device")
|
||||
{
|
||||
this->InitWpaP2PDevice(std::move(p2pDevice));
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
LogWarning("NMManager", "MaybeStartWpas", e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
LogError("NMManagerImpl", "MaybeStartWpas", e.what());
|
||||
}
|
||||
}
|
||||
void NMManagerImpl::MaybeStopWpas()
|
||||
{
|
||||
}
|
||||
void NMManagerImpl::OnWpaInterfaceAdded(const sdbus::ObjectPath &objectPath)
|
||||
{
|
||||
Post([this]()
|
||||
{ MaybeStartWpas(); });
|
||||
}
|
||||
void NMManagerImpl::OnWpaInterfaceRemoved(const sdbus::ObjectPath &objectPath)
|
||||
{
|
||||
Post([this, objectPath]()
|
||||
{
|
||||
if (this->wpaP2PDevice && this->wpaP2PDevice->getObjectPath() == objectPath)
|
||||
{
|
||||
this->wpaP2PDevice = nullptr;
|
||||
}
|
||||
if (this->wpaP2PGoDevice->getObjectPath() == objectPath)
|
||||
{
|
||||
this->wpaP2PGoDevice = nullptr;
|
||||
} });
|
||||
MaybeStopWpas();
|
||||
}
|
||||
void NMManagerImpl::Init()
|
||||
{
|
||||
this->wpaSupplicant = WpaSupplicant::Create(dispatcher.Connection());
|
||||
|
||||
this->wpaSupplicant->OnInterfaceAdded.add(
|
||||
[this](const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
this->OnWpaInterfaceAdded(path);
|
||||
});
|
||||
this->wpaSupplicant->OnInterfaceRemoved.add(
|
||||
[this](const sdbus::ObjectPath &path)
|
||||
{
|
||||
this->OnWpaInterfaceRemoved(path);
|
||||
});
|
||||
|
||||
Post([this]()
|
||||
{
|
||||
MaybeStartWpas(); });
|
||||
}
|
||||
NMManagerImpl::~NMManagerImpl()
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
|
||||
NMManager::ptr NMManager::Create()
|
||||
{
|
||||
return std::make_unique<NMManagerImpl>();
|
||||
}
|
||||
|
||||
void NMManagerImpl::Run()
|
||||
{
|
||||
dispatcher.Run();
|
||||
}
|
||||
|
||||
void NMManagerImpl::Stop()
|
||||
{
|
||||
if (this->wpaP2PDevice)
|
||||
{
|
||||
// no parameters cancels Extended listen.
|
||||
std::map<std::string, sdbus::Variant> listenArgs;
|
||||
this->wpaP2PDevice->ExtendedListen(listenArgs);
|
||||
}
|
||||
|
||||
wpaP2PDevice = nullptr;
|
||||
wpaP2PGoDevice = nullptr;
|
||||
wpaSupplicant = nullptr;
|
||||
nmDevice = nullptr;
|
||||
|
||||
dispatcher.Stop();
|
||||
}
|
||||
|
||||
void NMManagerImpl::Post(NMManagerImpl::PostCallback &&callback)
|
||||
{
|
||||
dispatcher.Post(std::move(callback));
|
||||
}
|
||||
|
||||
static const char hexDigits[] = "0123456789ABCDEFx";
|
||||
|
||||
static std::string peerToString(const std::vector<uint8_t> &peer)
|
||||
{
|
||||
std::stringstream s;
|
||||
bool firstTime = true;
|
||||
for (uint8_t byte : peer)
|
||||
{
|
||||
if (!firstTime)
|
||||
s << ':';
|
||||
firstTime = false;
|
||||
s << hexDigits[(byte >> 4) & 0x0F] << hexDigits[byte & 0x0F];
|
||||
}
|
||||
return s.str();
|
||||
}
|
||||
|
||||
void NMManagerImpl::StartConnection(const std::vector<uint8_t> &peer)
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
|
||||
class NMManager {
|
||||
protected:
|
||||
NMManager();
|
||||
public:
|
||||
using ptr = std::unique_ptr<NMManager>;
|
||||
static ptr Create();
|
||||
virtual ~NMManager();
|
||||
virtual void Init() =0;
|
||||
virtual void Run() = 0;
|
||||
virtual void Stop() = 0;
|
||||
};
|
||||
@@ -0,0 +1,235 @@
|
||||
#include "NMP2pSettings.hpp"
|
||||
#include "WifiDirectConfigSettings.hpp"
|
||||
#include "ServiceConfiguration.hpp"
|
||||
#include <stdexcept>
|
||||
#include "ss.hpp"
|
||||
#include <fstream>
|
||||
#include <random>
|
||||
#include <stdexcept>
|
||||
#include "WifiRegs.hpp"
|
||||
#include "ChannelInfo.hpp"
|
||||
#include "DBusLog.hpp"
|
||||
|
||||
using namespace pipedal;
|
||||
P2pSettings::P2pSettings(const std::filesystem::path&configDirectoryPath)
|
||||
{
|
||||
this->configDirectoryPath = configDirectoryPath;
|
||||
|
||||
}
|
||||
|
||||
static const char*hexDigits = "0123456789abcdef";
|
||||
std::string MakeBssid()
|
||||
{
|
||||
// "de:a6:32:d4:a1:66"
|
||||
std::random_device rDev;
|
||||
std::uniform_int_distribution<uint8_t> dist(0,255);
|
||||
uint8_t bssid[6];
|
||||
|
||||
for (size_t i = 0; i < 6; ++i)
|
||||
{
|
||||
bssid[i] = dist(rDev);
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
bool firstTime = true;
|
||||
|
||||
for (size_t i = 0; i < 6; ++i)
|
||||
{
|
||||
if (!firstTime)
|
||||
{
|
||||
ss << ':';
|
||||
}
|
||||
firstTime = false;
|
||||
ss << hexDigits[(bssid[i] >> 4) & 0x0F];
|
||||
ss << hexDigits[(bssid[i] >> 0) & 0x0F];
|
||||
|
||||
}
|
||||
return ss.str();
|
||||
|
||||
}
|
||||
void P2pSettings::Load()
|
||||
{
|
||||
bool configChanged = true;
|
||||
|
||||
// load our json config.
|
||||
{
|
||||
auto filename = config_filename();
|
||||
if (std::filesystem::exists(filename))
|
||||
{
|
||||
try {
|
||||
std::ifstream f;
|
||||
f.open(filename);
|
||||
if (!f)
|
||||
{
|
||||
throw std::runtime_error(SS("Can't open file."));
|
||||
}
|
||||
try {
|
||||
json_reader reader{f};
|
||||
reader.read(this);
|
||||
configChanged = false;
|
||||
} catch (const std::exception &e)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
} catch (const std::exception &e)
|
||||
{
|
||||
throw std::runtime_error(SS(e.what() << " (" << filename.string() << ")"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (this->bssid_.length() == 0)
|
||||
{
|
||||
configChanged = true;
|
||||
this->bssid_ = MakeBssid();
|
||||
}
|
||||
// copy UI settings into our settings.
|
||||
WifiDirectConfigSettings wifiDirectSettings; // settings from the UI.
|
||||
wifiDirectSettings.Load();
|
||||
|
||||
valid_ = false;
|
||||
if (!wifiDirectSettings.valid_)
|
||||
{
|
||||
LogError("NMP2PSettings","Load","Wifi Direct Config Settings are not valid.");
|
||||
return;
|
||||
}
|
||||
if (!wifiDirectSettings.enable_)
|
||||
{
|
||||
LogError("NMP2PSettings","Load","Wifi Direct service is not enabled.");
|
||||
return;
|
||||
}
|
||||
valid_ = true;
|
||||
bool updateRegClass = false;
|
||||
if (this->country_ != wifiDirectSettings.countryCode_)
|
||||
{
|
||||
this->country_ = wifiDirectSettings.countryCode_;
|
||||
configChanged = true;
|
||||
updateRegClass = true;
|
||||
}
|
||||
{
|
||||
int channel = 1;
|
||||
std::stringstream ss(wifiDirectSettings.channel_);
|
||||
ss >> channel;
|
||||
|
||||
if (this->op_channel_ != channel || this->listen_channel_ != channel)
|
||||
{
|
||||
updateRegClass = true;
|
||||
configChanged = true;
|
||||
}
|
||||
this->op_channel_ = channel;
|
||||
this->listen_channel_ = channel;
|
||||
if (updateRegClass || this->listen_reg_class_ == 0 || this->op_reg_class_ == 0)
|
||||
{
|
||||
// todo: we currently ignore 80khz ac channels (which pi supports)
|
||||
//
|
||||
int32_t reg_class = 0;
|
||||
if (channel == 0) // don't force a channel
|
||||
{
|
||||
reg_class = 0;
|
||||
} else {
|
||||
reg_class = getWifiRegClass(this->country_,channel,40);
|
||||
if (reg_class == -1)
|
||||
{
|
||||
throw std::runtime_error(SS("Wifi Channel " << channel << " is not allowed in country " << this->country_));
|
||||
}
|
||||
}
|
||||
configChanged |= this->op_reg_class_ != reg_class;
|
||||
configChanged |= this->listen_reg_class_ != reg_class;
|
||||
|
||||
this->op_reg_class_ = reg_class;
|
||||
this->listen_reg_class_ = reg_class;
|
||||
}
|
||||
}
|
||||
if (updateRegClass)
|
||||
{
|
||||
}
|
||||
|
||||
if (wifiDirectSettings.hotspotName_ != this->device_name_)
|
||||
{
|
||||
configChanged = true;
|
||||
this->device_name_ = wifiDirectSettings.hotspotName_;
|
||||
this->auth_changed_ = true;
|
||||
}
|
||||
if (this->pin_ != wifiDirectSettings.pin_)
|
||||
{
|
||||
configChanged = true;
|
||||
this->auth_changed_ = true;
|
||||
this->pin_ = wifiDirectSettings.pin_;
|
||||
}
|
||||
if (this->wlan_ != wifiDirectSettings.wlan_)
|
||||
{
|
||||
configChanged = true;
|
||||
this->auth_changed_ = true;
|
||||
this->wlan_ = wifiDirectSettings.wlan_;
|
||||
}
|
||||
|
||||
ServiceConfiguration serviceConfiguration;
|
||||
serviceConfiguration.Load();
|
||||
if ((int)serviceConfiguration.server_port != this->web_server_port_)
|
||||
{
|
||||
configChanged = true;
|
||||
this->web_server_port_ = (int)serviceConfiguration.server_port;
|
||||
}
|
||||
if (this->service_uuid() != serviceConfiguration.uuid)
|
||||
{
|
||||
configChanged = true;
|
||||
this->service_uuid_ = serviceConfiguration.uuid;
|
||||
}
|
||||
|
||||
if (wifiDirectSettings.pinChanged_)
|
||||
{
|
||||
wifiDirectSettings.pinChanged_ = false;
|
||||
wifiDirectSettings.Save();
|
||||
}
|
||||
if (configChanged)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
|
||||
}
|
||||
void P2pSettings::Save()
|
||||
{
|
||||
auto filename = config_filename();
|
||||
try {
|
||||
std::ofstream f(filename);
|
||||
if (!f)
|
||||
{
|
||||
throw std::runtime_error("Can't write to file.");
|
||||
}
|
||||
json_writer writer{f,false};
|
||||
writer.write(this);
|
||||
} catch (const std::exception &e)
|
||||
{
|
||||
throw std::runtime_error(SS(e.what() << " (" << filename.string() << ")"));
|
||||
}
|
||||
}
|
||||
|
||||
int32_t P2pSettings::op_frequency() const
|
||||
{
|
||||
return wifiChannelToFrequency(this->op_channel_);
|
||||
|
||||
}
|
||||
JSON_MAP_BEGIN(P2pSettings)
|
||||
JSON_MAP_REFERENCE(P2pSettings,wlan)
|
||||
JSON_MAP_REFERENCE(P2pSettings,driver)
|
||||
JSON_MAP_REFERENCE(P2pSettings,bssid)
|
||||
JSON_MAP_REFERENCE(P2pSettings,country)
|
||||
JSON_MAP_REFERENCE(P2pSettings,persistent_reconnect)
|
||||
JSON_MAP_REFERENCE(P2pSettings,config_methods)
|
||||
JSON_MAP_REFERENCE(P2pSettings,manufacturer)
|
||||
JSON_MAP_REFERENCE(P2pSettings,model_name)
|
||||
JSON_MAP_REFERENCE(P2pSettings,model_number)
|
||||
JSON_MAP_REFERENCE(P2pSettings,serial_number)
|
||||
JSON_MAP_REFERENCE(P2pSettings,pin)
|
||||
JSON_MAP_REFERENCE(P2pSettings,service_uuid)
|
||||
JSON_MAP_REFERENCE(P2pSettings,listen_channel)
|
||||
JSON_MAP_REFERENCE(P2pSettings,listen_reg_class)
|
||||
JSON_MAP_REFERENCE(P2pSettings,op_channel)
|
||||
JSON_MAP_REFERENCE(P2pSettings,op_reg_class)
|
||||
JSON_MAP_REFERENCE(P2pSettings,web_server_port)
|
||||
JSON_MAP_REFERENCE(P2pSettings,device_name)
|
||||
JSON_MAP_REFERENCE(P2pSettings,auth_changed)
|
||||
|
||||
|
||||
JSON_MAP_END()
|
||||
@@ -0,0 +1,87 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <filesystem>
|
||||
#include "json.hpp"
|
||||
|
||||
|
||||
class P2pSettings {
|
||||
// adapter between nm p2p settings, and legacy p2p
|
||||
public:
|
||||
P2pSettings(const std::filesystem::path&configDirectory = "/etc/pipedal/config");
|
||||
|
||||
void Load();
|
||||
void Save();
|
||||
|
||||
private:
|
||||
bool valid_ = false;
|
||||
std::filesystem::path configDirectoryPath;
|
||||
bool auth_changed_ = true;
|
||||
std::vector<uint8_t> device_type_{
|
||||
0x00,0x01, 0x00,0x50,0xF2,0x04, 0x00,0x02 /*"1-0050F204-2";*/
|
||||
};
|
||||
std::string wlan_ = "wlan0";
|
||||
std::string driver_ = "nl80211";
|
||||
std::string bssid_ = "";
|
||||
std::string country_ = "US";
|
||||
bool persistent_reconnect_ = true;
|
||||
std::vector<std::string> config_methods_ = {"display" };
|
||||
std::string manufacturer_ = "PiPedal Project";
|
||||
std::string model_name_ = "PiPedal";
|
||||
std::string model_number_ = "3";
|
||||
std::string serial_number_ = "1";
|
||||
std::string pin_ = "12345678";
|
||||
std::string service_uuid_ = "233e7c60-9f06-40c5-a53a-875279a44751";
|
||||
int32_t op_reg_class_ = 81;
|
||||
int32_t op_channel_ = 1;
|
||||
int32_t listen_channel_ = 1;
|
||||
int32_t listen_reg_class_ = 81;
|
||||
int web_server_port_ = 80;
|
||||
std::string device_name_ = "PiPedalS5";
|
||||
public:
|
||||
bool valid() const { return valid_; }
|
||||
std::string device_name() const { return device_name_; }
|
||||
|
||||
const std::vector<uint8_t>& device_type() const { return device_type_; }
|
||||
bool auth_changed() const { return auth_changed_; }
|
||||
void auth_changed(bool value) { auth_changed_ = value; }
|
||||
std::string wlan() const { return wlan_; }
|
||||
|
||||
std::string driver() const { return driver_; }
|
||||
std::string wpas_config_file() const {
|
||||
// "/etc/pipedal/config/wpa_supplicant/wpa_supplicant-pipedal.conf"; }
|
||||
return (configDirectoryPath / "wpa_supplicant" / "wpa_supplicant-pipedal.conf").string();
|
||||
};
|
||||
|
||||
std::string dnsmasq_config_file() const {
|
||||
// "/etc/pipedal/config/wpa_supplicant/wpa_supplicant-pipedal.conf"; }
|
||||
return (configDirectoryPath / "dnsmasq" / "dnsmasq-pipedal-nm.conf").string();
|
||||
};
|
||||
std::filesystem::path config_filename() const {
|
||||
// "/etc/pipedal/config/wpa_supplicant/wpa_supplicant-pipedal.conf"; }
|
||||
return (configDirectoryPath / "NetworkManagerP2P.json").string();
|
||||
};
|
||||
|
||||
const std::string& bssid() const { return bssid_; }
|
||||
std::string country() const { return country_; }
|
||||
bool persistent_reconnect() const { return persistent_reconnect_; }
|
||||
uint8_t p2p_go_intent() const { return 15; }
|
||||
//const std::vector<std::string>& config_methods() const { return config_methods_;}
|
||||
const std::string& manufacturer() const { return manufacturer_; }
|
||||
const std::string& model_name() const { return model_name_; }
|
||||
const std::string& model_number() const { return model_number_; }
|
||||
const std::string& serial_number() const {return serial_number_; }
|
||||
const std::string& pin() const { return pin_; }
|
||||
|
||||
const std::string &service_uuid() const { return service_uuid_; }
|
||||
int32_t op_reg_class() { return op_reg_class_; }
|
||||
int32_t op_channel() { return op_channel_; } // Should be social channel 1, 6 or 11.
|
||||
int32_t op_frequency() const;
|
||||
|
||||
int32_t listen_reg_class() { return listen_reg_class_; }
|
||||
int32_t listen_channel() { return listen_channel_; /*ch1*/ } // . Should be social channel 1, 6 or 11.
|
||||
|
||||
int web_server_port() { return web_server_port_; }
|
||||
public:
|
||||
DECLARE_JSON_MAP(P2pSettings);
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "NetworkManagerInterfaces.hpp"
|
||||
#include "ss.hpp"
|
||||
|
||||
using namespace impl;
|
||||
|
||||
namespace impl
|
||||
{
|
||||
std::string NetworkManagerStateToString(uint32_t state)
|
||||
{
|
||||
// STUB: Not clear which state enum we're getting.
|
||||
std::stringstream s;
|
||||
s << state;
|
||||
return s.str();
|
||||
}
|
||||
|
||||
std::string NetworkManagerDeviceStateToString(uint32_t state)
|
||||
{
|
||||
#define DEVICE_CASE(name, value) \
|
||||
case value: \
|
||||
return #name;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
DEVICE_CASE(NM_DEVICE_STATE_UNKNOWN, 0)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_UNMANAGED, 10)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_UNAVAILABLE, 20)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_DISCONNECTED, 30)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_PREPARE, 40)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_CONFIG, 50)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_NEED_AUTH, 60)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_IP_CONFIG, 70)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_IP_CHECK, 80)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_SECONDARIES, 90)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_ACTIVATED, 100)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_DEACTIVATING, 110)
|
||||
DEVICE_CASE(NM_DEVICE_STATE_FAILED, 120)
|
||||
default:
|
||||
{
|
||||
std::stringstream s;
|
||||
s << state;
|
||||
return s.str();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
#pragma once
|
||||
|
||||
#include "DBusEvent.hpp"
|
||||
#include "DBusLog.hpp"
|
||||
#include "DBusDispatcher.hpp"
|
||||
|
||||
#include "dbus/hpp/org.freedesktop.NetworkManager.Device.WifiP2P.hpp"
|
||||
#include "dbus/hpp/org.freedesktop.NetworkManager.Device.hpp"
|
||||
#include "dbus/hpp/org.freedesktop.NetworkManager.WifiP2PPeer.hpp"
|
||||
#include "dbus/hpp/org.freedesktop.NetworkManager.hpp"
|
||||
|
||||
namespace impl {
|
||||
extern std::string NetworkManagerStateToString(uint32_t state);
|
||||
std::string NetworkManagerDeviceStateToString(uint32_t state);
|
||||
};
|
||||
|
||||
class NetworkManager : public sdbus::ProxyInterfaces<org::freedesktop::NetworkManager_proxy>
|
||||
{
|
||||
public:
|
||||
using ptr = std::unique_ptr<NetworkManager>;
|
||||
NetworkManager(DBusDispatcher &dispatcher)
|
||||
: sdbus::ProxyInterfaces<org::freedesktop::NetworkManager_proxy>(
|
||||
dispatcher.Connection(),
|
||||
INTERFACE_NAME,
|
||||
"/org/freedesktop/NetworkManager")
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
virtual ~NetworkManager()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
|
||||
static ptr Create(DBusDispatcher &dispatcher) { return std::make_unique<NetworkManager>(dispatcher); }
|
||||
DBusEvent<> OnCheckPermissions;
|
||||
DBusEvent<uint32_t> OnStateChanged;
|
||||
DBusEvent<const sdbus::ObjectPath &> OnDeviceAdded;
|
||||
DBusEvent<const sdbus::ObjectPath &> OnDeviceRemoved;
|
||||
|
||||
private:
|
||||
void EventTrace(const char*method, const std::string &message) {
|
||||
LogTrace(getObjectPath(),method,message);
|
||||
}
|
||||
virtual void onStateChanged(const uint32_t &state) {
|
||||
EventTrace("onStateChanged",impl::NetworkManagerStateToString(state));
|
||||
OnStateChanged.fire(state);
|
||||
}
|
||||
|
||||
virtual void onCheckPermissions() { OnCheckPermissions.fire(); }
|
||||
|
||||
virtual void onDeviceAdded(const sdbus::ObjectPath &device_path) {
|
||||
EventTrace("onDeviceAdded",device_path.c_str());
|
||||
OnDeviceAdded.fire(device_path);
|
||||
}
|
||||
virtual void onDeviceRemoved(const sdbus::ObjectPath &device_path) {
|
||||
EventTrace("onDeviceRemoved",device_path.c_str());
|
||||
|
||||
OnDeviceRemoved.fire(device_path);
|
||||
}
|
||||
};
|
||||
|
||||
class Device : public sdbus::ProxyInterfaces<org::freedesktop::NetworkManager::Device_proxy>
|
||||
{
|
||||
public:
|
||||
using ptr = std::unique_ptr<Device>;
|
||||
Device(DBusDispatcher &dispatcher, const sdbus::ObjectPath &path)
|
||||
: sdbus::ProxyInterfaces<org::freedesktop::NetworkManager::Device_proxy>(
|
||||
dispatcher.Connection(),
|
||||
"org.freedesktop.NetworkManager",
|
||||
path)
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
virtual ~Device()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
|
||||
static ptr Create(DBusDispatcher &dispatcher, const sdbus::ObjectPath &path)
|
||||
{
|
||||
return std::make_unique<Device>(dispatcher, path);
|
||||
}
|
||||
DBusEvent<uint32_t, uint32_t, uint32_t> OnStateChanged;
|
||||
|
||||
private:
|
||||
const uint32_t NM_DEVICE_TYPE_WIFI_P2P = 30; // from lbnm-dev package.
|
||||
public:
|
||||
bool IsP2pDevice()
|
||||
{
|
||||
return this->DeviceType() == NM_DEVICE_TYPE_WIFI_P2P;
|
||||
}
|
||||
|
||||
private:
|
||||
void EventTrace(const char*method, const std::string &message) {
|
||||
LogTrace(getObjectPath(),method,message);
|
||||
}
|
||||
|
||||
virtual void onStateChanged(const uint32_t &new_state, const uint32_t &old_state, const uint32_t &reason)
|
||||
{
|
||||
EventTrace("onStateChanged",impl::NetworkManagerDeviceStateToString(new_state));
|
||||
|
||||
OnStateChanged.fire(new_state, old_state, reason);
|
||||
}
|
||||
};
|
||||
class WifiP2P : public sdbus::ProxyInterfaces<
|
||||
org::freedesktop::NetworkManager::Device::WifiP2P_proxy
|
||||
>
|
||||
{
|
||||
public:
|
||||
using ptr = std::unique_ptr<WifiP2P>;
|
||||
using base = sdbus::ProxyInterfaces<
|
||||
org::freedesktop::NetworkManager::Device::WifiP2P_proxy
|
||||
>;
|
||||
|
||||
WifiP2P(DBusDispatcher &dispatcher, const std::string &objectPath)
|
||||
: base(dispatcher.Connection(), "org.freedesktop.NetworkManager", objectPath)
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
virtual ~WifiP2P()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
static ptr Create(DBusDispatcher &dispatcher, const std::string &objectPath)
|
||||
{
|
||||
return std::make_unique<WifiP2P>(dispatcher, objectPath);
|
||||
}
|
||||
DBusEvent<const sdbus::ObjectPath &> OnPeerAdded;
|
||||
DBusEvent<const sdbus::ObjectPath &> OnPeerRemoved;
|
||||
DBusEvent<uint32_t> OnStateChanged;
|
||||
|
||||
private:
|
||||
void EventTrace(const char*method, const std::string &message) {
|
||||
LogTrace(getObjectPath(),method,message);
|
||||
}
|
||||
virtual void onStateChanged(const uint32_t &new_state, const uint32_t &old_state, const uint32_t &reason)
|
||||
{
|
||||
EventTrace("onStateChanged",impl::NetworkManagerStateToString(new_state));
|
||||
|
||||
OnStateChanged.fire(new_state);
|
||||
}
|
||||
|
||||
virtual void onPeerAdded(const sdbus::ObjectPath &peer)
|
||||
{
|
||||
EventTrace("onPeerAdded",peer);
|
||||
OnPeerAdded.fire(peer);
|
||||
}
|
||||
virtual void onPeerRemoved(const sdbus::ObjectPath &peer)
|
||||
{
|
||||
EventTrace("onPeerRemoved",peer);
|
||||
OnPeerRemoved.fire(peer);
|
||||
}
|
||||
};
|
||||
|
||||
class WifiP2PPeer : public sdbus::ProxyInterfaces<org::freedesktop::NetworkManager::WifiP2PPeer_proxy>
|
||||
{
|
||||
public:
|
||||
using self=WifiP2PPeer;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
|
||||
WifiP2PPeer(DBusDispatcher &dispatcher, const sdbus::ObjectPath &objectPath)
|
||||
: sdbus::ProxyInterfaces<org::freedesktop::NetworkManager::WifiP2PPeer_proxy>(
|
||||
dispatcher.Connection(), "org.freedesktop.NetworkManager", objectPath)
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
virtual ~WifiP2PPeer()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
static ptr Create(DBusDispatcher &dispatcher, const sdbus::ObjectPath &objectPath)
|
||||
{
|
||||
return std::make_unique<self>(dispatcher, objectPath);
|
||||
}
|
||||
DBusEvent<const sdbus::ObjectPath &> OnPeerAdded;
|
||||
DBusEvent<const sdbus::ObjectPath &> OnPeerRemoved;
|
||||
|
||||
private:
|
||||
virtual void onPeerAdded(const sdbus::ObjectPath &peer)
|
||||
{
|
||||
OnPeerAdded.fire(peer);
|
||||
}
|
||||
virtual void onPeerRemoved(const sdbus::ObjectPath &peer)
|
||||
{
|
||||
OnPeerRemoved.fire(peer);
|
||||
}
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
||||
class P2PManager {
|
||||
protected:
|
||||
P2PManager() { }
|
||||
public:
|
||||
using self=P2PManager;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
|
||||
static ptr Create();
|
||||
|
||||
virtual ~P2PManager() {}
|
||||
|
||||
virtual bool Init() = 0;
|
||||
virtual void Run() = 0;
|
||||
virtual void Stop() = 0;
|
||||
virtual bool IsFinished() = 0;
|
||||
virtual void Wait() = 0;
|
||||
virtual bool ReloadRequested() = 0;
|
||||
virtual bool TerminatedNormally() = 0;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
||||
class P2PManager {
|
||||
protected:
|
||||
P2PManager() { }
|
||||
public:
|
||||
using self=P2PManager;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
|
||||
static ptr Create();
|
||||
|
||||
virtual ~P2PManager() {}
|
||||
|
||||
virtual void Init() = 0;
|
||||
virtual void Run() = 0;
|
||||
virtual void Stop() = 0;
|
||||
virtual bool IsFinished() = 0;
|
||||
virtual void Wait() = 0;
|
||||
virtual bool ReloadRequested() = 0;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
#include "SignalHandler.hpp"
|
||||
|
||||
#include <csignal>
|
||||
#include <atomic>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
static int ToOsSignalType(SignalHandler::SignalType signalType)
|
||||
{
|
||||
int result;
|
||||
switch (signalType)
|
||||
{
|
||||
case SignalHandler::Terminate: result = SIGTERM; break;
|
||||
case SignalHandler::SegmentationFault: result = SIGSEGV; break;
|
||||
case SignalHandler::Interrupt: result = SIGINT; break;
|
||||
case SignalHandler::IllegalInstruction: result = SIGILL; break;
|
||||
case SignalHandler::Abort: result = SIGABRT; break;
|
||||
case SignalHandler::FloatingPointError: return SIGFPE; break;
|
||||
case SignalHandler::Hangup: result = SIGHUP; break;
|
||||
|
||||
default:
|
||||
throw std::runtime_error("INvalid signal type");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void SignalHandler::HandleSignal(SignalHandler::SignalType signal, SignalCallback&&callback)
|
||||
{
|
||||
int osSignal = ToOsSignalType(signal);
|
||||
if (osSignal > MAX_SIGNAL)
|
||||
{
|
||||
throw std::runtime_error("MAX_SIGNAL isn't large enough.");
|
||||
}
|
||||
|
||||
handlers[osSignal] = std::move(callback);
|
||||
std::signal(osSignal,OnSignal);
|
||||
}
|
||||
|
||||
void SignalHandler::UnhandleSignal(SignalHandler::SignalType signal)
|
||||
{
|
||||
int osSignal = ToOsSignalType(signal);
|
||||
std::atomic_signal_fence(std::memory_order::release);
|
||||
std::signal(osSignal,SIG_DFL);
|
||||
handlers[osSignal] = std::function<void(void)>();
|
||||
}
|
||||
|
||||
void SignalHandler::IgnoreSignal(SignalHandler::SignalType signal)
|
||||
{
|
||||
int osSignal = ToOsSignalType(signal);
|
||||
std::signal(osSignal,SIG_IGN);
|
||||
handlers[osSignal] = std::function<void(void)>();
|
||||
}
|
||||
|
||||
void SignalHandler::OnSignal(int osSignal)
|
||||
{
|
||||
std::atomic_signal_fence(std::memory_order::acquire);
|
||||
handlers[osSignal]();
|
||||
}
|
||||
|
||||
SignalHandler::SignalCallback SignalHandler::handlers[MAX_SIGNAL];
|
||||
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <atomic>
|
||||
|
||||
class SignalHandler {
|
||||
public:
|
||||
// Signal type. Limited to signal types supported by <csignal>
|
||||
enum SignalType
|
||||
{
|
||||
Terminate, //SIGTERM
|
||||
SegmentationFault, //SIGSEGV
|
||||
Interrupt, // SIGINT External interrupt executed by user.
|
||||
IllegalInstruction, // SIGILL
|
||||
Abort, // SIGABORT
|
||||
FloatingPointError, // SIGFPE.
|
||||
Hangup, // SIGHUP
|
||||
};
|
||||
using SignalCallback = std::function<void ()>;
|
||||
|
||||
static void HandleSignal(SignalType signal, SignalCallback&&fn);
|
||||
static void UnhandleSignal(SignalType signal);
|
||||
static void IgnoreSignal(SignalType signal);
|
||||
private:
|
||||
static void OnSignal(int osSignal);
|
||||
static const int MAX_SIGNAL = 64;
|
||||
static SignalCallback handlers[MAX_SIGNAL];
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
#include "Sudo.hpp"
|
||||
#include "unistd.h"
|
||||
#include "sys/types.h"
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
|
||||
bool IsSudo()
|
||||
{
|
||||
return (geteuid() == 0);
|
||||
}
|
||||
void ExecWithSudo(int argc, char**argv)
|
||||
{
|
||||
std::vector<const char*> newArgs;
|
||||
newArgs.reserve(argc+2);
|
||||
newArgs.push_back("sudo");
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
newArgs.push_back(argv[i]);
|
||||
}
|
||||
newArgs.push_back(nullptr);
|
||||
|
||||
execvp("sudo",(char*const*)&newArgs[0]);
|
||||
throw std::runtime_error("Failed to restart with sudo.");
|
||||
}
|
||||
|
||||
void ForceSudo(int argc, char**argv)
|
||||
{
|
||||
if (IsSudo()) return;
|
||||
ExecWithSudo(argc,argv);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
extern bool IsSudo();
|
||||
extern void ExecWithSudo(int argc, char**argv);
|
||||
extern void ForceSudo(int argc, char**argv);
|
||||
@@ -0,0 +1,366 @@
|
||||
#include "WpaInterfaces.hpp"
|
||||
#include "ss.hpp"
|
||||
#include "DBusLog.hpp"
|
||||
|
||||
void Interface_proxy_withevents::EventTrace(const char *methodName, const std::string &message)
|
||||
{
|
||||
::LogTrace(proxy.getObjectPath(), methodName, message);
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onScanDone(const bool &success)
|
||||
{
|
||||
this->EventTrace("onScanDone", SS("ScanDone " << success));
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onBSSAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
// too chatty
|
||||
// this->LogTrace("onBSSAdded", "");
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onBSSRemoved(const sdbus::ObjectPath &path)
|
||||
{
|
||||
// too chatty.
|
||||
// this->LogTrace("onBSSRemoved", "");
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onBlobAdded(const std::string &name)
|
||||
{
|
||||
this->EventTrace("onBlobAdded", "");
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onBlobRemoved(const std::string &name)
|
||||
{
|
||||
this->EventTrace("onBlobRemoved", "");
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onNetworkAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << properties;
|
||||
EventTrace("onNetworkAdded",
|
||||
SS(path.c_str() << ss.str()));
|
||||
OnNetworkAdded.fire(path, properties);
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onNetworkRemoved(const sdbus::ObjectPath &path)
|
||||
{
|
||||
EventTrace("onNetworkRemoved",
|
||||
path);
|
||||
OnNetworkRemoved.fire(path);
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onNetworkSelected(const sdbus::ObjectPath &path)
|
||||
{
|
||||
EventTrace("onNetworkSelected",
|
||||
path);
|
||||
OnNetworkSelected.fire(path);
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onPropertiesChanged(const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onProbeRequest(const std::map<std::string, sdbus::Variant> &args)
|
||||
{
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onCertification(const std::map<std::string, sdbus::Variant> &certification)
|
||||
{
|
||||
EventTrace("onCertification",
|
||||
"");
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onEAP(const std::string &status, const std::string ¶meter)
|
||||
{
|
||||
EventTrace("onEAP",
|
||||
SS("status: " << status << " parameter: " << parameter));
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onStaAuthorized(const std::string &name)
|
||||
{
|
||||
EventTrace("onStaAuthorized",
|
||||
SS("name: " << name));
|
||||
OnStaAuthorized.fire(name);
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onStaDeauthorized(const std::string &name)
|
||||
{
|
||||
EventTrace("onStaDeauthorized",
|
||||
SS("name: " << name));
|
||||
OnStaDeauthorized.fire(name);
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onStationAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << properties;
|
||||
EventTrace("onStationAdded",
|
||||
SS("path: " << path.c_str() << " properties: " << ss.str()));
|
||||
OnStationAdded.fire(path, properties);
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onStationRemoved(const sdbus::ObjectPath &path)
|
||||
{
|
||||
EventTrace("onStationRemoved",
|
||||
SS("path: " << path.c_str()));
|
||||
OnStationRemoved.fire(path);
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onNetworkRequest(const sdbus::ObjectPath &path, const std::string &field, const std::string &text)
|
||||
{
|
||||
EventTrace("onNetworkRequest",
|
||||
SS("path: " << path.c_str() << " field: " << field << " text: " << text));
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onInterworkingAPAdded(const sdbus::ObjectPath &bss, const sdbus::ObjectPath &cred, const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
EventTrace("onInterworkingAPAdded",
|
||||
"");
|
||||
}
|
||||
|
||||
void Interface_proxy_withevents::onInterworkingSelectDone()
|
||||
{
|
||||
EventTrace("onInterworkingSelectDone",
|
||||
"");
|
||||
}
|
||||
|
||||
void WpaP2PDevice::onDeviceFound(const sdbus::ObjectPath &path)
|
||||
{
|
||||
EventTrace("onDeviceFound",
|
||||
path.c_str());
|
||||
}
|
||||
void WpaP2PDevice::onDeviceFoundProperties(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << properties;
|
||||
EventTrace("onDeviceFoundProperties",
|
||||
[this, &path, &properties]()
|
||||
{
|
||||
return std::string();
|
||||
// return SS("path: " << path.c_str() << "properties: " << ss.str())
|
||||
});
|
||||
}
|
||||
}
|
||||
void WpaP2PDevice::onDeviceLost(const sdbus::ObjectPath &path)
|
||||
{
|
||||
EventTrace("onDeviceLost",
|
||||
path.c_str());
|
||||
}
|
||||
void WpaP2PDevice::onProvisionDiscoveryResponseDisplayPin(const sdbus::ObjectPath &peer_object, const std::string &pin)
|
||||
{
|
||||
EventTrace("onProvisionDiscoveryResponseDisplayPin",
|
||||
SS("peer: " << peer_object.c_str()));
|
||||
}
|
||||
void WpaP2PDevice::onProvisionDiscoveryRequestEnterPin(const sdbus::ObjectPath &peer_object)
|
||||
{
|
||||
EventTrace("onProvisionDiscoveryRequestEnterPin",
|
||||
SS("peer: " << peer_object.c_str()));
|
||||
OnProvisionDiscoveryEnterPin.fire(peer_object);
|
||||
}
|
||||
void WpaP2PDevice::onProvisionDiscoveryResponseEnterPin(const sdbus::ObjectPath &peer_object)
|
||||
{
|
||||
EventTrace("onProvisionDiscoveryResponseEnterPin",
|
||||
SS("peer: " << peer_object.c_str()));
|
||||
}
|
||||
void WpaP2PDevice::onProvisionDiscoveryPBCRequest(const sdbus::ObjectPath &peer_object)
|
||||
{
|
||||
EventTrace("onProvisionDiscoveryPBCRequest",
|
||||
SS("peer: " << peer_object.c_str()));
|
||||
}
|
||||
void WpaP2PDevice::onProvisionDiscoveryPBCResponse(const sdbus::ObjectPath &peer_object)
|
||||
{
|
||||
EventTrace("onProvisionDiscoveryPBCRequest",
|
||||
SS("peer: " << peer_object.c_str()));
|
||||
}
|
||||
void WpaP2PDevice::onInvitationResult(const std::map<std::string, sdbus::Variant> &invite_result)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << invite_result;
|
||||
EventTrace("onInvitationResult",
|
||||
SS("invite_result: " << ss.str()));
|
||||
}
|
||||
OnInvitationResult.fire(invite_result);
|
||||
}
|
||||
void WpaP2PDevice::onGroupFinished(const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << properties;
|
||||
EventTrace("onGroupFinished",
|
||||
SS("properties: " << ss.str()));
|
||||
|
||||
}
|
||||
OnGroupFinished.fire(properties);
|
||||
}
|
||||
void WpaP2PDevice::onServiceDiscoveryRequest(const std::map<std::string, sdbus::Variant> &sd_request)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << sd_request;
|
||||
EventTrace("onServiceDiscoveryRequest",
|
||||
SS("properties: " << ss.str()));
|
||||
|
||||
}
|
||||
OnServiceDiscoveryRequest.fire(sd_request);
|
||||
}
|
||||
void WpaP2PDevice::onServiceDiscoveryResponse(const std::map<std::string, sdbus::Variant> &sd_response)
|
||||
{
|
||||
EventTrace("onServiceDiscoveryResponse", "");
|
||||
}
|
||||
void WpaP2PDevice::onWpsFailed(const std::string &name, const std::map<std::string, sdbus::Variant> &args)
|
||||
{
|
||||
EventTrace("onWpsFailed",
|
||||
SS("name: " << name));
|
||||
OnWpsFailed.fire(name, args);
|
||||
}
|
||||
void WpaP2PDevice::onInvitationReceived(const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream s;
|
||||
s << properties;
|
||||
EventTrace("onInvitationReceived", SS("properties: " << s.str()));
|
||||
}
|
||||
OnInvitationReceived.fire(properties);
|
||||
}
|
||||
|
||||
void WpaWPS::onPropertiesChanged(const std::map<std::string, sdbus::Variant> &properties) {}
|
||||
|
||||
void WpaWPS::onCredentials(const std::map<std::string, sdbus::Variant> &credentials)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream s;
|
||||
s << credentials;
|
||||
LogTrace(getObjectPath(), "onCredentials", SS("credentials: " << s.str()));
|
||||
}
|
||||
}
|
||||
|
||||
void WpaP2PDevice::onGroupStarted(const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream s;
|
||||
s << properties;
|
||||
LogTrace(this->getObjectPath(), "onGroupStarted", SS("properties: " << s.str()));
|
||||
}
|
||||
OnGroupStarted.fire(properties);
|
||||
}
|
||||
void WpaP2PDevice::onGroupFormationFailure(const std::string &reason)
|
||||
{
|
||||
LogTrace(this->getObjectPath(), "onGroupFormationFailure", SS("reason:" << reason));
|
||||
OnGroupFormationFailure.fire(reason);
|
||||
}
|
||||
void WpaP2PDevice::onGONegotiationSuccess(const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream s;
|
||||
s << properties;
|
||||
LogTrace(this->getObjectPath(), "onGONegotiationSuccess", SS("properties: " << s.str()));
|
||||
}
|
||||
OnGONegotiationSuccess.fire(properties);
|
||||
}
|
||||
void WpaP2PDevice::onGONegotiationFailure(const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream s;
|
||||
s << properties;
|
||||
|
||||
LogTrace(this->getObjectPath(), "onGONegotiationFailure", SS("properties: " << s.str()));
|
||||
}
|
||||
OnGONegotiationFailure.fire(properties);
|
||||
}
|
||||
void WpaP2PDevice::onGONegotiationRequest(const sdbus::ObjectPath &path, const uint16_t &dev_passwd_id, const uint8_t &device_go_intent)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
|
||||
LogTrace(this->getObjectPath(), "onGONegotiationRequest", SS(" path: " << path.c_str() << " dev_passwd_id: " << dev_passwd_id << " device_go_intent: " << (int32_t)device_go_intent));
|
||||
}
|
||||
}
|
||||
|
||||
void WpaP2PDevice::onProvisionDiscoveryRequestDisplayPin(const sdbus::ObjectPath &peer_object, const std::string &pin)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
|
||||
EventTrace("onProvisionDiscoveryRequestDisplayPin", SS("peer: " << peer_object.c_str() << " pin: " << pin));
|
||||
}
|
||||
OnProvisionDiscoveryRequestDisplayPin.fire(peer_object, pin);
|
||||
}
|
||||
|
||||
void WpaP2PDevice::onPersistentGroupAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream s;
|
||||
s << properties;
|
||||
std::string propertiesString = s.str();
|
||||
EventTrace("onPersistentGroupAdded", SS("path: " << path.c_str() << " properties: " << propertiesString));
|
||||
}
|
||||
OnPersistentGroupAdded.fire(path, properties);
|
||||
}
|
||||
void WpaP2PDevice::onPersistentGroupRemoved(const sdbus::ObjectPath &path)
|
||||
{
|
||||
EventTrace("onPersistentGroupRemoved", SS("path: " << path.c_str()));
|
||||
OnPersistentGroupRemoved.fire(path);
|
||||
}
|
||||
|
||||
void WpaP2PDevice::onFindStopped()
|
||||
{
|
||||
EventTrace("onFindStopped", "");
|
||||
}
|
||||
|
||||
void WpaP2PDevice::onProvisionDiscoveryFailure(const sdbus::ObjectPath &peer_object, const int32_t &status)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
EventTrace("onProvisionDiscoveryFailure", SS("object: " << peer_object << " status: " << status));
|
||||
}
|
||||
}
|
||||
|
||||
void WpaWPS::onEvent(const std::string &name, const std::map<std::string, sdbus::Variant> &args)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << args;
|
||||
LogTrace(getObjectPath(), "onEvent", SS("object: " << name << " status: " << ss.str()));
|
||||
}
|
||||
}
|
||||
|
||||
void WpaSupplicant::onInterfaceAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties)
|
||||
{
|
||||
if (IsDBusLoggingEnabled(DBusLogLevel::Trace))
|
||||
{
|
||||
|
||||
std::stringstream ss;
|
||||
ss << properties;
|
||||
LogTrace("onInterfaceAdded",
|
||||
SS("path: " << path.c_str()
|
||||
//<< " properties: {" << ss.str() << "}"
|
||||
));
|
||||
}
|
||||
|
||||
OnInterfaceAdded.fire(path, properties);
|
||||
}
|
||||
void WpaSupplicant::onInterfaceRemoved(const sdbus::ObjectPath &path)
|
||||
{
|
||||
LogTrace("onInterfaceRemoved",
|
||||
SS("path: " << path.c_str()));
|
||||
OnInterfaceRemoved.fire(path);
|
||||
}
|
||||
|
||||
void WpaP2PDevice::EventTrace(const char *eventName, const std::function<std::string()> &getText)
|
||||
{
|
||||
::LogTrace(this->getObjectPath(), eventName, getText);
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
#pragma once
|
||||
#include "dbus/hpp/fi.w1.wpa_supplicant1.hpp"
|
||||
#include "dbus/hpp/f1.w1.wpa_supplicant1.Interfaces.hpp"
|
||||
#include "dbus/hpp/f1.w1.wpa_supplicant1.Peer.hpp"
|
||||
#include "dbus/hpp/f1.w1.wpa_supplicant1.Group.hpp"
|
||||
#include "dbus/hpp/org.freedesktop.DBus.Properties.hpp"
|
||||
#include "DBusLog.hpp"
|
||||
#include "DBusEvent.hpp"
|
||||
#include "DBusVariantHelper.hpp"
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
|
||||
class Interface_proxy_withevents : public fi::w1::wpa_supplicant1::Interface_proxy
|
||||
{
|
||||
public:
|
||||
using base = fi::w1::wpa_supplicant1::Interface_proxy;
|
||||
|
||||
Interface_proxy_withevents(sdbus::IProxy &proxy)
|
||||
: base(proxy), proxy(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
DBusEvent<const sdbus::ObjectPath &, const std::map<std::string, sdbus::Variant> &>
|
||||
OnNetworkAdded;
|
||||
|
||||
DBusEvent<const sdbus::ObjectPath &> OnNetworkRemoved;
|
||||
DBusEvent<const sdbus::ObjectPath &> OnNetworkSelected;
|
||||
DBusEvent<const sdbus::ObjectPath &, const std::map<std::string, sdbus::Variant> &> OnStationAdded;
|
||||
DBusEvent<const sdbus::ObjectPath &> OnStationRemoved;
|
||||
DBusEvent<const std::string &> OnStaAuthorized;
|
||||
DBusEvent<const std::string &> OnStaDeauthorized;
|
||||
|
||||
DBusEvent<const sdbus::ObjectPath &, const std::map<std::string, sdbus::Variant> &> OnInterworkingAPAdded;
|
||||
DBusEvent<> OnInterworkingSelectDone;
|
||||
|
||||
protected:
|
||||
void EventTrace(const char *methodName, const std::string &message);
|
||||
private:
|
||||
sdbus::IProxy &proxy;
|
||||
|
||||
protected:
|
||||
virtual void onScanDone(const bool &success);
|
||||
virtual void onBSSAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onBSSRemoved(const sdbus::ObjectPath &path);
|
||||
virtual void onBlobAdded(const std::string &name);
|
||||
virtual void onBlobRemoved(const std::string &name);
|
||||
virtual void onNetworkAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onNetworkRemoved(const sdbus::ObjectPath &path);
|
||||
virtual void onNetworkSelected(const sdbus::ObjectPath &path);
|
||||
virtual void onPropertiesChanged(const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onProbeRequest(const std::map<std::string, sdbus::Variant> &args);
|
||||
virtual void onCertification(const std::map<std::string, sdbus::Variant> &certification);
|
||||
virtual void onEAP(const std::string &status, const std::string ¶meter);
|
||||
virtual void onStaAuthorized(const std::string &name);
|
||||
virtual void onStaDeauthorized(const std::string &name);
|
||||
virtual void onStationAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onStationRemoved(const sdbus::ObjectPath &path);
|
||||
virtual void onNetworkRequest(const sdbus::ObjectPath &path, const std::string &field, const std::string &text);
|
||||
virtual void onInterworkingAPAdded(const sdbus::ObjectPath &bss, const sdbus::ObjectPath &cred, const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onInterworkingSelectDone();
|
||||
};
|
||||
|
||||
class WpaInterface
|
||||
: public sdbus::ProxyInterfaces<
|
||||
Interface_proxy_withevents>
|
||||
{
|
||||
public:
|
||||
using self = WpaInterface;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
static ptr Create(sdbus::IConnection &connection, const sdbus::ObjectPath &dbusPath) { return std::make_unique<self>(connection, dbusPath); }
|
||||
|
||||
WpaInterface(sdbus::IConnection &connection, const sdbus::ObjectPath &dbusPath)
|
||||
: ProxyInterfaces(connection, "fi.w1.wpa_supplicant1", dbusPath)
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
virtual ~WpaInterface()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
|
||||
protected:
|
||||
void Trace(const char *method, const std::string &msg)
|
||||
{
|
||||
::LogTrace(this->getObjectPath(), method, msg);
|
||||
}
|
||||
};
|
||||
|
||||
class WpaPersistentGroup
|
||||
: public sdbus::ProxyInterfaces<
|
||||
fi::w1::wpa_supplicant1::PersistentGroup_proxy>
|
||||
{
|
||||
public:
|
||||
using self = WpaPersistentGroup;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
|
||||
static ptr Create(sdbus::IConnection &connection, const sdbus::ObjectPath &path) { return std::make_unique<self>(connection, path); }
|
||||
|
||||
WpaPersistentGroup(sdbus::IConnection &connection, const sdbus::ObjectPath &objectPath)
|
||||
: ProxyInterfaces(connection, "fi.w1.wpa_supplicant1", objectPath)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class WpaWPS
|
||||
: public sdbus::ProxyInterfaces<
|
||||
fi::w1::wpa_supplicant1::Interface::WPS_proxy>
|
||||
{
|
||||
public:
|
||||
using self = WpaWPS;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
static ptr Create(sdbus::IProxy &proxy) { return std::make_unique<self>(proxy.getObjectPath()); }
|
||||
static ptr Create(const std::string &path) { return std::make_unique<self>(path); }
|
||||
static ptr Create(sdbus::IConnection &connection, const std::string &path) { return std::make_unique<self>(connection, path); }
|
||||
|
||||
WpaWPS(std::string objectPath)
|
||||
: ProxyInterfaces("fi.w1.wpa_supplicant1", objectPath)
|
||||
{
|
||||
}
|
||||
WpaWPS(sdbus::IConnection &connection, std::string objectPath)
|
||||
: ProxyInterfaces(connection, "fi.w1.wpa_supplicant1", objectPath)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void onEvent(const std::string &name, const std::map<std::string, sdbus::Variant> &args);
|
||||
virtual void onCredentials(const std::map<std::string, sdbus::Variant> &credentials);
|
||||
virtual void onPropertiesChanged(const std::map<std::string, sdbus::Variant> &properties);
|
||||
};
|
||||
|
||||
class WpaPeer
|
||||
: public sdbus::ProxyInterfaces<
|
||||
fi::w1::wpa_supplicant1::Peer_proxy>
|
||||
{
|
||||
public:
|
||||
using self = WpaPeer;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
static ptr Create(sdbus::IConnection &connection, const std::string &dbusPath) { return std::make_unique<self>(connection, dbusPath); }
|
||||
|
||||
WpaPeer(sdbus::IConnection &connection, const std::string &dbusPath)
|
||||
: ProxyInterfaces(connection, "fi.w1.wpa_supplicant1", dbusPath)
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
virtual ~WpaPeer()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void onPropertiesChanged(const std::map<std::string, sdbus::Variant> &properties) {}
|
||||
};
|
||||
|
||||
class WpaP2PDevice
|
||||
: public sdbus::ProxyInterfaces<
|
||||
fi::w1::wpa_supplicant1::Interface::P2PDevice_proxy,
|
||||
Interface_proxy_withevents>
|
||||
{
|
||||
public:
|
||||
using self = WpaP2PDevice;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
static ptr Create(const std::string &dbusPath) { return std::make_unique<self>(dbusPath); }
|
||||
static ptr Create(sdbus::IConnection &connection, const std::string &dbusPath) { return std::make_unique<self>(connection, dbusPath); }
|
||||
|
||||
WpaP2PDevice(const std::string &dbusPath)
|
||||
: ProxyInterfaces("fi.w1.wpa_supplicant1", dbusPath)
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
WpaP2PDevice(sdbus::IConnection &connection, const std::string &dbusPath)
|
||||
: ProxyInterfaces(connection, "fi.w1.wpa_supplicant1", dbusPath)
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
virtual ~WpaP2PDevice()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
void Disconnect()
|
||||
{
|
||||
fi::w1::wpa_supplicant1::Interface::P2PDevice_proxy::Disconnect();
|
||||
}
|
||||
|
||||
public:
|
||||
DBusEvent<const sdbus::ObjectPath &> OnProvisionDiscoveryEnterPin;
|
||||
DBusEvent<const sdbus::ObjectPath &, const std::string &> OnProvisionDiscoveryRequestDisplayPin;
|
||||
DBusEvent<const sdbus::ObjectPath, const std::map<std::string, sdbus::Variant> &> OnPersistentGroupAdded;
|
||||
DBusEvent<const sdbus::ObjectPath &> OnPersistentGroupRemoved;
|
||||
DBusEvent<const std::map<std::string, sdbus::Variant> &> OnGroupStarted;
|
||||
DBusEvent<const std::map<std::string, sdbus::Variant> &> OnGroupFinished;
|
||||
DBusEvent<const std::map<std::string, sdbus::Variant> &> OnServiceDiscoveryRequest;
|
||||
|
||||
DBusEvent<const std::string &> OnGroupFormationFailure;
|
||||
DBusEvent<const std::map<std::string, sdbus::Variant> &> OnGONegotiationSuccess;
|
||||
DBusEvent<const std::map<std::string, sdbus::Variant> &> OnGONegotiationFailure;
|
||||
DBusEvent<const std::string &, const std::map<std::string, sdbus::Variant>> OnWpsFailed;
|
||||
DBusEvent<const std::map<std::string, sdbus::Variant>> OnInvitationResult;
|
||||
DBusEvent<const std::map<std::string, sdbus::Variant> &> OnInvitationReceived;
|
||||
|
||||
private:
|
||||
void EventTrace(const char *methodName, const std::string &message)
|
||||
{
|
||||
Interface_proxy_withevents::EventTrace(methodName,message);
|
||||
}
|
||||
|
||||
void EventTrace(const char *eventName, const std::function<std::string()> &getText);
|
||||
protected:
|
||||
virtual void onDeviceFound(const sdbus::ObjectPath &path);
|
||||
virtual void onDeviceFoundProperties(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onDeviceLost(const sdbus::ObjectPath &path);
|
||||
virtual void onFindStopped();
|
||||
virtual void onProvisionDiscoveryRequestDisplayPin(const sdbus::ObjectPath &peer_object, const std::string &pin);
|
||||
virtual void onProvisionDiscoveryResponseDisplayPin(const sdbus::ObjectPath &peer_object, const std::string &pin);
|
||||
virtual void onProvisionDiscoveryRequestEnterPin(const sdbus::ObjectPath &peer_object);
|
||||
virtual void onProvisionDiscoveryResponseEnterPin(const sdbus::ObjectPath &peer_object);
|
||||
virtual void onProvisionDiscoveryPBCRequest(const sdbus::ObjectPath &peer_object);
|
||||
virtual void onProvisionDiscoveryPBCResponse(const sdbus::ObjectPath &peer_object);
|
||||
virtual void onProvisionDiscoveryFailure(const sdbus::ObjectPath &peer_object, const int32_t &status);
|
||||
|
||||
virtual void onGroupStarted(const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onGroupFormationFailure(const std::string &reason);
|
||||
virtual void onGONegotiationSuccess(const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onGONegotiationFailure(const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onGONegotiationRequest(const sdbus::ObjectPath &path, const uint16_t &dev_passwd_id, const uint8_t &device_go_intent);
|
||||
virtual void onInvitationResult(const std::map<std::string, sdbus::Variant> &invite_result);
|
||||
virtual void onGroupFinished(const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onServiceDiscoveryRequest(const std::map<std::string, sdbus::Variant> &sd_request);
|
||||
virtual void onServiceDiscoveryResponse(const std::map<std::string, sdbus::Variant> &sd_response);
|
||||
virtual void onPersistentGroupAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onPersistentGroupRemoved(const sdbus::ObjectPath &path);
|
||||
virtual void onWpsFailed(const std::string &name, const std::map<std::string, sdbus::Variant> &args);
|
||||
virtual void onInvitationReceived(const std::map<std::string, sdbus::Variant> &properties);
|
||||
|
||||
};
|
||||
|
||||
class WpaGroup
|
||||
: public sdbus::ProxyInterfaces<fi::w1::wpa_supplicant1::Group_proxy>,
|
||||
public DBusLog
|
||||
{
|
||||
public:
|
||||
using self = WpaGroup;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
static ptr Create(sdbus::IConnection &connection, const sdbus::ObjectPath &path) { return std::make_unique<self>(connection, path); }
|
||||
|
||||
WpaGroup(sdbus::IConnection &connection, const sdbus::ObjectPath &path)
|
||||
: ProxyInterfaces(connection, "fi.w1.wpa_supplicant1", path), DBusLog(path)
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
virtual ~WpaGroup()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
DBusEvent<const sdbus::ObjectPath &> OnPeerJoined;
|
||||
DBusEvent<const sdbus::ObjectPath &> OnPeerDisconnected;
|
||||
|
||||
private:
|
||||
virtual void onPeerJoined(const sdbus::ObjectPath &peer)
|
||||
{
|
||||
OnPeerJoined.fire(peer);
|
||||
}
|
||||
virtual void onPeerDisconnected(const sdbus::ObjectPath &peer)
|
||||
{
|
||||
OnPeerDisconnected.fire(peer);
|
||||
}
|
||||
};
|
||||
|
||||
class WpaSupplicant
|
||||
: public sdbus::ProxyInterfaces<fi::w1::wpa_supplicant1_proxy, org::freedesktop::DBus::Properties_proxy>,
|
||||
public DBusLog
|
||||
{
|
||||
public:
|
||||
using self = WpaSupplicant;
|
||||
using ptr = std::unique_ptr<self>;
|
||||
static ptr Create() { return std::make_unique<self>(); }
|
||||
static ptr Create(sdbus::IConnection &connection) { return std::make_unique<self>(connection); }
|
||||
|
||||
WpaSupplicant()
|
||||
: ProxyInterfaces("fi.w1.wpa_supplicant1", "/fi/w1/wpa_supplicant1"),
|
||||
DBusLog("fi/w1/WpaSupplicant1")
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
WpaSupplicant(sdbus::IConnection &connection)
|
||||
: ProxyInterfaces(connection, "fi.w1.wpa_supplicant1", "/fi/w1/wpa_supplicant1"),
|
||||
DBusLog("fi/w1/WpaSupplicant1")
|
||||
{
|
||||
registerProxy();
|
||||
}
|
||||
virtual ~WpaSupplicant()
|
||||
{
|
||||
unregisterProxy();
|
||||
}
|
||||
DBusEvent<const sdbus::ObjectPath &, const std::map<std::string, sdbus::Variant> &> OnInterfaceAdded;
|
||||
DBusEvent<const sdbus::ObjectPath &> OnInterfaceRemoved;
|
||||
|
||||
private:
|
||||
virtual void onInterfaceAdded(const sdbus::ObjectPath &path, const std::map<std::string, sdbus::Variant> &properties);
|
||||
virtual void onInterfaceRemoved(const sdbus::ObjectPath &path);
|
||||
virtual void onPropertiesChanged(const std::map<std::string, sdbus::Variant> &properties) {}
|
||||
};
|
||||
@@ -0,0 +1,92 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_f1_w1_wpa_supplicant1_Group_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_f1_w1_wpa_supplicant1_Group_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace fi {
|
||||
namespace w1 {
|
||||
namespace wpa_supplicant1 {
|
||||
|
||||
class Group_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "fi.w1.wpa_supplicant1.Group";
|
||||
|
||||
protected:
|
||||
Group_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("PeerJoined").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& peer){ this->onPeerJoined(peer); });
|
||||
proxy_.uponSignal("PeerDisconnected").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& peer){ this->onPeerDisconnected(peer); });
|
||||
}
|
||||
|
||||
~Group_proxy() = default;
|
||||
|
||||
virtual void onPeerJoined(const sdbus::ObjectPath& peer) = 0;
|
||||
virtual void onPeerDisconnected(const sdbus::ObjectPath& peer) = 0;
|
||||
|
||||
public:
|
||||
std::vector<sdbus::ObjectPath> Members()
|
||||
{
|
||||
return proxy_.getProperty("Members").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Group()
|
||||
{
|
||||
return proxy_.getProperty("Group").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Role()
|
||||
{
|
||||
return proxy_.getProperty("Role").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> SSID()
|
||||
{
|
||||
return proxy_.getProperty("SSID").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> BSSID()
|
||||
{
|
||||
return proxy_.getProperty("BSSID").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint16_t Frequency()
|
||||
{
|
||||
return proxy_.getProperty("Frequency").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Passphrase()
|
||||
{
|
||||
return proxy_.getProperty("Passphrase").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> PSK()
|
||||
{
|
||||
return proxy_.getProperty("PSK").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::vector<uint8_t>> WPSVendorExtensions()
|
||||
{
|
||||
return proxy_.getProperty("WPSVendorExtensions").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void WPSVendorExtensions(const std::vector<std::vector<uint8_t>>& value)
|
||||
{
|
||||
proxy_.setProperty("WPSVendorExtensions").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,120 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_f1_w1_wpa_supplicant1_Peer_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_f1_w1_wpa_supplicant1_Peer_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace fi {
|
||||
namespace w1 {
|
||||
namespace wpa_supplicant1 {
|
||||
|
||||
class Peer_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "fi.w1.wpa_supplicant1.Peer";
|
||||
|
||||
protected:
|
||||
Peer_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("PropertiesChanged").onInterface(INTERFACE_NAME).call([this](const std::map<std::string, sdbus::Variant>& properties){ this->onPropertiesChanged(properties); });
|
||||
}
|
||||
|
||||
~Peer_proxy() = default;
|
||||
|
||||
virtual void onPropertiesChanged(const std::map<std::string, sdbus::Variant>& properties) = 0;
|
||||
|
||||
public:
|
||||
std::string DeviceName()
|
||||
{
|
||||
return proxy_.getProperty("DeviceName").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Manufacturer()
|
||||
{
|
||||
return proxy_.getProperty("Manufacturer").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string ModelName()
|
||||
{
|
||||
return proxy_.getProperty("ModelName").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string ModelNumber()
|
||||
{
|
||||
return proxy_.getProperty("ModelNumber").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string SerialNumber()
|
||||
{
|
||||
return proxy_.getProperty("SerialNumber").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> PrimaryDeviceType()
|
||||
{
|
||||
return proxy_.getProperty("PrimaryDeviceType").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint16_t config_method()
|
||||
{
|
||||
return proxy_.getProperty("config_method").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
int32_t level()
|
||||
{
|
||||
return proxy_.getProperty("level").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint8_t devicecapability()
|
||||
{
|
||||
return proxy_.getProperty("devicecapability").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint8_t groupcapability()
|
||||
{
|
||||
return proxy_.getProperty("groupcapability").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::vector<uint8_t>> SecondaryDeviceTypes()
|
||||
{
|
||||
return proxy_.getProperty("SecondaryDeviceTypes").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::vector<uint8_t>> VendorExtension()
|
||||
{
|
||||
return proxy_.getProperty("VendorExtension").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> IEs()
|
||||
{
|
||||
return proxy_.getProperty("IEs").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> DeviceAddress()
|
||||
{
|
||||
return proxy_.getProperty("DeviceAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> Groups()
|
||||
{
|
||||
return proxy_.getProperty("Groups").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> VSIE()
|
||||
{
|
||||
return proxy_.getProperty("VSIE").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,123 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_fi_w1_wpa_supplicant1_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_fi_w1_wpa_supplicant1_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace fi {
|
||||
namespace w1 {
|
||||
|
||||
class wpa_supplicant1_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "fi.w1.wpa_supplicant1";
|
||||
|
||||
protected:
|
||||
wpa_supplicant1_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("InterfaceAdded").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& path, const std::map<std::string, sdbus::Variant>& properties){ this->onInterfaceAdded(path, properties); });
|
||||
proxy_.uponSignal("InterfaceRemoved").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& path){ this->onInterfaceRemoved(path); });
|
||||
proxy_.uponSignal("PropertiesChanged").onInterface(INTERFACE_NAME).call([this](const std::map<std::string, sdbus::Variant>& properties){ this->onPropertiesChanged(properties); });
|
||||
}
|
||||
|
||||
~wpa_supplicant1_proxy() = default;
|
||||
|
||||
virtual void onInterfaceAdded(const sdbus::ObjectPath& path, const std::map<std::string, sdbus::Variant>& properties) = 0;
|
||||
virtual void onInterfaceRemoved(const sdbus::ObjectPath& path) = 0;
|
||||
virtual void onPropertiesChanged(const std::map<std::string, sdbus::Variant>& properties) = 0;
|
||||
|
||||
public:
|
||||
sdbus::ObjectPath CreateInterface(const std::map<std::string, sdbus::Variant>& args)
|
||||
{
|
||||
sdbus::ObjectPath result;
|
||||
proxy_.callMethod("CreateInterface").onInterface(INTERFACE_NAME).withArguments(args).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void RemoveInterface(const sdbus::ObjectPath& path)
|
||||
{
|
||||
proxy_.callMethod("RemoveInterface").onInterface(INTERFACE_NAME).withArguments(path);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath GetInterface(const std::string& ifname)
|
||||
{
|
||||
sdbus::ObjectPath result;
|
||||
proxy_.callMethod("GetInterface").onInterface(INTERFACE_NAME).withArguments(ifname).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void ExpectDisconnect()
|
||||
{
|
||||
proxy_.callMethod("ExpectDisconnect").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
public:
|
||||
std::string DebugLevel()
|
||||
{
|
||||
return proxy_.getProperty("DebugLevel").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void DebugLevel(const std::string& value)
|
||||
{
|
||||
proxy_.setProperty("DebugLevel").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
bool DebugTimestamp()
|
||||
{
|
||||
return proxy_.getProperty("DebugTimestamp").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void DebugTimestamp(const bool& value)
|
||||
{
|
||||
proxy_.setProperty("DebugTimestamp").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
bool DebugShowKeys()
|
||||
{
|
||||
return proxy_.getProperty("DebugShowKeys").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void DebugShowKeys(const bool& value)
|
||||
{
|
||||
proxy_.setProperty("DebugShowKeys").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> Interfaces()
|
||||
{
|
||||
return proxy_.getProperty("Interfaces").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> EapMethods()
|
||||
{
|
||||
return proxy_.getProperty("EapMethods").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> Capabilities()
|
||||
{
|
||||
return proxy_.getProperty("Capabilities").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> WFDIEs()
|
||||
{
|
||||
return proxy_.getProperty("WFDIEs").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void WFDIEs(const std::vector<uint8_t>& value)
|
||||
{
|
||||
proxy_.setProperty("WFDIEs").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,56 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_DBus_Properties_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_DBus_Properties_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace DBus {
|
||||
|
||||
class Properties_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.DBus.Properties";
|
||||
|
||||
protected:
|
||||
Properties_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Properties_proxy() = default;
|
||||
|
||||
public:
|
||||
sdbus::Variant Get(const std::string& interface, const std::string& propname)
|
||||
{
|
||||
sdbus::Variant result;
|
||||
proxy_.callMethod("Get").onInterface(INTERFACE_NAME).withArguments(interface, propname).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::map<std::string, sdbus::Variant> GetAll(const std::string& interface)
|
||||
{
|
||||
std::map<std::string, sdbus::Variant> result;
|
||||
proxy_.callMethod("GetAll").onInterface(INTERFACE_NAME).withArguments(interface).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void Set(const std::string& interface, const std::string& propname, const sdbus::Variant& value)
|
||||
{
|
||||
proxy_.callMethod("Set").onInterface(INTERFACE_NAME).withArguments(interface, propname, value);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_AccessPoint_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_AccessPoint_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class AccessPoint_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.AccessPoint";
|
||||
|
||||
protected:
|
||||
AccessPoint_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~AccessPoint_proxy() = default;
|
||||
|
||||
public:
|
||||
uint32_t Flags()
|
||||
{
|
||||
return proxy_.getProperty("Flags").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t WpaFlags()
|
||||
{
|
||||
return proxy_.getProperty("WpaFlags").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t RsnFlags()
|
||||
{
|
||||
return proxy_.getProperty("RsnFlags").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> Ssid()
|
||||
{
|
||||
return proxy_.getProperty("Ssid").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Frequency()
|
||||
{
|
||||
return proxy_.getProperty("Frequency").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Mode()
|
||||
{
|
||||
return proxy_.getProperty("Mode").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t MaxBitrate()
|
||||
{
|
||||
return proxy_.getProperty("MaxBitrate").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint8_t Strength()
|
||||
{
|
||||
return proxy_.getProperty("Strength").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
int32_t LastSeen()
|
||||
{
|
||||
return proxy_.getProperty("LastSeen").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_AgentManager_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_AgentManager_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class AgentManager_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.AgentManager";
|
||||
|
||||
protected:
|
||||
AgentManager_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~AgentManager_proxy() = default;
|
||||
|
||||
public:
|
||||
void Register(const std::string& identifier)
|
||||
{
|
||||
proxy_.callMethod("Register").onInterface(INTERFACE_NAME).withArguments(identifier);
|
||||
}
|
||||
|
||||
void RegisterWithCapabilities(const std::string& identifier, const uint32_t& capabilities)
|
||||
{
|
||||
proxy_.callMethod("RegisterWithCapabilities").onInterface(INTERFACE_NAME).withArguments(identifier, capabilities);
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
proxy_.callMethod("Unregister").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Checkpoint_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Checkpoint_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class Checkpoint_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Checkpoint";
|
||||
|
||||
protected:
|
||||
Checkpoint_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Checkpoint_proxy() = default;
|
||||
|
||||
public:
|
||||
std::vector<sdbus::ObjectPath> Devices()
|
||||
{
|
||||
return proxy_.getProperty("Devices").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
int64_t Created()
|
||||
{
|
||||
return proxy_.getProperty("Created").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t RollbackTimeout()
|
||||
{
|
||||
return proxy_.getProperty("RollbackTimeout").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,126 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Connection_Active_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Connection_Active_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Connection {
|
||||
|
||||
class Active_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Connection.Active";
|
||||
|
||||
protected:
|
||||
Active_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("StateChanged").onInterface(INTERFACE_NAME).call([this](const uint32_t& state, const uint32_t& reason){ this->onStateChanged(state, reason); });
|
||||
}
|
||||
|
||||
~Active_proxy() = default;
|
||||
|
||||
virtual void onStateChanged(const uint32_t& state, const uint32_t& reason) = 0;
|
||||
|
||||
public:
|
||||
sdbus::ObjectPath Connection()
|
||||
{
|
||||
return proxy_.getProperty("Connection").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath SpecificObject()
|
||||
{
|
||||
return proxy_.getProperty("SpecificObject").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Id()
|
||||
{
|
||||
return proxy_.getProperty("Id").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Uuid()
|
||||
{
|
||||
return proxy_.getProperty("Uuid").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Type()
|
||||
{
|
||||
return proxy_.getProperty("Type").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> Devices()
|
||||
{
|
||||
return proxy_.getProperty("Devices").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t State()
|
||||
{
|
||||
return proxy_.getProperty("State").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t StateFlags()
|
||||
{
|
||||
return proxy_.getProperty("StateFlags").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool Default()
|
||||
{
|
||||
return proxy_.getProperty("Default").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Ip4Config()
|
||||
{
|
||||
return proxy_.getProperty("Ip4Config").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Dhcp4Config()
|
||||
{
|
||||
return proxy_.getProperty("Dhcp4Config").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool Default6()
|
||||
{
|
||||
return proxy_.getProperty("Default6").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Ip6Config()
|
||||
{
|
||||
return proxy_.getProperty("Ip6Config").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Dhcp6Config()
|
||||
{
|
||||
return proxy_.getProperty("Dhcp6Config").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool Vpn()
|
||||
{
|
||||
return proxy_.getProperty("Vpn").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Controller()
|
||||
{
|
||||
return proxy_.getProperty("Controller").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Master()
|
||||
{
|
||||
return proxy_.getProperty("Master").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_DHCP4Config_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_DHCP4Config_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class DHCP4Config_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.DHCP4Config";
|
||||
|
||||
protected:
|
||||
DHCP4Config_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~DHCP4Config_proxy() = default;
|
||||
|
||||
public:
|
||||
std::map<std::string, sdbus::Variant> Options()
|
||||
{
|
||||
return proxy_.getProperty("Options").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_DHCP6Config_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_DHCP6Config_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class DHCP6Config_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.DHCP6Config";
|
||||
|
||||
protected:
|
||||
DHCP6Config_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~DHCP6Config_proxy() = default;
|
||||
|
||||
public:
|
||||
std::map<std::string, sdbus::Variant> Options()
|
||||
{
|
||||
return proxy_.getProperty("Options").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Bond_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Bond_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class Bond_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.Bond";
|
||||
|
||||
protected:
|
||||
Bond_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Bond_proxy() = default;
|
||||
|
||||
public:
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool Carrier()
|
||||
{
|
||||
return proxy_.getProperty("Carrier").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> Slaves()
|
||||
{
|
||||
return proxy_.getProperty("Slaves").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Dummy_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Dummy_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class Dummy_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.Dummy";
|
||||
|
||||
protected:
|
||||
Dummy_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Dummy_proxy() = default;
|
||||
|
||||
public:
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,48 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Generic_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Generic_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class Generic_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.Generic";
|
||||
|
||||
protected:
|
||||
Generic_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Generic_proxy() = default;
|
||||
|
||||
public:
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string TypeDescription()
|
||||
{
|
||||
return proxy_.getProperty("TypeDescription").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Loopback_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Loopback_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class Loopback_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.Loopback";
|
||||
|
||||
protected:
|
||||
Loopback_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Loopback_proxy() = default;
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,63 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Modem_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Modem_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class Modem_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.Modem";
|
||||
|
||||
protected:
|
||||
Modem_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Modem_proxy() = default;
|
||||
|
||||
public:
|
||||
uint32_t ModemCapabilities()
|
||||
{
|
||||
return proxy_.getProperty("ModemCapabilities").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t CurrentCapabilities()
|
||||
{
|
||||
return proxy_.getProperty("CurrentCapabilities").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string DeviceId()
|
||||
{
|
||||
return proxy_.getProperty("DeviceId").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string OperatorCode()
|
||||
{
|
||||
return proxy_.getProperty("OperatorCode").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Apn()
|
||||
{
|
||||
return proxy_.getProperty("Apn").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,58 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Statistics_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Statistics_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class Statistics_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.Statistics";
|
||||
|
||||
protected:
|
||||
Statistics_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Statistics_proxy() = default;
|
||||
|
||||
public:
|
||||
uint32_t RefreshRateMs()
|
||||
{
|
||||
return proxy_.getProperty("RefreshRateMs").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void RefreshRateMs(const uint32_t& value)
|
||||
{
|
||||
proxy_.setProperty("RefreshRateMs").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
uint64_t TxBytes()
|
||||
{
|
||||
return proxy_.getProperty("TxBytes").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint64_t RxBytes()
|
||||
{
|
||||
return proxy_.getProperty("RxBytes").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_WifiP2P_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_WifiP2P_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class WifiP2P_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.WifiP2P";
|
||||
|
||||
protected:
|
||||
WifiP2P_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("PeerAdded").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& peer){ this->onPeerAdded(peer); });
|
||||
proxy_.uponSignal("PeerRemoved").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& peer){ this->onPeerRemoved(peer); });
|
||||
}
|
||||
|
||||
~WifiP2P_proxy() = default;
|
||||
|
||||
virtual void onPeerAdded(const sdbus::ObjectPath& peer) = 0;
|
||||
virtual void onPeerRemoved(const sdbus::ObjectPath& peer) = 0;
|
||||
|
||||
public:
|
||||
void StartFind(const std::map<std::string, sdbus::Variant>& options)
|
||||
{
|
||||
proxy_.callMethod("StartFind").onInterface(INTERFACE_NAME).withArguments(options);
|
||||
}
|
||||
|
||||
void StopFind()
|
||||
{
|
||||
proxy_.callMethod("StopFind").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
public:
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> Peers()
|
||||
{
|
||||
return proxy_.getProperty("Peers").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_WireGuard_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_WireGuard_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class WireGuard_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.WireGuard";
|
||||
|
||||
protected:
|
||||
WireGuard_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~WireGuard_proxy() = default;
|
||||
|
||||
public:
|
||||
std::vector<uint8_t> PublicKey()
|
||||
{
|
||||
return proxy_.getProperty("PublicKey").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint16_t ListenPort()
|
||||
{
|
||||
return proxy_.getProperty("ListenPort").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t FwMark()
|
||||
{
|
||||
return proxy_.getProperty("FwMark").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,63 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Wired_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Wired_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class Wired_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.Wired";
|
||||
|
||||
protected:
|
||||
Wired_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Wired_proxy() = default;
|
||||
|
||||
public:
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string PermHwAddress()
|
||||
{
|
||||
return proxy_.getProperty("PermHwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Speed()
|
||||
{
|
||||
return proxy_.getProperty("Speed").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> S390Subchannels()
|
||||
{
|
||||
return proxy_.getProperty("S390Subchannels").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool Carrier()
|
||||
{
|
||||
return proxy_.getProperty("Carrier").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,103 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Wireless_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Wireless_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class Wireless_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.Wireless";
|
||||
|
||||
protected:
|
||||
Wireless_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("AccessPointAdded").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& access_point){ this->onAccessPointAdded(access_point); });
|
||||
proxy_.uponSignal("AccessPointRemoved").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& access_point){ this->onAccessPointRemoved(access_point); });
|
||||
}
|
||||
|
||||
~Wireless_proxy() = default;
|
||||
|
||||
virtual void onAccessPointAdded(const sdbus::ObjectPath& access_point) = 0;
|
||||
virtual void onAccessPointRemoved(const sdbus::ObjectPath& access_point) = 0;
|
||||
|
||||
public:
|
||||
std::vector<sdbus::ObjectPath> GetAccessPoints()
|
||||
{
|
||||
std::vector<sdbus::ObjectPath> result;
|
||||
proxy_.callMethod("GetAccessPoints").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> GetAllAccessPoints()
|
||||
{
|
||||
std::vector<sdbus::ObjectPath> result;
|
||||
proxy_.callMethod("GetAllAccessPoints").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void RequestScan(const std::map<std::string, sdbus::Variant>& options)
|
||||
{
|
||||
proxy_.callMethod("RequestScan").onInterface(INTERFACE_NAME).withArguments(options);
|
||||
}
|
||||
|
||||
public:
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string PermHwAddress()
|
||||
{
|
||||
return proxy_.getProperty("PermHwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Mode()
|
||||
{
|
||||
return proxy_.getProperty("Mode").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Bitrate()
|
||||
{
|
||||
return proxy_.getProperty("Bitrate").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> AccessPoints()
|
||||
{
|
||||
return proxy_.getProperty("AccessPoints").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath ActiveAccessPoint()
|
||||
{
|
||||
return proxy_.getProperty("ActiveAccessPoint").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t WirelessCapabilities()
|
||||
{
|
||||
return proxy_.getProperty("WirelessCapabilities").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
int64_t LastScan()
|
||||
{
|
||||
return proxy_.getProperty("LastScan").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Wpan_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_Wpan_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Device {
|
||||
|
||||
class Wpan_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device.Wpan";
|
||||
|
||||
protected:
|
||||
Wpan_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Wpan_proxy() = default;
|
||||
|
||||
public:
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,233 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Device_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class Device_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Device";
|
||||
|
||||
protected:
|
||||
Device_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("StateChanged").onInterface(INTERFACE_NAME).call([this](const uint32_t& new_state, const uint32_t& old_state, const uint32_t& reason){ this->onStateChanged(new_state, old_state, reason); });
|
||||
}
|
||||
|
||||
~Device_proxy() = default;
|
||||
|
||||
virtual void onStateChanged(const uint32_t& new_state, const uint32_t& old_state, const uint32_t& reason) = 0;
|
||||
|
||||
public:
|
||||
void Reapply(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection, const uint64_t& version_id, const uint32_t& flags)
|
||||
{
|
||||
proxy_.callMethod("Reapply").onInterface(INTERFACE_NAME).withArguments(connection, version_id, flags);
|
||||
}
|
||||
|
||||
std::tuple<std::map<std::string, std::map<std::string, sdbus::Variant>>, uint64_t> GetAppliedConnection(const uint32_t& flags)
|
||||
{
|
||||
std::tuple<std::map<std::string, std::map<std::string, sdbus::Variant>>, uint64_t> result;
|
||||
proxy_.callMethod("GetAppliedConnection").onInterface(INTERFACE_NAME).withArguments(flags).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void Disconnect()
|
||||
{
|
||||
proxy_.callMethod("Disconnect").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void Delete()
|
||||
{
|
||||
proxy_.callMethod("Delete").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
public:
|
||||
std::string Udi()
|
||||
{
|
||||
return proxy_.getProperty("Udi").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Path()
|
||||
{
|
||||
return proxy_.getProperty("Path").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Interface()
|
||||
{
|
||||
return proxy_.getProperty("Interface").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string IpInterface()
|
||||
{
|
||||
return proxy_.getProperty("IpInterface").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Driver()
|
||||
{
|
||||
return proxy_.getProperty("Driver").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string DriverVersion()
|
||||
{
|
||||
return proxy_.getProperty("DriverVersion").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string FirmwareVersion()
|
||||
{
|
||||
return proxy_.getProperty("FirmwareVersion").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Capabilities()
|
||||
{
|
||||
return proxy_.getProperty("Capabilities").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Ip4Address()
|
||||
{
|
||||
return proxy_.getProperty("Ip4Address").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t State()
|
||||
{
|
||||
return proxy_.getProperty("State").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::Struct<uint32_t, uint32_t> StateReason()
|
||||
{
|
||||
return proxy_.getProperty("StateReason").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath ActiveConnection()
|
||||
{
|
||||
return proxy_.getProperty("ActiveConnection").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Ip4Config()
|
||||
{
|
||||
return proxy_.getProperty("Ip4Config").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Dhcp4Config()
|
||||
{
|
||||
return proxy_.getProperty("Dhcp4Config").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Ip6Config()
|
||||
{
|
||||
return proxy_.getProperty("Ip6Config").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath Dhcp6Config()
|
||||
{
|
||||
return proxy_.getProperty("Dhcp6Config").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool Managed()
|
||||
{
|
||||
return proxy_.getProperty("Managed").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void Managed(const bool& value)
|
||||
{
|
||||
proxy_.setProperty("Managed").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
bool Autoconnect()
|
||||
{
|
||||
return proxy_.getProperty("Autoconnect").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void Autoconnect(const bool& value)
|
||||
{
|
||||
proxy_.setProperty("Autoconnect").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
bool FirmwareMissing()
|
||||
{
|
||||
return proxy_.getProperty("FirmwareMissing").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool NmPluginMissing()
|
||||
{
|
||||
return proxy_.getProperty("NmPluginMissing").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t DeviceType()
|
||||
{
|
||||
return proxy_.getProperty("DeviceType").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> AvailableConnections()
|
||||
{
|
||||
return proxy_.getProperty("AvailableConnections").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string PhysicalPortId()
|
||||
{
|
||||
return proxy_.getProperty("PhysicalPortId").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Mtu()
|
||||
{
|
||||
return proxy_.getProperty("Mtu").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Metered()
|
||||
{
|
||||
return proxy_.getProperty("Metered").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::map<std::string, sdbus::Variant>> LldpNeighbors()
|
||||
{
|
||||
return proxy_.getProperty("LldpNeighbors").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool Real()
|
||||
{
|
||||
return proxy_.getProperty("Real").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Ip4Connectivity()
|
||||
{
|
||||
return proxy_.getProperty("Ip4Connectivity").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Ip6Connectivity()
|
||||
{
|
||||
return proxy_.getProperty("Ip6Connectivity").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t InterfaceFlags()
|
||||
{
|
||||
return proxy_.getProperty("InterfaceFlags").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> Ports()
|
||||
{
|
||||
return proxy_.getProperty("Ports").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,52 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_DnsManager_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_DnsManager_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class DnsManager_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.DnsManager";
|
||||
|
||||
protected:
|
||||
DnsManager_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~DnsManager_proxy() = default;
|
||||
|
||||
public:
|
||||
std::string Mode()
|
||||
{
|
||||
return proxy_.getProperty("Mode").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string RcManager()
|
||||
{
|
||||
return proxy_.getProperty("RcManager").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::map<std::string, sdbus::Variant>> Configuration()
|
||||
{
|
||||
return proxy_.getProperty("Configuration").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,102 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_IP4Config_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_IP4Config_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class IP4Config_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.IP4Config";
|
||||
|
||||
protected:
|
||||
IP4Config_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~IP4Config_proxy() = default;
|
||||
|
||||
public:
|
||||
std::vector<std::vector<uint32_t>> Addresses()
|
||||
{
|
||||
return proxy_.getProperty("Addresses").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::map<std::string, sdbus::Variant>> AddressData()
|
||||
{
|
||||
return proxy_.getProperty("AddressData").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Gateway()
|
||||
{
|
||||
return proxy_.getProperty("Gateway").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::vector<uint32_t>> Routes()
|
||||
{
|
||||
return proxy_.getProperty("Routes").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::map<std::string, sdbus::Variant>> RouteData()
|
||||
{
|
||||
return proxy_.getProperty("RouteData").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint32_t> Nameservers()
|
||||
{
|
||||
return proxy_.getProperty("Nameservers").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::map<std::string, sdbus::Variant>> NameserverData()
|
||||
{
|
||||
return proxy_.getProperty("NameserverData").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> Domains()
|
||||
{
|
||||
return proxy_.getProperty("Domains").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> Searches()
|
||||
{
|
||||
return proxy_.getProperty("Searches").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> DnsOptions()
|
||||
{
|
||||
return proxy_.getProperty("DnsOptions").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
int32_t DnsPriority()
|
||||
{
|
||||
return proxy_.getProperty("DnsPriority").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint32_t> WinsServers()
|
||||
{
|
||||
return proxy_.getProperty("WinsServers").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> WinsServerData()
|
||||
{
|
||||
return proxy_.getProperty("WinsServerData").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_IP6Config_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_IP6Config_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class IP6Config_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.IP6Config";
|
||||
|
||||
protected:
|
||||
IP6Config_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~IP6Config_proxy() = default;
|
||||
|
||||
public:
|
||||
std::vector<sdbus::Struct<std::vector<uint8_t>, uint32_t, std::vector<uint8_t>>> Addresses()
|
||||
{
|
||||
return proxy_.getProperty("Addresses").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::map<std::string, sdbus::Variant>> AddressData()
|
||||
{
|
||||
return proxy_.getProperty("AddressData").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Gateway()
|
||||
{
|
||||
return proxy_.getProperty("Gateway").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::Struct<std::vector<uint8_t>, uint32_t, std::vector<uint8_t>, uint32_t>> Routes()
|
||||
{
|
||||
return proxy_.getProperty("Routes").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::map<std::string, sdbus::Variant>> RouteData()
|
||||
{
|
||||
return proxy_.getProperty("RouteData").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::vector<uint8_t>> Nameservers()
|
||||
{
|
||||
return proxy_.getProperty("Nameservers").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> Domains()
|
||||
{
|
||||
return proxy_.getProperty("Domains").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> Searches()
|
||||
{
|
||||
return proxy_.getProperty("Searches").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<std::string> DnsOptions()
|
||||
{
|
||||
return proxy_.getProperty("DnsOptions").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
int32_t DnsPriority()
|
||||
{
|
||||
return proxy_.getProperty("DnsPriority").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_PPP_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_PPP_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class PPP_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.PPP";
|
||||
|
||||
protected:
|
||||
PPP_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~PPP_proxy() = default;
|
||||
|
||||
public:
|
||||
std::tuple<std::string, std::string> NeedSecrets()
|
||||
{
|
||||
std::tuple<std::string, std::string> result;
|
||||
proxy_.callMethod("NeedSecrets").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void SetIp4Config(const std::map<std::string, sdbus::Variant>& config)
|
||||
{
|
||||
proxy_.callMethod("SetIp4Config").onInterface(INTERFACE_NAME).withArguments(config);
|
||||
}
|
||||
|
||||
void SetIp6Config(const std::map<std::string, sdbus::Variant>& config)
|
||||
{
|
||||
proxy_.callMethod("SetIp6Config").onInterface(INTERFACE_NAME).withArguments(config);
|
||||
}
|
||||
|
||||
void SetState(const uint32_t& state)
|
||||
{
|
||||
proxy_.callMethod("SetState").onInterface(INTERFACE_NAME).withArguments(state);
|
||||
}
|
||||
|
||||
void SetIfindex(const int32_t& ifindex)
|
||||
{
|
||||
proxy_.callMethod("SetIfindex").onInterface(INTERFACE_NAME).withArguments(ifindex);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_SecretAgent_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_SecretAgent_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class SecretAgent_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.SecretAgent";
|
||||
|
||||
protected:
|
||||
SecretAgent_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~SecretAgent_proxy() = default;
|
||||
|
||||
public:
|
||||
std::map<std::string, std::map<std::string, sdbus::Variant>> GetSecrets(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection, const sdbus::ObjectPath& connection_path, const std::string& setting_name, const std::vector<std::string>& hints, const uint32_t& flags)
|
||||
{
|
||||
std::map<std::string, std::map<std::string, sdbus::Variant>> result;
|
||||
proxy_.callMethod("GetSecrets").onInterface(INTERFACE_NAME).withArguments(connection, connection_path, setting_name, hints, flags).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void CancelGetSecrets(const sdbus::ObjectPath& connection_path, const std::string& setting_name)
|
||||
{
|
||||
proxy_.callMethod("CancelGetSecrets").onInterface(INTERFACE_NAME).withArguments(connection_path, setting_name);
|
||||
}
|
||||
|
||||
void SaveSecrets(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection, const sdbus::ObjectPath& connection_path)
|
||||
{
|
||||
proxy_.callMethod("SaveSecrets").onInterface(INTERFACE_NAME).withArguments(connection, connection_path);
|
||||
}
|
||||
|
||||
void DeleteSecrets(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection, const sdbus::ObjectPath& connection_path)
|
||||
{
|
||||
proxy_.callMethod("DeleteSecrets").onInterface(INTERFACE_NAME).withArguments(connection, connection_path);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Settings_Connection_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Settings_Connection_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace Settings {
|
||||
|
||||
class Connection_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Settings.Connection";
|
||||
|
||||
protected:
|
||||
Connection_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("Updated").onInterface(INTERFACE_NAME).call([this](){ this->onUpdated(); });
|
||||
proxy_.uponSignal("Removed").onInterface(INTERFACE_NAME).call([this](){ this->onRemoved(); });
|
||||
}
|
||||
|
||||
~Connection_proxy() = default;
|
||||
|
||||
virtual void onUpdated() = 0;
|
||||
virtual void onRemoved() = 0;
|
||||
|
||||
public:
|
||||
void Update(const std::map<std::string, std::map<std::string, sdbus::Variant>>& properties)
|
||||
{
|
||||
proxy_.callMethod("Update").onInterface(INTERFACE_NAME).withArguments(properties);
|
||||
}
|
||||
|
||||
void UpdateUnsaved(const std::map<std::string, std::map<std::string, sdbus::Variant>>& properties)
|
||||
{
|
||||
proxy_.callMethod("UpdateUnsaved").onInterface(INTERFACE_NAME).withArguments(properties);
|
||||
}
|
||||
|
||||
void Delete()
|
||||
{
|
||||
proxy_.callMethod("Delete").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::map<std::string, std::map<std::string, sdbus::Variant>> GetSettings()
|
||||
{
|
||||
std::map<std::string, std::map<std::string, sdbus::Variant>> result;
|
||||
proxy_.callMethod("GetSettings").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::map<std::string, std::map<std::string, sdbus::Variant>> GetSecrets(const std::string& setting_name)
|
||||
{
|
||||
std::map<std::string, std::map<std::string, sdbus::Variant>> result;
|
||||
proxy_.callMethod("GetSecrets").onInterface(INTERFACE_NAME).withArguments(setting_name).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void ClearSecrets()
|
||||
{
|
||||
proxy_.callMethod("ClearSecrets").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void Save()
|
||||
{
|
||||
proxy_.callMethod("Save").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::map<std::string, sdbus::Variant> Update2(const std::map<std::string, std::map<std::string, sdbus::Variant>>& settings, const uint32_t& flags, const std::map<std::string, sdbus::Variant>& args)
|
||||
{
|
||||
std::map<std::string, sdbus::Variant> result;
|
||||
proxy_.callMethod("Update2").onInterface(INTERFACE_NAME).withArguments(settings, flags, args).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
public:
|
||||
bool Unsaved()
|
||||
{
|
||||
return proxy_.getProperty("Unsaved").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Flags()
|
||||
{
|
||||
return proxy_.getProperty("Flags").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Filename()
|
||||
{
|
||||
return proxy_.getProperty("Filename").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,112 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Settings_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_Settings_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class Settings_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.Settings";
|
||||
|
||||
protected:
|
||||
Settings_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("NewConnection").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& connection){ this->onNewConnection(connection); });
|
||||
proxy_.uponSignal("ConnectionRemoved").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& connection){ this->onConnectionRemoved(connection); });
|
||||
}
|
||||
|
||||
~Settings_proxy() = default;
|
||||
|
||||
virtual void onNewConnection(const sdbus::ObjectPath& connection) = 0;
|
||||
virtual void onConnectionRemoved(const sdbus::ObjectPath& connection) = 0;
|
||||
|
||||
public:
|
||||
std::vector<sdbus::ObjectPath> ListConnections()
|
||||
{
|
||||
std::vector<sdbus::ObjectPath> result;
|
||||
proxy_.callMethod("ListConnections").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
sdbus::ObjectPath GetConnectionByUuid(const std::string& uuid)
|
||||
{
|
||||
sdbus::ObjectPath result;
|
||||
proxy_.callMethod("GetConnectionByUuid").onInterface(INTERFACE_NAME).withArguments(uuid).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
sdbus::ObjectPath AddConnection(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection)
|
||||
{
|
||||
sdbus::ObjectPath result;
|
||||
proxy_.callMethod("AddConnection").onInterface(INTERFACE_NAME).withArguments(connection).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
sdbus::ObjectPath AddConnectionUnsaved(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection)
|
||||
{
|
||||
sdbus::ObjectPath result;
|
||||
proxy_.callMethod("AddConnectionUnsaved").onInterface(INTERFACE_NAME).withArguments(connection).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::tuple<sdbus::ObjectPath, std::map<std::string, sdbus::Variant>> AddConnection2(const std::map<std::string, std::map<std::string, sdbus::Variant>>& settings, const uint32_t& flags, const std::map<std::string, sdbus::Variant>& args)
|
||||
{
|
||||
std::tuple<sdbus::ObjectPath, std::map<std::string, sdbus::Variant>> result;
|
||||
proxy_.callMethod("AddConnection2").onInterface(INTERFACE_NAME).withArguments(settings, flags, args).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::tuple<bool, std::vector<std::string>> LoadConnections(const std::vector<std::string>& filenames)
|
||||
{
|
||||
std::tuple<bool, std::vector<std::string>> result;
|
||||
proxy_.callMethod("LoadConnections").onInterface(INTERFACE_NAME).withArguments(filenames).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool ReloadConnections()
|
||||
{
|
||||
bool result;
|
||||
proxy_.callMethod("ReloadConnections").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void SaveHostname(const std::string& hostname)
|
||||
{
|
||||
proxy_.callMethod("SaveHostname").onInterface(INTERFACE_NAME).withArguments(hostname);
|
||||
}
|
||||
|
||||
public:
|
||||
std::vector<sdbus::ObjectPath> Connections()
|
||||
{
|
||||
return proxy_.getProperty("Connections").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Hostname()
|
||||
{
|
||||
return proxy_.getProperty("Hostname").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool CanModify()
|
||||
{
|
||||
return proxy_.getProperty("CanModify").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,51 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_VPN_Connection_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_VPN_Connection_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace VPN {
|
||||
|
||||
class Connection_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.VPN.Connection";
|
||||
|
||||
protected:
|
||||
Connection_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("VpnStateChanged").onInterface(INTERFACE_NAME).call([this](const uint32_t& state, const uint32_t& reason){ this->onVpnStateChanged(state, reason); });
|
||||
}
|
||||
|
||||
~Connection_proxy() = default;
|
||||
|
||||
virtual void onVpnStateChanged(const uint32_t& state, const uint32_t& reason) = 0;
|
||||
|
||||
public:
|
||||
uint32_t VpnState()
|
||||
{
|
||||
return proxy_.getProperty("VpnState").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Banner()
|
||||
{
|
||||
return proxy_.getProperty("Banner").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,106 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_VPN_Plugin_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_VPN_Plugin_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace VPN {
|
||||
|
||||
class Plugin_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.VPN.Plugin";
|
||||
|
||||
protected:
|
||||
Plugin_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("StateChanged").onInterface(INTERFACE_NAME).call([this](const uint32_t& state){ this->onStateChanged(state); });
|
||||
proxy_.uponSignal("SecretsRequired").onInterface(INTERFACE_NAME).call([this](const std::string& message, const std::vector<std::string>& secrets){ this->onSecretsRequired(message, secrets); });
|
||||
proxy_.uponSignal("Config").onInterface(INTERFACE_NAME).call([this](const std::map<std::string, sdbus::Variant>& config){ this->onConfig(config); });
|
||||
proxy_.uponSignal("Ip4Config").onInterface(INTERFACE_NAME).call([this](const std::map<std::string, sdbus::Variant>& ip4config){ this->onIp4Config(ip4config); });
|
||||
proxy_.uponSignal("Ip6Config").onInterface(INTERFACE_NAME).call([this](const std::map<std::string, sdbus::Variant>& ip6config){ this->onIp6Config(ip6config); });
|
||||
proxy_.uponSignal("LoginBanner").onInterface(INTERFACE_NAME).call([this](const std::string& banner){ this->onLoginBanner(banner); });
|
||||
proxy_.uponSignal("Failure").onInterface(INTERFACE_NAME).call([this](const uint32_t& reason){ this->onFailure(reason); });
|
||||
}
|
||||
|
||||
~Plugin_proxy() = default;
|
||||
|
||||
virtual void onStateChanged(const uint32_t& state) = 0;
|
||||
virtual void onSecretsRequired(const std::string& message, const std::vector<std::string>& secrets) = 0;
|
||||
virtual void onConfig(const std::map<std::string, sdbus::Variant>& config) = 0;
|
||||
virtual void onIp4Config(const std::map<std::string, sdbus::Variant>& ip4config) = 0;
|
||||
virtual void onIp6Config(const std::map<std::string, sdbus::Variant>& ip6config) = 0;
|
||||
virtual void onLoginBanner(const std::string& banner) = 0;
|
||||
virtual void onFailure(const uint32_t& reason) = 0;
|
||||
|
||||
public:
|
||||
void Connect(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection)
|
||||
{
|
||||
proxy_.callMethod("Connect").onInterface(INTERFACE_NAME).withArguments(connection);
|
||||
}
|
||||
|
||||
void ConnectInteractive(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection, const std::map<std::string, sdbus::Variant>& details)
|
||||
{
|
||||
proxy_.callMethod("ConnectInteractive").onInterface(INTERFACE_NAME).withArguments(connection, details);
|
||||
}
|
||||
|
||||
std::string NeedSecrets(const std::map<std::string, std::map<std::string, sdbus::Variant>>& settings)
|
||||
{
|
||||
std::string result;
|
||||
proxy_.callMethod("NeedSecrets").onInterface(INTERFACE_NAME).withArguments(settings).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void Disconnect()
|
||||
{
|
||||
proxy_.callMethod("Disconnect").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void SetConfig(const std::map<std::string, sdbus::Variant>& config)
|
||||
{
|
||||
proxy_.callMethod("SetConfig").onInterface(INTERFACE_NAME).withArguments(config);
|
||||
}
|
||||
|
||||
void SetIp4Config(const std::map<std::string, sdbus::Variant>& config)
|
||||
{
|
||||
proxy_.callMethod("SetIp4Config").onInterface(INTERFACE_NAME).withArguments(config);
|
||||
}
|
||||
|
||||
void SetIp6Config(const std::map<std::string, sdbus::Variant>& config)
|
||||
{
|
||||
proxy_.callMethod("SetIp6Config").onInterface(INTERFACE_NAME).withArguments(config);
|
||||
}
|
||||
|
||||
void SetFailure(const std::string& reason)
|
||||
{
|
||||
proxy_.callMethod("SetFailure").onInterface(INTERFACE_NAME).withArguments(reason);
|
||||
}
|
||||
|
||||
void NewSecrets(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection)
|
||||
{
|
||||
proxy_.callMethod("NewSecrets").onInterface(INTERFACE_NAME).withArguments(connection);
|
||||
}
|
||||
|
||||
public:
|
||||
uint32_t State()
|
||||
{
|
||||
return proxy_.getProperty("State").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_WiMax_Nsp_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_WiMax_Nsp_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
namespace WiMax {
|
||||
|
||||
class Nsp_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.WiMax.Nsp";
|
||||
|
||||
protected:
|
||||
Nsp_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~Nsp_proxy() = default;
|
||||
|
||||
public:
|
||||
std::string Name()
|
||||
{
|
||||
return proxy_.getProperty("Name").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t SignalQuality()
|
||||
{
|
||||
return proxy_.getProperty("SignalQuality").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t NetworkType()
|
||||
{
|
||||
return proxy_.getProperty("NetworkType").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_WifiP2PPeer_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_WifiP2PPeer_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
namespace NetworkManager {
|
||||
|
||||
class WifiP2PPeer_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager.WifiP2PPeer";
|
||||
|
||||
protected:
|
||||
WifiP2PPeer_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
}
|
||||
|
||||
~WifiP2PPeer_proxy() = default;
|
||||
|
||||
public:
|
||||
std::string Name()
|
||||
{
|
||||
return proxy_.getProperty("Name").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Flags()
|
||||
{
|
||||
return proxy_.getProperty("Flags").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Manufacturer()
|
||||
{
|
||||
return proxy_.getProperty("Manufacturer").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Model()
|
||||
{
|
||||
return proxy_.getProperty("Model").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string ModelNumber()
|
||||
{
|
||||
return proxy_.getProperty("ModelNumber").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Serial()
|
||||
{
|
||||
return proxy_.getProperty("Serial").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> WfdIEs()
|
||||
{
|
||||
return proxy_.getProperty("WfdIEs").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string HwAddress()
|
||||
{
|
||||
return proxy_.getProperty("HwAddress").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint8_t Strength()
|
||||
{
|
||||
return proxy_.getProperty("Strength").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
int32_t LastSeen()
|
||||
{
|
||||
return proxy_.getProperty("LastSeen").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,320 @@
|
||||
|
||||
/*
|
||||
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
|
||||
*/
|
||||
|
||||
#ifndef __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_hpp__proxy__H__
|
||||
#define __sdbuscpp__dbus_hpp_org_freedesktop_NetworkManager_hpp__proxy__H__
|
||||
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace org {
|
||||
namespace freedesktop {
|
||||
|
||||
class NetworkManager_proxy
|
||||
{
|
||||
public:
|
||||
static constexpr const char* INTERFACE_NAME = "org.freedesktop.NetworkManager";
|
||||
|
||||
protected:
|
||||
NetworkManager_proxy(sdbus::IProxy& proxy)
|
||||
: proxy_(proxy)
|
||||
{
|
||||
proxy_.uponSignal("CheckPermissions").onInterface(INTERFACE_NAME).call([this](){ this->onCheckPermissions(); });
|
||||
proxy_.uponSignal("StateChanged").onInterface(INTERFACE_NAME).call([this](const uint32_t& state){ this->onStateChanged(state); });
|
||||
proxy_.uponSignal("DeviceAdded").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& device_path){ this->onDeviceAdded(device_path); });
|
||||
proxy_.uponSignal("DeviceRemoved").onInterface(INTERFACE_NAME).call([this](const sdbus::ObjectPath& device_path){ this->onDeviceRemoved(device_path); });
|
||||
}
|
||||
|
||||
~NetworkManager_proxy() = default;
|
||||
|
||||
virtual void onCheckPermissions() = 0;
|
||||
virtual void onStateChanged(const uint32_t& state) = 0;
|
||||
virtual void onDeviceAdded(const sdbus::ObjectPath& device_path) = 0;
|
||||
virtual void onDeviceRemoved(const sdbus::ObjectPath& device_path) = 0;
|
||||
|
||||
public:
|
||||
void Reload(const uint32_t& flags)
|
||||
{
|
||||
proxy_.callMethod("Reload").onInterface(INTERFACE_NAME).withArguments(flags);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> GetDevices()
|
||||
{
|
||||
std::vector<sdbus::ObjectPath> result;
|
||||
proxy_.callMethod("GetDevices").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> GetAllDevices()
|
||||
{
|
||||
std::vector<sdbus::ObjectPath> result;
|
||||
proxy_.callMethod("GetAllDevices").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
sdbus::ObjectPath GetDeviceByIpIface(const std::string& iface)
|
||||
{
|
||||
sdbus::ObjectPath result;
|
||||
proxy_.callMethod("GetDeviceByIpIface").onInterface(INTERFACE_NAME).withArguments(iface).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
sdbus::ObjectPath ActivateConnection(const sdbus::ObjectPath& connection, const sdbus::ObjectPath& device, const sdbus::ObjectPath& specific_object)
|
||||
{
|
||||
sdbus::ObjectPath result;
|
||||
proxy_.callMethod("ActivateConnection").onInterface(INTERFACE_NAME).withArguments(connection, device, specific_object).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::tuple<sdbus::ObjectPath, sdbus::ObjectPath> AddAndActivateConnection(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection, const sdbus::ObjectPath& device, const sdbus::ObjectPath& specific_object)
|
||||
{
|
||||
std::tuple<sdbus::ObjectPath, sdbus::ObjectPath> result;
|
||||
proxy_.callMethod("AddAndActivateConnection").onInterface(INTERFACE_NAME).withArguments(connection, device, specific_object).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::tuple<sdbus::ObjectPath, sdbus::ObjectPath, std::map<std::string, sdbus::Variant>> AddAndActivateConnection2(const std::map<std::string, std::map<std::string, sdbus::Variant>>& connection, const sdbus::ObjectPath& device, const sdbus::ObjectPath& specific_object, const std::map<std::string, sdbus::Variant>& options)
|
||||
{
|
||||
std::tuple<sdbus::ObjectPath, sdbus::ObjectPath, std::map<std::string, sdbus::Variant>> result;
|
||||
proxy_.callMethod("AddAndActivateConnection2").onInterface(INTERFACE_NAME).withArguments(connection, device, specific_object, options).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void DeactivateConnection(const sdbus::ObjectPath& active_connection)
|
||||
{
|
||||
proxy_.callMethod("DeactivateConnection").onInterface(INTERFACE_NAME).withArguments(active_connection);
|
||||
}
|
||||
|
||||
void Sleep(const bool& sleep)
|
||||
{
|
||||
proxy_.callMethod("Sleep").onInterface(INTERFACE_NAME).withArguments(sleep);
|
||||
}
|
||||
|
||||
void Enable(const bool& enable)
|
||||
{
|
||||
proxy_.callMethod("Enable").onInterface(INTERFACE_NAME).withArguments(enable);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> GetPermissions()
|
||||
{
|
||||
std::map<std::string, std::string> result;
|
||||
proxy_.callMethod("GetPermissions").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void SetLogging(const std::string& level, const std::string& domains)
|
||||
{
|
||||
proxy_.callMethod("SetLogging").onInterface(INTERFACE_NAME).withArguments(level, domains);
|
||||
}
|
||||
|
||||
std::tuple<std::string, std::string> GetLogging()
|
||||
{
|
||||
std::tuple<std::string, std::string> result;
|
||||
proxy_.callMethod("GetLogging").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t CheckConnectivity()
|
||||
{
|
||||
uint32_t result;
|
||||
proxy_.callMethod("CheckConnectivity").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t state()
|
||||
{
|
||||
uint32_t result;
|
||||
proxy_.callMethod("state").onInterface(INTERFACE_NAME).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
sdbus::ObjectPath CheckpointCreate(const std::vector<sdbus::ObjectPath>& devices, const uint32_t& rollback_timeout, const uint32_t& flags)
|
||||
{
|
||||
sdbus::ObjectPath result;
|
||||
proxy_.callMethod("CheckpointCreate").onInterface(INTERFACE_NAME).withArguments(devices, rollback_timeout, flags).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void CheckpointDestroy(const sdbus::ObjectPath& checkpoint)
|
||||
{
|
||||
proxy_.callMethod("CheckpointDestroy").onInterface(INTERFACE_NAME).withArguments(checkpoint);
|
||||
}
|
||||
|
||||
std::map<std::string, uint32_t> CheckpointRollback(const sdbus::ObjectPath& checkpoint)
|
||||
{
|
||||
std::map<std::string, uint32_t> result;
|
||||
proxy_.callMethod("CheckpointRollback").onInterface(INTERFACE_NAME).withArguments(checkpoint).storeResultsTo(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void CheckpointAdjustRollbackTimeout(const sdbus::ObjectPath& checkpoint, const uint32_t& add_timeout)
|
||||
{
|
||||
proxy_.callMethod("CheckpointAdjustRollbackTimeout").onInterface(INTERFACE_NAME).withArguments(checkpoint, add_timeout);
|
||||
}
|
||||
|
||||
public:
|
||||
std::vector<sdbus::ObjectPath> Devices()
|
||||
{
|
||||
return proxy_.getProperty("Devices").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> AllDevices()
|
||||
{
|
||||
return proxy_.getProperty("AllDevices").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> Checkpoints()
|
||||
{
|
||||
return proxy_.getProperty("Checkpoints").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool NetworkingEnabled()
|
||||
{
|
||||
return proxy_.getProperty("NetworkingEnabled").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool WirelessEnabled()
|
||||
{
|
||||
return proxy_.getProperty("WirelessEnabled").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void WirelessEnabled(const bool& value)
|
||||
{
|
||||
proxy_.setProperty("WirelessEnabled").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
bool WirelessHardwareEnabled()
|
||||
{
|
||||
return proxy_.getProperty("WirelessHardwareEnabled").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool WwanEnabled()
|
||||
{
|
||||
return proxy_.getProperty("WwanEnabled").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void WwanEnabled(const bool& value)
|
||||
{
|
||||
proxy_.setProperty("WwanEnabled").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
bool WwanHardwareEnabled()
|
||||
{
|
||||
return proxy_.getProperty("WwanHardwareEnabled").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool WimaxEnabled()
|
||||
{
|
||||
return proxy_.getProperty("WimaxEnabled").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void WimaxEnabled(const bool& value)
|
||||
{
|
||||
proxy_.setProperty("WimaxEnabled").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
bool WimaxHardwareEnabled()
|
||||
{
|
||||
return proxy_.getProperty("WimaxHardwareEnabled").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t RadioFlags()
|
||||
{
|
||||
return proxy_.getProperty("RadioFlags").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<sdbus::ObjectPath> ActiveConnections()
|
||||
{
|
||||
return proxy_.getProperty("ActiveConnections").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath PrimaryConnection()
|
||||
{
|
||||
return proxy_.getProperty("PrimaryConnection").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string PrimaryConnectionType()
|
||||
{
|
||||
return proxy_.getProperty("PrimaryConnectionType").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Metered()
|
||||
{
|
||||
return proxy_.getProperty("Metered").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
sdbus::ObjectPath ActivatingConnection()
|
||||
{
|
||||
return proxy_.getProperty("ActivatingConnection").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool Startup()
|
||||
{
|
||||
return proxy_.getProperty("Startup").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::string Version()
|
||||
{
|
||||
return proxy_.getProperty("Version").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint32_t> VersionInfo()
|
||||
{
|
||||
return proxy_.getProperty("VersionInfo").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::vector<uint32_t> Capabilities()
|
||||
{
|
||||
return proxy_.getProperty("Capabilities").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t State()
|
||||
{
|
||||
return proxy_.getProperty("State").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
uint32_t Connectivity()
|
||||
{
|
||||
return proxy_.getProperty("Connectivity").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool ConnectivityCheckAvailable()
|
||||
{
|
||||
return proxy_.getProperty("ConnectivityCheckAvailable").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
bool ConnectivityCheckEnabled()
|
||||
{
|
||||
return proxy_.getProperty("ConnectivityCheckEnabled").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void ConnectivityCheckEnabled(const bool& value)
|
||||
{
|
||||
proxy_.setProperty("ConnectivityCheckEnabled").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
std::string ConnectivityCheckUri()
|
||||
{
|
||||
return proxy_.getProperty("ConnectivityCheckUri").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
std::map<std::string, sdbus::Variant> GlobalDnsConfiguration()
|
||||
{
|
||||
return proxy_.getProperty("GlobalDnsConfiguration").onInterface(INTERFACE_NAME);
|
||||
}
|
||||
|
||||
void GlobalDnsConfiguration(const std::map<std::string, sdbus::Variant>& value)
|
||||
{
|
||||
proxy_.setProperty("GlobalDnsConfiguration").onInterface(INTERFACE_NAME).toValue(value);
|
||||
}
|
||||
|
||||
private:
|
||||
sdbus::IProxy& proxy_;
|
||||
};
|
||||
|
||||
}} // namespaces
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<node name="/org/sdbuscpp/concatenator">
|
||||
<interface name="org.sdbuscpp.Concatenator">
|
||||
<method name="concatenate">
|
||||
<arg type="ai" name="numbers" direction="in" />
|
||||
<arg type="s" name="separator" direction="in" />
|
||||
<arg type="s" name="concatenatedString" direction="out" />
|
||||
</method>
|
||||
<signal name="concatenated">
|
||||
<arg type="s" name="concatenatedString" />
|
||||
</signal>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection
|
||||
1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="fi.w1.wpa_supplicant1.Group">
|
||||
<signal name="PeerJoined">
|
||||
<arg name="peer" type="o"/>
|
||||
</signal>
|
||||
<signal name="PeerDisconnected">
|
||||
<arg name="peer" type="o"/>
|
||||
</signal>
|
||||
<property name="Members" type="ao" access="read"/>
|
||||
<property name="Group" type="o" access="read"/>
|
||||
<property name="Role" type="s" access="read"/>
|
||||
<property name="SSID" type="ay" access="read"/>
|
||||
<property name="BSSID" type="ay" access="read"/>
|
||||
<property name="Frequency" type="q" access="read"/>
|
||||
<property name="Passphrase" type="s" access="read"/>
|
||||
<property name="PSK" type="ay" access="read"/>
|
||||
<property name="WPSVendorExtensions" type="aay" access="readwrite"/>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,514 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="fi.w1.wpa_supplicant1.Interface">
|
||||
<method name="Scan">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="SignalPoll">
|
||||
<arg name="args" type="a{sv}" direction="out"/>
|
||||
</method>
|
||||
<method name="Disconnect"/>
|
||||
<method name="AddNetwork">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
<arg name="path" type="o" direction="out"/>
|
||||
</method>
|
||||
<method name="Reassociate"/>
|
||||
<method name="Reattach"/>
|
||||
<method name="Reconnect"/>
|
||||
<method name="RemoveNetwork">
|
||||
<arg name="path" type="o" direction="in"/>
|
||||
</method>
|
||||
<method name="RemoveAllNetworks"/>
|
||||
<method name="SelectNetwork">
|
||||
<arg name="path" type="o" direction="in"/>
|
||||
</method>
|
||||
<method name="NetworkReply">
|
||||
<arg name="path" type="o" direction="in"/>
|
||||
<arg name="field" type="s" direction="in"/>
|
||||
<arg name="value" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="Roam">
|
||||
<arg name="addr" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="AddBlob">
|
||||
<arg name="name" type="s" direction="in"/>
|
||||
<arg name="data" type="ay" direction="in"/>
|
||||
</method>
|
||||
<method name="GetBlob">
|
||||
<arg name="name" type="s" direction="in"/>
|
||||
<arg name="data" type="ay" direction="out"/>
|
||||
</method>
|
||||
<method name="RemoveBlob">
|
||||
<arg name="name" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="SetPKCS11EngineAndModulePath">
|
||||
<arg name="pkcs11_engine_path" type="s" direction="in"/>
|
||||
<arg name="pkcs11_module_path" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="FlushBSS">
|
||||
<arg name="age" type="u" direction="in"/>
|
||||
</method>
|
||||
<method name="SubscribeProbeReq"/>
|
||||
<method name="UnsubscribeProbeReq"/>
|
||||
<method name="EAPLogoff"/>
|
||||
<method name="EAPLogon"/>
|
||||
<method name="AutoScan">
|
||||
<arg name="arg" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="TDLSDiscover">
|
||||
<arg name="peer_address" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="TDLSSetup">
|
||||
<arg name="peer_address" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="TDLSStatus">
|
||||
<arg name="peer_address" type="s" direction="in"/>
|
||||
<arg name="status" type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="TDLSTeardown">
|
||||
<arg name="peer_address" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="TDLSChannelSwitch">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="TDLSCancelChannelSwitch">
|
||||
<arg name="peer_address" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="VendorElemAdd">
|
||||
<arg name="frame_id" type="i" direction="in"/>
|
||||
<arg name="ielems" type="ay" direction="in"/>
|
||||
</method>
|
||||
<method name="VendorElemGet">
|
||||
<arg name="frame_id" type="i" direction="in"/>
|
||||
<arg name="ielems" type="ay" direction="out"/>
|
||||
</method>
|
||||
<method name="VendorElemRem">
|
||||
<arg name="frame_id" type="i" direction="in"/>
|
||||
<arg name="ielems" type="ay" direction="in"/>
|
||||
</method>
|
||||
<method name="SaveConfig"/>
|
||||
<method name="AbortScan"/>
|
||||
<method name="AddCred">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
<arg name="path" type="o" direction="out"/>
|
||||
</method>
|
||||
<method name="RemoveCred">
|
||||
<arg name="path" type="o" direction="in"/>
|
||||
</method>
|
||||
<method name="RemoveAllCreds"/>
|
||||
<method name="InterworkingSelect"/>
|
||||
<signal name="ScanDone">
|
||||
<arg name="success" type="b"/>
|
||||
</signal>
|
||||
<signal name="BSSAdded">
|
||||
<arg name="path" type="o"/>
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="BSSRemoved">
|
||||
<arg name="path" type="o"/>
|
||||
</signal>
|
||||
<signal name="BlobAdded">
|
||||
<arg name="name" type="s"/>
|
||||
</signal>
|
||||
<signal name="BlobRemoved">
|
||||
<arg name="name" type="s"/>
|
||||
</signal>
|
||||
<signal name="NetworkAdded">
|
||||
<arg name="path" type="o"/>
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="NetworkRemoved">
|
||||
<arg name="path" type="o"/>
|
||||
</signal>
|
||||
<signal name="NetworkSelected">
|
||||
<arg name="path" type="o"/>
|
||||
</signal>
|
||||
<signal name="PropertiesChanged">
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="ProbeRequest">
|
||||
<arg name="args" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="Certification">
|
||||
<arg name="certification" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="EAP">
|
||||
<arg name="status" type="s"/>
|
||||
<arg name="parameter" type="s"/>
|
||||
</signal>
|
||||
<signal name="StaAuthorized">
|
||||
<arg name="name" type="s"/>
|
||||
</signal>
|
||||
<signal name="StaDeauthorized">
|
||||
<arg name="name" type="s"/>
|
||||
</signal>
|
||||
<signal name="StationAdded">
|
||||
<arg name="path" type="o"/>
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="StationRemoved">
|
||||
<arg name="path" type="o"/>
|
||||
</signal>
|
||||
<signal name="NetworkRequest">
|
||||
<arg name="path" type="o"/>
|
||||
<arg name="field" type="s"/>
|
||||
<arg name="text" type="s"/>
|
||||
</signal>
|
||||
<signal name="InterworkingAPAdded">
|
||||
<arg name="bss" type="o"/>
|
||||
<arg name="cred" type="o"/>
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="InterworkingSelectDone"/>
|
||||
<property name="Capabilities" type="a{sv}" access="read"/>
|
||||
<property name="State" type="s" access="read"/>
|
||||
<property name="Scanning" type="b" access="read"/>
|
||||
<property name="ApScan" type="u" access="readwrite"/>
|
||||
<property name="BSSExpireAge" type="u" access="readwrite"/>
|
||||
<property name="BSSExpireCount" type="u" access="readwrite"/>
|
||||
<property name="Country" type="s" access="readwrite"/>
|
||||
<property name="Ifname" type="s" access="read"/>
|
||||
<property name="Driver" type="s" access="read"/>
|
||||
<property name="BridgeIfname" type="s" access="readwrite"/>
|
||||
<property name="ConfigFile" type="s" access="read"/>
|
||||
<property name="CurrentBSS" type="o" access="read"/>
|
||||
<property name="CurrentNetwork" type="o" access="read"/>
|
||||
<property name="CurrentAuthMode" type="s" access="read"/>
|
||||
<property name="Blobs" type="a{say}" access="read"/>
|
||||
<property name="BSSs" type="ao" access="read"/>
|
||||
<property name="Networks" type="ao" access="read"/>
|
||||
<property name="FastReauth" type="b" access="readwrite"/>
|
||||
<property name="ScanInterval" type="i" access="readwrite"/>
|
||||
<property name="PKCS11EnginePath" type="s" access="read"/>
|
||||
<property name="PKCS11ModulePath" type="s" access="read"/>
|
||||
<property name="DisconnectReason" type="i" access="read"/>
|
||||
<property name="AuthStatusCode" type="i" access="read"/>
|
||||
<property name="AssocStatusCode" type="i" access="read"/>
|
||||
<property name="RoamTime" type="u" access="read"/>
|
||||
<property name="RoamComplete" type="b" access="read"/>
|
||||
<property name="SessionLength" type="u" access="read"/>
|
||||
<property name="BSSTMStatus" type="u" access="read"/>
|
||||
<property name="Stations" type="ao" access="read"/>
|
||||
<property name="MACAddressRandomizationMask" type="a{say}" access="readwrite"/>
|
||||
<property name="CtrlInterface" type="s" access="readwrite"/>
|
||||
<property name="CtrlInterfaceGroup" type="s" access="readwrite"/>
|
||||
<property name="EapolVersion" type="s" access="readwrite"/>
|
||||
<property name="Bgscan" type="s" access="readwrite"/>
|
||||
<property name="UserMpm" type="s" access="readwrite"/>
|
||||
<property name="MaxPeerLinks" type="s" access="readwrite"/>
|
||||
<property name="MeshMaxInactivity" type="s" access="readwrite"/>
|
||||
<property name="MeshFwding" type="s" access="readwrite"/>
|
||||
<property name="Dot11RSNASAERetransPeriod" type="s" access="readwrite"/>
|
||||
<property name="DisableScanOffload" type="s" access="readwrite"/>
|
||||
<property name="OpenscEnginePath" type="s" access="readwrite"/>
|
||||
<property name="OpensslCiphers" type="s" access="readwrite"/>
|
||||
<property name="PcscReader" type="s" access="readwrite"/>
|
||||
<property name="PcscPin" type="s" access="readwrite"/>
|
||||
<property name="ExternalSim" type="s" access="readwrite"/>
|
||||
<property name="DriverParam" type="s" access="readwrite"/>
|
||||
<property name="Dot11RSNAConfigPMKLifetime" type="s" access="readwrite"/>
|
||||
<property name="Dot11RSNAConfigPMKReauthThreshold" type="s" access="readwrite"/>
|
||||
<property name="Dot11RSNAConfigSATimeout" type="s" access="readwrite"/>
|
||||
<property name="UpdateConfig" type="s" access="readwrite"/>
|
||||
<property name="Uuid" type="s" access="readwrite"/>
|
||||
<property name="AutoUuid" type="s" access="readwrite"/>
|
||||
<property name="DeviceName" type="s" access="readwrite"/>
|
||||
<property name="Manufacturer" type="s" access="readwrite"/>
|
||||
<property name="ModelName" type="s" access="readwrite"/>
|
||||
<property name="ModelNumber" type="s" access="readwrite"/>
|
||||
<property name="SerialNumber" type="s" access="readwrite"/>
|
||||
<property name="DeviceType" type="s" access="readwrite"/>
|
||||
<property name="OsVersion" type="s" access="readwrite"/>
|
||||
<property name="ConfigMethods" type="s" access="readwrite"/>
|
||||
<property name="WpsCredProcessing" type="s" access="readwrite"/>
|
||||
<property name="WpsCredAddSae" type="s" access="readwrite"/>
|
||||
<property name="WpsVendorExtM1" type="s" access="readwrite"/>
|
||||
<property name="SecDeviceType" type="s" access="readwrite"/>
|
||||
<property name="P2pListenRegClass" type="s" access="readwrite"/>
|
||||
<property name="P2pListenChannel" type="s" access="readwrite"/>
|
||||
<property name="P2pOperRegClass" type="s" access="readwrite"/>
|
||||
<property name="P2pOperChannel" type="s" access="readwrite"/>
|
||||
<property name="P2pGoIntent" type="s" access="readwrite"/>
|
||||
<property name="P2pSsidPostfix" type="s" access="readwrite"/>
|
||||
<property name="PersistentReconnect" type="s" access="readwrite"/>
|
||||
<property name="P2pIntraBss" type="s" access="readwrite"/>
|
||||
<property name="P2pGroupIdle" type="s" access="readwrite"/>
|
||||
<property name="P2pGoFreqChangePolicy" type="s" access="readwrite"/>
|
||||
<property name="P2pPassphraseLen" type="s" access="readwrite"/>
|
||||
<property name="P2pPrefChan" type="s" access="readwrite"/>
|
||||
<property name="P2pNoGoFreq" type="s" access="readwrite"/>
|
||||
<property name="P2pAddCliChan" type="s" access="readwrite"/>
|
||||
<property name="P2pOptimizeListenChan" type="s" access="readwrite"/>
|
||||
<property name="P2pGoHt40" type="s" access="readwrite"/>
|
||||
<property name="P2pGoVht" type="s" access="readwrite"/>
|
||||
<property name="P2pGoHe" type="s" access="readwrite"/>
|
||||
<property name="P2pGoEdmg" type="s" access="readwrite"/>
|
||||
<property name="P2pDisabled" type="s" access="readwrite"/>
|
||||
<property name="P2pGoCtwindow" type="s" access="readwrite"/>
|
||||
<property name="P2pNoGroupIface" type="s" access="readwrite"/>
|
||||
<property name="P2pIgnoreSharedFreq" type="s" access="readwrite"/>
|
||||
<property name="IpAddrGo" type="s" access="readwrite"/>
|
||||
<property name="IpAddrMask" type="s" access="readwrite"/>
|
||||
<property name="IpAddrStart" type="s" access="readwrite"/>
|
||||
<property name="IpAddrEnd" type="s" access="readwrite"/>
|
||||
<property name="P2pCliProbe" type="s" access="readwrite"/>
|
||||
<property name="P2pDeviceRandomMacAddr" type="s" access="readwrite"/>
|
||||
<property name="P2pDevicePersistentMacAddr" type="s" access="readwrite"/>
|
||||
<property name="P2pInterfaceRandomMacAddr" type="s" access="readwrite"/>
|
||||
<property name="P2p6ghzDisable" type="s" access="readwrite"/>
|
||||
<property name="BssMaxCount" type="s" access="readwrite"/>
|
||||
<property name="FilterSsids" type="s" access="readwrite"/>
|
||||
<property name="FilterRssi" type="s" access="readwrite"/>
|
||||
<property name="MaxNumSta" type="s" access="readwrite"/>
|
||||
<property name="ApIsolate" type="s" access="readwrite"/>
|
||||
<property name="DisassocLowAck" type="s" access="readwrite"/>
|
||||
<property name="Hs20" type="s" access="readwrite"/>
|
||||
<property name="Interworking" type="s" access="readwrite"/>
|
||||
<property name="Hessid" type="s" access="readwrite"/>
|
||||
<property name="AccessNetworkType" type="s" access="readwrite"/>
|
||||
<property name="GoInterworking" type="s" access="readwrite"/>
|
||||
<property name="GoAccessNetworkType" type="s" access="readwrite"/>
|
||||
<property name="GoInternet" type="s" access="readwrite"/>
|
||||
<property name="GoVenueGroup" type="s" access="readwrite"/>
|
||||
<property name="GoVenueType" type="s" access="readwrite"/>
|
||||
<property name="PbcInM1" type="s" access="readwrite"/>
|
||||
<property name="Autoscan" type="s" access="readwrite"/>
|
||||
<property name="WpsNfcDevPwId" type="s" access="readwrite"/>
|
||||
<property name="WpsNfcDhPubkey" type="s" access="readwrite"/>
|
||||
<property name="WpsNfcDhPrivkey" type="s" access="readwrite"/>
|
||||
<property name="WpsNfcDevPw" type="s" access="readwrite"/>
|
||||
<property name="ExtPasswordBackend" type="s" access="readwrite"/>
|
||||
<property name="P2pGoMaxInactivity" type="s" access="readwrite"/>
|
||||
<property name="AutoInterworking" type="s" access="readwrite"/>
|
||||
<property name="Okc" type="s" access="readwrite"/>
|
||||
<property name="Pmf" type="s" access="readwrite"/>
|
||||
<property name="SaeGroups" type="s" access="readwrite"/>
|
||||
<property name="SaePwe" type="s" access="readwrite"/>
|
||||
<property name="SaePmkidInAssoc" type="s" access="readwrite"/>
|
||||
<property name="DtimPeriod" type="s" access="readwrite"/>
|
||||
<property name="BeaconInt" type="s" access="readwrite"/>
|
||||
<property name="ApAssocrespElements" type="s" access="readwrite"/>
|
||||
<property name="ApVendorElements" type="s" access="readwrite"/>
|
||||
<property name="IgnoreOldScanRes" type="s" access="readwrite"/>
|
||||
<property name="FreqList" type="s" access="readwrite"/>
|
||||
<property name="InitialFreqList" type="s" access="readwrite"/>
|
||||
<property name="ScanCurFreq" type="s" access="readwrite"/>
|
||||
<property name="ScanResValidForConnect" type="s" access="readwrite"/>
|
||||
<property name="SchedScanInterval" type="s" access="readwrite"/>
|
||||
<property name="SchedScanStartDelay" type="s" access="readwrite"/>
|
||||
<property name="TdlsExternalControl" type="s" access="readwrite"/>
|
||||
<property name="OsuDir" type="s" access="readwrite"/>
|
||||
<property name="WowlanTriggers" type="s" access="readwrite"/>
|
||||
<property name="P2pSearchDelay" type="s" access="readwrite"/>
|
||||
<property name="MacAddr" type="s" access="readwrite"/>
|
||||
<property name="RandAddrLifetime" type="s" access="readwrite"/>
|
||||
<property name="PreassocMacAddr" type="s" access="readwrite"/>
|
||||
<property name="KeyMgmtOffload" type="s" access="readwrite"/>
|
||||
<property name="PassiveScan" type="s" access="readwrite"/>
|
||||
<property name="ReassocSameBssOptim" type="s" access="readwrite"/>
|
||||
<property name="WpsPriority" type="s" access="readwrite"/>
|
||||
<property name="FstGroupId" type="s" access="readwrite"/>
|
||||
<property name="FstPriority" type="s" access="readwrite"/>
|
||||
<property name="FstLlt" type="s" access="readwrite"/>
|
||||
<property name="CertInCb" type="s" access="readwrite"/>
|
||||
<property name="WpaRscRelaxation" type="s" access="readwrite"/>
|
||||
<property name="SchedScanPlans" type="s" access="readwrite"/>
|
||||
<property name="NonPrefChan" type="s" access="readwrite"/>
|
||||
<property name="MboCellCapa" type="s" access="readwrite"/>
|
||||
<property name="DisassocImminentRssiThreshold" type="s" access="readwrite"/>
|
||||
<property name="Oce" type="s" access="readwrite"/>
|
||||
<property name="GasAddress3" type="s" access="readwrite"/>
|
||||
<property name="FtmResponder" type="s" access="readwrite"/>
|
||||
<property name="FtmInitiator" type="s" access="readwrite"/>
|
||||
<property name="GasRandAddrLifetime" type="s" access="readwrite"/>
|
||||
<property name="GasRandMacAddr" type="s" access="readwrite"/>
|
||||
<property name="DppConfigProcessing" type="s" access="readwrite"/>
|
||||
<property name="DppName" type="s" access="readwrite"/>
|
||||
<property name="DppMudUrl" type="s" access="readwrite"/>
|
||||
<property name="ColocIntfReporting" type="s" access="readwrite"/>
|
||||
<property name="DisableBtm" type="s" access="readwrite"/>
|
||||
<property name="ExtendedKeyId" type="s" access="readwrite"/>
|
||||
<property name="WowlanDisconnectOnDeinit" type="s" access="readwrite"/>
|
||||
</interface>
|
||||
<interface name="fi.w1.wpa_supplicant1.Interface.WPS">
|
||||
<method name="Start">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
<arg name="output" type="a{sv}" direction="out"/>
|
||||
</method>
|
||||
<method name="Cancel"/>
|
||||
<signal name="Event">
|
||||
<arg name="name" type="s"/>
|
||||
<arg name="args" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="Credentials">
|
||||
<arg name="credentials" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="PropertiesChanged">
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<property name="ProcessCredentials" type="b" access="readwrite"/>
|
||||
<property name="ConfigMethods" type="s" access="readwrite"/>
|
||||
<property name="DeviceName" type="s" access="readwrite"/>
|
||||
<property name="Manufacturer" type="s" access="readwrite"/>
|
||||
<property name="ModelName" type="s" access="readwrite"/>
|
||||
<property name="ModelNumber" type="s" access="readwrite"/>
|
||||
<property name="SerialNumber" type="s" access="readwrite"/>
|
||||
<property name="DeviceType" type="ay" access="readwrite"/>
|
||||
</interface>
|
||||
<interface name="fi.w1.wpa_supplicant1.Interface.P2PDevice">
|
||||
<method name="Find">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="StopFind"/>
|
||||
<method name="Listen">
|
||||
<arg name="timeout" type="i" direction="in"/>
|
||||
</method>
|
||||
<method name="ExtendedListen">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="PresenceRequest">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="ProvisionDiscoveryRequest">
|
||||
<arg name="peer" type="o" direction="in"/>
|
||||
<arg name="config_method" type="s" direction="in"/>
|
||||
</method>
|
||||
<method name="Connect">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
<arg name="generated_pin" type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="GroupAdd">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="Cancel"/>
|
||||
<method name="Invite">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="Disconnect"/>
|
||||
<method name="RejectPeer">
|
||||
<arg name="peer" type="o" direction="in"/>
|
||||
</method>
|
||||
<method name="RemoveClient">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="Flush"/>
|
||||
<method name="AddService">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="DeleteService">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="FlushService"/>
|
||||
<method name="ServiceDiscoveryRequest">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
<arg name="ref" type="t" direction="out"/>
|
||||
</method>
|
||||
<method name="ServiceDiscoveryResponse">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
<method name="ServiceDiscoveryCancelRequest">
|
||||
<arg name="args" type="t" direction="in"/>
|
||||
</method>
|
||||
<method name="ServiceUpdate"/>
|
||||
<method name="ServiceDiscoveryExternal">
|
||||
<arg name="arg" type="i" direction="in"/>
|
||||
</method>
|
||||
<method name="AddPersistentGroup">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
<arg name="path" type="o" direction="out"/>
|
||||
</method>
|
||||
<method name="RemovePersistentGroup">
|
||||
<arg name="path" type="o" direction="in"/>
|
||||
</method>
|
||||
<method name="RemoveAllPersistentGroups"/>
|
||||
<signal name="DeviceFound">
|
||||
<arg name="path" type="o"/>
|
||||
</signal>
|
||||
<signal name="DeviceFoundProperties">
|
||||
<arg name="path" type="o"/>
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="DeviceLost">
|
||||
<arg name="path" type="o"/>
|
||||
</signal>
|
||||
<signal name="FindStopped"/>
|
||||
<signal name="ProvisionDiscoveryRequestDisplayPin">
|
||||
<arg name="peer_object" type="o"/>
|
||||
<arg name="pin" type="s"/>
|
||||
</signal>
|
||||
<signal name="ProvisionDiscoveryResponseDisplayPin">
|
||||
<arg name="peer_object" type="o"/>
|
||||
<arg name="pin" type="s"/>
|
||||
</signal>
|
||||
<signal name="ProvisionDiscoveryRequestEnterPin">
|
||||
<arg name="peer_object" type="o"/>
|
||||
</signal>
|
||||
<signal name="ProvisionDiscoveryResponseEnterPin">
|
||||
<arg name="peer_object" type="o"/>
|
||||
</signal>
|
||||
<signal name="ProvisionDiscoveryPBCRequest">
|
||||
<arg name="peer_object" type="o"/>
|
||||
</signal>
|
||||
<signal name="ProvisionDiscoveryPBCResponse">
|
||||
<arg name="peer_object" type="o"/>
|
||||
</signal>
|
||||
<signal name="ProvisionDiscoveryFailure">
|
||||
<arg name="peer_object" type="o"/>
|
||||
<arg name="status" type="i"/>
|
||||
</signal>
|
||||
<signal name="GroupStarted">
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="GroupFormationFailure">
|
||||
<arg name="reason" type="s"/>
|
||||
</signal>
|
||||
<signal name="GONegotiationSuccess">
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="GONegotiationFailure">
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="GONegotiationRequest">
|
||||
<arg name="path" type="o"/>
|
||||
<arg name="dev_passwd_id" type="q"/>
|
||||
<arg name="device_go_intent" type="y"/>
|
||||
</signal>
|
||||
<signal name="InvitationResult">
|
||||
<arg name="invite_result" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="GroupFinished">
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="ServiceDiscoveryRequest">
|
||||
<arg name="sd_request" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="ServiceDiscoveryResponse">
|
||||
<arg name="sd_response" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="PersistentGroupAdded">
|
||||
<arg name="path" type="o"/>
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="PersistentGroupRemoved">
|
||||
<arg name="path" type="o"/>
|
||||
</signal>
|
||||
<signal name="WpsFailed">
|
||||
<arg name="name" type="s"/>
|
||||
<arg name="args" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="InvitationReceived">
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<property name="P2PDeviceConfig" type="a{sv}" access="readwrite"/>
|
||||
<property name="Peers" type="ao" access="read"/>
|
||||
<property name="Role" type="s" access="read"/>
|
||||
<property name="Group" type="o" access="read"/>
|
||||
<property name="PeerGO" type="o" access="read"/>
|
||||
<property name="PersistentGroups" type="ao" access="read"/>
|
||||
</interface>
|
||||
<interface name="fi.w1.wpa_supplicant1.PersistentGroup">
|
||||
<property name="Properties" type="a{sv}" access="readwrite"/>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,32 @@
|
||||
('<?xml version="1.0"?>\n'
|
||||
'<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection '
|
||||
'1.0//EN"\n'
|
||||
'"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">\n'
|
||||
'<node><interface name="org.freedesktop.DBus.Introspectable"><method '
|
||||
'name="Introspect"><arg name="data" type="s" '
|
||||
'direction="out"/></method></interface><interface '
|
||||
'name="org.freedesktop.DBus.Properties"><method name="Get"><arg '
|
||||
'name="interface" type="s" direction="in"/><arg name="propname" type="s" '
|
||||
'direction="in"/><arg name="value" type="v" direction="out"/></method><method '
|
||||
'name="GetAll"><arg name="interface" type="s" direction="in"/><arg '
|
||||
'name="props" type="a{sv}" direction="out"/></method><method name="Set"><arg '
|
||||
'name="interface" type="s" direction="in"/><arg name="propname" type="s" '
|
||||
'direction="in"/><arg name="value" type="v" '
|
||||
'direction="in"/></method></interface><interface '
|
||||
'name="fi.w1.wpa_supplicant1"><method name="CreateInterface"><arg name="args" '
|
||||
'type="a{sv}" direction="in"/><arg name="path" type="o" '
|
||||
'direction="out"/></method><method name="RemoveInterface"><arg name="path" '
|
||||
'type="o" direction="in"/></method><method name="GetInterface"><arg '
|
||||
'name="ifname" type="s" direction="in"/><arg name="path" type="o" '
|
||||
'direction="out"/></method><method name="ExpectDisconnect"/><signal '
|
||||
'name="InterfaceAdded"><arg name="path" type="o"/><arg name="properties" '
|
||||
'type="a{sv}"/></signal><signal name="InterfaceRemoved"><arg name="path" '
|
||||
'type="o"/></signal><signal name="PropertiesChanged"><arg name="properties" '
|
||||
'type="a{sv}"/></signal><property name="DebugLevel" type="s" '
|
||||
'access="readwrite"/><property name="DebugTimestamp" type="b" '
|
||||
'access="readwrite"/><property name="DebugShowKeys" type="b" '
|
||||
'access="readwrite"/><property name="Interfaces" type="ao" '
|
||||
'access="read"/><property name="EapMethods" type="as" '
|
||||
'access="read"/><property name="Capabilities" type="as" '
|
||||
'access="read"/><property name="WFDIEs" type="ay" '
|
||||
'access="readwrite"/></interface><node name="Interfaces"/></node>\n')
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="fi.w1.wpa_supplicant1.Peer">
|
||||
<signal name="PropertiesChanged">
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<property name="DeviceName" type="s" access="read"/>
|
||||
<property name="Manufacturer" type="s" access="read"/>
|
||||
<property name="ModelName" type="s" access="read"/>
|
||||
<property name="ModelNumber" type="s" access="read"/>
|
||||
<property name="SerialNumber" type="s" access="read"/>
|
||||
<property name="PrimaryDeviceType" type="ay" access="read"/>
|
||||
<property name="config_method" type="q" access="read"/>
|
||||
<property name="level" type="i" access="read"/>
|
||||
<property name="devicecapability" type="y" access="read"/>
|
||||
<property name="groupcapability" type="y" access="read"/>
|
||||
<property name="SecondaryDeviceTypes" type="aay" access="read"/>
|
||||
<property name="VendorExtension" type="aay" access="read"/>
|
||||
<property name="IEs" type="ay" access="read"/>
|
||||
<property name="DeviceAddress" type="ay" access="read"/>
|
||||
<property name="Groups" type="ao" access="read"/>
|
||||
<property name="VSIE" type="ay" access="read"/>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="fi.w1.wpa_supplicant1">
|
||||
<method name="CreateInterface">
|
||||
<arg name="args" type="a{sv}" direction="in"/>
|
||||
<arg name="path" type="o" direction="out"/>
|
||||
</method>
|
||||
<method name="RemoveInterface">
|
||||
<arg name="path" type="o" direction="in"/>
|
||||
</method>
|
||||
<method name="GetInterface">
|
||||
<arg name="ifname" type="s" direction="in"/>
|
||||
<arg name="path" type="o" direction="out"/>
|
||||
</method>
|
||||
<method name="ExpectDisconnect"/>
|
||||
<signal name="InterfaceAdded">
|
||||
<arg name="path" type="o"/>
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<signal name="InterfaceRemoved">
|
||||
<arg name="path" type="o"/>
|
||||
</signal>
|
||||
<signal name="PropertiesChanged">
|
||||
<arg name="properties" type="a{sv}"/>
|
||||
</signal>
|
||||
<property name="DebugLevel" type="s" access="readwrite"/>
|
||||
<property name="DebugTimestamp" type="b" access="readwrite"/>
|
||||
<property name="DebugShowKeys" type="b" access="readwrite"/>
|
||||
<property name="Interfaces" type="ao" access="read"/>
|
||||
<property name="EapMethods" type="as" access="read"/>
|
||||
<property name="Capabilities" type="as" access="read"/>
|
||||
<property name="WFDIEs" type="ay" access="readwrite"/>
|
||||
</interface>
|
||||
<node name="Interfaces"/>
|
||||
</node>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="org.freedesktop.DBus.Properties">
|
||||
<method name="Get">
|
||||
<arg name="interface" type="s" direction="in"/>
|
||||
<arg name="propname" type="s" direction="in"/>
|
||||
<arg name="value" type="v" direction="out"/>
|
||||
</method>
|
||||
<method name="GetAll">
|
||||
<arg name="interface" type="s" direction="in"/>
|
||||
<arg name="props" type="a{sv}" direction="out"/>
|
||||
</method>
|
||||
<method name="Set">
|
||||
<arg name="interface" type="s" direction="in"/>
|
||||
<arg name="propname" type="s" direction="in"/>
|
||||
<arg name="value" type="v" direction="in"/>
|
||||
</method>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.AccessPoint:
|
||||
@short_description: Wi-Fi Access Point.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.AccessPoint">
|
||||
|
||||
<!--
|
||||
Flags:
|
||||
|
||||
Flags describing the capabilities of the access point.
|
||||
|
||||
Returns: <link linkend="NM80211ApFlags">NM80211ApFlags</link>
|
||||
-->
|
||||
<property name="Flags" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
WpaFlags:
|
||||
|
||||
Flags describing the access point's capabilities according to WPA (Wifi
|
||||
Protected Access).
|
||||
|
||||
Returns: <link linkend="NM80211ApSecurityFlags">NM80211ApSecurityFlags</link>
|
||||
-->
|
||||
<property name="WpaFlags" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
RsnFlags:
|
||||
|
||||
Flags describing the access point's capabilities according to the RSN
|
||||
(Robust Secure Network) protocol.
|
||||
|
||||
Returns: <link linkend="NM80211ApSecurityFlags">NM80211ApSecurityFlags</link>
|
||||
-->
|
||||
<property name="RsnFlags" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
Ssid:
|
||||
|
||||
The Service Set Identifier identifying the access point.
|
||||
-->
|
||||
<property name="Ssid" type="ay" access="read">
|
||||
<!-- gdbus-codegen assumes that "ay" means "non-UTF-8 string" and
|
||||
won't deal with '\0' bytes correctly.
|
||||
-->
|
||||
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="1"/>
|
||||
</property>
|
||||
|
||||
<!--
|
||||
Frequency:
|
||||
|
||||
The radio channel frequency in use by the access point, in MHz.
|
||||
-->
|
||||
<property name="Frequency" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
HwAddress:
|
||||
|
||||
The hardware address (BSSID) of the access point.
|
||||
-->
|
||||
<property name="HwAddress" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Mode:
|
||||
|
||||
Describes the operating mode of the access point.
|
||||
|
||||
Returns: <link linkend="NM80211Mode">NM80211Mode</link>
|
||||
-->
|
||||
<property name="Mode" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
MaxBitrate:
|
||||
|
||||
The maximum bitrate this access point is capable of, in kilobits/second
|
||||
(Kb/s).
|
||||
-->
|
||||
<property name="MaxBitrate" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
Strength:
|
||||
|
||||
The current signal quality of the access point, in percent.
|
||||
-->
|
||||
<property name="Strength" type="y" access="read"/>
|
||||
|
||||
<!--
|
||||
LastSeen:
|
||||
|
||||
The timestamp (in CLOCK_BOOTTIME seconds) for the last time the access
|
||||
point was found in scan results. A value of -1 means the access point has
|
||||
never been found in scan results.
|
||||
-->
|
||||
<property name="LastSeen" type="i" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/org/freedesktop/NetworkManager/AgentManager">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.AgentManager:
|
||||
@short_description: Secret Agent Manager.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.AgentManager">
|
||||
|
||||
<!--
|
||||
Register:
|
||||
@identifier: Identifies this agent; only one agent in each user session may use the same identifier. Identifier formatting follows the same rules as D-Bus bus names with the exception that the ':' character is not allowed. The valid set of characters is "[A-Z][a-z][0-9]_-." and the identifier is limited in length to 255 characters with a minimum of 3 characters. An example valid identifier is 'org.gnome.nm-applet' (without quotes).
|
||||
|
||||
Called by secret Agents to register their ability to provide and save
|
||||
network secrets.
|
||||
-->
|
||||
<method name="Register">
|
||||
<arg name="identifier" type="s" direction="in"/>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
RegisterWithCapabilities:
|
||||
@identifier: See the Register() method's identifier argument.
|
||||
@capabilities: (<link linkend="NMSecretAgentCapabilities">NMSecretAgentCapabilities</link>) Indicates various agent capabilities to NetworkManager.
|
||||
|
||||
Like Register() but indicates agent capabilities to NetworkManager.
|
||||
-->
|
||||
<method name="RegisterWithCapabilities">
|
||||
<arg name="identifier" type="s" direction="in"/>
|
||||
<arg name="capabilities" type="u" direction="in"/>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
Unregister:
|
||||
|
||||
Called by secret Agents to notify NetworkManager that they will no longer
|
||||
handle requests for network secrets. Agents are automatically unregistered
|
||||
when they disconnect from D-Bus.
|
||||
-->
|
||||
<method name="Unregister"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Checkpoint:
|
||||
@short_description: Configuration and State Snapshot.
|
||||
|
||||
A snapshot of NetworkManager state for a given device list
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Checkpoint">
|
||||
<annotation name="org.gtk.GDBus.C.Name" value="Checkpoint"/>
|
||||
|
||||
<!--
|
||||
Devices:
|
||||
|
||||
Array of object paths for devices which are part of this
|
||||
checkpoint.
|
||||
-->
|
||||
<property name="Devices" type="ao" access="read"/>
|
||||
|
||||
<!--
|
||||
Created:
|
||||
|
||||
The timestamp (in CLOCK_BOOTTIME milliseconds) of checkpoint creation.
|
||||
-->
|
||||
<property name="Created" type="x" access="read"/>
|
||||
|
||||
<!--
|
||||
RollbackTimeout:
|
||||
|
||||
Timeout in seconds for automatic rollback, or zero.
|
||||
-->
|
||||
<property name="RollbackTimeout" type="u" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,185 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Connection.Active:
|
||||
@short_description: Active Connection.
|
||||
|
||||
Objects that implement the Connection.Active interface represent an
|
||||
attempt to connect to a network using the details provided by a Connection
|
||||
object. The Connection.Active object tracks the life-cycle of the
|
||||
connection attempt and if successful indicates whether the connected
|
||||
network is the "default" or preferred network for access. NetworkManager
|
||||
has the concept of connections, which can be thought of as settings, a
|
||||
profile or a configuration that can be applied on a networking device.
|
||||
Such settings-connections are exposed as D-Bus object and the
|
||||
active-connection expresses this relationship between device and
|
||||
settings-connection. At any time a settings-connection can only be
|
||||
activated on one device and vice versa. However, during activation and
|
||||
deactivation multiple active-connections can reference the same device or
|
||||
settings-connection as they are waiting to be activated or to be
|
||||
deactivated.
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Connection.Active">
|
||||
<annotation name="org.gtk.GDBus.C.Name" value="ActiveConnection"/>
|
||||
|
||||
<!--
|
||||
Connection:
|
||||
|
||||
The path of the connection.
|
||||
-->
|
||||
<property name="Connection" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
SpecificObject:
|
||||
|
||||
A specific object associated with the active connection. This property
|
||||
reflects the specific object used during connection activation, and will
|
||||
not change over the lifetime of the ActiveConnection once set.
|
||||
-->
|
||||
<property name="SpecificObject" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Id:
|
||||
|
||||
The ID of the connection, provided as a convenience so that clients do not
|
||||
have to retrieve all connection details.
|
||||
-->
|
||||
<property name="Id" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Uuid:
|
||||
|
||||
The UUID of the connection, provided as a convenience so that clients do
|
||||
not have to retrieve all connection details.
|
||||
-->
|
||||
<property name="Uuid" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Type:
|
||||
|
||||
The type of the connection, provided as a convenience so that clients do
|
||||
not have to retrieve all connection details.
|
||||
-->
|
||||
<property name="Type" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Devices:
|
||||
|
||||
Array of object paths representing devices which are part of this active
|
||||
connection.
|
||||
-->
|
||||
<property name="Devices" type="ao" access="read"/>
|
||||
|
||||
<!--
|
||||
State:
|
||||
|
||||
The state of this active connection.
|
||||
|
||||
Returns: <link linkend="NMActiveConnectionState">NMActiveConnectionState</link>
|
||||
-->
|
||||
<property name="State" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
StateFlags:
|
||||
|
||||
The state flags of this active connection.
|
||||
|
||||
Returns: <link linkend="NMActivationStateFlags">NMActivationStateFlags</link>
|
||||
-->
|
||||
<property name="StateFlags" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
StateChanged:
|
||||
@state: (<link linkend="NMActiveConnectionState">NMActiveConnectionState</link>) The new state of the active connection.
|
||||
@reason: (<link linkend="NMActiveConnectionStateReason">NMActiveConnectionStateReason</link>) Reason code describing the change to the new state.
|
||||
@since: 1.8
|
||||
|
||||
Emitted when the state of the active connection has changed.
|
||||
|
||||
-->
|
||||
<signal name="StateChanged">
|
||||
<arg name="state" type="u"/>
|
||||
<arg name="reason" type="u"/>
|
||||
</signal>
|
||||
|
||||
<!--
|
||||
Default:
|
||||
|
||||
Whether this active connection is the default IPv4 connection, i.e.
|
||||
whether it currently owns the default IPv4 route.
|
||||
-->
|
||||
<property name="Default" type="b" access="read"/>
|
||||
|
||||
<!--
|
||||
Ip4Config:
|
||||
|
||||
Object path of the Ip4Config object describing the configuration of the
|
||||
connection. Only valid when the connection is in the
|
||||
NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
|
||||
-->
|
||||
<property name="Ip4Config" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Dhcp4Config:
|
||||
|
||||
Object path of the Dhcp4Config object describing the DHCP options returned
|
||||
by the DHCP server (assuming the connection used DHCP). Only valid when
|
||||
the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
|
||||
-->
|
||||
<property name="Dhcp4Config" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Default6:
|
||||
|
||||
Whether this active connection is the default IPv6 connection, i.e.
|
||||
whether it currently owns the default IPv6 route.
|
||||
-->
|
||||
<property name="Default6" type="b" access="read"/>
|
||||
|
||||
<!--
|
||||
Ip6Config:
|
||||
|
||||
Object path of the Ip6Config object describing the configuration of the
|
||||
connection. Only valid when the connection is in the
|
||||
NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
|
||||
-->
|
||||
<property name="Ip6Config" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Dhcp6Config:
|
||||
|
||||
Object path of the Dhcp6Config object describing the DHCP options returned
|
||||
by the DHCP server (assuming the connection used DHCP). Only valid when
|
||||
the connection is in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
|
||||
-->
|
||||
<property name="Dhcp6Config" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Vpn:
|
||||
|
||||
Whether this active connection is also a VPN connection.
|
||||
-->
|
||||
<property name="Vpn" type="b" access="read"/>
|
||||
|
||||
<!--
|
||||
Controller:
|
||||
@Since: 1.44, 1.42.2
|
||||
|
||||
The path to the controller device if the connection is a port. This
|
||||
property replaces the deprecated 'Master' property.
|
||||
-->
|
||||
<property name="Controller" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Master:
|
||||
|
||||
The path to the controller device if the connection is a port.
|
||||
|
||||
This property is deprecated in favor of the 'Controller'
|
||||
property since 1.44 and 1.42.2.
|
||||
-->
|
||||
<property name="Master" type="o" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.DHCP4Config:
|
||||
@short_description: IPv4 DHCP Client State.
|
||||
|
||||
Options and configuration returned by the IPv4 DHCP server.
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.DHCP4Config">
|
||||
<annotation name="org.gtk.GDBus.C.Name" value="Dhcp4Config"/>
|
||||
|
||||
<!--
|
||||
Options:
|
||||
|
||||
Configuration options returned by a DHCP server, if any.
|
||||
-->
|
||||
<property name="Options" type="a{sv}" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.DHCP6Config:
|
||||
@short_description: IPv6 DHCP Client State.
|
||||
|
||||
Options and configuration returned by the IPv6 DHCP server.
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.DHCP6Config">
|
||||
<annotation name="org.gtk.GDBus.C.Name" value="Dhcp6Config"/>
|
||||
|
||||
<!--
|
||||
Options:
|
||||
|
||||
Configuration options returned by a DHCP server, if any.
|
||||
-->
|
||||
<property name="Options" type="a{sv}" access="read"/>
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.Bond:
|
||||
@short_description: Bonding Device.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.Bond">
|
||||
|
||||
<!--
|
||||
HwAddress:
|
||||
|
||||
Hardware address of the device.
|
||||
n
|
||||
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||
-->
|
||||
<property name="HwAddress" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Carrier:
|
||||
|
||||
Indicates whether the physical carrier is found (e.g. whether a cable is
|
||||
plugged in or not).
|
||||
|
||||
DEPRECATED: check for the "lower-up" flag in the "InterfaceFlags"
|
||||
property on the "org.freedesktop.NetworkManager.Device" interface.
|
||||
-->
|
||||
<property name="Carrier" type="b" access="read"/>
|
||||
|
||||
<!--
|
||||
Slaves:
|
||||
|
||||
DEPRECATED. Use the "Ports" property in
|
||||
"org.freedesktop.NetworkManager.Device" instead which exists since
|
||||
version NetworkManager 1.34.0.
|
||||
-->
|
||||
<property name="Slaves" type="ao" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.Dummy:
|
||||
@short_description: Dummy Device.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.Dummy">
|
||||
|
||||
<!--
|
||||
HwAddress:
|
||||
|
||||
Hardware address of the device.
|
||||
n
|
||||
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||
-->
|
||||
<property name="HwAddress" type="s" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.Generic:
|
||||
@short_description: Unrecognized Device.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.Generic">
|
||||
|
||||
<!--
|
||||
HwAddress:
|
||||
|
||||
Hardware address of the device.
|
||||
n
|
||||
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||
-->
|
||||
<property name="HwAddress" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
TypeDescription:
|
||||
|
||||
A (non-localized) description of the interface type, if known.
|
||||
-->
|
||||
<property name="TypeDescription" type="s" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.Loopback:
|
||||
@short_description: Loopback Device.
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.Loopback"/>
|
||||
</node>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.Modem:
|
||||
@short_description: Modem Device.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.Modem">
|
||||
<!--
|
||||
ModemCapabilities:
|
||||
|
||||
The generic family of access technologies the modem supports. Not all
|
||||
capabilities are available at the same time however; some modems require a
|
||||
firmware reload or other reinitialization to switch between eg CDMA/EVDO
|
||||
and GSM/UMTS.
|
||||
|
||||
Returns: <link linkend="NMDeviceModemCapabilities">NMDeviceModemCapabilities</link>
|
||||
-->
|
||||
<property name="ModemCapabilities" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
CurrentCapabilities:
|
||||
|
||||
The generic family of access technologies the modem currently supports
|
||||
without a firmware reload or reinitialization.
|
||||
|
||||
Returns: <link linkend="NMDeviceModemCapabilities">NMDeviceModemCapabilities</link>
|
||||
-->
|
||||
<property name="CurrentCapabilities" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
DeviceId:
|
||||
@since: 1.20
|
||||
|
||||
An identifier used by the modem backend (ModemManager) that aims to
|
||||
uniquely identify the a device. Can be used to match a connection to a
|
||||
particular device.
|
||||
|
||||
-->
|
||||
<property name="DeviceId" type="s" access="read" />
|
||||
|
||||
<!--
|
||||
OperatorCode:
|
||||
@since: 1.20
|
||||
|
||||
The MCC and MNC (concatenated) of the network the modem is connected to.
|
||||
Blank if disconnected or not a 3GPP modem.
|
||||
|
||||
-->
|
||||
<property name="OperatorCode" type="s" access="read" />
|
||||
|
||||
<!--
|
||||
Apn:
|
||||
@since: 1.20
|
||||
|
||||
The access point name the modem is connected to. Blank if disconnected.
|
||||
|
||||
-->
|
||||
<property name="Apn" type="s" access="read" />
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.Statistics:
|
||||
@short_description: Device Statistic Counters.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.Statistics">
|
||||
|
||||
<!--
|
||||
RefreshRateMs:
|
||||
|
||||
Refresh rate of the rest of properties of this interface. The properties
|
||||
are guaranteed to be refreshed each RefreshRateMs milliseconds in case
|
||||
the underlying counter has changed too.
|
||||
If zero, there is no guaranteed refresh rate of the properties.
|
||||
-->
|
||||
<property name="RefreshRateMs" type="u" access="readwrite"/>
|
||||
|
||||
<!--
|
||||
TxBytes:
|
||||
|
||||
Number of transmitted bytes
|
||||
-->
|
||||
<property name="TxBytes" type="t" access="read"/>
|
||||
|
||||
<!--
|
||||
RxBytes:
|
||||
|
||||
Number of received bytes
|
||||
-->
|
||||
<property name="RxBytes" type="t" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.WifiP2P:
|
||||
@short_description: Wi-Fi P2P Device.
|
||||
@since: 1.16
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.WifiP2P">
|
||||
<annotation name="org.gtk.GDBus.C.Name" value="Device_Wifi_P2P"/>
|
||||
|
||||
<!--
|
||||
HwAddress:
|
||||
|
||||
The active hardware address of the device.
|
||||
|
||||
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||
-->
|
||||
<property name="HwAddress" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Peers:
|
||||
|
||||
List of object paths of peers visible to this Wi-Fi P2P device.
|
||||
-->
|
||||
<property name="Peers" type="ao" access="read"/>
|
||||
|
||||
<!--
|
||||
StartFind:
|
||||
@options: Options of find.
|
||||
|
||||
Start a find operation for Wi-Fi P2P peers.
|
||||
|
||||
The %options argument accepts the following keys:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>i timeout</literal>:</term>
|
||||
<listitem><para>Timeout value in the range of 1-600 seconds.</para>
|
||||
<para>The default is 30 seconds.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
-->
|
||||
<method name="StartFind">
|
||||
<arg name="options" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
StopFind:
|
||||
|
||||
Stop an ongoing find operation again.
|
||||
-->
|
||||
<method name="StopFind">
|
||||
</method>
|
||||
|
||||
<!--
|
||||
PeerAdded:
|
||||
@peer: The object path of the newly found access point.
|
||||
|
||||
Emitted when a new Wi-Fi P2P peer is found by the device.
|
||||
-->
|
||||
<signal name="PeerAdded">
|
||||
<arg name="peer" type="o"/>
|
||||
</signal>
|
||||
|
||||
<!--
|
||||
PeerRemoved:
|
||||
@peer: The object path of the Wi-Fi P2P peer that has disappeared.
|
||||
|
||||
Emitted when a Wi-Fi P2P peer disappears from view of the device.
|
||||
-->
|
||||
<signal name="PeerRemoved">
|
||||
<arg name="peer" type="o"/>
|
||||
</signal>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.WireGuard:
|
||||
@short_description: WireGuard Device.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.WireGuard">
|
||||
|
||||
<!--
|
||||
PublicKey:
|
||||
|
||||
32-byte public WireGuard key.
|
||||
-->
|
||||
<property name="PublicKey" type="ay" access="read">
|
||||
<!-- gdbus-codegen assumes that "ay" means "non-UTF-8 string" and
|
||||
won't deal with '\0' bytes correctly.
|
||||
-->
|
||||
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="1"/>
|
||||
</property>
|
||||
|
||||
<!--
|
||||
ListenPort:
|
||||
|
||||
Local UDP listening port.
|
||||
-->
|
||||
<property name="ListenPort" type="q" access="read"/>
|
||||
|
||||
<!--
|
||||
FwMark:
|
||||
|
||||
Optional 32-bit mark used to set routing policy for outgoing encrypted packets.
|
||||
See: ip-rule(8)
|
||||
-->
|
||||
<property name="FwMark" type="u" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.Wired:
|
||||
@short_description: Wired Ethernet Device.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.Wired">
|
||||
<annotation name="org.gtk.GDBus.C.Name" value="DeviceEthernet"/>
|
||||
|
||||
<!--
|
||||
HwAddress:
|
||||
|
||||
Active hardware address of the device.
|
||||
|
||||
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||
-->
|
||||
<property name="HwAddress" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
PermHwAddress:
|
||||
|
||||
Permanent hardware address of the device.
|
||||
-->
|
||||
<property name="PermHwAddress" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Speed:
|
||||
|
||||
Design speed of the device, in megabits/second (Mb/s).
|
||||
-->
|
||||
<property name="Speed" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
S390Subchannels:
|
||||
|
||||
Array of S/390 subchannels for S/390 or z/Architecture devices.
|
||||
-->
|
||||
<property name="S390Subchannels" type="as" access="read"/>
|
||||
|
||||
<!--
|
||||
Carrier:
|
||||
|
||||
Indicates whether the physical carrier is found (e.g. whether a cable is
|
||||
plugged in or not).
|
||||
|
||||
DEPRECATED: check for the "carrier" flag in the "InterfaceFlags"
|
||||
property on the "org.freedesktop.NetworkManager.Device" interface.
|
||||
-->
|
||||
<property name="Carrier" type="b" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.Wireless:
|
||||
@short_description: Wi-Fi Device.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.Wireless">
|
||||
<annotation name="org.gtk.GDBus.C.Name" value="DeviceWifi"/>
|
||||
|
||||
<!--
|
||||
GetAccessPoints:
|
||||
@access_points: List of access point object paths.
|
||||
|
||||
DEPRECATED. Get the list of access points visible to this device. Note
|
||||
that this list does not include access points which hide their SSID. To
|
||||
retrieve a list of all access points (including hidden ones) use the
|
||||
GetAllAccessPoints() method.
|
||||
-->
|
||||
<method name="GetAccessPoints">
|
||||
<arg name="access_points" type="ao" direction="out"/>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
GetAllAccessPoints:
|
||||
@access_points: List of access point object paths.
|
||||
|
||||
Get the list of all access points visible to this device, including hidden
|
||||
ones for which the SSID is not yet known.
|
||||
-->
|
||||
<method name="GetAllAccessPoints">
|
||||
<arg name="access_points" type="ao" direction="out"/>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
RequestScan:
|
||||
@options: Options of scan. Currently, 'ssids' option with value of "aay" type is supported.
|
||||
|
||||
Request the device to scan. To know when the scan is finished, use the "PropertiesChanged" signal from "org.freedesktop.DBus.Properties" to listen to changes to the "LastScan" property.
|
||||
-->
|
||||
<method name="RequestScan">
|
||||
<arg name="options" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
HwAddress:
|
||||
|
||||
The active hardware address of the device.
|
||||
|
||||
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||
-->
|
||||
<property name="HwAddress" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
PermHwAddress:
|
||||
|
||||
The permanent hardware address of the device.
|
||||
-->
|
||||
<property name="PermHwAddress" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Mode:
|
||||
|
||||
The operating mode of the wireless device.
|
||||
|
||||
Returns: <link linkend="NM80211Mode">NM80211Mode</link>
|
||||
-->
|
||||
<property name="Mode" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
Bitrate:
|
||||
|
||||
The bit rate currently used by the wireless device, in kilobits/second
|
||||
(Kb/s).
|
||||
-->
|
||||
<property name="Bitrate" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
AccessPoints:
|
||||
|
||||
List of object paths of access point visible to this wireless device.
|
||||
-->
|
||||
<property name="AccessPoints" type="ao" access="read"/>
|
||||
|
||||
<!--
|
||||
ActiveAccessPoint:
|
||||
|
||||
Object path of the access point currently used by the wireless device.
|
||||
-->
|
||||
<property name="ActiveAccessPoint" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
WirelessCapabilities:
|
||||
|
||||
The capabilities of the wireless device.
|
||||
|
||||
Returns: <link linkend="NMDeviceWifiCapabilities">NMDeviceWifiCapabilities</link>
|
||||
-->
|
||||
<property name="WirelessCapabilities" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
LastScan:
|
||||
@since: 1.12
|
||||
|
||||
The timestamp (in CLOCK_BOOTTIME milliseconds) for the last finished network scan.
|
||||
A value of -1 means the device never scanned for access points.
|
||||
-->
|
||||
<property name="LastScan" type="x" access="read"/>
|
||||
|
||||
<!--
|
||||
AccessPointAdded:
|
||||
@access_point: The object path of the newly found access point.
|
||||
|
||||
Emitted when a new access point is found by the device.
|
||||
-->
|
||||
<signal name="AccessPointAdded">
|
||||
<arg name="access_point" type="o"/>
|
||||
</signal>
|
||||
|
||||
<!--
|
||||
AccessPointRemoved:
|
||||
@access_point: The object path of the access point that has disappeared.
|
||||
|
||||
Emitted when an access point disappears from view of the device.
|
||||
-->
|
||||
<signal name="AccessPointRemoved">
|
||||
<arg name="access_point" type="o"/>
|
||||
</signal>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device.Wpan:
|
||||
@short_description: IEEE 802.15.4 (WPAN) MAC Layer Device.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device.Wpan">
|
||||
|
||||
<!--
|
||||
HwAddress:
|
||||
|
||||
The active hardware address of the device.
|
||||
|
||||
DEPRECATED. Use the "HwAddress" property in "org.freedesktop.NetworkManager.Device" instead which exists since version NetworkManager 1.24.0.
|
||||
-->
|
||||
<property name="HwAddress" type="s" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,407 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.Device:
|
||||
@short_description: Device.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.Device">
|
||||
|
||||
<!--
|
||||
Udi:
|
||||
|
||||
Operating-system specific transient device hardware identifier. This is an
|
||||
opaque string representing the underlying hardware for the device, and
|
||||
shouldn't be used to keep track of individual devices. For some device
|
||||
types (Bluetooth, Modems) it is an identifier used by the hardware service
|
||||
(ie bluez or ModemManager) to refer to that device, and client programs
|
||||
use it get additional information from those services which NM does not
|
||||
provide. The Udi is not guaranteed to be consistent across reboots or
|
||||
hotplugs of the hardware. If you're looking for a way to uniquely track
|
||||
each device in your application, use the object path. If you're looking
|
||||
for a way to track a specific piece of hardware across reboot or hotplug,
|
||||
use a MAC address or USB serial number.
|
||||
|
||||
Note that non-UTF-8 characters are backslash escaped. Use g_strcompress()
|
||||
to obtain the true (non-UTF-8) string.
|
||||
-->
|
||||
<property name="Udi" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Path:
|
||||
|
||||
The path of the device as exposed by the udev property ID_PATH.
|
||||
|
||||
Note that non-UTF-8 characters are backslash escaped. Use g_strcompress()
|
||||
to obtain the true (non-UTF-8) string.
|
||||
-->
|
||||
<property name="Path" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Interface:
|
||||
|
||||
The name of the device's control (and often data) interface.
|
||||
Note that non UTF-8 characters are backslash escaped, so the
|
||||
resulting name may be longer then 15 characters. Use g_strcompress()
|
||||
to revert the escaping.
|
||||
-->
|
||||
<property name="Interface" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
IpInterface:
|
||||
|
||||
The name of the device's data interface when available. This property may
|
||||
not refer to the actual data interface until the device has successfully
|
||||
established a data connection, indicated by the device's State becoming
|
||||
ACTIVATED.
|
||||
Note that non UTF-8 characters are backslash escaped, so the
|
||||
resulting name may be longer then 15 characters. Use g_strcompress()
|
||||
to revert the escaping.
|
||||
-->
|
||||
<property name="IpInterface" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Driver:
|
||||
|
||||
The driver handling the device.
|
||||
Non-UTF-8 sequences are backslash escaped. Use g_strcompress()
|
||||
to revert.
|
||||
-->
|
||||
<property name="Driver" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
DriverVersion:
|
||||
|
||||
The version of the driver handling the device.
|
||||
Non-UTF-8 sequences are backslash escaped. Use g_strcompress()
|
||||
to revert.
|
||||
-->
|
||||
<property name="DriverVersion" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
FirmwareVersion:
|
||||
|
||||
The firmware version for the device.
|
||||
Non-UTF-8 sequences are backslash escaped. Use g_strcompress()
|
||||
to revert.
|
||||
-->
|
||||
<property name="FirmwareVersion" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Capabilities:
|
||||
|
||||
Flags describing the capabilities of the device.
|
||||
|
||||
Returns: <link linkend="NMDeviceCapabilities">NMDeviceCapabilities</link>
|
||||
-->
|
||||
<property name="Capabilities" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
Ip4Address:
|
||||
|
||||
DEPRECATED; use the 'Addresses' property of the 'Ip4Config' object
|
||||
instead. This property always returns 0.0.0.0 (numeric 0) as address.
|
||||
-->
|
||||
<property name="Ip4Address" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
State:
|
||||
|
||||
The current state of the device.
|
||||
|
||||
Returns: <link linkend="NMDeviceState">NMDeviceState</link>
|
||||
-->
|
||||
<property name="State" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
StateReason:
|
||||
|
||||
The current state and reason for changing to that state.
|
||||
|
||||
Returns: A tuple of <link linkend="NMDeviceState">NMDeviceState</link> and <link linkend="NMDeviceStateReason">NMDeviceStateReason</link>.
|
||||
-->
|
||||
<property name="StateReason" type="(uu)" access="read"/>
|
||||
|
||||
<!--
|
||||
ActiveConnection:
|
||||
|
||||
Object path of an ActiveConnection object that "owns" this device during
|
||||
activation. The ActiveConnection object tracks the life-cycle of a
|
||||
connection to a specific network and implements the
|
||||
org.freedesktop.NetworkManager.Connection.Active D-Bus interface.
|
||||
-->
|
||||
<property name="ActiveConnection" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Ip4Config:
|
||||
|
||||
Object path of the Ip4Config object describing the configuration of the
|
||||
device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED
|
||||
state.
|
||||
-->
|
||||
<property name="Ip4Config" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Dhcp4Config:
|
||||
|
||||
Object path of the Dhcp4Config object describing the DHCP options returned
|
||||
by the DHCP server. Only valid when the device is in the
|
||||
NM_DEVICE_STATE_ACTIVATED state.
|
||||
-->
|
||||
<property name="Dhcp4Config" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Ip6Config:
|
||||
|
||||
Object path of the Ip6Config object describing the configuration of the
|
||||
device. Only valid when the device is in the NM_DEVICE_STATE_ACTIVATED
|
||||
state.
|
||||
-->
|
||||
<property name="Ip6Config" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Dhcp6Config:
|
||||
|
||||
Object path of the Dhcp6Config object describing the DHCP options returned
|
||||
by the DHCP server. Only valid when the device is in the
|
||||
NM_DEVICE_STATE_ACTIVATED state.
|
||||
-->
|
||||
<property name="Dhcp6Config" type="o" access="read"/>
|
||||
|
||||
<!--
|
||||
Managed:
|
||||
|
||||
Whether or not this device is managed by NetworkManager. Setting this
|
||||
property has a similar effect to configuring the device as unmanaged via
|
||||
the keyfile.unmanaged-devices setting in NetworkManager.conf. Changes to
|
||||
this value are not persistent and lost after NetworkManager restart.
|
||||
-->
|
||||
<property name="Managed" type="b" access="readwrite"/>
|
||||
|
||||
<!--
|
||||
Autoconnect:
|
||||
|
||||
If TRUE, indicates the device is allowed to autoconnect. If FALSE, manual
|
||||
intervention is required before the device will automatically connect to a
|
||||
known network, such as activating a connection using the device, or
|
||||
setting this property to TRUE. This property cannot be set to TRUE for
|
||||
default-unmanaged devices, since they never autoconnect.
|
||||
-->
|
||||
<property name="Autoconnect" type="b" access="readwrite"/>
|
||||
|
||||
<!--
|
||||
FirmwareMissing:
|
||||
|
||||
If TRUE, indicates the device is likely missing firmware necessary for its
|
||||
operation.
|
||||
-->
|
||||
<property name="FirmwareMissing" type="b" access="read"/>
|
||||
|
||||
<!--
|
||||
NmPluginMissing:
|
||||
|
||||
If TRUE, indicates the NetworkManager plugin for the device is likely
|
||||
missing or misconfigured.
|
||||
-->
|
||||
<property name="NmPluginMissing" type="b" access="read"/>
|
||||
|
||||
<!--
|
||||
DeviceType:
|
||||
|
||||
The general type of the network device; ie Ethernet, Wi-Fi, etc.
|
||||
|
||||
Returns: <link linkend="NMDeviceType">NMDeviceType</link>
|
||||
-->
|
||||
<property name="DeviceType" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
AvailableConnections:
|
||||
|
||||
An array of object paths of every configured connection that is currently
|
||||
'available' through this device.
|
||||
-->
|
||||
<property name="AvailableConnections" type="ao" access="read"/>
|
||||
|
||||
<!--
|
||||
PhysicalPortId:
|
||||
|
||||
If non-empty, an (opaque) indicator of the physical network port
|
||||
associated with the device. This can be used to recognize when two
|
||||
seemingly-separate hardware devices are actually just different virtual
|
||||
interfaces to the same physical port.
|
||||
-->
|
||||
<property name="PhysicalPortId" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Mtu:
|
||||
|
||||
The device MTU (maximum transmission unit).
|
||||
-->
|
||||
<property name="Mtu" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
Metered:
|
||||
|
||||
Whether the amount of traffic flowing through the device is subject to
|
||||
limitations, for example set by service providers.
|
||||
|
||||
Returns: <link linkend="NMMetered">NMMetered</link>
|
||||
-->
|
||||
<property name="Metered" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
LldpNeighbors:
|
||||
|
||||
Array of LLDP neighbors; each element is a dictionary mapping LLDP TLV
|
||||
names to variant boxed values.
|
||||
-->
|
||||
<property name="LldpNeighbors" type="aa{sv}" access="read"/>
|
||||
|
||||
<!--
|
||||
Real:
|
||||
|
||||
True if the device exists, or False for placeholder devices that do not
|
||||
yet exist but could be automatically created by NetworkManager if one of
|
||||
their AvailableConnections was activated.
|
||||
-->
|
||||
<property name="Real" type="b" access="read"/>
|
||||
|
||||
<!--
|
||||
Ip4Connectivity:
|
||||
@since: 1.16
|
||||
|
||||
The result of the last IPv4 connectivity check.
|
||||
|
||||
Returns: <link linkend="NMConnectivityState">NMConnectivityState</link>
|
||||
-->
|
||||
<property name="Ip4Connectivity" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
Ip6Connectivity:
|
||||
@since: 1.16
|
||||
|
||||
The result of the last IPv6 connectivity check.
|
||||
|
||||
Returns: <link linkend="NMConnectivityState">NMConnectivityState</link>
|
||||
-->
|
||||
<property name="Ip6Connectivity" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
InterfaceFlags:
|
||||
@since: 1.22
|
||||
|
||||
The flags of the network interface. See
|
||||
<link linkend="NMDeviceInterfaceFlags">NMDeviceInterfaceFlags</link> for
|
||||
the currently defined flags.
|
||||
-->
|
||||
<property name="InterfaceFlags" type="u" access="read"/>
|
||||
|
||||
<!--
|
||||
HwAddress:
|
||||
@since: 1.24
|
||||
|
||||
The hardware address of the device.
|
||||
|
||||
This replaces the other 'HwAddress' properties on the device-specific D-Bus interfaces.
|
||||
-->
|
||||
<property name="HwAddress" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Ports:
|
||||
@since: 1.34
|
||||
|
||||
The port devices of the controller device.
|
||||
|
||||
Array of object paths representing devices which are currently set as
|
||||
port of this device. This replaces the 'Slaves' properties on the
|
||||
device-specific D-Bus interfaces.
|
||||
-->
|
||||
<property name="Ports" type="ao" access="read"/>
|
||||
|
||||
<!--
|
||||
Reapply:
|
||||
@connection: The optional connection settings that will be reapplied on the device. If empty, the currently active settings-connection will be used. The connection cannot arbitrarily differ from the current applied-connection otherwise the call will fail. Only certain changes are supported, like adding or removing IP addresses.
|
||||
@version_id: If non-zero, the current version id of the applied-connection must match. The current version id can be retrieved via GetAppliedConnection. This optional argument allows to catch concurrent modifications between the GetAppliedConnection call and Reapply.
|
||||
@flags: Flags which would modify the behavior of the Reapply call. Invalid flags are rejected.
|
||||
|
||||
Attempts to update the configuration of a device without deactivating it.
|
||||
NetworkManager has the concept of connections, which are profiles that
|
||||
contain the configuration for a networking device. Those connections are
|
||||
exposed via D-Bus as individual objects that can be created, modified and
|
||||
deleted. When activating such a settings-connection on a device, the
|
||||
settings-connection is cloned to become an applied-connection and used to
|
||||
configure the device (see GetAppliedConnection). Subsequent modification
|
||||
of the settings-connection don't propagate automatically to the device's
|
||||
applied-connection (with exception of the firewall-zone and the metered
|
||||
property). For the changes to take effect, you can either re-activate the
|
||||
settings-connection, or call Reapply. The Reapply call allows you to
|
||||
directly update the applied-connection and reconfigure the device. Reapply
|
||||
can also be useful if the currently applied-connection is equal to the
|
||||
connection that is about to be reapplied. This allows to reconfigure the
|
||||
device and revert external changes like removing or adding an IP address
|
||||
(which NetworkManager doesn't revert automatically because it is assumed
|
||||
that the user made these changes intentionally outside of NetworkManager).
|
||||
Reapply can make the applied-connection different from the
|
||||
settings-connection, just like updating the settings-connection can make
|
||||
them different.
|
||||
|
||||
Since 1.42, "preserve-external-ip" flag (0x1) is supported to not remove
|
||||
externally added IP addresses and routes on the device during reapply.
|
||||
-->
|
||||
<method name="Reapply">
|
||||
<arg name="connection" type="a{sa{sv}}" direction="in"/>
|
||||
<arg name="version_id" type="t" direction="in"/>
|
||||
<arg name="flags" type="u" direction="in"/>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
GetAppliedConnection:
|
||||
@flags: Flags which would modify the behavior of the GetAppliedConnection call. There are no flags defined currently and the users should use the value of 0.
|
||||
@connection: The effective connection settings that the connection has currently applied.
|
||||
@version_id: The version-id of the currently applied connection. This can be specified during Reapply to avoid races where you first fetch the applied connection, modify it and try to reapply it. If the applied connection is modified in the meantime, the version_id gets incremented and Reapply will fail.
|
||||
|
||||
Get the currently applied connection on the device. This is a snapshot of
|
||||
the last activated connection on the device, that is the configuration
|
||||
that is currently applied on the device. Usually this is the same as
|
||||
GetSettings of the referenced settings connection. However, it can differ
|
||||
if the settings connection was subsequently modified or the applied
|
||||
connection was modified by Reapply. The applied connection is set when
|
||||
activating a device or when calling Reapply.
|
||||
-->
|
||||
<method name="GetAppliedConnection">
|
||||
<arg name="flags" type="u" direction="in"/>
|
||||
<arg name="connection" type="a{sa{sv}}" direction="out"/>
|
||||
<arg name="version_id" type="t" direction="out"/>
|
||||
</method>
|
||||
|
||||
<!--
|
||||
Disconnect:
|
||||
|
||||
Disconnects a device and prevents the device from automatically activating
|
||||
further connections without user intervention.
|
||||
-->
|
||||
<method name="Disconnect"/>
|
||||
|
||||
<!--
|
||||
Delete:
|
||||
|
||||
Deletes a software device from NetworkManager and removes the interface
|
||||
from the system. The method returns an error when called for a hardware
|
||||
device.
|
||||
-->
|
||||
<method name="Delete"/>
|
||||
|
||||
<!--
|
||||
StateChanged:
|
||||
@new_state: (<link linkend="NMDeviceState">NMDeviceState</link>) The new state of the device.
|
||||
@old_state: (<link linkend="NMDeviceState">NMDeviceState</link>) The previous state of the device.
|
||||
@reason: (<link linkend="NMDeviceStateReason">NMDeviceStateReason</link>) A reason for the state transition.
|
||||
-->
|
||||
<signal name="StateChanged">
|
||||
<arg name="new_state" type="u"/>
|
||||
<arg name="old_state" type="u"/>
|
||||
<arg name="reason" type="u"/>
|
||||
</signal>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/org/freedesktop/NetworkManager/DnsManager">
|
||||
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.DnsManager:
|
||||
@short_description: DNS Configuration State.
|
||||
|
||||
The interface contains DNS-related information.
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.DnsManager">
|
||||
|
||||
<!--
|
||||
Mode:
|
||||
|
||||
The current DNS processing mode.
|
||||
-->
|
||||
<property name="Mode" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
RcManager:
|
||||
|
||||
The current resolv.conf management mode.
|
||||
-->
|
||||
<property name="RcManager" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Configuration:
|
||||
|
||||
The current DNS configuration represented as an array of
|
||||
dictionaries. Each dictionary has the "nameservers",
|
||||
"priority" keys and, optionally, "interface" and "vpn".
|
||||
"nameservers" is the list of DNS servers, "priority" their
|
||||
relative priority, "interface" the interface on which these
|
||||
servers are contacted, "vpn" a boolean telling whether the
|
||||
configuration was obtained from a VPN connection.
|
||||
-->
|
||||
<property name="Configuration" type="aa{sv}" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.IP4Config:
|
||||
@short_description: IPv4 Configuration Set.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.IP4Config">
|
||||
|
||||
<!--
|
||||
Addresses:
|
||||
|
||||
Array of arrays of IPv4 address/prefix/gateway. All 3 elements of each
|
||||
array are in network byte order. Essentially: [(addr, prefix, gateway),
|
||||
(addr, prefix, gateway), ...] Deprecated: use AddressData and Gateway
|
||||
-->
|
||||
<property name="Addresses" type="aau" access="read"/>
|
||||
|
||||
<!--
|
||||
AddressData:
|
||||
|
||||
Array of IP address data objects. All addresses will include "address" (an
|
||||
IP address string), and "prefix" (a uint). Some addresses may include
|
||||
additional attributes.
|
||||
-->
|
||||
<property name="AddressData" type="aa{sv}" access="read"/>
|
||||
|
||||
<!--
|
||||
Gateway:
|
||||
|
||||
The gateway in use.
|
||||
-->
|
||||
<property name="Gateway" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Routes:
|
||||
|
||||
Arrays of IPv4 route/prefix/next-hop/metric. All 4 elements of each tuple
|
||||
are in network byte order. 'route' and 'next hop' are IPv4 addresses,
|
||||
while prefix and metric are simple unsigned integers. Essentially:
|
||||
[(route, prefix, next-hop, metric), (route, prefix, next-hop, metric),
|
||||
...] Deprecated: use RouteData
|
||||
-->
|
||||
<property name="Routes" type="aau" access="read"/>
|
||||
|
||||
<!--
|
||||
RouteData:
|
||||
|
||||
Array of IP route data objects. All routes will include "dest" (an IP
|
||||
address string) and "prefix" (a uint). Some routes may include "next-hop"
|
||||
(an IP address string), "metric" (a uint), and additional attributes.
|
||||
-->
|
||||
<property name="RouteData" type="aa{sv}" access="read"/>
|
||||
|
||||
<!--
|
||||
Nameservers:
|
||||
|
||||
The nameservers in use. Deprecated: use NameserverData
|
||||
-->
|
||||
<property name="Nameservers" type="au" access="read"/>
|
||||
|
||||
<!--
|
||||
NameserverData:
|
||||
@since: 1.14
|
||||
|
||||
The nameservers in use. Currently, only the value "address"
|
||||
is recognized (with an IP address string).
|
||||
-->
|
||||
<property name="NameserverData" type="aa{sv}" access="read"/>
|
||||
|
||||
<!--
|
||||
Domains:
|
||||
|
||||
A list of domains this address belongs to.
|
||||
-->
|
||||
<property name="Domains" type="as" access="read"/>
|
||||
|
||||
<!--
|
||||
Searches:
|
||||
|
||||
A list of dns searches.
|
||||
-->
|
||||
<property name="Searches" type="as" access="read"/>
|
||||
|
||||
<!--
|
||||
DnsOptions:
|
||||
|
||||
A list of DNS options that modify the behavior of the DNS resolver. See
|
||||
resolv.conf(5) manual page for the list of supported options.
|
||||
-->
|
||||
<property name="DnsOptions" type="as" access="read"/>
|
||||
|
||||
<!--
|
||||
DnsPriority:
|
||||
|
||||
The relative priority of DNS servers.
|
||||
-->
|
||||
<property name="DnsPriority" type="i" access="read"/>
|
||||
|
||||
<!--
|
||||
WinsServers:
|
||||
|
||||
The Windows Internet Name Service servers associated with the connection.
|
||||
Each address is in network byte order. Deprecated: use WinsServerData
|
||||
-->
|
||||
<property name="WinsServers" type="au" access="read"/>
|
||||
|
||||
<!--
|
||||
WinsServerData:
|
||||
@since: 1.14
|
||||
|
||||
The Windows Internet Name Service servers associated with the connection.
|
||||
-->
|
||||
<property name="WinsServerData" type="as" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.IP6Config:
|
||||
@short_description: IPv6 Configuration Set.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.IP6Config">
|
||||
|
||||
<!--
|
||||
Addresses:
|
||||
|
||||
Array of tuples of IPv6 address/prefix/gateway. Deprecated: use
|
||||
AddressData and Gateway.
|
||||
-->
|
||||
<property name="Addresses" type="a(ayuay)" access="read"/>
|
||||
|
||||
<!--
|
||||
AddressData:
|
||||
|
||||
Array of IP address data objects. All addresses will include "address" (an
|
||||
IP address string), and "prefix" (a uint). Some addresses may include
|
||||
additional attributes.
|
||||
-->
|
||||
<property name="AddressData" type="aa{sv}" access="read"/>
|
||||
|
||||
<!--
|
||||
Gateway:
|
||||
|
||||
The gateway in use.
|
||||
-->
|
||||
<property name="Gateway" type="s" access="read"/>
|
||||
|
||||
<!--
|
||||
Routes:
|
||||
|
||||
Tuples of IPv6 route/prefix/next-hop/metric. Deprecated: use RouteData
|
||||
-->
|
||||
<property name="Routes" type="a(ayuayu)" access="read"/>
|
||||
|
||||
<!--
|
||||
RouteData:
|
||||
|
||||
Array of IP route data objects. All routes will include "dest" (an IP
|
||||
address string) and "prefix" (a uint). Some routes may include "next-hop"
|
||||
(an IP address string), "metric" (a uint), and additional attributes.
|
||||
-->
|
||||
<property name="RouteData" type="aa{sv}" access="read"/>
|
||||
|
||||
<!--
|
||||
Nameservers:
|
||||
|
||||
The nameservers in use.
|
||||
-->
|
||||
<property name="Nameservers" type="aay" access="read">
|
||||
<!-- gdbus-codegen assumes that "aay" means "array of non-UTF-8
|
||||
string" and so would make this a char **.
|
||||
-->
|
||||
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="1"/>
|
||||
</property>
|
||||
|
||||
<!--
|
||||
Domains:
|
||||
|
||||
A list of domains this address belongs to.
|
||||
-->
|
||||
<property name="Domains" type="as" access="read"/>
|
||||
|
||||
<!--
|
||||
Searches:
|
||||
|
||||
A list of dns searches.
|
||||
-->
|
||||
<property name="Searches" type="as" access="read"/>
|
||||
|
||||
<!--
|
||||
DnsOptions:
|
||||
|
||||
A list of DNS options that modify the behavior of the DNS resolver. See
|
||||
resolv.conf(5) manual page for the list of supported options.
|
||||
-->
|
||||
<property name="DnsOptions" type="as" access="read"/>
|
||||
|
||||
<!--
|
||||
DnsPriority:
|
||||
|
||||
The relative priority of DNS servers.
|
||||
-->
|
||||
<property name="DnsPriority" type="i" access="read"/>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<node name="/">
|
||||
<!--
|
||||
org.freedesktop.NetworkManager.PPP:
|
||||
@short_description: Helper interface for a PPP plugin.
|
||||
|
||||
-->
|
||||
<interface name="org.freedesktop.NetworkManager.PPP">
|
||||
<annotation name="org.gtk.GDBus.C.Name" value="PPP_Manager"/>
|
||||
|
||||
<method name="NeedSecrets">
|
||||
<arg name="username" type="s" direction="out"/>
|
||||
<arg name="password" type="s" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="SetIp4Config">
|
||||
<arg name="config" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
|
||||
<method name="SetIp6Config">
|
||||
<arg name="config" type="a{sv}" direction="in"/>
|
||||
</method>
|
||||
|
||||
<method name="SetState">
|
||||
<arg name="state" type="u" direction="in"/>
|
||||
</method>
|
||||
|
||||
<method name="SetIfindex">
|
||||
<arg name="ifindex" type="i" direction="in"/>
|
||||
</method>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user