1pub mod autostart;
4pub mod clipboard;
5mod display;
6pub use display::physical_size_mm;
7pub mod firewall;
8pub mod fs;
9pub mod input;
10pub mod local_socket;
11pub mod notify;
12pub mod permissions;
13
14#[must_use]
16pub fn host_name() -> Option<String> {
17 let name = os_host_name()?;
18 let name: String = name
19 .chars()
20 .take(a7n_proto::limits::PEER_NAME_MAX)
21 .collect();
22 (!name.is_empty()).then_some(name)
23}
24
25#[cfg(unix)]
26fn os_host_name() -> Option<String> {
27 rustix::system::uname()
28 .nodename()
29 .to_str()
30 .ok()
31 .map(str::to_owned)
32}
33
34#[cfg(windows)]
35fn os_host_name() -> Option<String> {
36 std::env::var("COMPUTERNAME").ok()
37}
38
39#[cfg(feature = "tray")]
40pub mod tray;
41
42#[must_use]
44pub const fn platform() -> a7n_proto::v1::Platform {
45 use a7n_proto::v1::Platform;
46
47 if cfg!(target_os = "macos") {
48 Platform::Macos
49 } else if cfg!(target_os = "windows") {
50 Platform::Windows
51 } else if cfg!(target_os = "linux") {
52 Platform::Linux
53 } else {
54 Platform::Unspecified
55 }
56}
57
58pub mod transfer_fs;
59
60mod network;
61pub use network::{hw_addr_for, ipv4_broadcasts, local_addr_for};