rustflexstack 0.1.1

ETSI C-ITS GeoNetworking and BTP protocol stack in Rust
Documentation
  • Coverage
  • 31.65%
    1417 out of 4477 items documented42 out of 1732 items with examples
  • Size
  • Source code size: 1.84 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 980.39 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8m 16s Average build duration of successful builds.
  • all releases: 7m 25s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • JordiMarias

FlexStack(R) Community Edition — Rust

Rust License

Short description

FlexStack(R) is a software library implementing the ETSI C-ITS protocol stack. Its aim is to facilitate and accelerate the development and integration of software applications on vehicles, vulnerable road users (VRU), and roadside infrastructure that requires the exchange of V2X messages (compliant with ETSI standards) with other actors of the V2X ecosystem.

This repository contains the Rust implementation of the FlexStack library, providing a high-performance, memory-safe ETSI C-ITS GeoNetworking (EN 302 636-4-1) and BTP (EN 302 636-5-1) protocol stack. It supports CAM, DENM, and VAM message encoding/decoding and transmission.

Documentation

Extensive documentation is available at https://flexstack.eu.

Library API documentation can be generated locally by running:

cargo doc --open

Pre-requisites

Supported Operating Systems

This library can run on any system that supports Rust 1.75 or higher, including Linux, macOS, and Windows. Raw link-layer access (via pnet) may require elevated privileges or specific capabilities (e.g. CAP_NET_RAW) on Linux.

Cross-compilation for embedded or non-x86 targets (e.g. aarch64-unknown-linux-gnu) is fully supported.

Dependencies

All dependencies are managed by Cargo and declared in Cargo.toml:

Crate Version Purpose
pnet 0.34 Raw link-layer packet I/O
rand 0.8 Random number generation
libc 0.2 POSIX system bindings
rasn 0.26 ASN.1 encoding/decoding (for CAM, DENM, VAM)

Build tools

Requires a stable Rust toolchain. Install via rustup:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

To build the library:

cargo build --release

To build and run examples:

cargo run --example cam_sender_receiver
cargo run --example denm_sender_receiver
cargo run --example vam_sender_receiver

Cross-compilation for aarch64

  1. Add the target:
    rustup target add aarch64-unknown-linux-gnu
    
  2. Install the cross-linker (Debian/Ubuntu):
    sudo apt install gcc-aarch64-linux-gnu
    
  3. Configure the linker in .cargo/config.toml:
    [target.aarch64-unknown-linux-gnu]
    linker = "aarch64-linux-gnu-gcc"
    
  4. Build:
    cargo build --release --target aarch64-unknown-linux-gnu
    

Alternatively, use cross for a Docker-based, zero-configuration cross-compilation:

cargo install cross
cross build --release --target aarch64-unknown-linux-gnu

Known Limitations

  • Raw link-layer reception and transmission (via pnet) requires CAP_NET_RAW privileges or running as root on Linux.
  • The ASN.1 codec (rasn) may not support all ETSI C-ITS optional extensions. Messages have been tested for interoperability with existing commercial implementations.

Installation

Add the library to your Cargo.toml:

[dependencies]
rustflexstack = { git = "https://github.com/Fundacio-i2CAT/rustflexstack" }

Developers

Source

This code has been developed within the following research and innovation projects:

  • CARAMEL (Grant Agreement No. 833611) – Funded under the Horizon 2020 programme, focusing on cybersecurity for connected and autonomous vehicles.
  • PLEDGER (Grant Agreement No. 871536) – A Horizon 2020 project aimed at edge computing solutions to improve performance and security.
  • CODECO (Grant Agreement No. 101092696) – A Horizon Europe initiative addressing cooperative and connected mobility.
  • SAVE-V2X (Grant Agreement No. ACE05322000044) – Focused on V2X communication for vulnerable road user safety, and funded by ACCIO.
  • PoDIUM (Grant Agreement No. 101069547) – Funded under the Horizon 2021 programme, this project focuses on accelerating the implementation of connected, cooperative and automated mobility technology.
  • SPRINGTIME (PID2023-146378NB-I00) funded by the Spanish government (MCIU/AEI/10.13039/501100011033/FEDER/UE), this project focuses in techniques to get IP-based interconnection on multiple environments.
  • ONOFRE-3 (PID2020-112675RB-C43) funded by the Spanish government (MCIN/ AEI /10.13039/501100011033), this project focuses on the adaptation of network and compute resources from the cloud to the far-edge.

Copyright

This code has been developed by Fundació Privada Internet i Innovació Digital a Catalunya (i2CAT).

FlexStack is a registered trademark of i2CAT. Unauthorized use is strictly prohibited.

i2CAT is a non-profit research and innovation centre that promotes mission-driven knowledge to solve business challenges, co-create solutions with a transformative impact, empower citizens through open and participative digital social innovation with territorial capillarity, and promote pioneering and strategic initiatives. i2CAT aims to transfer research project results to private companies in order to create social and economic impact via the out-licensing of intellectual property and the creation of spin-offs. Find more information of i2CAT projects and IP rights at https://i2cat.net/tech-transfer/

License

This code is licensed under the terms of the AGPL. Information about the license can be located at https://www.gnu.org/licenses/agpl-3.0.html.

Please, refer to FlexStack Community Edition (Rust) as a dependence of your works.

If you find that this license doesn't fit with your requirements regarding the use, distribution or redistribution of our code for your specific work, please, don't hesitate to contact the intellectual property managers in i2CAT at the following address: techtransfer@i2cat.net. Also, in the following page you'll find more information about the current commercialization status or other licensees: Under Development.

Attributions

Attributions of Third Party Components of this work: