How can I model a dynamic length packet field?
How can I model a dynamic length packet field?
If a packet field represents data, it is possible that its length is different for different instances of the packet. There are two possible approaches to model this.Remember: The modeled size of a packet is the sum of the sizes of its set fields and the bulk packet size. 1. One approach is to use op_pk_bulk_size_set() to model the dynamic part of the field size. 2. The second approach is to use the Simulation KP op_pk_fd_set() to set the field. One of the arguments to this function is the size of the field. Note that you will need to first use the KP op_pk_nfd_name_to_index() to first determine the index of a named field before you can use op_pk_fd_set(). If you have only one dynamic length field in the packet, it is easier to use the first approach. Even if you have multiple dynamic length fields, the bulk size approach will work, but it is safer to use op_pk_nfd_set() for all fields.
DES Kernel->Process Modeling/Coding,DES Kernel->Other