commit | 1a30467fb3b874b8b7fff7ce9e3b982c82d58bff | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Sep 01 21:00:22 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Sep 01 21:00:22 2023 +0000 |
tree | 897836674c74faac90707276de61c91a3c2e8c6b | |
parent | 42ce95e07de0cf20aefdf1c7ea8ac6112dc61234 [diff] | |
parent | c926f5b2ffcdda548241ea633c8d6b77975de1df [diff] |
Snap for 10750748 from c926f5b2ffcdda548241ea633c8d6b77975de1df to mainline-cellbroadcast-release Change-Id: I3e67d6a5a0e0de4063d0cd5cbaa7bfa1b7c28a56
PDL is a domain specific language for writing the definition of binary protocol packets. Parsing and validating packets from raw bytes is tedious and error prone in any language. PDL generates memory safe and tailored backends for multiple target languages:
- Rust - C++ - Python
Historically PDL was developed as part of the Android Bluetooth stack (bluetooth_packetgen) as a way to generate the parser and serializer for Bluetooth packets, and reduce the number of memory safety issues that come with manipulating and validating raw data.
cargo run my-protocol.pdl --output-format rust > my-protocol.rs
Language specific instructions are provided for all supported backends: