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
- Use the KP op_hla_obj_info_get() to obtain the HLA ID of a Riverbed Modeler object