Victor Julien wrote in #note-4:
What is the purpose of this ticket? Can you add a bit more detail?
Many protocols such as SNMP, LDAP, kerberos... have a spec describing the messages in ASN1.
It is possible to do a program that compiles this ASN1 into rust code using nom
For instance snmpv2 ans is here https://www.rfc-editor.org/rfc/rfc3416#section-3
PDUs ::= CHOICE {
get-request GetRequest-PDU,
get-next-request GetNextRequest-PDU,
get-bulk-request GetBulkRequest-PDU,
response Response-PDU,
set-request SetRequest-PDU,
inform-request InformRequest-PDU,
snmpV2-trap SNMPv2-Trap-PDU,
report Report-PDU }
should become a rust enumeration and
GetRequest-PDU ::= [0] IMPLICIT PDU
should tell us that value 0 should be parsed as `PDU` (which is described afterwards...)