Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ members = [
"agama-dbus-server",
"agama-derive",
"agama-lib",
"agama-locale-data",
"agama-network"
]
"agama-locale-data"
]
4 changes: 3 additions & 1 deletion rust/agama-dbus-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ edition = "2021"
[dependencies]
anyhow = "1.0"
agama-locale-data = { path="../agama-locale-data" }
agama-network = { path="../agama-network" }
agama-lib = { path="../agama-lib" }
log = "0.4"
simplelog = "0.12.1"
systemd-journal-logger = "1.0"
zbus = "3.7.0"
zbus_macros = "3.7.0"
async-std = { version = "1.12.0", features = ["attributes"]}
uuid = { version = "1.3.4", features = ["v4"] }
parking_lot = "0.12.1"
thiserror = "1.0.40"
3 changes: 2 additions & 1 deletion rust/agama-dbus-server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
pub mod error;
pub mod locale;
pub mod network;
pub mod questions;

use agama_network::NetworkService;
use log::LevelFilter;
use network::NetworkService;
use std::future::pending;

const ADDRESS: &str = "unix:path=/run/agama/bus";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::model::{Connection, DeviceType};
use crate::network::model::{Connection, DeviceType};
use uuid::Uuid;

/// Networking actions, like adding, updating or removing connections.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::NetworkState;
use crate::network::NetworkState;
use std::error::Error;

/// A trait for the ability to read/write from/to a network service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! This module contains the set of D-Bus interfaces that are exposed by [D-Bus network
//! service](crate::NetworkService).
use super::ObjectsRegistry;
use crate::{
use crate::network::{
action::Action,
error::NetworkStateError,
model::{Connection as NetworkConnection, Device as NetworkDevice, WirelessConnection},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Network D-Bus service.
//!
//! This module defines a D-Bus service which exposes Agama's network configuration.
use crate::NetworkSystem;
use crate::network::NetworkSystem;
use agama_lib::connection_to;
use std::{error::Error, thread};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use agama_lib::error::ServiceError;
use parking_lot::Mutex;
use uuid::Uuid;

use crate::{action::Action, dbus::interfaces, model::*};
use crate::network::{action::Action, dbus::interfaces, model::*};
use std::collections::HashMap;
use std::sync::mpsc::Sender;
use std::sync::Arc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! agnostic from the real network service (e.g., NetworkManager).
use uuid::Uuid;

use crate::error::NetworkStateError;
use crate::network::error::NetworkStateError;
use agama_lib::network::types::SSID;
use std::{fmt, net::Ipv4Addr, str};

Expand Down Expand Up @@ -91,7 +91,7 @@ mod tests {
use uuid::Uuid;

use super::{BaseConnection, Connection, EthernetConnection, NetworkState};
use crate::error::NetworkStateError;
use crate::network::error::NetworkStateError;

#[test]
fn test_add_connection() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{
use crate::network::{
model::{Connection, NetworkState},
nm::NetworkManagerClient,
Adapter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use super::dbus::{connection_from_dbus, connection_to_dbus, merge_dbus_connections};
use super::model::NmDeviceType;
use super::proxies::{ConnectionProxy, DeviceProxy, NetworkManagerProxy, SettingsProxy};
use crate::model::{Connection, Device};
use crate::network::model::{Connection, Device};
use agama_lib::error::ServiceError;
use uuid::Uuid;
use zbus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Working with hash maps coming from D-Bus is rather tedious and it is even worse when working
//! with nested hash maps (see [NestedHash] and [OwnedNestedHash]).
use super::model::*;
use crate::model::*;
use crate::network::model::*;
use agama_lib::{
dbus::{NestedHash, OwnedNestedHash},
network::types::SSID,
Expand Down Expand Up @@ -246,7 +246,7 @@ mod test {
connection_from_dbus, connection_to_dbus, merge_dbus_connections, NestedHash,
OwnedNestedHash,
};
use crate::{model::*, nm::dbus::ETHERNET_KEY};
use crate::network::{model::*, nm::dbus::ETHERNET_KEY};
use agama_lib::network::types::SSID;
use std::{collections::HashMap, net::Ipv4Addr};
use uuid::Uuid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! NetworkManager error types
use crate::error::NetworkStateError;
use crate::network::error::NetworkStateError;
use thiserror::Error;

#[derive(Error, Debug)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
///
/// Using the newtype pattern around an String is enough. For proper support, we might replace this
/// struct with an enum.
use crate::{
use crate::network::{
model::{DeviceType, IpMethod, SecurityProtocol, WirelessMode},
nm::error::NmError,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::dbus::Tree;
use crate::{model::Connection, nm::NetworkManagerAdapter, Action, Adapter, NetworkState};
use crate::network::{
dbus::Tree, model::Connection, nm::NetworkManagerAdapter, Action, Adapter, NetworkState
};
use agama_lib::error::ServiceError;
use std::error::Error;
use std::sync::mpsc::{channel, Receiver, Sender};
Expand Down
14 changes: 0 additions & 14 deletions rust/agama-network/Cargo.toml

This file was deleted.