You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into some issues where I've wanted to write packets to disk in their parsed form, not in their on-the-wire format. What are folks thoughts about peppering all of the major structs (PacketHeaders, PacketSlice, and transitively) to auto-derive Serialize and Deserialize? Happy to write it myself - just wanted to ask first.
The text was updated successfully, but these errors were encountered:
Add serde as non default feature, and make it optional (the PR bellow already does this).
You can have a look at Add serde derive macros where applicable #45 where someone already started. Note that this PR is currently not building (I just did a quick and dirty rebase of it) and is missing custom serialize implementations for the types with buffers (see next note). You don't have to use the PR, but feel free to if you want to.
You will have to implement the Serialize and Deserialize traits manually for structs that contain a buffer (e.g. for header options). Specifically you will have to do it in a way so only the actually used data gets serialized and deserialization fails if the data is not fulfilling the length constraints for. I think the following headers will need a custom implementation: Ipv4Options, TcpOptions, Ipv6RawExtHeader, IpAuthHeader.
I've run into some issues where I've wanted to write packets to disk in their parsed form, not in their on-the-wire format. What are folks thoughts about peppering all of the major structs (PacketHeaders, PacketSlice, and transitively) to auto-derive Serialize and Deserialize? Happy to write it myself - just wanted to ask first.
The text was updated successfully, but these errors were encountered: