op_pk_print_options()
Abstract
Prints information about a packet to an output device, optionally including TDA and VVEC values.
Syntax
op_pk_print_options (pkptr, options)
| Argument | Type | Description |
|---|---|---|
pkptr |
Packet* |
pointer to the packet-of-interest [A pointer to a packet can be obtained from many KPs, including op_pk_create(), op_pk_create_fmt(), op_pk_copy(), op_pk_get(), op_subq_pk_access(), and op_subq_pk_remove().] |
options |
int |
what kinds of information should be output (see Details) |
Return Type
void
No return value.
Example
/* obtain an incoming packet */
pkptr = op_pk_get (0);
/* determine if the packet is of the appropriate type; */
/* if so, print its contents onto the terminal */
op_pk_format (pkptr, pk_format);
if (strcmp ("ams_aal5_cpcs_pdu", pk_format) == 0)
op_pk_print_options (pkptr, OPC_PK_PRINT_ALL);
example output:
Packet content
ID : 4042
tree ID : 3568
address : 0x044CC2B0
format : ams_aal5_cpcs_pdu
creation module : top.Central SW1.AAL [Objid=1624]
creation time : 108.008848304158 sec. [1m 48s . 008ms 848us 304ns 158ps]
stamp module : top.Central SW1.AAL [Objid=1624]
stamp time : 108.008848304158 sec. [1m 48s . 008ms 848us 304ns 158ps]
bulk size : 704 bits
total size : 768 bits
owner : Simulation Kernel
ICI ID : NONE
ID trace : off
tree ID trace : off
encap flags : NONE
____________________________________________________________
Packet Fields
Index Name Type Value Size
----- ------------------- ----------- --------------- ----
0 payload packet pk id (4040) 0
1 UU integer 1 8
2 CPI integer 0 8
3 Length integer 0 16
4 CRC integer 0 32
____________________________________________________________
SAR Information
Number of segment references to this packet: 2
IDs of these segment packets: 4043 4045
____________________________________________________________
Transmission Data Attributes (TDA)
No associated TDAs.
Details
options must be one of the following symbolic constants:
OPC_PK_PRINT_NO_OPTIONS—print basic information only (same output as op_pk_print())OPC_PK_PRINT_TDA—print basic information plus TDA valuesOPC_PK_PRINT_VVEC—print basic information plus VVEC valuesOPC_PK_PRINT_ALL—print basic information plus both TDA and VVEC values
See op_pk_print() for additional details.
Purpose
Provides a mechanism for monitoring packet contents from a terminal or logging them to a file for later investigation. This KP works like op_pk_print() and provides the same output, plus allows the optional output of TDA values, VVEC values, or both.
Errors
- Program Abort: Segmentation violation. (due to an invalid packet pointer or a malformed packet)
- Program Abort: Packet pointer is NIL.
- Program Abort: Packet pointer references destroyed packet.
Reference
- Use the KP op_pk_id() to obtain the unique ID of a packet
- Use the KP op_pk_format() to obtain the format name of a packet
- Use the KPs op_pk_creation_mod_get(), op_pk_creation_time_get(), op_pk_stamp_mod_get(), and op_pk_stamp_time_get() to obtain creation and stamp modules and times of a packet
- Use the KPs op_pk_bulk_size_get() and op_pk_total_size_get() to obtain a packet’s bulk size or total size, respectively
- Use the KP op_subq_print() to print out a list of packets contained within a subqueue