op_hla_id_hla_to_opnet_map()

Note: Requires High-Level Architecture functionality

Abstract

Maps an HLA ID to its corresponding Riverbed Modeler ID.

Syntax

op_hla_id_hla_to_opnet_map (hla_id, opnet_ id_ptr)
Argument Type Description
hla_id unsigned long ID of HLA object
opnet_id_ptr Objid * pointer to Riverbed Modeler ID for mapping

Return Type

Compcode

Completion code indicating success or failure in mapping the HLA ID. The procedure returns OPC_COMPCODE_SUCCESS if the HLA ID was successfully mapped. It returns OPC_COMPCODE_FAILURE if it could not map the ID.

Example

Using interactions to have Riverbed Modeler update an attribute value.

Packet            * pk_ptr
unsigned long       hla_id;
Objid              opnet_id;

/* Extract an HLA ID from an incoming interaction */
pk_ptr = op_pk_get(op_intrpt_strm());
op_pk_nfd_get(pk_ptr, “hla ID”, &hla_id);

/* Check for an already-existing mapping for that object */
if (op_hla_id_hla_to_opnet_map (hla_id, &opnet_id)
	== OPC_COMPCODE_SUCCESS)
	{
	/* Extract an attribute name and value from the interaction*/
	char attr_name [100];
	int attr_value;

	op_pk_nfd_get(pk_ptr, “Attr_Name”, attr_name);
	op_pk_nfd_get(pk_ptr, “Attr_Value”, &attr_value);

	/* Apply the attribute value to the mapped object */
	op_ima_obj_attr_set(opnet_id, attr_name, attr_value);
	}

op_pk_destroy (pk_ptr);

Details

This KP places the Riverbed Modeler ID of the HLA object referenced by hla_id into opnet_id_ptr.

Purpose

Provides a mechanism to obtain the ID of a Riverbed Modeler object mapped to an HLA ID.

Errors

  • No errors are trapped.

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