op_pk_id_str_get()

Abstract

Obtains the string representation of a packet ID.

Syntax

op_pk_id_str_get (pkid, buffer)
Argument Type Description
pkid OpT_Packet_Id ID of the packet-of-interest
buffer char * variable to be filled with the string representation of the packet ID

Return Type

void

No return value.

Example

char    pkt_id_str[20];

/* A packet has arrived at our receiver */
pkptr = op_pk_get (op_intrpt_strm ());

/* Get the packet ID and convert to a string */
pkt_id = op_pk_id (pkptr);
op_pk_id_str_get (pkt_id, pkt_id_str);

Details

If the simulation uses module-based ID generation, the returned string consists of the ID of the module in which the packet was created (or "kernel" if created by the simulation) and the creation index in that module. Otherwise, it is simply the global packet creation index.

When using module-based ID generation, this KP provides a better output than just using OPC_PACKET_ID_FMT to print the ID to a string.

Purpose

Provides a way to obtain a well-formed string representation of a packet ID, regardless of whether ID generation is module-based or global.

Errors

  • None.

Reference

  • None.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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