op_ici_print()
Abstract
Prints the contents of the specified ICI onto the standard output device.
Syntax
op_ici_print (iciptr)
| Argument | Type | Description |
|---|---|---|
iciptr |
Ici * |
pointer to the ICI-of-interest [A pointer to an ICI can be obtained from two KPs: op_ici_create() returns a pointer to a newly allocated ICI (in an ICI-sending process), and op_intrpt_ici() returns a pointer to an ICI associated with an incoming interrupt (in an ICI-receiving process).] |
Return Type
void
No return value.
Example
/* obtain incoming ICI */
iciptr = op_intrpt_ici();
/* determine if the ICI is of the appropriate type; */
/* if so, print its contents onto the terminal */
op_ici_format (pkptr, ici_name);
if (strcmp (ici_name, "fddi_mac_fr_llc") == 0)
op_ici_print (iciptr);
example output as it appears on the standard output device:
------------- ICI (34) -------------
format (fddi_mac_fr_llc)
svc_class : (2)
dst_addr : (13)
pri : (1)
tk_class : (0)
------------------------------------
Details
By default, the standard output device for a simulation is the command shell that spawned the simulation process. If the simulation process was spun off by the application GUI, the standard output device is the command shell that spawned the application process. If the simulation process was spawned from a window system window, the default standard output device will be associated with that window. The standard output can be redirected to a file, using the > I/O redirection operator on the simulation command line.
The format of the ICI information generated by this KP is shown in the Example section. Note that the unique numeric ID of the ICI is printed in the banner.
This KP does not affect the contents or installation status of ICIs on which it operates.
For ICI pointers equal to the constant OPC_NIL, this KP simply prints a message to the effect that the ICI has a NIL address, but no errors are generated.
Purpose
Provides a mechanism for a user to monitor the contents of ICIs from a terminal, or to log the ICI contents into a file for later investigation. Printing out ICI contents can be very useful in the simulation debugger, when arriving ICIs contain values that are used in process computations or that influence the flow of process logic. Statements to print out ICIs can be added to state executives (for event-driven printing), or to the diagnostic block (for user-driven printing of packet information whenever the prodiag command is issued from the debugger). (ICIs also can be printed directly from the simulation debugger using the iciprint_ev and iciprint_pk commands.)
Errors
- Program Abort: Segmentation violation. (due to an invalid ICI pointer or malformed ICI data structure)
Reference
- Use the KP op_intrpt_ici() to obtain the pointer to an ICI associated with an incoming interrupt
- Use the KP op_pk_format() to obtain the format of a packet
- Use the KP op_ici_format_print_proc_set() to specify a custom print procedure for the named structure fields of ICIs with a given format