-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCargo.toml
More file actions
103 lines (82 loc) · 3.5 KB
/
Copy pathCargo.toml
File metadata and controls
103 lines (82 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[package]
name = "libcsp"
version = "2.1.0"
edition = "2021"
description = "Safe Rust bindings for libcsp (Cubesat Space Protocol) v2.1 with v1 wire-format compatibility"
license = "LGPL-2.1"
links = "csp"
[features]
default = ["std", "rdp", "hmac", "promisc", "dedup", "host-default-arch"]
# Pull in the standard library. Disable to build for no_std targets.
# When disabled you still need `alloc` (for CString / heap-allocated strings
# in CspConfig). The CSP buffer pool itself never calls the Rust allocator.
std = []
# Auto-export a POSIX `TestArch` as the C-side OS shim when `external-arch`
# is enabled on a host platform (Linux/macOS). On by default so that
# `cargo test --features external-arch` and the in-tree examples link without
# requiring the user to invoke `export_arch!` themselves.
#
# Disable (via `default-features = false`) when you want to provide your own
# arch implementation on a host target — e.g., the `examples/custom_arch_external`
# sub-crate. Disabling has no effect on bare-metal targets, where the host
# arch is excluded by `target_os` regardless.
host-default-arch = []
# Security / protocol features
rdp = [] # Reliable Datagram Protocol
rdp-fast-close = ["rdp"] # Fast close of RDP connections
hmac = [] # HMAC-SHA1 authentication
# Routing / misc
promisc = [] # Promiscuous mode
dedup = [] # Packet deduplication (runtime-configurable via CspConfig::dedup())
# Drivers / interfaces (optional external dependencies)
socketcan = [] # Linux SocketCAN driver (requires libsocketcan)
zmq = [] # ZMQ hub interface (requires libzmq)
usart-linux = [] # Linux USART driver
# Debug
debug = [] # Enable CSP debug output (csp_print + counters)
# CSP v1-on-ZMQ interop: swap to little-endian CSP v1 headers on ZMQ
# (only needed if you're bridging legacy systems via ZMQ).
zmq-v1-fixup = []
# Zero out freed buffers (runtime scrub). Off by default.
buffer-zero-clear = []
# Custom Architecture Support
# Enable this to provide your own implementation of OS primitives (mutex, queue, clock)
# from outside this crate.
external-arch = []
# ROPI-RWPI ARM support: the export_arch! macro emits *_impl-suffixed symbols for the
# functions that touch Rust statics (queue_create, get_ms).
# The crate compiles an assembly file that provides the public csp_* names as
# R9-saving trampolines that reload __data_start before calling the *_impl variant.
ropi-rwpi = []
[dependencies]
bitflags = "2"
spin = "0.9"
# Note: We don't use tinyrlibc because it exports symbols with no_mangle when features are enabled,
# causing conflicts with our export_arch! macro. Instead, we implement the simple functions ourselves.
# libc is used by test_arch on host platforms (Linux, macOS)
[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies]
libc = "0.2"
[dev-dependencies]
anyhow = "1.0"
libc = "0.2"
# socketcan's build script hard-fails on non-Linux hosts, and an unconditional
# dev-dependency is resolved for every `cargo build --tests` regardless of
# features. Only the socketcan examples use it, and they are feature-gated.
[target.'cfg(target_os = "linux")'.dev-dependencies]
socketcan = "3.3"
[build-dependencies]
cc = "1"
bindgen = "0.72"
# Examples that require specific features
[[example]]
name = "sniffer"
required-features = ["socketcan"]
[[example]]
name = "stress_tx"
required-features = ["socketcan"]
[[example]]
name = "stress_rx"
required-features = ["socketcan"]
[[example]]
name = "rust_socketcan_iface"
required-features = ["socketcan"]