Skip to content
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

General protocol buffer approach #255

Open
KristianLyng opened this issue Sep 19, 2022 · 0 comments
Open

General protocol buffer approach #255

KristianLyng opened this issue Sep 19, 2022 · 0 comments
Labels
enhancement New feature or request parser

Comments

@KristianLyng
Copy link
Collaborator

With USP, we now have two protobuf family parsers. We should expect more.

A general-purpose protobuf parser would be nice. I envision the general logic as:

  1. Do proto.Unmarshal() onto an interface{}, named Data
  2. Do type casting on the Data, checking for known protobuf messages
  3. Allocate a subtype struct depending on the type of Data, e.g. USP for USP, Junos for junos, call it PType
  4. Issue PType.GetTimestamp, PType.GetMetadata and PType.GetData (or similar)
  5. Do some sort of common normalization at the end, e.g.: PType.Nornalize()

This is obviously just marginally processed thoughts, and the algorithm could be widely different, but I think at least step 1-3 is probably sensible?

This would allow us to actually have a general-purpose protobuf parser.

@KristianLyng KristianLyng added enhancement New feature or request parser labels Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser
Projects
None yet
Development

No branches or pull requests

1 participant