oms_aa_dest_addr_from_range_get()

Abstract

Obtains a random destination address within a given subset of addresses.

Syntax

oms_aa_dest_addr_from_range_get (oms_aa_handle, dest_address_ptr, low, high)

Argument Type Description
oms_aa_handle OmsT_Aa_Address_Handle Handle to the list for the specific address type
dest_address_ptr int * Memory address to which the address will be copied
low int Lowest array index in range of acceptable addresses
high int Highest array index in range of acceptable addresses

Return Type

void

No value returned

Details

This procedure obtains an address (whose destination status is OmsC_Aa_Valid_Destination) from a subset of addresses in an address list, as indicated by the low and high array indices.

Example

From tr_mac_interface process model, appl_layer_arrvl enter execs:

/* Determine the destination. Don't try infinite times.             */
num_tries = 0;
	do
	{
	/* Increment the try counter.  This will prevent an infinite loop.  */
	num_tries++;
	/* Pick a random destination address unless the destination address  */
	/* is already set to a specific value.                               */
	if (low_dest_index + high_dest_index > 0)
		oms_aa_dest_addr_from_range_get (oms_aa_handle, &dest_addr,
		  low_dest_index, high_dest_index);
	else
		dest_addr = destination_address;
	oms_aa_dest_addr_get (oms_aa_handle, &dest_addr);
	}
	} while ((dest_addr == station_addr) && (num_tries < TRY_THRESH));
	if (dest_addr == station_addr)
		tr_gen_error ("Unable to choose remote address.", OPC_NIL, OPC_NIL);

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