op_pk_print_options()

摘要

将数据包的信息打印到输出设备,可选择性地包含 TDA 和 VVEC 值。

语法

op_pk_print_options (pkptr, options)
参数 类型 说明
pkptr Packet* 目标数据包的指针 [指向数据包的指针可以从许多内核过程获得,包括 op_pk_create()、op_pk_create_fmt()、op_pk_copy()、op_pk_get()、op_subq_pk_access() 和 op_subq_pk_remove()。]
options int 应输出哪类信息(见详情)

返回类型

void

无返回值。

示例

/* 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);

示例输出:

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.

详情

options 必须是以下符号常量之一:

  • OPC_PK_PRINT_NO_OPTIONS——只打印基本信息(与 op_pk_print() 的输出相同)
  • OPC_PK_PRINT_TDA——打印基本信息以及 TDA 值
  • OPC_PK_PRINT_VVEC——打印基本信息以及 VVEC 值
  • OPC_PK_PRINT_ALL——打印基本信息以及 TDA 和 VVEC 值

更多详情见 op_pk_print()。

用途

提供一种从终端监视数据包内容、或将数据包内容记录到文件以供后续分析的机制。该内核过程的工作方式与 op_pk_print() 相同,提供相同的输出,并额外允许选择性地输出 TDA 值、VVEC 值或两者。

错误

  • 程序中止:段违例。(由于无效的数据包指针或格式错误的数据包)
  • 程序中止:数据包指针为 NIL。
  • 程序中止:数据包指针指向已被销毁的数据包。

参考

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com