[package]
name = "ant-quic"
version = "0.6.1"
edition = "2024"
rust-version = "1.85.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/dirvine/ant-quic"
description = "QUIC transport protocol with advanced NAT traversal for P2P networks"
keywords = ["quic", "nat-traversal", "p2p", "autonomi", "networking"]
categories = ["network-programming", "asynchronous"]

[features]
# Default features include only essential functionality
default = ["platform-verifier", "network-discovery", "runtime-tokio", "rustls-ring"]

# Crypto providers
rustls-ring = ["dep:rustls", "rustls?/ring", "ring"]
rustls-aws-lc-rs = ["dep:rustls", "rustls?/aws-lc-rs", "aws-lc-rs"]
aws-lc-rs = ["dep:aws-lc-rs", "aws-lc-rs?/aws-lc-sys", "aws-lc-rs?/prebuilt-nasm"]
ring = ["dep:ring"]

# Platform-specific certificate verification
platform-verifier = ["dep:rustls-platform-verifier"]

# Configure `tracing` to log events via `log` if no `tracing` subscriber exists
log = ["tracing/log"]

# Enhanced network interface discovery
network-discovery = ["dep:socket2", "dep:nix"]

# Runtime features
runtime-tokio = []
runtime-async-std = ["dep:async-std", "dep:async-io"]

# Additional features
arbitrary = ["dep:arbitrary"]
__qlog = ["dep:qlog"]
bloom = []

# Post-Quantum Cryptography support
pqc = ["aws-lc-rs"]

# Zero-cost tracing system
trace = []
trace-app = ["trace"]
trace-index = ["trace"]
trace-full = ["trace", "trace-app", "trace-index"]

# Test utilities
test-utils = []
docker-tests = ["test-utils"]
platform-tests = ["test-utils"]
linux-tests = ["platform-tests"]
macos-tests = ["platform-tests"]
windows-tests = ["platform-tests"]

# Memory optimization features
low_memory = []

# Test features
security_validation_not_yet_implemented = []

[dependencies]
# Core dependencies
bytes = "1"
rustc-hash = "2"
rand = "0.8"
thiserror = "2.0.3"
tinyvec = { version = "1.1", features = ["alloc"] }
tracing = { version = "0.1.10", default-features = false, features = ["std", "attributes"] }
async-trait = "0.1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
ed25519-dalek = { version = "2.1", features = ["rand_core"] }
x25519-dalek = { version = "2.0", features = ["static_secrets"] }

# Data structures
slab = "0.4.6"
indexmap = "2.0"
parking_lot = "0.12"
lru-slab = "0.1.2"

# Crypto dependencies (optional)
rustls = { version = "0.23.5", default-features = false, features = ["std"], optional = true }
ring = { version = "0.17", optional = true }
aws-lc-rs = { version = "1.9", default-features = false, features = ["unstable"], optional = true }
rustls-platform-verifier = { version = "0.6", optional = true }

# Network discovery dependencies (optional)
socket2 = { version = "0.5", optional = true }
nix = { version = "0.29", features = ["resource", "net"], optional = true }

# Async runtime dependencies (optional)
async-std = { version = "1.12", optional = true }
async-io = { version = "2.0", optional = true }
smol = { version = "2.0", optional = true }

# Essential dependencies (formerly production-ready)
rcgen = { version = "0.14" }
tokio-util = { version = "0.7" }
futures-util = { version = "0.3" }
hickory-resolver = { version = "0.24" }
time = { version = "0.3" }
rustls-pemfile = { version = "2.0" }

# Feature-specific dependencies (optional)
arbitrary = { version = "1.3", optional = true, features = ["derive"] }
qlog = { version = "0.13", optional = true }

# Essential dependencies
uuid = { version = "1.0", features = ["v4", "serde"] }
unicode-width = "0.2"
hex = "0.4"
once_cell = "1.21"
dashmap = "6"
zeroize = { version = "1.8", features = ["derive"] }

# Dependencies for ant-quic binary
clap = { version = "4", features = ["derive"] }
tokio = { version = "1.28.1", features = ["full"] }
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time", "json"] }
quinn-udp = { version = "0.5", features = ["log", "tracing"] }
pin-project-lite = "0.2"

# Compliance validator dependencies
regex = "1.11"
chrono = { version = "0.4", features = ["serde"] }
rustls-native-certs = "0.8"

# Platform-specific target dependencies
[target.'cfg(windows)'.dependencies]
windows = { version = "0.58", features = [
    "Win32_Foundation",
    "Win32_NetworkManagement_IpHelper",
    "Win32_NetworkManagement_Ndis",
    "Win32_Networking_WinSock",
    "Win32_System",
    "Win32_System_IO",
    "Win32_System_Threading",
] }

[target.'cfg(target_os = "linux")'.dependencies]
netlink-packet-route = "0.20"
netlink-sys = "0.8"
hex = "0.4"

[target.'cfg(target_os = "macos")'.dependencies]
system-configuration = "0.6"
core-foundation = "0.9"

[dev-dependencies]
assert_matches = "1.1"
hex-literal = "0.4"
rand_pcg = "0.3"
rcgen = "0.14"
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time", "json"] }
tempfile = "3"
lazy_static = "1"
criterion = { version = "0.5", features = ["html_reports"] }
anyhow = "1"
serde_yaml = "0.9"
serde_json = "1"
webpki-roots = "1.0"
tokio = { version = "1.36", features = ["full"] }
proptest = { version = "1.5", features = ["std"] }
proptest-derive = "0.5"
quickcheck = "1.0"
quickcheck_macros = "1.0"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)', 'cfg(wasm_browser)', 'cfg(feature, values("arbitrary", "__qlog", "bloom", "low_memory", "security_validation_not_yet_implemented"))'] }

# Main binary - unified P2P node with automatic coordinator services
[[bin]]
name = "ant-quic"
path = "src/bin/ant-quic.rs"

# Interoperability test runner
[[bin]]
name = "interop-test"
path = "src/bin/interop-test.rs"

# Public endpoint tester
[[bin]]
name = "test-public-endpoints"
path = "src/bin/test_public_endpoints.rs"

# Benchmarks
[[bench]]
name = "quic_benchmarks"
harness = false

[[bench]]
name = "relay_queue"
harness = false

[[bench]]
name = "candidate_discovery"
harness = false

[[bench]]
name = "nat_traversal"
harness = false

[[bench]]
name = "address_discovery_bench"
harness = false

[[bench]]
name = "connection_management"
harness = false

[[bench]]
name = "nat_traversal_performance"
harness = false


# Test categorization
[[test]]
name = "quick"
path = "tests/quick/main.rs"

[[test]]
name = "standard"
path = "tests/standard/main.rs"

[[test]]
name = "long"
path = "tests/long/main.rs"
harness = false  # Custom test runner for long tests

[package.metadata.docs.rs]
features = ["rustls-aws-lc-rs", "rustls-ring", "platform-verifier", "log"]