op_pk_creation_time_set()

Abstract

Changes the creation time of a packet.

Syntax

op_pk_creation_time_set (pkptr, time)
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().]
time double new creation time
[Must be between 0.0 and the current simulation time. If the “sim_time_quantum“ preference has a value other than 0.0, time will be truncated internally to a multiple of the specified quantum.]

Return Type

Compcode

OPC_COMPCODE_SUCCESS if the change was successful; OPC_COMPCODE_FAILURE otherwise

Example

/* declarations */
Packet *uf_pkptr;

/* create an unformatted packet */
uf_pkptr = op_pk_create (64);

/* Set the creation time for this packet */
op_pk_creation_time_set (uf_pkptr, op_sim_time());

Details

A process model invoking this function must own the packet to be changed; non-process model code can use this function for any packet.

Purpose

Provides a way for cosimulations to reset the creation time for packets converted from value vector representation.

Errors

  • Program Abort: Segmentation violation. (due to an invalid packet pointer or malformed packet)
  • Program Abort: Packet pointer is NIL.
  • Program Abort: Packet pointer references destroyed packet.
  • Program Abort: Packet pointer references unowned packet (<pk_id>).
  • Program Abort: Packet creation time (<time>) must be positive and less than or equal to the simulation time (<current_sim_time>)

Reference

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