Skip to content

Serde Debugability #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

najaco
Copy link

@najaco najaco commented Jun 26, 2023

For testing purposes, it would be nice to be able to serialize and deserialize packets in a human readable format. This adds an optional feature to derive the serialize and deserialize impls from the serde crate

In conjunction with netlink-packet-xfrm PR #8

@najaco
Copy link
Author

najaco commented Jun 26, 2023

Realistically, I think an effort could be made to get rid of NetlinkSerializable and NetlinkDeserializable, derive serde::Serialize and serde::Deserialize without it being a feature, and have your own netlink-serde encoder, similar to:

Doing so would keep in line with traits defined by the serde crate. Such a task is outside the scope of this PR.

@cathay4t
Copy link
Member

cathay4t commented Jul 9, 2023

The serde is big crate to depend on. It is strange to me we need human friendly output for test purpose, why the {:?} is not good enough.

@najaco
Copy link
Author

najaco commented Jul 10, 2023

@cathay4t I can see your point on that, which is why I opted to make it a feature. We would find having the serde crate added on help us in recording messages in a human readable format, so that we can play them back in testing setups.

@najaco
Copy link
Author

najaco commented Jul 18, 2023

@cathay4t any update?

@cathay4t
Copy link
Member

cathay4t commented Aug 4, 2024

Sorry for the long wait. Please provide more detail on so that we can play them back in testing setups.

@cathay4t
Copy link
Member

If you want to store data and apply it back. Try emit().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants