1 | initial version |
It is possible to register fields outside of the proto_register_MYPROTOCOL function. For examples for particular reasons, see packet-radius.c
and packet-diameter.c
, which register the protocol (and a small number of fields) initially, and then register the rest of the fields (which require parsing text files) only when a packet encountering the protocol is parsed, or in a few cases such as wanting to see reports that list all the fields.
However, your custom protocol does not sound like the kind of thing that would need to register fields dynamically. It doesn't sound particularly variable or like there's very many fields. Why would you not register a field for the marker and register fields for the various types you encounter? Can you explain why you think you need to do that?