op_td_increment_int()

Abstract

Increments a TDA 32-bit integer value by a specified amount.

Syntax

op_td_increment_int (pkptr, tda_index, value)
Argument Type Description
pkptr Packet* pointer to the packet-of-interest
tda_index int numeric index of the transmission data attribute-of-interest. The TDA must be a 32-bit integer.
[This value is an integer code that specifies the transmission data attribute to be accessed. Predefined values for this argument appear in “Transmission Data Attribute“ on page 28. User-defined transmission information can be obtained from any attribute index greater than the largest index occupied by a predefined attribute (assuming the attribute has been previously assigned). The largest predefined attribute indices are OPC_TDA_PT_MAX_INDEX (for the point-to-point pipeline), OPC_TDA_BU_MAX_INDEX (for the bus pipeline), and OPC_TDA_RA_MAX_INDEX (for the radio pipeline).]
value int value to be added to the current TDA value

Return Type

void

no return value

Example

/* Increment number of collisions in arriving packet. */
op_td_increment_int (pkptr_arriv, OPC_TDA_RA_NUM_COLLS, 1);

Details

This function adds the value argument to the current TDA value. If the TDA does not exist, this function creates a new custom TDA with an initial value of value.

Purpose

When changing a TDA value, this function provides a convenient alternative to using op_td_get_int() and op_td_set_int().

Errors

  • Recoverable Error: <type> TDA (<name>) cannot be incremented using 'op_td_increment_int'.
  • 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 (<pk_id>).
  • Program Abort: Tda index (<tda_index>) is out-of-range for packet (<pk_id>).
  • Program Abort: Read-only Tda (<tda_name>) cannot be modified in pk (<pk_id>)

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