op_sar_buf_options_set()

Abstract

Assigns the specified options to the specified buffer.

Syntax

op_sar_buf_options_set (sb_hndl, options, flush_time)
Argument Type Description
sb_hndl Sbhandle handle identifying the buffer-of-interest
[This value can identify any of the three Sar buffer types: segmentation, reassembly, or resegmentation. A Sar buffer handle is obtained when a buffer is created via the KP op_sar_buf_create().]
options int buffer option flags
[This value is the bitwise OR combination of symbolic constant flags that specify the Sar buffer options to be enabled (see the Details section and Table 77 “Sar Buffer Option Symbolic Constants“ on page 23).]
flush_time double time limit for incomplete source packets to be flushed
[This value is only used when an invocation of this KP references a reassembly buffer and includes the option flag OPC_SAR_BUF_OPT_FLUSH_TIMED (note that a “place-holder” value must always be passed to the KP, however). The value is measured in seconds, specifying the amount of time that segments of an incomplete source packet can remain in a reassembly buffer; when incomplete packet segments in a reassembly buffer reach the time limit, they are flushed.]

Return Type

void

No return value.

Example

/* Change the reassembly buffer’s flush timer. */
switch (flush_mode)
	{
	case FM_LONG:
		/* Long is ten minutes. */
		op_sar_buf_options_set (sbh, OPC_SAR_BUF_OPT_FLUSH_TIMED, 600.0);
		break;

	case FM_MEDIUM:
		/* Medium is one minute. */
		op_sar_buf_options_set (sbh, OPC_SAR_BUF_OPT_FLUSH_TIMED, 60.0);
		break;

	case FM_SHORT:
		/* Short is one second. */
		op_sar_buf_options_set (sbh, OPC_SAR_BUF_OPT_FLUSH_TIMED, 1.0);
		break;
	}

Details

The options argument indicates the operational options of the specified buffer that are to be enabled, and allows more than one option flag to be combined using the C bitwise OR operator (the vertical bar character, “|”). Buffer option symbolic constants that are passed to the options argument cause the corresponding options to be enabled indefinitely; buffer options only change when this KP is invoked. The options supported in an invocation of this KP depend on the type of buffer, as shown in Table 17; invalid option values passed to this KP are ignored and recoverable errors are generated.

Table 17: Sar Buffer Options for Setting Buffers

Buffer Type Supported Options Option Flags
Any Type default options (none) OPC_SAR_BUF_OPT_DEFAULT
Segmentation & Resegmentation packet boundary
segment padding
OPC_SAR_BUF_OPT_PK_BNDRY
OPC_SAR_BUF_OPT_SEG_PAD
Reassembly automatic flush
timed flush
OPC_SAR_BUF_OPT_FLUSH_AUTO
OPC_SAR_BUF_OPT_FLUSH_TIMED

Setting the packet boundary or segment padding options does not cause any immediate actions; the new option values have their first effect when a buffer insertion or removal occurs. Setting the automatic flush option causes an immediate flush of any incomplete source packets containing gaps. Setting the timed flush option causes an immediate flush of any incomplete source packets that have been in the specified reassembly buffer longer than the new flush_time value.

Purpose

Provides a mechanism for altering the operational options of a Sar buffer after it has been created. The timed flush option of reassembly buffers can only be set using this KP, so the initialization of reassembly buffers with this option must include an invocation of this KP. The other buffer options can all be set when a buffer is created by op_sar_buf_create(), so op_sar_buf_options_set() is only invoked for these options when they are to be modified. Segmentation & resegmentation buffer options, which deal with the relationship of the source packet and segment bit boundaries, are typically modified when the changing nature of source packet data requires a new form of segmentation (a fairly rare circumstance). Reassembly buffer options, which deal with flushing, are typically modified if buffer sizes approach a monitored upper limit.

Errors

  • Standard Sar errors (see Table 15)
  • Recoverable Error: Invalid option (<option>) for specified buffer type.
  • Recoverable Error: Flush time (<flush_time>) is invalid. Value must be greater than or equal to 0.0.

Reference

  • Use the KP op_sar_buf_create() to create a Sar buffer with an initial set of options
  • Use the KP op_sar_buf_print() to print detailed information about a Sar buffer to the standard output

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