Compaq AAR04BCTE eSNMP API Routines str2oid, Format, Arguments, Description, Return Values

Models: AAR04BCTE

1 132
Download 132 pages 53.41 Kb
Page 96
Image 96
eSNMP API Routines str2oid

eSNMP API Routines str2oid

str2oid

Converts a null-terminated string OID in dot notation to an OID structure. The str2oid routine does not allocate an OID structure.

Format

oid *str2oid ( oid *oid, char *s );

Arguments

oid

The value to be inserted as data into the VARBIND structure. For more information about OID length and values, see Chapter 3.

s

A null string or empty string returns an OID structure that has one element of zero.

Description

The routine dynamically allocates the buffer and inserts its pointer into the OID structure passed in the call. The caller must explicitly free this buffer. The OID can have a maximum of 128 elements.

Return Values

null

An error occurred. Otherwise, the pointer to the

 

OID structure (its first argument) is returned.

Example

 

include <esnmp.h> OID abc;

if (stroid (&abc, "1.2.5.4.3.6") == NULL DPRINTF((WARNING, "It did not work...\n");

5–38eSNMP API Routines

Page 96
Image 96
Compaq AAR04BCTE manual eSNMP API Routines str2oid, Format, Arguments, Description, Return Values, Example