Skip to content

Commit

Permalink
dhcp: replace dbus_proxy with proxy, and zbus traits
Browse files Browse the repository at this point in the history
The latest version of zbus has deprecated the use of the dbus_proxy
trait, replace its use with #[proxy()] and #[zbus()].
  • Loading branch information
prestist committed Sep 11, 2024
1 parent 135fc8a commit 613dc7b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/util/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::collections::HashMap;
use std::fs::File;
use std::path::Path;
use std::time::Duration;
use zbus::{dbus_proxy, zvariant};
use zbus::{proxy, zvariant};

use super::key_lookup;
use crate::retry;
Expand Down Expand Up @@ -138,30 +138,30 @@ impl DhcpOption {
}
}

#[dbus_proxy(
#[proxy(
default_service = "org.freedesktop.NetworkManager",
default_path = "/org/freedesktop/NetworkManager",
interface = "org.freedesktop.NetworkManager"
)]
trait NetworkManager {
#[dbus_proxy(property)]
#[zbus(property)]
fn active_connections(&self) -> zbus::Result<Vec<zvariant::ObjectPath>>;
}

#[dbus_proxy(
#[proxy(
default_service = "org.freedesktop.NetworkManager",
interface = "org.freedesktop.NetworkManager.Connection.Active"
)]
trait NMActiveConnection {
#[dbus_proxy(property)]
#[zbus(property)]
fn dhcp4_config(&self) -> zbus::Result<zvariant::ObjectPath>;
}

#[dbus_proxy(
#[proxy(
default_service = "org.freedesktop.NetworkManager",
interface = "org.freedesktop.NetworkManager.DHCP4Config"
)]
trait NMDhcp4Config {
#[dbus_proxy(property)]
#[zbus(property)]
fn options(&self) -> Result<HashMap<String, zvariant::Value>>;
}

0 comments on commit 613dc7b

Please sign in to comment.