op_sar_rsgbuf_bits_flush_abs()

Abstract

Flushes the specified absolute bit-range from the specified resegmentation buffer.

Syntax

op_sar_rsgbuf_bits_flush_abs (sb_hndl, bit_index_abs, bit_count)
Argument Type Description
sb_hndl Sbhandle handle identifying the resegmentation buffer-of-interest
[This value must identify a Sar resegmentation buffer. A Sar buffer handle is obtained when a buffer is created via the KP op_sar_buf_create().]
bit_index_abs OpT_Sar_Size absolute index of the first bit in the range to be flushed from the buffer
[An absolute index is a numeric value that identifies the first bit of a range within a Sar buffer, based on a user-defined numbering system. The absolute index of the first bit of each segment in a resegmentation buffer is set upon insertion by the KP op_sar_rsgbuf_seg_insert()]
bit_count OpT_Sar_Size number of bits in the range to be flushed from the buffer
[This value specifies the length of the bit-range to be flushed.]

Return Type

Compcode

Completion code indicating whether the specified bits were successfully flushed.

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

Example

/* Receive an acknowledgment from the peer process. */
ack_pkptr = op_pk_get (ACK_INSTRM);

/* Determine the sequence number of the last byte being acknowledged. */
op_pk_nfd_get (ack_pkptr, "seq_num", &new_ack_last_byte);

/* Check if new acknowledgment progressed past last acknowledgment. */
if (new_ack_last_byte > old_ack_last_byte)
	{
	/* Determine the bit-range of new acknowledgment. */ 
	new_ack_bit_index = (old_ack_last_byte + 1) * 8;
	new_ack_bit_count = (new_ack_last_byte - old_ack_last_byte) * 8;

	/* Flush the resegmentation buffer of acknowledged bits. */
	op_sar_rsgbuf_bits_flush_abs (rsg_sbh, new_ack_bit_index, new_ack_bit_count);
	/* Reset new acknowledgment as old acknowledgment. */
	old_ack_last_byte = new_ack_last_byte;
	}

Details

Flushing a range of bits from a resegmentation buffer permanently takes them out of the sequence of bits stored in the buffer. If a flushed bit-range is not at the head of the buffer, the buffer’s remaining bits will have a “sequential jump” at the location of the flushed bit-range. If the specified bit-range includes all bits in the buffer associated with a particular segment or source packet, then the segment or source packet association will also be flushed from the buffer. If the specified bit-range includes portions of the bits in the buffer associated with a particular segment or source packet, then the segment or source packet association will be reduced by the flushed portions.

Both the bit_index_abs and bit_count arguments are 64-bit integer numbers to accommodate large ranges.

Purpose

Provides a mechanism to flush a range of bits from a resegmentation buffer, as identified by the absolute index of the first bit in the range. Flushing bit-ranges from resegmentation buffers is typically performed when these buffers are being used for retransmission purposes (that is, to store copies of transmitted data for potential retransmission due to packet loss, excessive delays, etc.). In such cases, when a range of transmitted data has been correctly received, it can be flushed from the resegmentation buffer, because it will no longer be needed as “insurance” against transmission failure (see the Example section for an illustration of this use). Flushing data identified by bit-ranges is useful when flushed data may straddle segment and source packet boundaries.

Errors

  • Standard Sar errors (see Table 15)
  • Program Abort: Buffer handle references destroyed buffer.
  • Program Abort: Buffer type (<type>) is invalid for this KP, should be (resegmentation).
  • Program Abort: Packet (<pkid>) must be a segment of another packet.
  • Program Abort: Number of bits value (<bit_count>) must be greater than 0.
  • Recoverable Error: Index (<bit_index_abs>) is invalid. / Value must be greater than or equal to 0.

Reference

  • Use the KP op_sar_srcbuf_bits_flush() to flush a bit-range, identified by local bit index and length, from a (re)segmentation buffer
  • Use the KP op_sar_rsgbuf_lbl_pk_range_get() to determine the local bit index and length of the bit-range associated with a specific source packet in a resegmentation buffer
  • Use the KP op_sar_rsgbuf_lbl_seg_range_get() to determine the local bit index and length of the bit-range associated with a specific Sar segment in a resegmentation buffer
  • Use the KP op_sar_buf_size() to determine the number of bits stored in a Sar buffer

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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