op_sar_bitrange_info_get()

Abstract

Obtains information about a bit-range, placing the number of the starting bit, the number of bits, the size of the original packet, or the packet’s label into a variable.

Syntax

op_sar_bitrange_info_get (bit_range, property, dest)
Argument Type Description
bit_range Sar_Bitrange* bit-range to query
property int item of interest in the bit-range. See Details for possible values.
dest int * or OpT_Sar_Size * variable that receives the value of the queried component

Return Type

Compcode

Completion code indicating whether the property was successfully retrieved.

[This value can be compared to the two symbolic constants OPC_COMPCODE_SUCCESS and OPC_COMPCODE_FAILURE.]

Example

/* obtain the label associated with a bitrange and          */
/* encode it as an integer value in an unused packet field. */

bitrange_ptr = (Sar_Bitrange *) op_prg_list_access (bitrange_list_ptr,
	OPC_LISTPOS_HEAD);
op_sar_bitrange_info_get (bitrange_ptr, OPC_SAR_BITRANGE_PROPERTY_LABEL,
	&label_value);

/* encode the label in packet field. */
op_pk_nfd_set (pkptr, "encoded label", label_value);

/* send packet down to lower layer. */
op_pk_send (pkptr, 0);

Details

A bit-range contains four properties that can be queried by this KP. The starting bit is the first bit’s position in the original packet. The number of bits in the bit-range, the original packet size, and the original packet label can also be retrieved.

The property argument can have the following values:

  • OPC_SAR_BITRANGE_PROPERTY_COUNT (dest is int)
  • OPC_SAR_BITRANGE_PROPERTY_COUNT_INT64 (dest is OpT_Int64)
  • OPC_SAR_BITRANGE_PROPERTY_STARTBIT (dest is int)
  • OPC_SAR_BITRANGE_PROPERTY_STARTBIT_INT64 (dest is OpT_Int64)
  • OPC_SAR_BITRANGE_PROPERTY_LABEL (dest is int)
  • OPC_SAR_BITRANGE_PROPERTY_LABEL_INT64 (dest is OpT_Int64)
  • OPC_SAR_BITRANGE_PROPERTY_PKSIZE (dest is int)
  • OPC_SAR_BITRANGE_PROPERTY_PKSIZE_INT64 (dest is OpT_Int64)

Purpose

Provides a mechanism to retrieve information about a bit-range.

Errors

  • Recoverable Error: Invalid bitrange.
  • Recoverable Error: Bitrange property is invalid.

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