267
270
.RI "int \fBnetsnmp_set_request_error\fP (\fBnetsnmp_agent_request_info\fP *reqinfo, \fBnetsnmp_request_info\fP *request, int error_value)"
269
.RI "\fIdeprecated, use netsnmp_request_set_error instead \fP"
272
.RI "\fIset error for a request \fP"
271
274
.RI "int \fBnetsnmp_set_mode_request_error\fP (int mode, \fBnetsnmp_request_info\fP *request, int error_value)"
273
.RI "\fIdeprecated, use netsnmp_request_set_error instead \fP"
276
.RI "\fIset error for a request \fP"
275
278
.RI "int \fBnetsnmp_set_all_requests_error\fP (\fBnetsnmp_agent_request_info\fP *reqinfo, \fBnetsnmp_request_info\fP *requests, int error_value)"
314
317
set error for a request
316
Definition at line 3395 of file snmp_agent.c.
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.
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)"
323
This function checks for packets arriving on the SNMP port and processes them(snmp_read) if some are found, using the select().
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
327
324
\fBParameters:\fP
339
336
Definition at line 566 of file snmp_agent.c.
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)"
344
returns 1 if there are valid GETNEXT requests left.
348
Definition at line 2796 of file snmp_agent.c.
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.
352
Referenced by handle_getnext_loop().
339
returns 1 if there are valid GETNEXT requests left. Returns 0 if not.
341
Definition at line 2815 of file snmp_agent.c.
353
342
.SS "int handle_getnext_loop (\fBnetsnmp_agent_session\fP * asp)"
355
repeatedly calls getnext handlers looking for an answer till all requests are satisified.
357
It's expected that one pass has been made before entering this function
359
Definition at line 2913 of file snmp_agent.c.
361
References check_acm(), check_getnext_results(), handle_var_requests(), netsnmp_check_for_delegated(), netsnmp_reassign_requests(), netsnmp_running, and variable_list::next_variable.
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
346
Definition at line 2932 of file snmp_agent.c.
364
347
.SS "int handle_pdu (\fBnetsnmp_agent_session\fP * asp)"
366
This function calls into netsnmp_set_mode_request_error, sets error_value given a reqinfo->mode value.
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.
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.
435
Definition at line 3207 of file snmp_agent.c.
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.
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)"
442
419
handles an incoming SNMP packet into the agent
444
Definition at line 1754 of file snmp_agent.c.
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.
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)"
451
Definition at line 1863 of file snmp_agent.c.
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.
455
Referenced by netsnmp_create_subtree_cache(), and netsnmp_reassign_requests().
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.
431
Definition at line 1880 of file snmp_agent.c.
456
432
.SS "int netsnmp_check_transaction_id (int transaction_id)"
458
Decide if the requested transaction_id is still being processed within the agent.
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.
462
436
returns SNMPERR_SUCCESS if it's still valid, or SNMPERR_GENERR if not.
464
Definition at line 2699 of file snmp_agent.c.
466
References agent_delegated_list, netsnmp_agent_session_s::next, and NULL.
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)"
471
set error for a request
441
set error for a request \fBParameters:\fP
475
443
\fIrequest\fP request which has error
505
467
paranoid sanity checks
507
Definition at line 3506 of file snmp_agent.c.
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().
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)"
514
set error for a request within a request list
472
set error for a request within a request list \fBParameters:\fP
518
474
\fIrequest\fP head of the request list
613
561
\fBdelayed_instance.c\fP.
615
Definition at line 3645 of file snmp_agent.c.
617
References _request_set_error(), and netsnmp_agent_request_info_s::mode.
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)"
622
Definition at line 1501 of file snmp_agent.c.
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.
626
Referenced by check_delayed_request(), and netsnmp_handle_request().
568
Definition at line 1518 of file snmp_agent.c.
571
Generated automatically by Doxygen for net-snmp from the source code.