nrac_resource_create()

Abstract

Create a resource object within a network.

Syntax

nrac_resource_create (net_handle, name, capacity, client_state_ptr)
Argument Type Description
net_handle Nrac_Net_Handle handle for the network context of interest
name const char * name of the resource (used only for reporting)
capacity double nominal number of consumer units the resource can support
client_state_ptr void * a way to link the resource to other states in the client application. Use OPC_NIL if not needed.

Return Type

Nrac_Resource_Handle

handle representing the new resource object. OPC_NIL means that creation failed, typically due to insufficient memory.

nrac.h

Details

Resources represent physical or logical building blocks of the network, such as nodes, links, or channels. A resource can then be used to support resource consumers, typically traffic. Initially, the resource object simply exists within the network and is unassociated with any consumers. The object has three properties that can be queried at any time via other NRAC functions:

  • name is used only for reporting. (This field can be empty if desired.)
  • capacity specifies, in a way that is meaningful to the client application, how many units of consumer load can nominally be supported by the resource. No enforcement of this limit is performed. It is merely used for accounting.
  • client_state_ptr is a pointer to any data that the application wishes to associate with this resource. For example, if the resource represents a link, this could be a pointer to a corresponding link data structure. The NRAC package does not use this pointer itself—pass in OPC_NIL if it is not needed.

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