op_td_increment_int64()
Abstract
Increments a TDA 64-bit integer value by a specified amount.
Syntax
op_td_increment_int64 (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 64-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 |
OpT_Int64 |
value to be added to the current TDA value |
Return Type
void
no return value
Example
Opt_Int64 curr_colls;
/* Increment number of collisions in arriving packet. */
op_td_increment_int64 (pkptr_arriv, OPC_TDA_RA_NUM_COLLS, curr_colls);
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_int64() and op_td_set_int64().
Errors
- Recoverable Error:
<type>TDA (<name>) cannot be incremented using 'op_td_increment_int64'. - 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
- Use the KP op_td_increment_int() to increment the value of a 32-bit integer transmission data attribute
- Use the KP op_td_increment_dbl() to increment the value of a double transmission data attribute
- Use the KP op_td_get_int() or op_td_get_int64() to obtain the value of an integer transmission data attribute
- Use the KP op_td_set_int() or op_td_set_int64() to assign the value of an integer transmission data attribute
- Use the KP op_td_is_set() to determine whether a transmission data attribute has been assigned