Manual Pages for UNIX Darwin command on man netsnmp_ds_get_boolean
MyWebUniversity

Manual Pages for UNIX Darwin command on man netsnmp_ds_get_boolean

DEFAULTSTORE(3) Net-SNMP DEFAULTSTORE(3)

NAME

defaultstore - generic storage of global data.

SYNOPSIS

##iinncclluuddee <>

##iinncclluuddee <>

iinntt nneettssnnmmppddsssseettbboooolleeaann((iinntt store,, iinntt which,, iinntt val));; iinntt nneettssnnmmppddssggeettbboooolleeaann((iinntt store,, iinntt which));; iinntt nneettssnnmmppddsssseettiinntt((iinntt store,, iinntt which,, iinntt val));; iinntt nneettssnnmmppddssggeettiinntt((iinntt store,, iinntt which));; iinntt nneettssnnmmppddsssseettssttrriinngg((iinntt store,, iinntt which,, ccoonnsstt cchhaarr **val));; cchhaarr **nneettssnnmmppddssggeettssttrriinngg((iinntt store,, iinntt which));; iinntt nneettssnnmmppddssrreeggiisstteerrccoonnffiigg((uucchhaarr type,, ccoonnsstt cchhaarr **ftype,, ccoonnsstt cchhaarr **token,, iinntt store,, iinntt which));; iinntt nneettssnnmmppddssrreeggiisstteerrpprreemmiibb((uucchhaarr type,, ccoonnsstt cchhaarr **ftype,, ccoonnsstt cchhaarr **token,, iinntt store,, iinntt which));; vvooiidd nneettssnnmmppddsssshhuuttddoowwnn((vvooiidd));;

DESCRIPTION

The purpose of the default storage is three-fold:

1) To create a global storage space without creating a whole bunch of globally accessible variables or a whole bunch of access functions to work with more privately restricted variables. 2) To provide a single location where the thread locking needs to be implemented. At the time of this writing, however, thread locking is not yet in place. 3) To reduce the number of cross dependencies between code pieces that may or may not be linked together in the long run. This provides for a single location in which configuration data, for example, can be stored for a separate section of code that may not be linked in to the application in question. The functions defined here implement these goals. Currently, three data types are supported: booleans, integers, and strings. Each of these data types have separate storage spaces. In addition, the storage space for each data type is divided further by the application level. Currently, there are two storage spaces. The first is reserved for the SNMP library itself. The second is intended for use in applications and is not modified or checked by the library, and, therefore, this is the space usable by you. You can think of these storage spaces as being 3 arrays, something like boolstorage[storeid][which], intstorage[storeid][which], and stringstorage[storeid][which]. The data is then accessed through the functions defined below. For data you wish to store, you should use a store parameter of NNEETTSSNNMMPPDDSSAAPPPPLLIICCAATTIIOONNIIDD. The storage space used by the library (for which the store parameter is NNEETTSSNNMMPPDDSSLLIIBBRRAARRYYIIDD) is defined in the defaultstore.h file, which currently contains the following defines: */ /** * @def NETSNMPDSLIBRARYID These definitions correspond with the "storid" argument to the API */

#define NETSNMPDSLIBRARYID 0

#define NETSNMPDSAPPLICATIONID 1

#define NETSNMPDSTOKENID 2

/* * These definitions correspond with the "which" argument to the API, * when the storeid argument is NETSNMPDSLIBRARYID */ /* * library booleans */

#define NETSNMPDSLIBMIBERRORS 0

#define NETSNMPDSLIBSAVEMIBDESCRS 1

#define NETSNMPDSLIBMIBCOMMENTTERM 2

#define NETSNMPDSLIBMIBPARSELABEL 3

#define NETSNMPDSLIBDUMPPACKET 4

#define NETSNMPDSLIBLOGTIMESTAMP 5

#define NETSNMPDSLIBDONTREADCONFIGS 6

#define NETSNMPDSLIBMIBREPLACE 7 /* replace objects from latest module */

#define NETSNMPDSLIBPRINTNUMERICENUM 8 /* print only numeric enum values */

#define NETSNMPDSLIBPRINTNUMERICOIDS 9 /* print only numeric enum values */

#define NETSNMPDSLIBDONTBREAKDOWNOIDS 10 /* dont print oid indexes specially */

#define NETSNMPDSLIBALARMDONTUSESIG 11 /* don't use the alarm() signal */

#define NETSNMPDSLIBPRINTFULLOID 12 /* print fully qualified oids */

#define NETSNMPDSLIBQUICKPRINT 13 /* print very brief output for parsing */

#define NETSNMPDSLIBRANDOMACCESS 14 /* random access to oid labels */

