zond-engine 0.16.0

The core networking library powering Zond. Raw packet injection, protocol parsing, service and OS fingerprinting, and asynchronous network scanning.
Documentation
// Copyright (c) 2026 Erik Lening (hollowpointer) and Contributors
//
// This file is part of Zond Engine, licensed under the GNU Affero General
// Public License, version 3 or later. See the LICENSE file for details, or
// <https://www.gnu.org/licenses/agpl-3.0.html>.
//
// SPDX-License-Identifier: AGPL-3.0-or-later

//! The shape of this engine's CSV: which columns there are and what order they
//! come in.
//!
//! Both directions read this list rather than each keeping their own. The writer
//! emits it as the header row and fills a field per entry; the reader matches an
//! incoming header against it to decide whether the table is one this engine
//! wrote, then maps each column it recognises by name.

/// The column names, in order. Host columns first, then the port columns that
/// are empty on a host with no ports.
pub const COLUMNS: [&str; 25] = [
    "ip",
    "hostname",
    "status",
    "alive",
    "ips",
    "mac",
    "mac_vendor",
    "os",
    "os_accuracy",
    "roles",
    "rtt_median_us",
    "first_seen",
    "last_seen",
    "port",
    "protocol",
    "state",
    "service",
    "service_product",
    "service_version",
    "service_confidence",
    "discovery_reason",
    "tls_version",
    "cert_common_name",
    "cert_not_after",
    "findings",
];

/// The characters that make a spreadsheet read a cell as a formula, which the
/// writer hides behind an apostrophe and the reader takes back off.
///
/// A character one side guards and the other does not know to unguard reads back
/// with a stray apostrophe in it, and nothing errors, so the list is shared for
/// the same reason [`COLUMNS`] is.
///
/// The carriage return is not a formula character. It is guarded by the same
/// apostrophe because a cell beginning with one is a cell a spreadsheet
/// mangles.
#[cfg(any(feature = "export-csv", feature = "import-csv"))]
pub const FORMULA_LEADERS: [char; 6] = ['=', '+', '-', '@', '\t', '\r'];

/// How many of [`COLUMNS`] describe the port rather than the host.
///
/// The port columns are the last `PORT_COLUMNS` entries and the host columns are
/// everything before them, so the boundary sits at
/// `COLUMNS.len() - PORT_COLUMNS`.
pub const PORT_COLUMNS: usize = 12;