cniGetAttribute

Gets the value of an attribute on a specific node instance. It is invoked by the message broker when a report request is received that retrieves the value of a node attribute. The broker verifies that the attribute name is valid for the node.

The responsibilities of the node at this point are to:
  1. Return a character representation of the attribute value.
  2. Return a null string if the data is sensitive and should not be displayed in reports.
  3. Throw an exception if an error occurs.
Defined In Type Member
CNI_VFT Optional iFpGetAttribute

Syntax

int cniGetAttribute(
  CciContext*  context,
  CciChar*     attrName,
  CciChar*     buffer,
  int          bufsize);

Parameters

context
The address of the context for the instance of the node, as created by the node and returned by the cniCreateNodeContext function (input).
attrName
The name of the attribute for which the value is to be retrieved (input).
buffer
The address of a buffer into which the attribute value is copied (output).
bufsize
The length, in bytes, of the buffer specified in the buffer parameter (input).

Return values

If successful, zero is returned, and the character representation of the value of the attribute is returned in the specified buffer. If the name of the attribute does not identify one supported by the node, a non-zero value is returned.