~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to man/netsnmp_handler.3

  • Committer: Bazaar Package Importer
  • Author(s): Jochen Friedrich
  • Date: 2010-06-10 18:02:54 UTC
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100610180254-6ezvupl2clicwdqf
ImportĀ upstreamĀ versionĀ 5.4.3~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH "Net-SNMP Agent handler and extensibility API" 3 "5 Sep 2008" "Version 5.4.2" "net-snmp" \" -*- nroff -*-
 
1
.TH "Net-SNMP Agent handler and extensibility API" 3 "23 May 2010" "Version 5.4.3.pre1" "net-snmp" \" -*- nroff -*-
2
2
.ad l
3
3
.nh
4
4
.SH NAME
5
 
Net-SNMP Agent handler and extensibility API \- The basic theory goes something like this: In the past, with the original mib module api (which derived from the original CMU SNMP code) the underlying mib modules were passed very little information (only the truly most basic information about a request).  
6
 
 
 
5
Net-SNMP Agent handler and extensibility API \- 
7
6
.PP
 
7
The basic theory goes something like this: In the past, with the original mib \fBmodule\fP api (which derived from the original CMU SNMP code) the underlying mib modules were passed very little information (only the truly most basic information about a request).  
 
8
 
 
9
.SS "Data Structures"
 
10
 
 
11
.in +1c
 
12
.ti -1c
 
13
.RI "struct \fBnetsnmp_mib_handler_s\fP"
 
14
.br
 
15
.RI "\fIthe mib handler structure to be registered \fP"
 
16
.ti -1c
 
17
.RI "struct \fBnetsnmp_handler_registration_s\fP"
 
18
.br
 
19
.RI "\fIRoot registration info. \fP"
 
20
.ti -1c
 
21
.RI "struct \fBnetsnmp_handler_args_s\fP"
 
22
.br
 
23
.ti -1c
 
24
.RI "struct \fBnetsnmp_delegated_cache_s\fP"
 
25
.br
 
26
.in -1c
8
27
.SS "Modules"
9
28
 
10
29
.in +1c
11
30
.ti -1c
12
31
.RI "\fButility_handlers\fP"
13
32
.br
 
33
.PP
 
34
 
14
35
.RI "\fISimplify request processing A group of handlers intended to simplify certain aspects of processing a request for a MIB object. \fP"
15
 
.PP
16
 
.in +1c
17
 
 
18
36
.ti -1c
19
37
.RI "\fBleaf_handlers\fP"
20
38
.br
 
39
.PP
 
40
 
21
41
.RI "\fIProcess individual leaf objects A group of handlers to implement individual leaf objects and instances (both scalar objects, and individual objects and instances within a table). \fP"
22
 
.PP
23
 
.in +1c
24
 
 
25
42
.ti -1c
26
43
.RI "\fBbaby_steps\fP"
27
44
.br
 
45
.PP
 
46
 
28
47
.RI "\fICalls your handler in baby_steps for set processing. \fP"
29
 
.PP
30
 
.in +1c
31
 
 
32
48
.ti -1c
33
49
.RI "\fBold_api\fP"
34
50
.br
35
 
.RI "\fICalls mib module code written in the old style of code. \fP"
36
51
.PP
37
 
.in +1c
38
52
 
 
53
.RI "\fICalls mib \fBmodule\fP code written in the old style of code. \fP"
39
54
.ti -1c
40
55
.RI "\fBstash_cache\fP"
41
56
.br
 
57
.PP
 
58
 
42
59
.RI "\fIAutomatically caches data for certain handlers. \fP"
43
 
.PP
44
 
.in +1c
45
 
 
46
60
.ti -1c
47
61
.RI "\fBtable\fP"
48
62
.br
 
63
.PP
 
64
 
49
65
.RI "\fIHelps you implement a table. \fP"
50
 
.PP
51
 
 
52
 
.in -1c
53
 
.SS "Data Structures"
54
 
 
55
 
.in +1c
56
 
.ti -1c
57
 
.RI "struct \fBnetsnmp_mib_handler_s\fP"
58
 
.br
59
 
.RI "\fIthe mib handler structure to be registered \fP"
60
 
.ti -1c
61
 
.RI "struct \fBnetsnmp_handler_registration_s\fP"
62
 
.br
63
 
.RI "\fIRoot registration info. \fP"
64
 
.ti -1c
65
 
.RI "struct \fBnetsnmp_handler_args_s\fP"
66
 
.br
67
 
.ti -1c
68
 
.RI "struct \fBnetsnmp_delegated_cache_s\fP"
69
 
.br
70
 
.ti -1c
71
 
.RI "struct \fBnetsnmp_mib_handler_s\fP"
72
 
.br
73
 
.RI "\fIthe mib handler structure to be registered \fP"
74
 
.ti -1c
75
 
.RI "struct \fBnetsnmp_handler_registration_s\fP"
76
 
.br
77
 
.RI "\fIRoot registration info. \fP"
78
66
.in -1c
79
67
.SS "Defines"
80
68
 
141
129
 
142
130
.in +1c
143
131
.ti -1c
144
 
.RI "typedef \fBnetsnmp_mib_handler_s\fP \fBnetsnmp_mib_handler\fP"
 