#define NETSNMPDSLIBREGEXACCESS 15 /* regex matching to oid labels */

#define NETSNMPDSLIBDONTCHECKRANGE 16 /* don't check values for ranges on send */

#define NETSNMPDSLIBNOTOKENWARNINGS 17 /* no warn about unknown config tokens */

#define NETSNMPDSLIBNUMERICTIMETICKS 18 /* print timeticks as a number */

#define NETSNMPDSLIBESCAPEQUOTES 19 /* shell escape quote marks in oids */

#define NETSNMPDSLIBREVERSEENCODE 20 /* encode packets from back to front */

#define NETSNMPDSLIBPRINTBAREVALUE 21 /* just print value (not OID = value) */

#define NETSNMPDSLIBEXTENDEDINDEX 22 /* print extended index format [x1][x2] */

#define NETSNMPDSLIBPRINTHEXTEXT 23 /* print ASCII text along with hex strings */

#define NETSNMPDSLIBPRINTUCDSTYLEOID 24 /* print OID's using the UCD-style prefix suppression */

#define NETSNMPDSLIBREADUCDSTYLEOID 25 /* require top-level OIDs to be prefixed with a dot */

#define NETSNMPDSLIBHAVEREADPREMIBCONFIG 26 /* have the pre-mib parsing config tokens been processed */

#define NETSNMPDSLIBHAVEREADCONFIG 27 /* have the config tokens been processed */

#define NETSNMPDSLIBQUICKEPRINT 28

#define NETSNMPDSLIBDONTPRINTUNITS 29 /* don't print UNITS suffix */

#define NETSNMPDSLIBNODISPLAYHINT 30 /* don't apply DISPLAY-HINTs */

#define NETSNMPDSLIB16BITIDS 31 /* restrict requestIDs, etc to 16-bit values */

#define NETSNMPDSLIBDONTPERSISTSTATE 32 /* don't save/load any persistant state */

#define NETSNMPDSLIB2DIGITHEXOUTPUT 33 /* print a leading 0 on hex values <= 'f' */

#define NETSNMPDSLIBIGNORENOCOMMUNITY 34 /* don't complain if not community is specified in the command arguments */

/* * library integers */

#define NETSNMPDSLIBMIBWARNINGS 0

#define NETSNMPDSLIBSECLEVEL 1

#define NETSNMPDSLIBSNMPVERSION 2

#define NETSNMPDSLIBDEFAULTPORT 3

#define NETSNMPDSLIBOIDOUTPUTFORMAT 4

#define NETSNMPDSLIBPRINTSUFFIXONLY NETSNMPDSLIBOIDOUTPUTFORMAT

#define NETSNMPDSLIBSTRINGOUTPUTFORMAT 5

#define NETSNMPDSLIBHEXOUTPUTLENGTH 6

#define NETSNMPDSLIBSERVERSENDBUF 7 /* send buffer (server) */

#define NETSNMPDSLIBSERVERRECVBUF 8 /* receive buffer (server) */

#define NETSNMPDSLIBCLIENTSENDBUF 9 /* send buffer (client) */

#define NETSNMPDSLIBCLIENTRECVBUF 10 /* receive buffer (client) */

/* * special meanings for the default SNMP version slot (NETSNMPDSLIBSNMPVERSION) */

#ifndef DISABLESNMPV1

#define NETSNMPDSSNMPVERSION1 128 /* bogus */

#endif

#ifndef DISABLESNMPV2C

#define NETSNMPDSSNMPVERSION2c 1 /* real */

#endif

#define NETSNMPDSSNMPVERSION3 3 /* real */

/* * library strings */

#define NETSNMPDSLIBSECNAME 0

#define NETSNMPDSLIBCONTEXT 1

#define NETSNMPDSLIBPASSPHRASE 2

#define NETSNMPDSLIBAUTHPASSPHRASE 3

#define NETSNMPDSLIBPRIVPASSPHRASE 4

#define NETSNMPDSLIBOPTIONALCONFIG 5

#define NETSNMPDSLIBAPPTYPE 6

#define NETSNMPDSLIBCOMMUNITY 7

#define NETSNMPDSLIBPERSISTENTDIR 8

#define NETSNMPDSLIBCONFIGURATIONDIR 9

#define NETSNMPDSLIBSECMODEL 10

#define NETSNMPDSLIBMIBDIRS 11

#define NETSNMPDSLIBOIDSUFFIX 12

#define NETSNMPDSLIBOIDPREFIX 13

#define NETSNMPDSLIBCLIENTADDR 14

#define NETSNMPDSLIBTEMPFILEPATTERN 15

#define NETSNMPDSLIBAUTHMASTERKEY 16

