Add more interfaces and sort some old ones

This commit is contained in:
Lucy 2022-01-11 13:42:27 -05:00
parent 2b00c7f3e3
commit d17c660410
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1
10 changed files with 155 additions and 93 deletions

View file

@ -22,7 +22,10 @@
use zbus::dbus_proxy;
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.AccessPoint")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.AccessPoint",
default_service = "org.freedesktop.NetworkManager"
)]
trait AccessPoint {
/// Flags property
#[dbus_proxy(property)]

View file

@ -22,7 +22,10 @@
use zbus::dbus_proxy;
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.IP4Config")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.IP4Config",
default_service = "org.freedesktop.NetworkManager"
)]
pub trait Ipv4Config {
/// AddressData property
#[dbus_proxy(property)]

View file

@ -22,7 +22,10 @@
use zbus::dbus_proxy;
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.IP6Config")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.IP6Config",
default_service = "org.freedesktop.NetworkManager"
)]
pub trait Ipv6Config {
/// AddressData property
#[dbus_proxy(property)]

View file

@ -20,12 +20,16 @@
//!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
pub mod bluetooth;
pub mod wired;
pub mod wireless;
use zbus::dbus_proxy;
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.Device.Generic")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.Device.Generic",
default_service = "org.freedesktop.NetworkManager"
)]
pub trait GenericDevice {
/// HwAddress property
#[dbus_proxy(property)]
@ -36,7 +40,10 @@ pub trait GenericDevice {
fn type_description(&self) -> zbus::Result<String>;
}
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.Device")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.Device",
default_service = "org.freedesktop.NetworkManager"
)]
pub trait Device {
/// Delete method
fn delete(&self) -> zbus::Result<()>;

View file

@ -22,7 +22,10 @@
use zbus::dbus_proxy;
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.Device.Wired")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.Device.Wired",
default_service = "org.freedesktop.NetworkManager"
)]
trait WiredDevice {
/// Carrier property
#[dbus_proxy(property)]

View file

@ -22,7 +22,10 @@
use zbus::dbus_proxy;
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.Device.Wireless")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.Device.Wireless",
default_service = "org.freedesktop.NetworkManager"
)]
pub trait WirelessDevice {
/// GetAccessPoints method
fn get_access_points(&self) -> zbus::Result<Vec<zbus::zvariant::OwnedObjectPath>>;

View file

@ -22,13 +22,18 @@
pub mod access_point;
pub mod config;
pub mod connection;
pub mod device;
pub mod settings;
pub mod statistics;
use zbus::dbus_proxy;
#[dbus_proxy(interface = "org.freedesktop.NetworkManager")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager",
default_service = "org.freedesktop.NetworkManager",
default_path = "/org/freedesktop/NetworkManager"
)]
pub trait NetworkManager {
/// ActivateConnection method
fn activate_connection(

View file

@ -1,5 +1,5 @@
// SPDX-License-Identifier: MPL-2.0
//! # DBus interface proxy for: `org.freedesktop.NetworkManager.Settings`, `org.freedesktop.NetworkManager.Settings.Connection`
//! # DBus interface proxy for: `org.freedesktop.NetworkManager.Settings`
//!
//! This code was generated by `zbus-xmlgen` `2.0.0` from DBus introspection data.
//! Source: `Interface '/org/freedesktop/NetworkManager/Settings' from service 'org.freedesktop.NetworkManager' on system bus`.
@ -20,9 +20,15 @@
//!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
pub mod connection;
use zbus::dbus_proxy;
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.Settings")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.Settings",
default_service = "org.freedesktop.NetworkManager",
default_path = "/org/freedesktop/NetworkManager/Settings"
)]
pub trait Settings {
/// AddConnection method
fn add_connection(
@ -91,85 +97,3 @@ pub trait Settings {
#[dbus_proxy(property)]
fn hostname(&self) -> zbus::Result<String>;
}
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.Settings.Connection")]
pub trait Connection {
/// ClearSecrets method
fn clear_secrets(&self) -> zbus::Result<()>;
/// Delete method
fn delete(&self) -> zbus::Result<()>;
/// GetSecrets method
fn get_secrets(
&self,
setting_name: &str,
) -> zbus::Result<
std::collections::HashMap<
String,
std::collections::HashMap<String, zbus::zvariant::OwnedValue>,
>,
>;
/// GetSettings method
fn get_settings(
&self,
) -> zbus::Result<
std::collections::HashMap<
String,
std::collections::HashMap<String, zbus::zvariant::OwnedValue>,
>,
>;
/// Save method
fn save(&self) -> zbus::Result<()>;
/// Update method
fn update(
&self,
properties: std::collections::HashMap<
&str,
std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
>,
) -> zbus::Result<()>;
/// Update2 method
fn update2(
&self,
settings: std::collections::HashMap<
&str,
std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
>,
flags: u32,
args: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> zbus::Result<std::collections::HashMap<String, zbus::zvariant::OwnedValue>>;
/// UpdateUnsaved method
fn update_unsaved(
&self,
properties: std::collections::HashMap<
&str,
std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
>,
) -> zbus::Result<()>;
/// Removed signal
#[dbus_proxy(signal)]
fn removed(&self) -> zbus::Result<()>;
/// Updated signal
#[dbus_proxy(signal)]
fn updated(&self) -> zbus::Result<()>;
/// Filename property
#[dbus_proxy(property)]
fn filename(&self) -> zbus::Result<String>;
/// Flags property
#[dbus_proxy(property)]
fn flags(&self) -> zbus::Result<u32>;
/// Unsaved property
#[dbus_proxy(property)]
fn unsaved(&self) -> zbus::Result<bool>;
}

View file

@ -0,0 +1,108 @@
// SPDX-License-Identifier: MPL-2.0
//! # DBus interface proxy for: `org.freedesktop.NetworkManager.Settings.Connection`
//!
//! This code was generated by `zbus-xmlgen` `2.0.0` from DBus introspection data.
//! Source: `Interface '/org/freedesktop/NetworkManager/Settings' from service 'org.freedesktop.NetworkManager' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
//! More information can be found in the
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
//! section of the zbus documentation.
//!
//! This DBus object implements
//! [standard DBus interfaces](https://dbus.freedesktop.org/doc/dbus-specification.html),
//! (`org.freedesktop.DBus.*`) for which the following zbus proxies can be used:
//!
//! * [`zbus::fdo::PropertiesProxy`]
//! * [`zbus::fdo::IntrospectableProxy`]
//! * [`zbus::fdo::PeerProxy`]
//!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use zbus::dbus_proxy;
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.Settings.Connection",
default_service = "org.freedesktop.NetworkManager"
)]
pub trait ConnectionSettings {
/// ClearSecrets method
fn clear_secrets(&self) -> zbus::Result<()>;
/// Delete method
fn delete(&self) -> zbus::Result<()>;
/// GetSecrets method
fn get_secrets(
&self,
setting_name: &str,
) -> zbus::Result<
std::collections::HashMap<
String,
std::collections::HashMap<String, zbus::zvariant::OwnedValue>,
>,
>;
/// GetSettings method
fn get_settings(
&self,
) -> zbus::Result<
std::collections::HashMap<
String,
std::collections::HashMap<String, zbus::zvariant::OwnedValue>,
>,
>;
/// Save method
fn save(&self) -> zbus::Result<()>;
/// Update method
fn update(
&self,
properties: std::collections::HashMap<
&str,
std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
>,
) -> zbus::Result<()>;
/// Update2 method
fn update2(
&self,
settings: std::collections::HashMap<
&str,
std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
>,
flags: u32,
args: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> zbus::Result<std::collections::HashMap<String, zbus::zvariant::OwnedValue>>;
/// UpdateUnsaved method
fn update_unsaved(
&self,
properties: std::collections::HashMap<
&str,
std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
>,
) -> zbus::Result<()>;
/// Removed signal
#[dbus_proxy(signal)]
fn removed(&self) -> zbus::Result<()>;
/// Updated signal
#[dbus_proxy(signal)]
fn updated(&self) -> zbus::Result<()>;
/// Filename property
#[dbus_proxy(property)]
fn filename(&self) -> zbus::Result<String>;
/// Flags property
#[dbus_proxy(property)]
fn flags(&self) -> zbus::Result<u32>;
/// Unsaved property
#[dbus_proxy(property)]
fn unsaved(&self) -> zbus::Result<bool>;
}

View file

@ -22,7 +22,10 @@
use zbus::dbus_proxy;
#[dbus_proxy(interface = "org.freedesktop.NetworkManager.Device.Statistics")]
#[dbus_proxy(
interface = "org.freedesktop.NetworkManager.Device.Statistics",
default_service = "org.freedesktop.NetworkManager"
)]
pub trait Statistics {
/// RefreshRateMs property
#[dbus_proxy(property)]