and added files
[bcm963xx.git] / userapps / opensource / net-snmp / man / default_store.3.bot
1 .fi
2 .SH FUNCTIONS
3 .TP
4 .BI "int netsnmp_ds_set_boolean(int " store ", int " which ", int " val ");"
5 Stores
6 .I TRUE
7 if 
8 .I val
9 != 0 or else
10 .I FALSE
11 into the bool_storage[store][which] slot.  Returns
12 .B SNMPERR_GENERR
13 if the
14 .IR store " and " which
15 parameters do not correspond to a valid slot, or
16 .B SNMPERR_SUCCESS
17 otherwise.
18 .TP
19 .BI "int netsnmp_ds_get_boolean(int " store ", int " which ");"
20 Returns 1 if bool_storage[store][which] is 
21 .IR TRUE
22 or 0 if not.  May also return
23 .B SNMPERR_GENERR
24 if the 
25 .IR store " and " which
26 parameters do not correspond to a valid slot.
27 .TP
28 .BI "int netsnmp_ds_set_string(int " store ", int " which ", const char *" val ");"
29 Stores
30 .I val
31 into the string_storage[store][which] slot.  Returns
32 .B SNMPERR_SUCCESS
33 normally, or 
34 .B SNMPERR_GENERR
35 if the 
36 .IR store " and " which
37 parameters do not correspond to a valid slot.
38 .TP
39 .BI "char *netsnmp_ds_get_string(int " store ", int " which ");"
40 Returns the string which has been stored in the
41 string_storage[store][which] slot, or
42 .B NULL
43 if the
44 .IR store " and " which
45 parameters do not correspond to a valid slot.
46 .TP 
47 .BI "netsnmp_ds_set_int(int " store ", int " which ", int " val ");"
48 Stores
49 .I val
50 into the int_storage[store][which] slot.  Returns
51 .B SNMPERR_GENERR
52 if the
53 .IR store " and " which
54 parameters do not correspond to a valid slot, or
55 .B SNMPERR_SUCCESS
56 otherwise.
57 .TP
58 .BI "int netsnmp_ds_get_int(int " store ", int " which ");"
59 Returns the integer which has been stored in the
60 int_storage[store][which] slot, or
61 .B SNMPERR_GENERR
62 if the
63 .IR store " and " which
64 parameters do not correspond to a valid slot.
65 .TP
66 .BI "void netsnmp_ds_shutdown(void);"
67 Reclaims memory used to hold information gathered by
68 .BR netsnmp_ds_register_config " and " netsnmp_ds_register_premib .
69 .TP
70 .BI "int netsnmp_ds_register_config(u_char " type ", const char *" ftype ", const char *" token ", int " store ", int " which ");"
71 Registers a configuration file directive 
72 .I token
73 and attaches it to 
74 a default storage type and slot.  Specifically,
75 .I store
76 and
77 .I which
78 indicate the storage slot in the data type indicated by
79 .I type,
80 where
81 .I type
82 is one of the following constants:
83 .BR ASN_BOOLEAN ", " ASN_INTEGER ", or " ASN_OCTET_STR .
84 The
85 .I ftype
86 variable indicates the file name base string searched for the
87 .I token
88 keyword.  For example, the following call:
89 .RS
90 .IP
91 netsnmp_ds_register_config(ASN_INTEGER, "snmp", "testtoken", DS_APPLICATION_ID, 5)
92 .RE
93 .IP
94 would indicate that when the snmp.conf file(s) were found and parsed,
95 that any line beginning with the word "testtoken" should be read and
96 the value after "testtoken" should be stored into the
97 int_storage[DS_APPLICATION_ID][5] slot.  For example the following
98 line in the configuration file:
99 .RS
100 .IP
101 testtoken 502
102 .RE
103 .IP
104 would set int_storage[DS_APPLICATION_ID][5] = 502.  This function returns
105 .B SNMPERR_SUCCESS
106 if the registration was made successfully, or 
107 .B SNMPERR_GENERR
108 if the registration was not made (perhaps because the
109 .IR store " and " which
110 parameters do not correspond to a valid slot, or because of a memory
111 allocation failure).
112 .TP
113 .BI "int netsnmp_ds_register_premib(u_char " type ", const char *" ftype ", const char *" token ", int " store ", int " which ");"
114 Analogous to the preceeding function, but the
115 .I token
116 is processed before MIBs are read (this is therefore useful for controlling
117 MIB processing options).
118 .SH "SEE ALSO"
119 .BR snmp_config "(5), " read_config "(3)"
120