zond-engine 0.6.1

A lightweight, fast, and highly concurrent networking backend for packet crafting, protocol fingerprinting, and host discovery.
Documentation
// Copyright (c) 2026 Erik Lening (hollowpointer) and Contributors
//
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at
// https://mozilla.org/MPL/2.0/.

//! # Local System Information Service
//!
//! Implements the "System Info" use case.
//!
//! This service acts as a facade for gathering local machine statistics and
//! configuration, useful for debugging or self-awareness context.

use crate::core::models::localhost::{FirewallStatus, IpServiceGroup};
use pnet::datalink::NetworkInterface;

/// Retrieves a comprehensive snapshot of the local system's network state.
pub fn get_system_info() -> anyhow::Result<SystemInfo> {
    let services = crate::host_sys::get_local_services()?;
    let firewall = crate::host_sys::get_firewall_status()?;
    let interfaces = crate::host_sys::get_network_interfaces()?;

    Ok(SystemInfo {
        services,
        firewall,
        interfaces,
    })
}

pub struct SystemInfo {
    pub services: Vec<IpServiceGroup>,
    pub firewall: FirewallStatus,
    pub interfaces: Vec<NetworkInterface>,
}