libaprs-engine
Protocol-first APRS parsing and inspection for Rust.
libaprs-engine is a byte-preserving APRS engine. It accepts untrusted
packet bytes, keeps the original bytes intact, rejects malformed packet shape at
the codec boundary, and exposes structured APRS views for downstream policy,
telemetry, indexing, and diagnostics.
Project Status
- APRS engine with meaningful semantics, conformance fixtures, compatibility tests, examples, benchmark, optional transport adapters, and CLI inspector.
- Current tagged release:
v1.1.0. - Public API is semver-protected from
1.0.0. The public boundary is tracked in Public API Boundary. - Core runtime remains network-free and async-free. Optional
serdediagnostics and separate transport adapter crates are available. - GitHub Actions workflow is active and checks Rust
1.80.0plus stable, including formatting, tests, examples, metadata, docs, and clippy.
Workspace Crates
libaprs-engine: library crate with packet types, parser, semantic views, policy, engine orchestration, counters, JSON diagnostics, shared transport contracts, bounded-read helpers, and line transport.aprs-cli: command-line packet inspector built on the library crate.aprs-transport-file: optional file transport helper crate that reads packet files as bytes and returns newline-separated packet byte vectors.aprs-transport-tcp: optional TCP transport helper crate that reads packet bytes from a reader or TCP address outside the parser core.aprs-transport-aprs-is: optional APRS-IS helper crate for login line framing and reader-backed packet splitting.aprs-transport-kiss: optional KISS frame encode/decode helper crate.aprs-transport-serial: optional serial-like reader helper crate.aprs-transport-udp: optional UDP datagram helper crate.aprs-transport-http: optional HTTP body ingestion helper crate.aprs-transport-file-watch: optional append-only packet log helper crate.aprs-transport-mqtt: optional MQTT payload helper crate.aprs-transport-ax25: optional AX.25 UI frame helper crate.aprs-transport-corpus: optional corpus replay helper crate.aprs-transport-channel: optional in-process channel helper crate.aprs-transport-async: optional runtime-neutral async splitting helper crate.
Which Crate Should I Use?
- Use
libaprs-enginefor parsing, semantic inspection, policy, counters, and diagnostics. - Use
aprs-clifor command-line inspection and corpus triage. - Use
aprs-transport-filewhen packet bytes come from files or stdin-style buffers. - Use
aprs-transport-tcpwhen packet bytes come from blocking TCP or anotherReadimplementation. - Use
aprs-transport-aprs-iswhen connecting to APRS-IS and you need login line framing plus APRS-IS comment filtering. - Use
aprs-transport-kissfor KISS TNC/TCP/serial frame encode/decode. - Use
aprs-transport-serial,aprs-transport-udp,aprs-transport-http,aprs-transport-file-watch,aprs-transport-mqtt,aprs-transport-ax25,aprs-transport-corpus,aprs-transport-channel, oraprs-transport-asyncwhen those source boundaries match your application.
Install Or Depend On It
Use crates.io:
[]
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
= "1.1.0"
Use a Git dependency when testing unreleased changes from this repository.
[]
= { = "https://github.com/elodiejmirza/libaprs-engine", = "libaprs-engine", = "v1.1.0" }
For local development from a checkout:
[]
= { = "../libaprs-engine/crates/libaprs-engine" }
Rust imports use underscores:
use parse_packet;
Quick Start
Parse one APRS packet from bytes:
use ;
Run the CLI against newline-separated packets:
|
Security Model
- Treat every packet as untrusted bytes.
- Preserve raw input exactly for accepted packets.
- Reject empty, oversized, malformed, or non-AX.25-like packet shape.
- Do not trim, lowercase, normalize, or lossy-convert packet bytes before calling the parser.
- Keep payload bytes opaque; they may not be valid UTF-8.
- Use bounded transport reads. The default helper limit is
DEFAULT_TRANSPORT_READ_LIMIT, and oversized transport input reportstransport.oversized_input. - Return optional typed interpretations when fields cannot be decoded safely.
- Use
PolicyandEngineto apply operational rejection rules after codec validation.
See Security Model for details.
Documentation
- API Guide: library types, parser, engine, policy, and semantic variants.
- CLI Guide: command-line input, output, exit behavior, and examples.
- Examples: copyable integration patterns.
- Operations Guide: production deployment patterns, diagnostics, logging, limits, and safe defaults.
- Transport Adapters: byte-preserving transport crate boundaries and integration examples.
- Architecture: boundaries, contracts, and pipeline.
- Security Model: untrusted input handling and OWASP-aligned controls.
- Public API Boundary: semver-protected public API surface, internal boundaries, and semver guidance.
- Stability: API stability levels and feature flags.
- Conformance Matrix: APRS family support and known gaps.
- Verification: local checks and release gates.
- Release Checklist: pre-release steps.
- Publishing: crates.io package and publish workflow.
- Contributing: development rules, verification, and secure review checklist.
Verification
Run the local gate before integrating changes:
For the fuller local release gate, run:
Minimal Packet Scope
The codec validates a conservative source>path:payload shape:
sourceis an uppercase ASCII callsign of 1-6 letters or digits with optional-0through-15SSID.pathcontains at least one component; the first component is the destination.- path components use the same address rules, and digipeater components may end
with
*. payloadmust contain at least the APRS data type identifier byte.- total packet length must be at most
MAX_PACKET_LEN.
Semantic parsing covers status, position, timestamped position, compressed position, messages, bulletins, announcements, acknowledgements, rejects, objects/items with coordinate helpers, weather, telemetry, telemetry metadata, queries, capabilities, NMEA identifiers/fields/checksum inspection, Mic-E message codes and coordinates/speed/course when decodable, Maidenhead locator, user-defined data, explicit third-party nested parsing, malformed data, and unsupported data.