How can I print packet fields of type structure?

Categories:
Solution Number:
S20648
Last Modified:
2013-08-20
Issue

How can I print packet fields of type structure?

Solution

If you are using OPNET 4.0 or earlier, you will need to write a function which will get the pointer to the structure from the packet field (op_pk_nfd_get ()). Print out the fields in the structure and then place the pointer pack into the packet field (op_pk_nfd_set ()). You can then place a call to the function in a block of code associated with a labeled ODB trace. You can then printout your structure fields by enabling the labeled trace:if (op_prg_odb_ltrace_active (print_packet_struct) ) print_struct_field (pkptr);If you are using OPNET version 5.1 or later there is a new kernel procedure op_pk_fd_print_proc_set (), which associates a print function with a packet field for a particular packet format. You still need to write the function, but it only needs to print out the fields, the pointer is provided as one of the functions arguments. Then when you use pkprint this function will automatically be called to print the packet fields structure. (See the Simulation KernelPrg-Topo manual for more information on op_prg_odb_ltrace_active ())(See the Simulation KernelAnim-Pk manual for more information on op_pk_fd_print_proc_set ())(See the External Interfaces Manual for more information on the OPNET Debugger (ODB) )

Environment

DES Kernel->Process Modeling/Coding

Attachments
NOTICE: Riverbed® product names have changed. Please refer to the Product List for a complete list of product names.
Can't find an answer? Create a case