op_sar_bitrange_create()

Abstract

Creates a bit-range that defines a series of contiguous bits belonging to a single packet.

Syntax

op_sar_bitrange_create (start_bit, count, pkt_size, pkt_label)
Argument Type Description
start_bit OpT_Sar_Size first bit of a bit-range
[The start bit refers to the first bit’s position in the original packet.]
count OpT_Sar_Size number of contiguous bits in the bit-range
pkt_size OpT_Sar_Size size of the packet to which the bits belong
[The size of the packet in bits.]
pkt_label OpT_Int64 label for the packet to which the bits belong
[A packet label is a user-defined numeric value that identifies a particular packet within a Sar buffer. Source packets are assigned labels when inserted into Sar segmentation buffers by op_sar_segbuf_pk_insert().]

Return Type

Sar_Bitrange*

Bit-range defining a group of contiguous bits within a segment belonging to a single packet.

Example

/* create a new list of SAR bit ranges to assign */
/* bits within incoming vector to packets.       */
/* All bits within the vector are assumed to     */
/* belong to the next packet in sequence.        */
bitrange_ptr = op_sar_bitrange_create (last_start, op_vvec_size_get (incoming_vvec),
	MTU_SIZE, sequence_num++);
last_start += op_vvec_size_get (incoming_vvec);
/* append this bitrange pointer to bitrange list being constructed. */
op_prg_list_insert(bitrange_list_ptr, bitrange_ptr, OPC_LISTPOS_TAIL);

Details

A bit-range is a data type specific to the Sar package that stores key information about bit configuration inside segments. A bit-range specifies a series of contiguous bits that all belong to the same packet, which is identified by its user defined label. The value assigned to the starting bit of a bit-range specifies its location in the labeled packet. In addition, the packet’s total size before segmentation is also stored in the bit-range.

Bit-ranges should be destroyed after they are no longer needed to free the memory associated with them. op_sar_bitrange_create() returns OPC_NIL if the memory for a new bit-range could not be allocated.

Purpose

Provides a mechanism to create bit-ranges.

Errors

  • Recoverable Error: Bitrange count (<count>) is invalid.
  • Recoverable Error: Bitrange start bit (<start>) is invalid.
  • Recoverable Error: Bitrange total size (<packet size>) 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