1instance(3) net-snmp instance(3)
2
3
4
6 instance - Process individual MIB instances easily.
7
8
9 Functions
10 netsnmp_mib_handler * netsnmp_get_instance_handler (void)
11 Creates an instance helper handler, calls netsnmp_create_handler,
12 which then could be registered, using netsnmp_register_handler().
13 int netsnmp_register_instance (netsnmp_handler_registration *reginfo)
14 This function registers an instance helper handler, which is a way
15 of registering an exact OID such that GENEXT requests are handled
16 entirely by the helper.
17 int netsnmp_register_read_only_instance (netsnmp_handler_registration
18 *reginfo)
19 This function injects a 'read only' handler into the handler chain
20 prior to serializing/registering the handler.
21 int netsnmp_register_read_only_ulong_instance (const char *name, oid
22 *reg_oid, size_t reg_oid_len, u_long *it, Netsnmp_Node_Handler
23 *subhandler)
24 int netsnmp_register_ulong_instance (const char *name, oid *reg_oid,
25 size_t reg_oid_len, u_long *it, Netsnmp_Node_Handler *subhandler)
26 int netsnmp_register_read_only_counter32_instance (const char *name,
27 oid *reg_oid, size_t reg_oid_len, u_long *it, Netsnmp_Node_Handler
28 *subhandler)
29 int netsnmp_register_read_only_long_instance (const char *name, oid
30 *reg_oid, size_t reg_oid_len, long *it, Netsnmp_Node_Handler
31 *subhandler)
32 int netsnmp_register_long_instance (const char *name, oid *reg_oid,
33 size_t reg_oid_len, long *it, Netsnmp_Node_Handler *subhandler)
34 int netsnmp_register_read_only_uint_instance (const char *name, oid
35 *reg_oid, size_t reg_oid_len, unsigned int *it,
36 Netsnmp_Node_Handler *subhandler)
37 int netsnmp_register_uint_instance (const char *name, oid *reg_oid,
38 size_t reg_oid_len, unsigned int *it, Netsnmp_Node_Handler
39 *subhandler)
40 int netsnmp_register_read_only_int_instance (const char *name, oid
41 *reg_oid, size_t reg_oid_len, int *it, Netsnmp_Node_Handler
42 *subhandler)
43 int register_read_only_int_instance (const char *name, oid *reg_oid,
44 size_t reg_oid_len, int *it, Netsnmp_Node_Handler *subhandler)
45 int netsnmp_register_read_only_ulong_instance_context (const char
46 *name, oid *reg_oid, size_t reg_oid_len, u_long *it,
47 Netsnmp_Node_Handler *subhandler, const char *contextName)
48 int netsnmp_register_ulong_instance_context (const char *name, oid
49 *reg_oid, size_t reg_oid_len, u_long *it, Netsnmp_Node_Handler
50 *subhandler, const char *contextName)
51 int netsnmp_register_read_only_counter32_instance_context (const char
52 *name, oid *reg_oid, size_t reg_oid_len, u_long *it,
53 Netsnmp_Node_Handler *subhandler, const char *contextName)
54 int netsnmp_register_read_only_long_instance_context (const char *name,
55 oid *reg_oid, size_t reg_oid_len, long *it, Netsnmp_Node_Handler
56 *subhandler, const char *contextName)
57 int netsnmp_register_long_instance_context (const char *name, oid
58 *reg_oid, size_t reg_oid_len, long *it, Netsnmp_Node_Handler
59 *subhandler, const char *contextName)
60 int netsnmp_register_int_instance_context (const char *name, oid
61 *reg_oid, size_t reg_oid_len, int *it, Netsnmp_Node_Handler
62 *subhandler, const char *contextName)
63 int netsnmp_register_read_only_int_instance_context (const char *name,
64 oid *reg_oid, size_t reg_oid_len, int *it, Netsnmp_Node_Handler
65 *subhandler, const char *contextName)
66 int register_read_only_int_instance_context (const char *name, oid
67 *reg_oid, size_t reg_oid_len, int *it, Netsnmp_Node_Handler
68 *subhandler, const char *contextName)
69 int netsnmp_register_num_file_instance (const char *name, oid *reg_oid,
70 size_t reg_oid_len, char *file_name, int asn_type, int mode,
71 Netsnmp_Node_Handler *subhandler, const char *contextName)
72 int netsnmp_register_int_instance (const char *name, oid *reg_oid,
73 size_t reg_oid_len, int *it, Netsnmp_Node_Handler *subhandler)
74 This function registers an int helper handler to a specified OID.
75 int netsnmp_instance_ulong_handler (netsnmp_mib_handler *handler,
76 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
77 *reqinfo, netsnmp_request_info *requests)
78 int netsnmp_instance_counter32_handler (netsnmp_mib_handler *handler,
79 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
80 *reqinfo, netsnmp_request_info *requests)
81 int netsnmp_instance_long_handler (netsnmp_mib_handler *handler,
82 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
83 *reqinfo, netsnmp_request_info *requests)
84 int netsnmp_instance_int_handler (netsnmp_mib_handler *handler,
85 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
86 *reqinfo, netsnmp_request_info *requests)
87 int netsnmp_instance_num_file_handler (netsnmp_mib_handler *handler,
88 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
89 *reqinfo, netsnmp_request_info *requests)
90 int netsnmp_instance_uint_handler (netsnmp_mib_handler *handler,
91 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
92 *reqinfo, netsnmp_request_info *requests)
93 int netsnmp_instance_helper_handler (netsnmp_mib_handler *handler,
94 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
95 *reqinfo, netsnmp_request_info *requests)
96
98 Process individual MIB instances easily.
99
101 netsnmp_mib_handler* netsnmp_get_instance_handler (void)
102 Creates an instance helper handler, calls netsnmp_create_handler, which
103 then could be registered, using netsnmp_register_handler().
104
105 Returns:
106 Returns a pointer to a netsnmp_mib_handler struct which contains
107 the handler's name and the access method
108
109 Definition at line 48 of file instance.c.
110
111 References netsnmp_create_handler(), and
112 netsnmp_instance_helper_handler().
113
114 Referenced by netsnmp_register_instance(),
115 netsnmp_register_read_only_instance(),
116 netsnmp_register_read_only_scalar(), netsnmp_register_scalar(), and
117 netsnmp_register_scalar_group().
118
119 int netsnmp_instance_num_file_handler (netsnmp_mib_handler * handler,
120 netsnmp_handler_registration * reginfo, netsnmp_agent_request_info *
121 reqinfo, netsnmp_request_info * requests)
122 fall through
123
124 Definition at line 741 of file instance.c.
125
126 References netsnmp_mib_handler_s::access_method,
127 netsnmp_num_file_instance_s::file_name,
128 netsnmp_num_file_instance_s::filep, netsnmp_vardata::integer, memdup(),
129 netsnmp_agent_request_info_s::mode, netsnmp_mib_handler_s::myvoid,
130 netsnmp_call_next_handler(), netsnmp_create_data_list(),
131 netsnmp_request_add_list_data(), netsnmp_request_get_list_data(),
132 netsnmp_set_request_error(), netsnmp_mib_handler_s::next, NULL,
133 netsnmp_request_info_s::requestvb, snmp_set_var_typed_value(),
134 variable_list::type, netsnmp_num_file_instance_s::type, and
135 variable_list::val.
136
137 Referenced by netsnmp_register_num_file_instance().
138
139 int netsnmp_register_instance (netsnmp_handler_registration * reginfo)
140 This function registers an instance helper handler, which is a way of
141 registering an exact OID such that GENEXT requests are handled entirely
142 by the helper.
143
144 First need to inject it into the calling chain of the handler defined
145 by the netsnmp_handler_registration struct, reginfo. The new handler is
146 injected at the top of the list and will be the new handler to be
147 called first. This function also injects a serialize handler before
148 actually calling netsnmp_register_handle, registering reginfo.
149
150 Parameters:
151 reginfo a handler registration structure which could get created
152 using netsnmp_create_handler_registration. Used to register an
153 instance helper handler.
154
155 Returns:
156 MIB_REGISTERED_OK is returned if the registration was a success.
157 Failures are MIB_REGISTRATION_FAILED and
158 MIB_DUPLICATE_REGISTRATION.
159
160 Examples:
161 delayed_instance.c.
162
163 Definition at line 73 of file instance.c.
164
165 References netsnmp_mib_handler_s::flags, MIB_HANDLER_INSTANCE,
166 netsnmp_get_instance_handler(), netsnmp_inject_handler(), and
167 netsnmp_register_serialize().
168
169 Referenced by netsnmp_register_int_instance(),
170 netsnmp_register_long_instance(),
171 netsnmp_register_long_instance_context(),
172 netsnmp_register_num_file_instance(), netsnmp_register_uint_instance(),
173 netsnmp_register_ulong_instance(),
174 netsnmp_register_ulong_instance_context(), and
175 netsnmp_register_watched_instance().
176
177 int netsnmp_register_int_instance (const char * name, oid * reg_oid, size_t
178 reg_oid_len, int * it, Netsnmp_Node_Handler * subhandler)
179 This function registers an int helper handler to a specified OID.
180
181 Parameters:
182 name the name used for registration pruposes.
183 reg_oid the OID where you want to register your integer at
184 reg_oid_len the length of the OID
185 it the integer value to be registered during initialization
186 subhandler a handler to do whatever you want to do, otherwise use
187 NULL to use the default int handler.
188
189 Returns:
190 MIB_REGISTERED_OK is returned if the registration was a success.
191 Failures are MIB_REGISTRATION_FAILED and
192 MIB_DUPLICATE_REGISTRATION.
193
194 Examples:
195 scalar_int.c.
196
197 Definition at line 460 of file instance.c.
198
199 References HANDLER_CAN_RWRITE, netsnmp_instance_int_handler(),
200 netsnmp_register_instance(), and NULL.
201
202 int netsnmp_register_read_only_instance (netsnmp_handler_registration *
203 reginfo)
204 This function injects a 'read only' handler into the handler chain
205 prior to serializing/registering the handler.
206
207 The only purpose of this 'read only' handler is to return an
208 appropriate error for any requests passed to it in a SET mode.
209 Inserting it into your handler chain will ensure you're never asked to
210 perform a SET request so you can ignore those error conditions.
211
212 Parameters:
213 reginfo a handler registration structure which could get created
214 using netsnmp_create_handler_registration. Used to register a read
215 only instance helper handler.
216
217 Returns:
218 MIB_REGISTERED_OK is returned if the registration was a success.
219 Failures are MIB_REGISTRATION_FAILED and
220 MIB_DUPLICATE_REGISTRATION.
221
222 Definition at line 100 of file instance.c.
223
224 References netsnmp_get_instance_handler(),
225 netsnmp_get_read_only_handler(), netsnmp_inject_handler(), and
226 netsnmp_register_serialize().
227
228 Referenced by netsnmp_register_int_instance_context(),
229 netsnmp_register_num_file_instance(),
230 netsnmp_register_read_only_counter32_instance(),
231 netsnmp_register_read_only_counter32_instance_context(),
232 netsnmp_register_read_only_int_instance(),
233 netsnmp_register_read_only_int_instance_context(),
234 netsnmp_register_read_only_long_instance(),
235 netsnmp_register_read_only_long_instance_context(),
236 netsnmp_register_read_only_uint_instance(),
237 netsnmp_register_read_only_ulong_instance(), and
238 netsnmp_register_read_only_ulong_instance_context().
239
240
241
242Version 5.4 24 Nov 2006 instance(3)