This file just contains some notes about the design and usage of the PDL language. ------- TERMS ------- .pdl The file type that defines packet definitions. You may think of each pdl file as its own translation unit. Packet Views and Builders Generated from a packet definition. Views are used to validate packets and extract the fields that are defined in the pdl file. Builders check the input arguments and can be serialized. Checksum types checksum MyChecksumClass : 16 "path/to/the/class/" Checksum fields need to implement the following three methods: void Initialize(MyChecksumClass&); void AddByte(MyChecksumClass&, uint8_t); // Assuming a 16-bit (uint16_t) checksum: uint16_t GetChecksum(MyChecksumClass&); ------------- LIMITATIONS ------------- - Size fields for a variable length field MUST come before the definition of said field. - Payload fields must be byte-aligned unless they have an unknown size. Body fields are allowed to not be byte aligned. - No conditionals - Can not have to fields with the same name anywhere in the in an inheritence chain - Can't handle size for Body type fields yet since they might not be byte aligned. - Currently no arrays of custom types (might change later) ------- NOTES ------- All field names should be in snake_case. Types should be in CamelCase. The _payload_ keyword generates a getter but _body_ doesn't. Therefore, a _payload_ must be byte aligned. Supports constraints on grandparents Supports multiple constraints Every field handles its own generation. One pdl file will result in one header file with all the packets Things to cover - Constraints Inheritance vs Contains Custom fields with fixed size must extend and implement: packet::CustomFieldFixedSizeInterface Custom fields with variable size need the following functions: static void Serialize(const Type&, MutableView&); static std::optional Size(Iterator); static Type Parse(Iterator); std::string ToString();