#define NETSNMPDSLIBPRIVMASTERKEY 17

#define NETSNMPDSLIBAUTHLOCALIZEDKEY 18

#define NETSNMPDSLIBPRIVLOCALIZEDKEY 19

#define NETSNMPDSLIBAPPTYPES 20

#define NETSNMPDSLIBKSMKEYTAB 21

#define NETSNMPDSLIBKSMSERVICENAME 22

/* FFUUNNCCTTIIOONNSS iinntt nneettssnnmmppddsssseettbboooolleeaann((iinntt store,, iinntt which,, iinntt val));;

Stores TRUE if val != 0 or else FALSE into the boolstor-

age[store][which] slot. Returns SSNNMMPPEERRRRGGEENNEERRRR if the store and

which parameters do not correspond to a valid slot, or SSNNMM-

PPEERRRRSSUUCCCCEESSSS otherwise. iinntt nneettssnnmmppddssggeettbboooolleeaann((iinntt store,, iinntt which));; Returns 1 if boolstorage[store][which] is TRUE or 0 if not. May also return SSNNMMPPEERRRRGGEENNEERRRR if the store and which parameters do not correspond to a valid slot. iinntt nneettssnnmmppddsssseettssttrriinngg((iinntt store,, iinntt which,, ccoonnsstt cchhaarr **val));; Stores val into the stringstorage[store][which] slot. Returns SSNNMMPPEERRRRSSUUCCCCEESSSS normally, or SSNNMMPPEERRRRGGEENNEERRRR if the store and which parameters do not correspond to a valid slot. cchhaarr **nneettssnnmmppddssggeettssttrriinngg((iinntt store,, iinntt which));;

Returns the string which has been stored in the stringstor-

age[store][which] slot, or NNUULLLL if the store and which parame-

ters do not correspond to a valid slot. nneettssnnmmppddsssseettiinntt((iinntt store,, iinntt which,, iinntt val));; Stores val into the intstorage[store][which] slot. Returns

SSNNMMPPEERRRRGGEENNEERRRR if the store and which parameters do not corre-

spond to a valid slot, or SSNNMMPPEERRRRSSUUCCCCEESSSS otherwise. iinntt nneettssnnmmppddssggeettiinntt((iinntt store,, iinntt which));;

Returns the integer which has been stored in the intstor-

age[store][which] slot, or SSNNMMPPEERRRRGGEENNEERRRR if the store and which parameters do not correspond to a valid slot. vvooiidd nneettssnnmmppddsssshhuuttddoowwnn((vvooiidd));;

Reclaims memory used to hold information gathered by nneett-

ssnnmmppddssrreeggiisstteerrccoonnffiigg and nneettssnnmmppddssrreeggiisstteerrpprreemmiibb. iinntt nneettssnnmmppddssrreeggiisstteerrccoonnffiigg((uucchhaarr type,, ccoonnsstt cchhaarr **ftype,, ccoonnsstt cchhaarr **token,, iinntt store,, iinntt which));; Registers a configuration file directive token and attaches it to a default storage type and slot. Specifically, store and which indicate the storage slot in the data type indicated by type, where type is one of the following constants: AASSNNBBOOOOLLEEAANN, AASSNNIINNTTEEGGEERR, or AASSNNOOCCTTEETTSSTTRR. The ftype variable indicates the

file name base string searched for the token keyword. For exam-

ple, the following call:

netsnmpdsregisterconfig(ASNINTEGER, "snmp", "testto-

ken", DSAPPLICATIONID, 5) would indicate that when the snmp.conf file(s) were found and parsed, that any line beginning with the word "testtoken" should be read and the value after "testtoken" should be stored into the intstorage[DSAPPLICATIONID][5] slot. For example the following line in the configuration file: testtoken 502

would set intstorage[DSAPPLICATIONID][5] = 502. This func-

tion returns SSNNMMPPEERRRRSSUUCCCCEESSSS if the registration was made suc-

cessfully, or SSNNMMPPEERRRRGGEENNEERRRR if the registration was not made

(perhaps because the store and which parameters do not corre-

spond to a valid slot, or because of a memory allocation fail-

ure). iinntt nneettssnnmmppddssrreeggiisstteerrpprreemmiibb((uucchhaarr type,, ccoonnsstt cchhaarr **ftype,, ccoonnsstt cchhaarr **token,, iinntt store,, iinntt which));; Analogous to the preceeding function, but the token is processed before MIBs are read (this is therefore useful for controlling MIB processing options).

SEE ALSO

ssnnmmppccoonnffiigg(5), rreeaaddccoonnffiigg(3) 4.2 Berkeley Distribution 25 Jun 2002 DEFAULTSTORE(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™