[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Communications Technical Reference, Volume 2

s_generic Subroutine

Purpose

Sets the value of the Management Information Base (MIB) variable in the database.

Library

The SNMP Library (libsnmp.a)

Syntax

#include <isode/objects.h>
int s_generic 
(oi, v, offset)
OI oi;
register struct type_SNMP_VarBind *v;
int offset;

Description

The s_generic subroutine sets the database value of the MIB variable. The subroutine retrieves the information it needs from a value in a variable binding within the Protocol Data Unit (PDU). The s_generic subroutine sets the MIB variable, specified by the object identifier oi parameter, to the value field specified by the v parameter.

The offset parameter is used to determine the stage of the set process. If the offset parameter value is type_SNMP_PDUs_set__reque st, the value is checked for validity and the value in the ot_save field in the OI structure is set. If the offset parameter value is type_SNMP_PDUs_commit, the value in the ot_save field is freed and moved to the MIB ot_info field. If the offset parameter value is type_SNMP_PDUs_rollback, the value in the ot_save field is freed and no new value is written.

Parameters

oi Designates the OI structure representing the MIB variable to be set.
v Specifies the variable binding that contains the value to be set.
offset Contains the stage of the set. The possible values for the offset parameter are type_SNMP_PDUs_commit, type_SNMP_PDUs_rollback, or type_SNMP_PDUs_set__request.

Return Values

If the subroutine is successful, a value of int_SNMP_error__status_noError is returned. Otherwise, a value of int_SNMP_error__status_badValue is returned.

Implementation Specifics

This subroutine is part of the SNMP Application Programming Interface in the TCP/IP facility.

Related Information

The o_number, o_integer, o_string, o_specific, o_igeneric, o_generic, or o_ipaddr subroutines.

List of Network Manager Programming References.

SNMP Overview for Programmers, and Understanding SNMP Daemon Processing in AIX Version 4.3 Communications Programming Concepts.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]