132
.RI "typedef struct \fBnetsnmp_mib_handler_s\fP \fBnetsnmp_mib_handler\fP"
145
133
.br
146
134
.RI "\fITypedefs the \fBnetsnmp_mib_handler_s\fP struct into netsnmp_mib_handler. \fP"
147
135
.ti -1c
148
 
.RI "typedef \fBnetsnmp_handler_registration_s\fP \fBnetsnmp_handler_registration\fP"
 
136
.RI "typedef struct \fBnetsnmp_handler_registration_s\fP \fBnetsnmp_handler_registration\fP"
149
137
.br
150
138
.RI "\fITypedefs the \fBnetsnmp_handler_registration_s\fP struct into netsnmp_handler_registration. \fP"
151
139
.ti -1c
152
140
.RI "typedef int( \fBNetsnmp_Node_Handler\fP )(\fBnetsnmp_mib_handler\fP *handler, \fBnetsnmp_handler_registration\fP *reginfo, \fBnetsnmp_agent_request_info\fP *reqinfo, \fBnetsnmp_request_info\fP *requests)"
153
141
.br
154
142
.ti -1c
155
 
.RI "typedef \fBnetsnmp_handler_args_s\fP \fBnetsnmp_handler_args\fP"
 
143
.RI "typedef struct \fBnetsnmp_handler_args_s\fP \fBnetsnmp_handler_args\fP"
156
144
.br
157
145
.ti -1c
158
 
.RI "typedef \fBnetsnmp_delegated_cache_s\fP \fBnetsnmp_delegated_cache\fP"
 
146
.RI "typedef struct \fBnetsnmp_delegated_cache_s\fP \fBnetsnmp_delegated_cache\fP"
159
147
.br
160
148
.in -1c
161
149
.SS "Functions"
162
150
 
163
151
.in +1c
164
152
.ti -1c
165
 
.RI "\fBnetsnmp_mib_handler\fP * \fBnetsnmp_create_handler\fP (const char *name, \fBNetsnmp_Node_Handler\fP *handler_access_method)"
 
153
.RI "\fBnetsnmp_mib_handler\fP * \fBnetsnmp_create_handler\fP (const char *name, Netsnmp_Node_Handler *handler_access_method)"
166
154
.br
167
155
.RI "\fIcreates a netsnmp_mib_handler structure given a name and a access method. \fP"
168
156
.ti -1c
170
158
.br
171
159
.RI "\fIcreates a handler registration structure given a name, a access_method function, a registration location oid and the modes the handler supports. \fP"
172
160
.ti -1c
173
 
.RI "\fBnetsnmp_handler_registration\fP * \fBnetsnmp_create_handler_registration\fP (const char *name, \fBNetsnmp_Node_Handler\fP *handler_access_method, oid *reg_oid, size_t reg_oid_len, int modes)"
 
161
.RI "\fBnetsnmp_handler_registration\fP * \fBnetsnmp_create_handler_registration\fP (const char *name, Netsnmp_Node_Handler *handler_access_method, oid *reg_oid, size_t reg_oid_len, int modes)"
174
162
.br
175
163
.ti -1c
176
164
.RI "int \fBnetsnmp_register_handler\fP (\fBnetsnmp_handler_registration\fP *reginfo)"
248
236
.br
249
237
.RI "\fIremove data from a request \fP"
250
238
.ti -1c
251
 
.RI "NETSNMP_INLINE void * \fBnetsnmp_request_get_list_data\fP (\fBnetsnmp_request_info\fP *request, const char *name)"
 
239
.RI "void * \fBnetsnmp_request_get_list_data\fP (\fBnetsnmp_request_info\fP *request, const char *name)"
252
240
.br
253
 
.RI "\fIextract data from a request that was added previously by a parent module \fP"
 
241
.RI "\fIextract data from a request that was added previously by a parent \fBmodule\fP \fP"
254
242
.ti -1c
255
243
.RI "NETSNMP_INLINE void \fBnetsnmp_free_request_data_set\fP (\fBnetsnmp_request_info\fP *request)"
256
244
.br
293
281
.in -1c
294
282
.SH "Detailed Description"
295
283
.PP 
296
 
The basic theory goes something like this: In the past, with the original mib module api (which derived from the original CMU SNMP code) the underlying mib modules were passed very little information (only the truly most basic information about a request). 
297
 
.PP
 
284
The basic theory goes something like this: In the past, with the original mib \fBmodule\fP api (which derived from the original CMU SNMP code) the underlying mib modules were passed very little information (only the truly most basic information about a request). 
 
285
 
298
286
This worked well at the time but in todays world of subagents, device instrumentation, low resource consumption, etc, it just isn't flexible enough. 'handlers' are here to fix all that.
299
287
.PP
300
288
With the rewrite of the agent internals for the net-snmp 5.0 release, we introduce a modular calling scheme that allows agent modules to be written in a very flexible manner, and more importantly allows reuse of code in a decent way (and without the memory and speed overheads of OO languages like C++).
301
289
.PP
302
 
Functionally, the notion of what a handler does is the same as the older api: A handler is \fBcreated\fP and then \fBregistered\fP with the main agent at a given OID in the OID tree and gets called any time a request is made that it should respond to. You probably should use one of the convenience helpers instead of doing anything else yourself though:
 
290
Functionally, the notion of what a handler does is the same as the older api: A handler is \fBcreated\fP and then \fBregistered\fP with the main agent at a given OID in the OID \fBtree\fP and gets called any time a request is made that it should respond to. You probably should use one of the convenience helpers instead of doing anything else yourself though:
303
291
.PP
304
 
Most importantly, though, is that the handlers are built on the notion of modularity and reuse. Specifically, rather than do all the really hard work (like parsing table indexes out of an incoming oid request) in each module, the API is designed to make it easy to write 'helper' handlers that merely process some aspect of the request before passing it along to the final handler that returns the real answer. Most people will want to make use of the \fBinstance\fP, \fBtable\fP, \fBtable_iterator\fP, \fBtable_data\fP, or \fBtable_dataset\fP helpers to make their life easier. These 'helpers' interpert important aspects of the request and pass them on to you.
 
292
Most importantly, though, is that the handlers are built on the notion of modularity and reuse. Specifically, rather than do all the really hard work (like parsing table indexes out of an incoming oid request) in each \fBmodule\fP, the API is designed to make it easy to write 'helper' handlers that merely process some aspect of the request before passing it along to the final handler that returns the real answer. Most people will want to make use of the \fBinstance\fP, \fBtable\fP, \fBtable_iterator\fP, \fBtable_data\fP, or \fBtable_dataset\fP helpers to make their life easier. These 'helpers' interpert important aspects of the request and pass them on to you.
305
293
.PP
306
294
For instance, the \fBtable\fP helper is designed to hand you a list of extracted index values from an incoming request. THe \fBtable_iterator\fP helper is built on top of the table helper, and is designed to help you iterate through data stored elsewhere (like in a kernel) that is not in OID lexographical order (ie, don't write your own index/oid sorting routine, use this helper instead). The beauty of the \fBtable_iterator helper\fP, as well as the \fBinstance\fP helper is that they take care of the complex GETNEXT processing entirely for you and hand you everything you need to merely return the data as if it was a GET request. Much less code and hair pulling. I've pulled all my hair out to help you so that only one of us has to be bald. 
307
295
.SH "Typedef Documentation"
309
297
.SS "struct \fBnetsnmp_handler_registration_s\fP \fBnetsnmp_handler_registration\fP"
310
298
.PP
311
299
Typedefs the \fBnetsnmp_handler_registration_s\fP struct into netsnmp_handler_registration. 
312
 
.PP
313
300
.SS "struct \fBnetsnmp_mib_handler_s\fP \fBnetsnmp_mib_handler\fP"
314
301
.PP
315
302
Typedefs the \fBnetsnmp_mib_handler_s\fP struct into netsnmp_mib_handler. 
316
 
.PP
317
303
.SH "Function Documentation"
318
304
.PP 
319
305
.SS "int netsnmp_call_handler (\fBnetsnmp_mib_handler\fP * next_handler, \fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_agent_request_info\fP * reqinfo, \fBnetsnmp_request_info\fP * requests)"
320
306
.PP
321
307
calls a handler with with appropriate NULL checking of arguments, etc. 
322
 
.PP
323
 
Definition at line 394 of file agent_handler.c.
324
 
.PP
325
 
References netsnmp_mib_handler_s::access_method, netsnmp_mib_handler_s::handler_name, MIB_HANDLER_AUTO_NEXT, MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE, netsnmp_agent_request_info_s::mode, netsnmp_mib_handler_s::next, NULL, and snmp_log().
326
 
.PP
327
 
Referenced by netsnmp_call_handlers(), netsnmp_call_next_handler(), netsnmp_call_next_handler_one_request(), netsnmp_mode_end_call_helper(), and netsnmp_multiplexer_helper_handler().
328
308
.SS "int netsnmp_call_next_handler (\fBnetsnmp_mib_handler\fP * current, \fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_agent_request_info\fP * reqinfo, \fBnetsnmp_request_info\fP * requests)"
329
309
.PP
330
310
calls the next handler in the chain after the current one with with appropriate NULL checking, etc. 
331
 
.PP
332
 
Definition at line 524 of file agent_handler.c.
333
 
.PP
334
 
References netsnmp_call_handler(), netsnmp_mib_handler_s::next, NULL, and snmp_log().
335
 
.PP
336
 
Referenced by _netsnmp_stash_cache_load(), netsnmp_bulk_to_next_helper(), netsnmp_debug_helper(), netsnmp_instance_counter32_handler(), netsnmp_instance_helper_handler(), netsnmp_instance_int_handler(), netsnmp_instance_long_handler(), netsnmp_instance_num_file_handler(), netsnmp_instance_uint_handler(), netsnmp_instance_ulong_handler(), netsnmp_mode_end_call_helper(), netsnmp_row_merge_helper_handler(), netsnmp_scalar_group_helper_handler(), netsnmp_scalar_helper_handler(), netsnmp_serialize_helper_handler(), netsnmp_stash_to_next_helper(), and table_helper_handler().
337
311
.SS "int netsnmp_call_next_handler_one_request (\fBnetsnmp_mib_handler\fP * current, \fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_agent_request_info\fP * reqinfo, \fBnetsnmp_request_info\fP * requests)"
338
312
.PP
339
313
calls the next handler in the chain after the current one with with appropriate NULL checking, etc. 
340
 
.PP
341
 
Definition at line 546 of file agent_handler.c.
342
 
.PP
343
 
References netsnmp_call_handler(), netsnmp_mib_handler_s::next, netsnmp_request_info_s::next, NULL, and snmp_log().
344
314
.SS "void netsnmp_clear_handler_list (void)"
345
315
.PP
346
316
clears the entire handler-registration list 
347
 
.PP
348
 
Definition at line 905 of file agent_handler.c.
349
 
.PP
350
 
References netsnmp_free_all_list_data(), and NULL.
351
 
.PP
352
 
Referenced by shutdown_agent().
353
 
.SS "NETSNMP_INLINE \fBnetsnmp_delegated_cache\fP * netsnmp_create_delegated_cache (\fBnetsnmp_mib_handler\fP * handler, \fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_agent_request_info\fP * reqinfo, \fBnetsnmp_request_info\fP * requests, void * localinfo)"
354
 
.PP
355
 
creates a cache of information which can be saved for future reference. 
356
 
.PP
357
 
Use \fBnetsnmp_handler_check_cache()\fP later to make sure it's still valid before referencing it in the future. 
 
317
.SS "\fBnetsnmp_delegated_cache\fP * netsnmp_create_delegated_cache (\fBnetsnmp_mib_handler\fP * handler, \fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_agent_request_info\fP * reqinfo, \fBnetsnmp_request_info\fP * requests, void * localinfo)"
 
318
.PP
 
319
creates a cache of information which can be saved for future reference. Use \fBnetsnmp_handler_check_cache()\fP later to make sure it's still valid before referencing it in the future. 
358
320
.PP
359
321
\fBExamples: \fP
360
322
.in +1c
361
323
\fBdelayed_instance.c\fP.
362
 
.PP
363
 
Definition at line 696 of file agent_handler.c.
364
 
.PP
365
 
References netsnmp_agent_request_info_s::asp, netsnmp_delegated_cache_s::handler, netsnmp_delegated_cache_s::localinfo, netsnmp_agent_session_s::pdu, netsnmp_delegated_cache_s::reginfo, netsnmp_delegated_cache_s::reqinfo, netsnmp_delegated_cache_s::requests, SNMP_MALLOC_TYPEDEF, netsnmp_delegated_cache_s::transaction_id, and snmp_pdu::transid.
366
 
.SS "\fBnetsnmp_mib_handler\fP * netsnmp_create_handler (const char * name, \fBNetsnmp_Node_Handler\fP * handler_access_method)"
367
 
.PP
368
 
creates a netsnmp_mib_handler structure given a name and a access method. 
369
 
.PP
370
 
The returned handler should then be \fBregistered.\fP
 
324
.SS "\fBnetsnmp_mib_handler\fP * netsnmp_create_handler (const char * name, Netsnmp_Node_Handler * handler_access_method)"
 
325
.PP
 
326
creates a netsnmp_mib_handler structure given a name and a access method. The returned handler should then be \fBregistered.\fP
371
327
.PP
372
328
\fBParameters:\fP
373
329
.RS 4
383
339
.PP
384
340
\fBSee also:\fP
385
341
.RS 4
386
 
\fBnetsnmp_create_handler_registration()\fP 
 
342
netsnmp_create_handler_registration() 
387
343
.PP
388
344
\fBnetsnmp_register_handler()\fP 
389
345
.RE
390
346
.PP
391
347
 
392
 
.PP
393
 
Definition at line 105 of file agent_handler.c.
394
 
.PP
395
 
References netsnmp_mib_handler_s::access_method, netsnmp_mib_handler_s::handler_name, NULL, SNMP_FREE, and SNMP_MALLOC_TYPEDEF.
396
 
.PP
397
 
Referenced by get_old_api_handler(), netsnmp_baby_steps_access_multiplexer_get(), netsnmp_baby_steps_handler_get(), netsnmp_cache_handler_get(), netsnmp_container_table_handler_get(), netsnmp_create_handler_registration(), netsnmp_get_bulk_to_next_handler(), netsnmp_get_debug_handler(), netsnmp_get_instance_handler(), netsnmp_get_mode_end_call_handler(), netsnmp_get_multiplexer_handler(), netsnmp_get_read_only_handler(), netsnmp_get_row_merge_handler(), netsnmp_get_scalar_group_handler(), netsnmp_get_scalar_handler(), netsnmp_get_serialize_handler(), netsnmp_get_stash_to_next_handler(), netsnmp_get_table_data_handler(), netsnmp_get_table_data_set_handler(), netsnmp_get_table_handler(), netsnmp_get_table_iterator_handler(), netsnmp_get_tdata_handler(), netsnmp_get_timed_bare_stash_cache_handler(), netsnmp_get_watched_spinlock_handler(), netsnmp_get_watched_timestamp_handler(), netsnmp_get_watcher_handler(), netsnmp_sparse_table_handler_get(), netsnmp_sparse_table_register(), netsnmp_table_array_register(), and netsnmp_table_row_handler_get().
398
348
.SS "\fBnetsnmp_mib_handler\fP * netsnmp_find_handler_by_name (\fBnetsnmp_handler_registration\fP * reginfo, const char * name)"
399
349
.PP
400
350
Returns a handler from a chain based on the name. 
401
 
.PP
402
 
Definition at line 838 of file agent_handler.c.
403
 
.PP
404
 
References netsnmp_handler_registration_s::handler, netsnmp_mib_handler_s::handler_name, netsnmp_mib_handler_s::next, and NULL.
405
 
.PP
406
 
Referenced by netsnmp_find_handler_data_by_name().
407
351
.SS "void * netsnmp_find_handler_data_by_name (\fBnetsnmp_handler_registration\fP * reginfo, const char * name)"
408
352
.PP
409
 
Returns a handler's void * pointer from a chain based on the name. 
410
 
.PP
411
 
This probably shouldn't be used by the general public as the void * data may change as a handler evolves. Handlers should really advertise some function for you to use instead. 
412
 
.PP
413
 
Definition at line 855 of file agent_handler.c.
414
 
.PP
415
 
References netsnmp_mib_handler_s::myvoid, netsnmp_find_handler_by_name(), and NULL.
416
 
.PP
417
 
Referenced by netsnmp_find_table_registration_info().
418
 
.SS "NETSNMP_INLINE void netsnmp_free_delegated_cache (\fBnetsnmp_delegated_cache\fP * dcache)"
 
353
Returns a handler's void * pointer from a chain based on the name. This probably shouldn't be used by the general public as the void * data may change as a handler evolves. Handlers should really advertise some function for you to use instead. 
 
354
.SS "void netsnmp_free_delegated_cache (\fBnetsnmp_delegated_cache\fP * dcache)"
419
355
.PP
420
356
frees a cache once you're finished using it 
421
357
.PP
422
358
\fBExamples: \fP
423
359
.in +1c
424
360
\fBdelayed_instance.c\fP.
425
 
.PP
426
 
Definition at line 734 of file agent_handler.c.
427
 
.PP
428
 
References SNMP_FREE.
429
 
.SS "NETSNMP_INLINE void netsnmp_free_request_data_set (\fBnetsnmp_request_info\fP * request)"
 
361
.SS "void netsnmp_free_request_data_set (\fBnetsnmp_request_info\fP * request)"
430
362
.PP
431
363
Free the extra data stored in a request. 
432
 
.PP
433
 
Definition at line 820 of file agent_handler.c.
434
 
.PP
435
 
References netsnmp_free_list_data(), and netsnmp_request_info_s::parent_data.
436
 
.SS "NETSNMP_INLINE void netsnmp_free_request_data_sets (\fBnetsnmp_request_info\fP * request)"
 
364
.SS "void netsnmp_free_request_data_sets (\fBnetsnmp_request_info\fP * request)"
437
365
.PP
438
366
Free the extra data stored in a bunch of requests (all data in the chain). 
439
 
.PP
440
 
Definition at line 828 of file agent_handler.c.
441
 
.PP
442
 
References netsnmp_free_all_list_data(), NULL, and netsnmp_request_info_s::parent_data.
443
 
.PP
444
 
Referenced by free_agent_snmp_session(), get_set_cache(), netsnmp_add_varbind_to_cache(), and netsnmp_delete_request_infos().
445
 
.SS "NETSNMP_INLINE \fBnetsnmp_delegated_cache\fP * netsnmp_handler_check_cache (\fBnetsnmp_delegated_cache\fP * dcache)"
446
 
.PP
447
 
check's a given cache and returns it if it is still valid (ie, the agent still considers it to be an outstanding request. 
448
 
.PP
449
 
Returns NULL if it's no longer valid. 
 
367
.SS "\fBnetsnmp_delegated_cache\fP * netsnmp_handler_check_cache (\fBnetsnmp_delegated_cache\fP * dcache)"
 
368
.PP
 
369
check's a given cache and returns it if it is still valid (ie, the agent still considers it to be an outstanding request. Returns NULL if it's no longer valid. 
450
370
.PP
451
371
\fBExamples: \fP
452
372
.in +1c
453
373
\fBdelayed_instance.c\fP.
454
 
.PP
455
 
Definition at line 720 of file agent_handler.c.
456
 
.PP
457
 
References netsnmp_check_transaction_id(), NULL, and netsnmp_delegated_cache_s::transaction_id.
458
374
.SS "\fBnetsnmp_mib_handler\fP * netsnmp_handler_dup (\fBnetsnmp_mib_handler\fP * handler)"
459
375
.PP
460
376
dulpicates a handler and all subsequent handlers see also _clone_handler 
461
 
.PP
462
 
Definition at line 591 of file agent_handler.c.
463
 
.PP
464
 
References netsnmp_mib_handler_s::myvoid, netsnmp_handler_free(), netsnmp_mib_handler_s::next, NULL, and netsnmp_mib_handler_s::prev.
465
 
.PP
466
 
Referenced by netsnmp_handler_registration_dup().
467
377
.SS "void netsnmp_handler_free (\fBnetsnmp_mib_handler\fP * handler)"
468
378
.PP
469
379
free's the resourceses associated with a given handler 
470
380
.PP
471
381
make sure we aren't pointing to ourselves.
472
382
.PP
473
 
XXX : segv here at shutdown if SHUTDOWN_AGENT_CLEANLY defined. About 30 functions down the stack, starting in \fBclear_context()\fP -> \fBclear_subtree()\fP 
474
 
.PP
475
 
Definition at line 569 of file agent_handler.c.
476
 
.PP
477
 
References netsnmp_mib_handler_s::handler_name, netsnmp_mib_handler_s::next, NULL, and SNMP_FREE.
478
 
.PP
479
 
Referenced by handler_free_callback(), netsnmp_baby_steps_handler_get(), netsnmp_get_scalar_group_handler(), netsnmp_get_timed_bare_stash_cache_handler(), netsnmp_handler_dup(), and netsnmp_handler_registration_free().
 
383
XXX : segv here at shutdown if SHUTDOWN_AGENT_CLEANLY defined. About 30 functions down the stack, starting in clear_context() -> clear_subtree()
480
384
.SS "void netsnmp_handler_mark_requests_as_delegated (\fBnetsnmp_request_info\fP * requests, int isdelegated)"
481
385
.PP
482
386
marks a list of requests as delegated (or not if isdelegaded = 0) 
483
 
.PP
484
 
Definition at line 748 of file agent_handler.c.
485
 
.PP
486
 
References netsnmp_request_info_s::delegated, and netsnmp_request_info_s::next.
487
387
.SS "\fBnetsnmp_handler_registration\fP * netsnmp_handler_registration_create (const char * name, \fBnetsnmp_mib_handler\fP * handler, oid * reg_oid, size_t reg_oid_len, int modes)"
488
388
.PP
489
 
creates a handler registration structure given a name, a access_method function, a registration location oid and the modes the handler supports. 
490
 
.PP
491
 
If modes == 0, then modes will automatically be set to the default value of only HANDLER_CAN_DEFAULT, which is by default read-only GET and GETNEXT requests. A hander which supports sets but not row creation should set us a mode of HANDLER_CAN_SET_ONLY. 
 
389
creates a handler registration structure given a name, a access_method function, a registration location oid and the modes the handler supports. If modes == 0, then modes will automatically be set to the default value of only HANDLER_CAN_DEFAULT, which is by default read-only GET and GETNEXT requests. A hander which supports sets but not row creation should set us a mode of HANDLER_CAN_SET_ONLY. 
492
390
.PP
493
391
\fBNote:\fP
494
392
.RS 4
537
435
.RE
538
436
.PP
539
437
 
540
 
.PP
541
 
Definition at line 163 of file agent_handler.c.
542
 
.PP
543
 
References netsnmp_handler_registration_s::handler, HANDLER_CAN_DEFAULT, netsnmp_handler_registration_s::handlerName, memdup(), netsnmp_handler_registration_s::modes, NULL, netsnmp_handler_registration_s::priority, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, and SNMP_MALLOC_TYPEDEF.
544
 
.PP
545
 
Referenced by netsnmp_create_handler_registration().
546
438
.SS "\fBnetsnmp_handler_registration\fP * netsnmp_handler_registration_dup (\fBnetsnmp_handler_registration\fP * reginfo)"
547
439
.PP
548
440
duplicates the handler registration object 
549
 
.PP
550
 
Definition at line 634 of file agent_handler.c.
551
 
.PP
552
 
References netsnmp_handler_registration_s::contextName, netsnmp_handler_registration_s::handler, netsnmp_handler_registration_s::handlerName, memdup(), netsnmp_handler_registration_s::modes, netsnmp_handler_dup(), netsnmp_handler_registration_free(), NULL, netsnmp_handler_registration_s::priority, netsnmp_handler_registration_s::range_subid, netsnmp_handler_registration_s::range_ubound, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, and netsnmp_handler_registration_s::timeout.
553
 
.PP
554
 
Referenced by netsnmp_subtree_deepcopy().
555
441
.SS "void netsnmp_handler_registration_free (\fBnetsnmp_handler_registration\fP * reginfo)"
556
442
.PP
557
443
free the resources associated with a handler registration object 
558
 
.PP
559
 
Definition at line 620 of file agent_handler.c.
560
 
.PP
561
 
References netsnmp_handler_registration_s::contextName, netsnmp_handler_registration_s::handler, netsnmp_handler_registration_s::handlerName, netsnmp_handler_free(), NULL, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, and SNMP_FREE.
562
 
.PP
563
 
Referenced by netsnmp_handler_registration_dup(), netsnmp_register_mib(), netsnmp_register_mib_table_row(), netsnmp_subtree_free(), and unregister_mibs_by_session().
564
444
.SS "int netsnmp_inject_handler (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_mib_handler\fP * handler)"
565
445
.PP
566
 
inject a new handler into the calling chain of the handlers definedy by the netsnmp_handler_registration pointer. 
567
 
.PP
568
 
The new handler is injected at the top of the list and hence will be the new handler to be called first. 
569
 
.PP
570
 
Definition at line 386 of file agent_handler.c.
571
 
.PP
572
 
References netsnmp_inject_handler_before(), and NULL.
573
 
.PP
574
 
Referenced by netsnmp_cache_handler_register(), netsnmp_container_table_register(), netsnmp_register_cache_handler(), netsnmp_register_handler(), netsnmp_register_instance(), netsnmp_register_read_only_instance(), netsnmp_register_read_only_scalar(), netsnmp_register_read_only_table_data(), netsnmp_register_row_merge(), netsnmp_register_scalar(), netsnmp_register_scalar_group(), netsnmp_register_serialize(), netsnmp_register_table(), netsnmp_register_table_data(), netsnmp_register_table_data_set(), netsnmp_register_table_iterator(), netsnmp_register_watched_instance(), netsnmp_register_watched_scalar(), netsnmp_register_watched_spinlock(), netsnmp_sparse_table_register(), netsnmp_table_array_register(), netsnmp_table_row_register(), netsnmp_tdata_register(), and netsnmp_watched_timestamp_register().
 
446
inject a new handler into the calling chain of the handlers definedy by the netsnmp_handler_registration pointer. The new handler is injected at the top of the list and hence will be the new handler to be called first. 
575
447
.SS "int netsnmp_inject_handler_before (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_mib_handler\fP * handler, const char * before_what)"
576
448
.PP
577
 
inject a new handler into the calling chain of the handlers definedy by the netsnmp_handler_registration pointer. 
578
 
.PP
579
 
The new handler is injected after the before_what handler, or if NULL at the top of the list and hence will be the new handler to be called first. 
580
 
.PP
581
 
Definition at line 329 of file agent_handler.c.
582
 
.PP
583
 
References netsnmp_handler_registration_s::handler, netsnmp_mib_handler_s::handler_name, netsnmp_mib_handler_s::next, NULL, netsnmp_mib_handler_s::prev, and snmp_log().
584
 
.PP
585
 
Referenced by netsnmp_inject_handler(), and netsnmp_inject_handler_into_subtree().
 
449
inject a new handler into the calling chain of the handlers definedy by the netsnmp_handler_registration pointer. The new handler is injected after the before_what handler, or if NULL at the top of the list and hence will be the new handler to be called first. 
586
450
.SS "int netsnmp_register_handler (\fBnetsnmp_handler_registration\fP * reginfo)"
587
451
.PP
588
452
register a handler, as defined by the netsnmp_handler_registration pointer. 
589
 
.PP
590
 
Definition at line 202 of file agent_handler.c.
591
 
.PP
592
 
References netsnmp_handler_registration_s::contextName, netsnmp_mib_handler_s::flags, netsnmp_handler_registration_s::handler, HANDLER_CAN_DEFAULT, HANDLER_CAN_GETBULK, netsnmp_mib_handler_s::handler_name, netsnmp_handler_registration_s::handlerName, MIB_HANDLER_INSTANCE, netsnmp_handler_registration_s::modes, netsnmp_get_bulk_to_next_handler(), netsnmp_inject_handler(), netsnmp_register_mib(), netsnmp_mib_handler_s::next, NULL, netsnmp_handler_registration_s::priority, netsnmp_handler_registration_s::range_subid, netsnmp_handler_registration_s::range_ubound, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, snmp_log(), and netsnmp_handler_registration_s::timeout.
593
 
.PP
594
 
Referenced by netsnmp_cache_handler_register(), netsnmp_register_cache_handler(), netsnmp_register_old_api(), netsnmp_register_row_merge(), netsnmp_register_serialize(), netsnmp_register_table(), netsnmp_sparse_table_register(), and netsnmp_table_row_register().
595
453
.SS "void netsnmp_register_handler_by_name (const char * name, \fBnetsnmp_mib_handler\fP * handler)"
596
454
.PP
597
455
registers a given handler by name so that it can be found easily later. 
598
 
.PP
599
 
Definition at line 893 of file agent_handler.c.
600
 
.PP
601
 
References handler_free_callback(), netsnmp_add_list_data(), and netsnmp_create_data_list().
602
 
.PP
603
 
Referenced by netsnmp_baby_steps_handler_init(), netsnmp_init_bulk_to_next_helper(), netsnmp_init_debug_helper(), netsnmp_init_read_only_helper(), netsnmp_init_row_merge(), netsnmp_init_serialize(), and netsnmp_init_stash_cache_helper().
604
456
.SS "int netsnmp_register_handler_nocallback (\fBnetsnmp_handler_registration\fP * reginfo)"
605
457
.PP
606
458
register a handler, as defined by the netsnmp_handler_registration pointer. 
607
 
.PP
608
 
Definition at line 277 of file agent_handler.c.
609
 
.PP
610
 
References netsnmp_handler_registration_s::contextName, netsnmp_handler_registration_s::handler, HANDLER_CAN_DEFAULT, netsnmp_mib_handler_s::handler_name, netsnmp_handler_registration_s::modes, netsnmp_register_mib(), netsnmp_mib_handler_s::next, NULL, netsnmp_handler_registration_s::priority, netsnmp_handler_registration_s::range_subid, netsnmp_handler_registration_s::range_ubound, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, snmp_log(), and netsnmp_handler_registration_s::timeout.
611
 
.PP
612
 
Referenced by netsnmp_register_mib_table_row().
613
 
.SS "NETSNMP_INLINE void netsnmp_request_add_list_data (\fBnetsnmp_request_info\fP * request, \fBnetsnmp_data_list\fP * node)"
614
 
.PP
615
 
add data to a request that can be extracted later by submodules 
616
 
.PP
617
 
\fBParameters:\fP
 
459
.SS "void netsnmp_request_add_list_data (\fBnetsnmp_request_info\fP * request, \fBnetsnmp_data_list\fP * node)"
 
460
.PP
 
461
add data to a request that can be extracted later by submodules \fBParameters:\fP
618
462
.RS 4
619
463
\fIrequest\fP the netsnmp request info structure
620
464
.br
621
 
\fInode\fP this is the data to be added to the linked list request->parent_data
 
465
\fI\fBnode\fP\fP this is the data to be added to the linked list request->parent_data
622
466
.RE
623
467
.PP
624
468
\fBReturns:\fP
631
475
\fBExamples: \fP
632
476
.in +1c
633
477
\fBdelayed_instance.c\fP.
634
 
.PP
635
 
Definition at line 768 of file agent_handler.c.
636
 
.PP
637
 
References netsnmp_add_list_data(), and netsnmp_request_info_s::parent_data.
638
 
.PP
639
 
Referenced by _netsnmp_tdata_helper_handler(), netsnmp_container_table_row_insert(), netsnmp_insert_iterator_context(), netsnmp_insert_table_row(), netsnmp_instance_int_handler(), netsnmp_instance_long_handler(), netsnmp_instance_num_file_handler(), netsnmp_instance_uint_handler(), netsnmp_instance_ulong_handler(), netsnmp_table_data_helper_handler(), netsnmp_table_data_set_helper_handler(), netsnmp_table_iterator_helper_handler(), netsnmp_watcher_helper_handler(), and table_helper_handler().
640
 
.SS "NETSNMP_INLINE void * netsnmp_request_get_list_data (\fBnetsnmp_request_info\fP * request, const char * name)"
641
 
.PP
642
 
extract data from a request that was added previously by a parent module 
643
 
.PP
644
 
\fBParameters:\fP
 
478
.SS "void * netsnmp_request_get_list_data (\fBnetsnmp_request_info\fP * request, const char * name)"
 
479
.PP
 
480
extract data from a request that was added previously by a parent \fBmodule\fP \fBParameters:\fP
645
481
.RS 4
646
482
\fIrequest\fP the netsnmp request info function
647
483
.br
658
494
\fBExamples: \fP
659
495
.in +1c
660
496
\fBdelayed_instance.c\fP.
661
 
.PP
662
 
Definition at line 810 of file agent_handler.c.
663
 
.PP
664
 
References netsnmp_get_list_data(), NULL, and netsnmp_request_info_s::parent_data.
665
 
.PP
666
 
Referenced by netsnmp_container_table_container_extract(), netsnmp_container_table_extract_context(), netsnmp_container_table_row_extract(), netsnmp_extract_array_context(), netsnmp_extract_iterator_context(), netsnmp_extract_table(), netsnmp_extract_table_data_set(), netsnmp_extract_table_info(), netsnmp_extract_table_row(), netsnmp_instance_int_handler(), netsnmp_instance_long_handler(), netsnmp_instance_num_file_handler(), netsnmp_instance_uint_handler(), netsnmp_instance_ulong_handler(), netsnmp_table_iterator_helper_handler(), netsnmp_table_row_extract(), netsnmp_tdata_extract_container(), netsnmp_tdata_extract_table(), and netsnmp_watcher_helper_handler().
667
 
.SS "NETSNMP_INLINE int netsnmp_request_remove_list_data (\fBnetsnmp_request_info\fP * request, const char * name)"
668
 
.PP
669
 
remove data from a request 
670
 
.PP
671
 
\fBParameters:\fP
 
497
.SS "int netsnmp_request_remove_list_data (\fBnetsnmp_request_info\fP * request, const char * name)"
 
498
.PP
 
499
remove data from a request \fBParameters:\fP
672
500
.RS 4
673
501
\fIrequest\fP the netsnmp request info structure
674
502
.br
681
509
.RE
682
510
.PP
683
511
 
684
 
.PP
685
 
Definition at line 789 of file agent_handler.c.
686
 
.PP
687
 
References netsnmp_remove_list_node(), NULL, and netsnmp_request_info_s::parent_data.
688
 
.PP
689
 
Referenced by netsnmp_table_data_set_helper_handler().
690
512
.SS "int netsnmp_unregister_handler (\fBnetsnmp_handler_registration\fP * reginfo)"
691
513
.PP
692
514
unregister a handler, as defined by the netsnmp_handler_registration pointer. 
693
 
.PP
694
 
Definition at line 267 of file agent_handler.c.
695
 
.PP
696
 
References netsnmp_handler_registration_s::contextName, netsnmp_handler_registration_s::priority, netsnmp_handler_registration_s::range_subid, netsnmp_handler_registration_s::range_ubound, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, and unregister_mib_context().
 
515
.SH "Author"
 
516
.PP 
 
517
Generated automatically by Doxygen for net-snmp from the source code.