op_td_is_set()

Abstract

Determines if the specified transmission data attribute has an assigned value.

Syntax

op_td_is_set (pkptr, tda_index)
Argument Type Description
pkptr Packet* pointer to the packet-of-interest
tda_index int numeric index of the transmission data attribute-of-interest.
[This value is an integer code that specifies the transmission data attribute. Predefined values for this argument appear in “Transmission Data Attribute“ on page 28.]

Return Type

Boolean

Boolean value indicating if the specified transmission data attribute has received an assignment. The constant OPC_TRUE is returned if the TDA is set; OPC_FALSE if it is not.

Example

Excerpt from: example model (models/std/base); pipeline model (dra_power).

/* If the incoming packet is ’valid’, it may cause the receiver to */
/* lock onto it. However, if the receiving node is disabled, then */
/* the channel match should be set to noise. */
if (op_td_get_int (pkptr, OPC_TDA_RA_MATCH_STATUS) == OPC_TDA_RA_MATCH_VALID)
	{
	if (op_td_is_set (pkptr, OPC_TDA_RA_ND_FAIL))
		{
		/* The receiving node is disabled. Change the channel */
		/* match status to noise. */
		op_td_set_int (pkptr, OPC_TDA_RA_MATCH_STATUS, OPC_TDA_RA_MATCH_NOISE);
		}
	else
		{
		. . .
		}
	}

Details

Transmission data attributes are used to convey link modeling data between the Simulation Kernel and successive Transceiver Pipeline stages. The Td package KPs provide primitive operations (set and get) for operating on transmission data attributes. If the value is set (i.e., if it has at any time received an assignment), this KP will return OPC_TRUE; otherwise, OPC_FALSE.

Purpose

Provides a mechanism to determine if the transmission data attribute value is currently set. This is useful when pipeline stages cannot necessarily depend on particular attributes being present in a packet, either because they are written generically so as to operate with a variety of other stages, or because it is known that another (previous) stage in the pipeline might leave an attribute that is of interest unset. Attempting to access an attribute that is unset causes a simulation error. Therefore, if such a condition can be anticipated as a possibility, it should be tested for with op_td_is_set() prior to attempting extraction of a TDA value.

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 (<pk_id>).
  • Program Abort: Tda index (<tda_index>) is out-of-range for packet (<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