Skip to content

google/pdl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

27d63c1 · Jan 29, 2025
May 13, 2024
May 13, 2024
Aug 31, 2023
Aug 25, 2023
Jan 29, 2025
Jan 29, 2025
Nov 26, 2024
Jan 29, 2025
Aug 25, 2023
Apr 17, 2023
Jun 2, 2024
Apr 17, 2023
Apr 2, 2024
May 10, 2023

Packet Description Language (PDL)

Crate Build workflow GitHub contributors GitHub stars

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.

How to use PDL

  1. Write the protocol definition
  2. cargo run my-protocol.pdl --output-format rust > my-protocol.rs

Language specific instructions are provided for all supported backends:

  1. Rust generated code guide
  2. Python generated code guide
  3. C++ generated code guide

Supported Features

Full reference documentation

  • Scalar values
  • Enumerators
  • Arrays
  • Optional fields
  • Nested packets
  • Conditional packet derivation
  • Custom field definitions

Similar projects

About

No description or website provided.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages