~ubuntu-branches/ubuntu/wily/net-snmp/wily-proposed

« back to all changes in this revision

Viewing changes to man/netsnmp_snmp_agent.3

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-28 14:59:36 UTC
  • mfrom: (1.2.3 upstream) (1.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100628145936-cbiallic69pn044g
Tags: 5.4.3~dfsg-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Set Ubuntu maintainer address.
  - net-snmp-config: Use bash. (LP: #104738)
  - Removed multiuser option when calling update-rc.d. (LP: #254261)
  - debian/snmpd.init: LSBify the init script.
  - debian/patches/52_fix_snmpcmd_1_typo.patch: Adjust a typo in snmpcmd.1
    (LP: #250459)
  - debian/snmpd.postinst: source debconf before doing work, LP: #589056
  - debian/snmp.preinst, debian/snmp.prerm: kill any/all processes owned by
    snmp user before install/uninstall, LP: #573391
  - Add apport hook (LP: #533603):
  - debian/{snmp,snmpd}.apport: Added.
  - debian/control: Build-depends on dh-apport.
  - debian/rules: 
    + Add --with apport.
    + override_dh_apport to install hook on snmpd package only.
 * Dropped patches:
   - debian/patches/99-fix-ubuntu-div0.patch: Fix dvision by zero.. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH "net-snmp agent related processing" 3 "5 Sep 2008" "Version 5.4.2" "net-snmp" \" -*- nroff -*-
 
1
.TH "net-snmp agent related processing" 3 "23 May 2010" "Version 5.4.3.pre1" "net-snmp" \" -*- nroff -*-
2
2
.ad l
3
3
.nh
4
4
.SH NAME
33
33
 
34
34
.in +1c
35
35
.ti -1c
36
 
.RI "typedef \fB_agent_nsap\fP \fBagent_nsap\fP"
 
36
.RI "typedef struct \fB_agent_nsap\fP \fBagent_nsap\fP"
37
37
.br
38
38
.ti -1c
39
 
.RI "typedef \fBagent_set_cache_s\fP \fBagent_set_cache\fP"
 
39
.RI "typedef struct \fBagent_set_cache_s\fP \fBagent_set_cache\fP"
40
40
.br
41
41
.in -1c
42
42
.SS "Enumerations"
122
122
.RI "void \fBnetsnmp_addrcache_initialise\fP (void)"
123
123
.br
124
124
.ti -1c
 
125
.RI "void \fBnetsnmp_addrcache_destroy\fP (void)"
 
126
.br
 
127
.ti -1c
125
128
.RI "int \fBnetsnmp_addrcache_add\fP (const char *addr)"
126
129
.br
127
130
.ti -1c
167
170
.RI "void \fBnetsnmp_remove_and_free_agent_snmp_session\fP (\fBnetsnmp_agent_session\fP *asp)"
168
171
.br
169
172
.ti -1c
170
 
.RI "void \fBnetsnmp_free_agent_snmp_session_by_session\fP (\fBnetsnmp_session\fP *sess, void(*free_request)(netsnmp_request_list *))"
 
173
.RI "void \fBnetsnmp_free_agent_snmp_session_by_session\fP (\fBnetsnmp_session\fP *sess, void(*free_request)(\fBnetsnmp_request_list\fP *))"
171
174
.br
172
175
.ti -1c
173
176
.RI "int \fBhandle_snmp_packet\fP (int op, \fBnetsnmp_session\fP *session, int reqid, \fBnetsnmp_pdu\fP *pdu, void *magic)"
237
240
.br
238
241
.RI "\fIset error for all requests \fP"
239
242
.ti -1c
240
 
.RI "u_long \fBnetsnmp_marker_uptime\fP (\fBmarker_t\fP pm)"
 
243
.RI "u_long \fBnetsnmp_marker_uptime\fP (marker_t pm)"
241
244
.br
242
245
.ti -1c
243
246
.RI "u_long \fBnetsnmp_timeval_uptime\fP (struct timeval *tv)"
266
269
.ti -1c
267
270
.RI "int \fBnetsnmp_set_request_error\fP (\fBnetsnmp_agent_request_info\fP *reqinfo, \fBnetsnmp_request_info\fP *request, int error_value)"
268
271
.br
269
 
.RI "\fIdeprecated, use netsnmp_request_set_error instead \fP"
 
272
.RI "\fIset error for a request \fP"
270
273
.ti -1c
271
274
.RI "int \fBnetsnmp_set_mode_request_error\fP (int mode, \fBnetsnmp_request_info\fP *request, int error_value)"
272
275
.br
273
 
.RI "\fIdeprecated, use netsnmp_request_set_error instead \fP"
 
276
.RI "\fIset error for a request \fP"
274
277
.ti -1c
275
278
.RI "int \fBnetsnmp_set_all_requests_error\fP (\fBnetsnmp_agent_request_info\fP *reqinfo, \fBnetsnmp_request_info\fP *requests, int error_value)"
276
279
.br
283
286
.RI "oid \fBversion_sysoid\fP [] = { NETSNMP_SYSTEM_MIB }"
284
287
.br
285
288
.ti -1c
286
 
.RI "int \fBversion_sysoid_len\fP = OID_LENGTH(\fBversion_sysoid\fP)"
 
289
.RI "int \fBversion_sysoid_len\fP = OID_LENGTH(version_sysoid)"
287
290
.br
288
291
.ti -1c
289
292
.RI "int \fBlog_addresses\fP = 0"
304
307
.RI "\fBnetsnmp_session\fP * \fBmain_session\fP = NULL"
305
308
.br
306
309
.ti -1c
307
 
.RI "timeval \fBstarttime\fP"
 
310
.RI "struct timeval \fBstarttime\fP"
308
311
.br
309
312
.in -1c
310
313
.SH "Function Documentation"
313
316
.PP
314
317
set error for a request 
315
318
.PP
316
 
Definition at line 3395 of file snmp_agent.c.
317
 
.PP
318
 
References netsnmp_request_info_s::delegated, netsnmp_request_info_s::processed, REQUEST_IS_NOT_DELEGATED, netsnmp_request_info_s::requestvb, snmp_log(), netsnmp_request_info_s::status, and variable_list::type.
319
 
.PP
320
 
Referenced by netsnmp_request_set_error(), netsnmp_request_set_error_all(), netsnmp_request_set_error_idx(), netsnmp_set_mode_request_error(), and netsnmp_set_request_error().
 
319
Definition at line 3414 of file snmp_agent.c.
321
320
.SS "int agent_check_and_process (int block)"
322
321
.PP
323
 
This function checks for packets arriving on the SNMP port and processes them(snmp_read) if some are found, using the select(). 
324
 
.PP
325
 
If block is non zero, the function call blocks until a packet arrives
 
322
This function checks for packets arriving on the SNMP port and processes them(snmp_read) if some are found, using the select(). If block is non zero, the function call blocks until a packet arrives
326
323
.PP
327
324
\fBParameters:\fP
328
325
.RS 4
337
334
 
338
335
.PP
339
336
Definition at line 566 of file snmp_agent.c.
340
 
.PP
341
 
References FD_ZERO, netsnmp_check_outstanding_agent_requests(), NULL, run_alarms(), snmp_log(), snmp_log_perror(), snmp_read(), snmp_select_info(), and snmp_timeout().
342
337
.SS "int check_getnext_results (\fBnetsnmp_agent_session\fP * asp)"
343
338
.PP
344
 
returns 1 if there are valid GETNEXT requests left. 
345
 
.PP
346
 
Returns 0 if not. 
347
 
.PP
348
 
Definition at line 2796 of file snmp_agent.c.
349
 
.PP
350
 
References netsnmp_request_info_s::inclusive, netsnmp_request_info_s::index, netsnmp_agent_session_s::mode, variable_list::name, variable_list::name_length, netsnmp_request_info_s::next, NULL, netsnmp_agent_session_s::oldmode, netsnmp_request_info_s::range_end, netsnmp_request_info_s::range_end_len, netsnmp_request_info_s::requestvb, snmp_oid_compare(), snmp_set_var_objid(), snmp_set_var_typed_value(), netsnmp_agent_session_s::treecache, netsnmp_agent_session_s::treecache_num, and variable_list::type.
351
 
.PP
352
 
Referenced by handle_getnext_loop().
 
339
returns 1 if there are valid GETNEXT requests left. Returns 0 if not. 
 
340
.PP
 
341
Definition at line 2815 of file snmp_agent.c.
353
342
.SS "int handle_getnext_loop (\fBnetsnmp_agent_session\fP * asp)"
354
343
.PP
355
 
repeatedly calls getnext handlers looking for an answer till all requests are satisified. 
356
 
.PP
357
 
It's expected that one pass has been made before entering this function 
358
 
.PP
359
 
Definition at line 2913 of file snmp_agent.c.
360
 
.PP
361
 
References check_acm(), check_getnext_results(), handle_var_requests(), netsnmp_check_for_delegated(), netsnmp_reassign_requests(), netsnmp_running, and variable_list::next_variable.
362
 
.PP
363
 
Referenced by check_delayed_request(), and handle_pdu().
 
344
repeatedly calls getnext handlers looking for an answer till all requests are satisified. It's expected that one pass has been made before entering this function 
 
345
.PP
 
346
Definition at line 2932 of file snmp_agent.c.
364
347
.SS "int handle_pdu (\fBnetsnmp_agent_session\fP * asp)"
365
348
.PP
366
 
This function calls into netsnmp_set_mode_request_error, sets error_value given a reqinfo->mode value. 
367
 
.PP
368
 
It's used to send specific errors back to the agent to process accordingly.
 
349
This function calls into netsnmp_set_mode_request_error, sets error_value given a reqinfo->mode value. It's used to send specific errors back to the agent to process accordingly.
369
350
.PP
370
351
If error_value is set to SNMP_NOSUCHOBJECT, SNMP_NOSUCHINSTANCE, or SNMP_ENDOFMIBVIEW the following is applicable: Sets the error_value to request->requestvb->type if reqinfo->mode value is set to MODE_GET. If the reqinfo->mode value is set to MODE_GETNEXT or MODE_GETBULK the code calls snmp_log logging an error message.
371
352
.PP
432
413
.PP
433
414
 
434
415
.PP
435
 
Definition at line 3207 of file snmp_agent.c.
436
 
.PP
437
 
References check_acm(), snmp_pdu::command, count_varbinds(), snmp_pdu::flags, get_set_cache(), handle_getnext_loop(), handle_set_loop(), handle_var_requests(), netsnmp_agent_session_s::mode, netsnmp_create_subtree_cache(), variable_list::next_variable, NULL, netsnmp_agent_session_s::oldmode, netsnmp_agent_session_s::pdu, netsnmp_agent_session_s::requests, snmp_increment_statistic(), snmp_replace_var_types(), snmp_set_var_typed_value(), netsnmp_agent_session_s::status, variable_list::type, snmp_pdu::variables, and netsnmp_agent_session_s::vbcount.
438
 
.PP
439
 
Referenced by netsnmp_handle_request().
 
416
Definition at line 3226 of file snmp_agent.c.
440
417
.SS "int handle_snmp_packet (int op, \fBnetsnmp_session\fP * session, int reqid, \fBnetsnmp_pdu\fP * pdu, void * magic)"
441
418
.PP
442
419
handles an incoming SNMP packet into the agent 
443
420
.PP
444
 
Definition at line 1754 of file snmp_agent.c.
445
 
.PP
446
 
References check_access(), snmp_pdu::command, snmp_pdu::errstat, init_agent_snmp_session(), netsnmp_handle_request(), netsnmp_remove_and_free_agent_snmp_session(), NULL, netsnmp_agent_session_s::pdu, snmp_session::s_snmp_errno, send_easy_trap(), netsnmp_agent_session_s::session, snmp_free_pdu(), snmp_increment_statistic(), snmp_send(), netsnmp_agent_session_s::status, and snmp_pdu::version.
447
 
.PP
448
 
Referenced by netsnmp_register_agent_nsap().
 
421
Definition at line 1771 of file snmp_agent.c.
449
422
.SS "\fBnetsnmp_request_info\fP* netsnmp_add_varbind_to_cache (\fBnetsnmp_agent_session\fP * asp, int vbcount, \fBnetsnmp_variable_list\fP * varbind_ptr, \fBnetsnmp_subtree\fP * tp)"
450
423
.PP
451
 
Definition at line 1863 of file snmp_agent.c.
452
 
.PP
453
 
References netsnmp_request_info_s::agent_req_info, netsnmp_agent_session_s::cache_store, netsnmp_subtree_s::cacheid, snmp_pdu::command, netsnmp_request_info_s::delegated, netsnmp_subtree_s::end_a, netsnmp_subtree_s::end_len, netsnmp_subtree_s::global_cacheid, netsnmp_request_info_s::inclusive, netsnmp_request_info_s::index, variable_list::name, variable_list::name_length, netsnmp_acm_check_subtree(), netsnmp_free_request_data_sets(), netsnmp_get_local_cachid(), netsnmp_get_or_add_local_cachid(), netsnmp_oid_find_prefix(), netsnmp_request_info_s::next, netsnmp_subtree_s::next, NULL, netsnmp_request_info_s::parent_data, netsnmp_agent_session_s::pdu, netsnmp_request_info_s::prev, netsnmp_request_info_s::processed, netsnmp_request_info_s::range_end, netsnmp_request_info_s::range_end_len, netsnmp_agent_session_s::reqinfo, netsnmp_agent_session_s::requests, netsnmp_tree_cache_s::requests_begin, netsnmp_tree_cache_s::requests_end, netsnmp_request_info_s::requestvb, netsnmp_request_info_s::requestvb_start, netsnmp_subtree_s::start_a, netsnmp_subtree_s::start_len, netsnmp_request_info_s::status, netsnmp_tree_cache_s::subtree, netsnmp_request_info_s::subtree, netsnmp_agent_session_s::treecache, netsnmp_agent_session_s::treecache_len, netsnmp_agent_session_s::treecache_num, and variable_list::type.
454
 
.PP
455
 
Referenced by netsnmp_create_subtree_cache(), and netsnmp_reassign_requests().
 
424
\fBTodo\fP
 
425
.RS 4
 
426
make this be more intelligent about ranges. Right now we merely take the highest level commonality of a registration range and use that. At times we might be able to be smarter about checking the range itself as opposed to the \fBnode\fP above where the range exists, but I doubt this will come up all that frequently. 
 
427
.RE
 
428
.PP
 
429
 
 
430
.PP
 
431
Definition at line 1880 of file snmp_agent.c.
456
432
.SS "int netsnmp_check_transaction_id (int transaction_id)"
457
433
.PP
458
 
Decide if the requested transaction_id is still being processed within the agent. 
459
 
.PP
460
 
This is used to validate whether a delayed cache (containing possibly freed pointers) is still usable.
 
434
Decide if the requested transaction_id is still being processed within the agent. This is used to validate whether a delayed cache (containing possibly freed pointers) is still usable.
461
435
.PP
462
436
returns SNMPERR_SUCCESS if it's still valid, or SNMPERR_GENERR if not. 
463
437
.PP
464
 
Definition at line 2699 of file snmp_agent.c.
465
 
.PP
466
 
References agent_delegated_list, netsnmp_agent_session_s::next, and NULL.
467
 
.PP
468
 
Referenced by check_delayed_request(), and netsnmp_handler_check_cache().
 
438
Definition at line 2718 of file snmp_agent.c.
469
439
.SS "int netsnmp_request_set_error (\fBnetsnmp_request_info\fP * request, int error_value)"
470
440
.PP
471
 
set error for a request 
472
 
.PP
473
 
\fBParameters:\fP
 
441
set error for a request \fBParameters:\fP
474
442
.RS 4
475
443
\fIrequest\fP request which has error 
476
444
.br
479
447
.PP
480
448
 
481
449
.PP
482
 
Definition at line 3463 of file snmp_agent.c.
483
 
.PP
484
 
References _request_set_error(), netsnmp_request_info_s::agent_req_info, and netsnmp_agent_request_info_s::mode.
485
 
.PP
486
 
Referenced by netsnmp_remove_delegated_requests_for_session().
 
450
Definition at line 3482 of file snmp_agent.c.
487
451
.SS "NETSNMP_INLINE int netsnmp_request_set_error_all (\fBnetsnmp_request_info\fP * requests, int error)"
488
452
.PP
489
 
set error for all requests 
490
 
.PP
491
 
\fBParameters:\fP
 
453
set error for all requests \fBParameters:\fP
492
454
.RS 4
493
455
\fIrequests\fP request list 
494
456
.br
504
466
.PP
505
467
paranoid sanity checks 
506
468
.PP
507
 
Definition at line 3506 of file snmp_agent.c.
508
 
.PP
509
 
References _request_set_error(), netsnmp_request_info_s::agent_req_info, netsnmp_agent_request_info_s::mode, netsnmp_request_info_s::next, NULL, and snmp_log().
510
 
.PP
511
 
Referenced by netsnmp_cache_helper_handler(), netsnmp_multiplexer_helper_handler(), netsnmp_read_only_helper(), and netsnmp_set_all_requests_error().
 
469
Definition at line 3525 of file snmp_agent.c.
512
470
.SS "int netsnmp_request_set_error_idx (\fBnetsnmp_request_info\fP * request, int error_value, int idx)"
513
471
.PP
514
 
set error for a request within a request list 
515
 
.PP
516
 
\fBParameters:\fP
 
472
set error for a request within a request list \fBParameters:\fP
517
473
.RS 4
518
474
\fIrequest\fP head of the request list 
519
475
.br
524
480
.PP
525
481
 
526
482
.PP
527
 
Definition at line 3478 of file snmp_agent.c.
528
 
.PP
529
 
References _request_set_error(), netsnmp_request_info_s::agent_req_info, netsnmp_agent_request_info_s::mode, and netsnmp_request_info_s::next.
 
483
Definition at line 3497 of file snmp_agent.c.
530
484
.SS "int netsnmp_set_all_requests_error (\fBnetsnmp_agent_request_info\fP * reqinfo, \fBnetsnmp_request_info\fP * requests, int error_value)"
531
485
.PP
532
 
set error for all request 
533
 
.PP
534
 
\fBDeprecated\fP
 
486
set error for all request \fBDeprecated\fP
535
487
.RS 4
536
488
use netsnmp_request_set_error_all 
537
489
.RE
552
504
.PP
553
505
 
554
506
.PP
555
 
Definition at line 3680 of file snmp_agent.c.
556
 
.PP
557
 
References netsnmp_request_set_error_all().
 
507
Definition at line 3699 of file snmp_agent.c.
558
508
.SS "int netsnmp_set_mode_request_error (int mode, \fBnetsnmp_request_info\fP * request, int error_value)"
559
509
.PP
560
 
deprecated, use netsnmp_request_set_error instead 
 
510
set error for a request deprecated, use netsnmp_request_set_error instead
561
511
.PP
562
512
\fBDeprecated\fP
563
513
.RS 4
580
530
.PP
581
531
 
582
532
.PP
583
 
Definition at line 3664 of file snmp_agent.c.
584
 
.PP
585
 
References _request_set_error().
 
533
Definition at line 3683 of file snmp_agent.c.
586
534
.SS "int netsnmp_set_request_error (\fBnetsnmp_agent_request_info\fP * reqinfo, \fBnetsnmp_request_info\fP * request, int error_value)"
587
535
.PP
588
 
deprecated, use netsnmp_request_set_error instead 
 
536
set error for a request deprecated, use netsnmp_request_set_error instead
589
537
.PP
590
538
\fBDeprecated\fP
591
539
.RS 4
612
560
.in +1c
613
561
\fBdelayed_instance.c\fP.
614
562
.PP
615
 
Definition at line 3645 of file snmp_agent.c.
616
 
.PP
617
 
References _request_set_error(), and netsnmp_agent_request_info_s::mode.
618
 
.PP
619
 
Referenced by netsnmp_call_handlers(), 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_scalar_group_helper_handler(), netsnmp_scalar_helper_handler(), netsnmp_table_data_set_helper_handler(), netsnmp_watched_spinlock_handler(), netsnmp_watched_timestamp_handler(), netsnmp_watcher_helper_handler(), and table_helper_handler().
 
563
Definition at line 3664 of file snmp_agent.c.
620
564
.SS "int netsnmp_wrap_up_request (\fBnetsnmp_agent_session\fP * asp, int status)"
621
565
.PP
622
 
Definition at line 1501 of file snmp_agent.c.
623
 
.PP
624
 
References _fix_endofmibview(), _reorder_getbulk(), snmp_pdu::command, count_varbinds(), snmp_pdu::errindex, snmp_pdu::errstat, netsnmp_agent_session_s::index, variable_list::name, variable_list::name_length, netsnmp_processing_set, netsnmp_remove_and_free_agent_snmp_session(), variable_list::next_variable, NULL, netsnmp_agent_session_s::orig_pdu, netsnmp_agent_session_s::pdu, save_set_cache(), netsnmp_agent_session_s::session, SNMP_FREE, snmp_free_pdu(), snmp_increment_statistic(), snmp_increment_statistic_by(), snmp_log(), snmp_perror(), snmp_send(), sprint_realloc_objid(), netsnmp_agent_session_s::status, variable_list::type, snmp_pdu::variables, and snmp_pdu::version.
625
 
.PP
626
 
Referenced by check_delayed_request(), and netsnmp_handle_request().
 
566
if asp->pdu 
 
567
.PP
 
568
Definition at line 1518 of file snmp_agent.c.
 
569
.SH "Author"
 
570
.PP 
 
571
Generated automatically by Doxygen for net-snmp from the source code.