commit | 527ab0dee170ce9dd83476f4978d340bb7548705 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sat Jul 15 14:35:08 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sat Jul 15 14:35:08 2023 +0000 |
tree | e00e76908c9390c398f7ffc6ca31cf93b9aaa8ea | |
parent | 5a685899cde87c8b2796e2cb4cff128b01c1e106 [diff] | |
parent | e107b6ca4d4614084ff2a32db5defe2bc5194bcb [diff] |
Snap for 10502042 from e107b6ca4d4614084ff2a32db5defe2bc5194bcb to mainline-cellbroadcast-release Change-Id: I242f94e2b93407f4a712fc9d335798806350b197
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: