| .TH "The Net-SNMP library" 3 "24 Jun 2011" "Version 5.4.3.pre1" "net-snmp" \" -*- nroff -*- |
| .ad l |
| .nh |
| .SH NAME |
| The Net-SNMP library \- |
| .SS "Data Structures" |
| |
| .in +1c |
| .ti -1c |
| .RI "struct \fBsnmp_internal_session\fP" |
| .br |
| .ti -1c |
| .RI "struct \fBsession_list\fP" |
| .br |
| .in -1c |
| .SS "Modules" |
| |
| .in +1c |
| .ti -1c |
| .RI "\fBasn1 parsing and datatype manipulation routines.\fP" |
| .br |
| .PP |
| |
| .RI "\fINote on. \fP" |
| .ti -1c |
| .RI "\fBA generic callback mechanism\fP" |
| .br |
| .ti -1c |
| .RI "\fBgeneric linked-list data handling with a string as a key.\fP" |
| .br |
| .ti -1c |
| .RI "\fBstorage space for defaults\fP" |
| .br |
| .PP |
| |
| .RI "\fIThe purpose of the default storage is three-fold:. \fP" |
| .ti -1c |
| .RI "\fBmib parsing and datatype manipulation routines.\fP" |
| .br |
| .ti -1c |
| .RI "\fBStore and retrieve data referenced by an OID.\fP" |
| .br |
| .PP |
| |
| .RI "\fIThis is essentially a way of storing data associated with a given OID. \fP" |
| .ti -1c |
| .RI "\fBparsing various configuration files at run time\fP" |
| .br |
| .PP |
| |
| .RI "\fIThe read_config related functions are a fairly extensible system of parsing various configuration files at the run time. \fP" |
| .ti -1c |
| .RI "\fBgeneric library based alarm timers for various parts of an application\fP" |
| .br |
| .ti -1c |
| .RI "\fBvarious PDU processing routines\fP" |
| .br |
| .ti -1c |
| .RI "\fBgeneric logging for net-snmp\fP" |
| .br |
| .ti -1c |
| .RI "\fBMemory Utility Routines\fP" |
| .br |
| .in -1c |
| .SS "Defines" |
| |
| .in +1c |
| .ti -1c |
| .RI "#define \fBMIN\fP(a, b) (((a) < (b)) ? (a) : (b))" |
| .br |
| .ti -1c |
| .RI "#define \fBMIB_CLIENTS_ARE_EVIL\fP 1" |
| .br |
| .ti -1c |
| .RI "#define \fB_init_agent_callback_transport\fP()" |
| .br |
| .ti -1c |
| .RI "#define \fBSNMP_NEED_REQUEST_LIST\fP" |
| .br |
| .ti -1c |
| .RI "#define \fBtimercmp\fP(tvp, uvp, cmp)" |
| .br |
| .ti -1c |
| .RI "#define \fBtimerclear\fP(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0" |
| .br |
| .ti -1c |
| .RI "#define \fBMAX_PACKET_LENGTH\fP (0x7fffffff)" |
| .br |
| .ti -1c |
| .RI "#define \fBNETSNMP_STREAM_QUEUE_LEN\fP 5" |
| .br |
| .ti -1c |
| .RI "#define \fBBSD4_2\fP" |
| .br |
| .ti -1c |
| .RI "#define \fBDEFAULT_COMMUNITY\fP 'public'" |
| .br |
| .ti -1c |
| .RI "#define \fBDEFAULT_RETRIES\fP 5" |
| .br |
| .ti -1c |
| .RI "#define \fBDEFAULT_TIMEOUT\fP 1000000L" |
| .br |
| .ti -1c |
| .RI "#define \fBDEFAULT_REMPORT\fP SNMP_PORT" |
| .br |
| .ti -1c |
| .RI "#define \fBDEFAULT_ENTERPRISE\fP default_enterprise" |
| .br |
| .ti -1c |
| .RI "#define \fBDEFAULT_TIME\fP 0" |
| .br |
| .ti -1c |
| .RI "#define \fBMAXIMUM_PACKET_SIZE\fP 0x7fffffff" |
| .br |
| .ti -1c |
| .RI "#define \fBDEBUGPRINTPDUTYPE\fP(token, type) DEBUGDUMPSECTION(token, snmp_pdu_type(type))" |
| .br |
| .ti -1c |
| .RI "#define \fBERROR_STAT_LENGTH\fP 11" |
| .br |
| .in -1c |
| .SS "Functions" |
| |
| .in +1c |
| .ti -1c |
| .RI "int \fBinit_agent\fP (const char *app)" |
| .br |
| .RI "\fIInitialize the agent. \fP" |
| .ti -1c |
| .RI "void \fBshutdown_agent\fP (void)" |
| .br |
| .ti -1c |
| .RI "void \fBadd_to_init_list\fP (char *module_list)" |
| .br |
| .ti -1c |
| .RI "int \fBshould_init\fP (const char *module_name)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_build\fP (u_char **pkt, size_t *pkt_len, size_t *offset, \fBnetsnmp_session\fP *pss, \fBnetsnmp_pdu\fP *pdu)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_get_errno\fP (void)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_synch_reset\fP (\fBnetsnmp_session\fP *notused)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_synch_setup\fP (\fBnetsnmp_session\fP *notused)" |
| .br |
| .ti -1c |
| .RI "const char * \fBstrerror\fP (int err)" |
| .br |
| .ti -1c |
| .RI "const char * \fBsnmp_pdu_type\fP (int type)" |
| .br |
| .ti -1c |
| .RI "long \fBsnmp_get_next_reqid\fP (void)" |
| .br |
| .ti -1c |
| .RI "long \fBsnmp_get_next_msgid\fP (void)" |
| .br |
| .ti -1c |
| .RI "long \fBsnmp_get_next_sessid\fP (void)" |
| .br |
| .ti -1c |
| .RI "long \fBsnmp_get_next_transid\fP (void)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_perror\fP (const char *prog_string)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_set_detail\fP (const char *detail_string)" |
| .br |
| .ti -1c |
| .RI "const char * \fBsnmp_api_errstring\fP (int snmp_errnumber)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_error\fP (\fBnetsnmp_session\fP *psess, int *p_errno, int *p_snmp_errno, char **p_str)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_sess_error\fP (void *sessp, int *p_errno, int *p_snmp_errno, char **p_str)" |
| .br |
| .ti -1c |
| .RI "void \fBnetsnmp_sess_log_error\fP (int priority, const char *prog_string, \fBnetsnmp_session\fP *ss)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_sess_perror\fP (const char *prog_string, \fBnetsnmp_session\fP *ss)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_sess_init\fP (\fBnetsnmp_session\fP *session)" |
| .br |
| .ti -1c |
| .RI "void \fBinit_snmp\fP (const char *type)" |
| .br |
| .RI "\fICalls the functions to do config file loading and mib \fBmodule\fP parsing in the correct order. \fP" |
| .ti -1c |
| .RI "void \fBsnmp_store\fP (const char *type)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_shutdown\fP (const char *type)" |
| .br |
| .RI "\fIShuts down the application, saving any needed persistent storage, and appropriate clean up. \fP" |
| .ti -1c |
| .RI "\fBnetsnmp_session\fP * \fBsnmp_open\fP (\fBnetsnmp_session\fP *session)" |
| .br |
| .ti -1c |
| .RI "\fBnetsnmp_session\fP * \fBsnmp_open_ex\fP (\fBnetsnmp_session\fP *session, int(*fpre_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_transport\fP *, void *, int), int(*fparse)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, u_char *, size_t), int(*fpost_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, int), int(*fbuild)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, u_char *, size_t *), int(*frbuild)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, u_char **, size_t *, size_t *), int(*fcheck)(u_char *, size_t))" |
| .br |
| .ti -1c |
| .RI "int \fBsnmpv3_engineID_probe\fP (struct \fBsession_list\fP *slp, \fBnetsnmp_session\fP *in_session)" |
| .br |
| .RI "\fIprobe for peer engineID \fP" |
| .ti -1c |
| .RI "\fBnetsnmp_session\fP * \fBsnmp_add\fP (\fBnetsnmp_session\fP *in_session, \fBnetsnmp_transport\fP *transport, int(*fpre_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_transport\fP *, void *, int), int(*fpost_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, int))" |
| .br |
| .ti -1c |
| .RI "\fBnetsnmp_session\fP * \fBsnmp_add_full\fP (\fBnetsnmp_session\fP *in_session, \fBnetsnmp_transport\fP *transport, int(*fpre_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_transport\fP *, void *, int), int(*fparse)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, u_char *, size_t), int(*fpost_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, int), int(*fbuild)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, u_char *, size_t *), int(*frbuild)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, u_char **, size_t *, size_t *), int(*fcheck)(u_char *, size_t), \fBnetsnmp_pdu\fP *(*fcreate_pdu)(\fBnetsnmp_transport\fP *, void *, size_t))" |
| .br |
| .ti -1c |
| .RI "void * \fBsnmp_sess_add_ex\fP (\fBnetsnmp_session\fP *in_session, \fBnetsnmp_transport\fP *transport, int(*fpre_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_transport\fP *, void *, int), int(*fparse)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, u_char *, size_t), int(*fpost_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, int), int(*fbuild)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, u_char *, size_t *), int(*frbuild)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, u_char **, size_t *, size_t *), int(*fcheck)(u_char *, size_t), \fBnetsnmp_pdu\fP *(*fcreate_pdu)(\fBnetsnmp_transport\fP *, void *, size_t))" |
| .br |
| .ti -1c |
| .RI "void * \fBsnmp_sess_add\fP (\fBnetsnmp_session\fP *in_session, \fBnetsnmp_transport\fP *transport, int(*fpre_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_transport\fP *, void *, int), int(*fpost_parse)(\fBnetsnmp_session\fP *, \fBnetsnmp_pdu\fP *, int))" |
| .br |
| .ti -1c |
| .RI "void * \fBsnmp_sess_open\fP (\fBnetsnmp_session\fP *pss)" |
| .br |
| .ti -1c |
| .RI "int \fBcreate_user_from_session\fP (\fBnetsnmp_session\fP *session)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_sess_close\fP (void *sessp)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_close\fP (\fBnetsnmp_session\fP *session)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_close_sessions\fP (void)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmpv3_header_realloc_rbuild\fP (u_char **pkt, size_t *pkt_len, size_t *offset, \fBnetsnmp_session\fP *session, \fBnetsnmp_pdu\fP *pdu)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmpv3_scopedPDU_header_realloc_rbuild\fP (u_char **pkt, size_t *pkt_len, size_t *offset, \fBnetsnmp_pdu\fP *pdu, size_t body_len)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmpv3_packet_realloc_rbuild\fP (u_char **pkt, size_t *pkt_len, size_t *offset, \fBnetsnmp_session\fP *session, \fBnetsnmp_pdu\fP *pdu, u_char *pdu_data, size_t pdu_data_len)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmpv3_packet_build\fP (\fBnetsnmp_session\fP *session, \fBnetsnmp_pdu\fP *pdu, u_char *packet, size_t *out_length, u_char *pdu_data, size_t pdu_data_len)" |
| .br |
| .ti -1c |
| .RI "u_char * \fBsnmp_pdu_build\fP (\fBnetsnmp_pdu\fP *pdu, u_char *cp, size_t *out_length)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_pdu_realloc_rbuild\fP (u_char **pkt, size_t *pkt_len, size_t *offset, \fBnetsnmp_pdu\fP *pdu)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmpv3_parse\fP (\fBnetsnmp_pdu\fP *pdu, u_char *data, size_t *length, u_char **after_header, \fBnetsnmp_session\fP *sess)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmpv3_make_report\fP (\fBnetsnmp_pdu\fP *pdu, int error)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmpv3_get_report_type\fP (\fBnetsnmp_pdu\fP *pdu)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_pdu_parse\fP (\fBnetsnmp_pdu\fP *pdu, u_char *data, size_t *length)" |
| .br |
| .ti -1c |
| .RI "u_char * \fBsnmpv3_scopedPDU_parse\fP (\fBnetsnmp_pdu\fP *pdu, u_char *cp, size_t *length)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_send\fP (\fBnetsnmp_session\fP *session, \fBnetsnmp_pdu\fP *pdu)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_sess_send\fP (void *sessp, \fBnetsnmp_pdu\fP *pdu)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_async_send\fP (\fBnetsnmp_session\fP *session, \fBnetsnmp_pdu\fP *pdu, snmp_callback callback, void *cb_data)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_sess_async_send\fP (void *sessp, \fBnetsnmp_pdu\fP *pdu, snmp_callback callback, void *cb_data)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_free_var\fP (\fBnetsnmp_variable_list\fP *var)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_free_varbind\fP (\fBnetsnmp_variable_list\fP *var)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_free_pdu\fP (\fBnetsnmp_pdu\fP *pdu)" |
| .br |
| .ti -1c |
| .RI "\fBnetsnmp_pdu\fP * \fBsnmp_create_sess_pdu\fP (\fBnetsnmp_transport\fP *transport, void *opaque, size_t olength)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_read\fP (fd_set *fdset)" |
| .br |
| .ti -1c |
| .RI "int \fB_sess_read\fP (void *sessp, fd_set *fdset)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_sess_read\fP (void *sessp, fd_set *fdset)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_select_info\fP (int *numfds, fd_set *fdset, struct timeval *timeout, int *block)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_sess_select_info\fP (void *sessp, int *numfds, fd_set *fdset, struct timeval *timeout, int *block)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_timeout\fP (void)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_sess_timeout\fP (void *sessp)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_oid_ncompare\fP (const oid *in_name1, size_t len1, const oid *in_name2, size_t len2, size_t max_len)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_oid_compare\fP (const oid *in_name1, size_t len1, const oid *in_name2, size_t len2)" |
| .br |
| .RI "\fIlexicographical compare two object identifiers. \fP" |
| .ti -1c |
| .RI "int \fBnetsnmp_oid_compare_ll\fP (const oid *in_name1, size_t len1, const oid *in_name2, size_t len2, size_t *offpt)" |
| .br |
| .RI "\fIlexicographical compare two object identifiers and return the point where they differ \fP" |
| .ti -1c |
| .RI "int \fBsnmp_oidtree_compare\fP (const oid *in_name1, size_t len1, const oid *in_name2, size_t len2)" |
| .br |
| .RI "\fICompares 2 OIDs to determine if they are equal up until the shortest length. \fP" |
| .ti -1c |
| .RI "int \fBsnmp_oidsubtree_compare\fP (const oid *in_name1, size_t len1, const oid *in_name2, size_t len2)" |
| .br |
| .ti -1c |
| .RI "int \fBnetsnmp_oid_equals\fP (const oid *in_name1, size_t len1, const oid *in_name2, size_t len2)" |
| .br |
| .RI "\fICompares 2 OIDs to determine if they are exactly equal. \fP" |
| .ti -1c |
| .RI "int \fBnetsnmp_oid_is_subtree\fP (const oid *in_name1, size_t len1, const oid *in_name2, size_t len2)" |
| .br |
| .RI "\fIIdentical to netsnmp_oid_equals, except only the length up to len1 is compared. \fP" |
| .ti -1c |
| .RI "int \fBnetsnmp_oid_find_prefix\fP (const oid *in_name1, size_t len1, const oid *in_name2, size_t len2)" |
| .br |
| .RI "\fIGiven two OIDs, determine the common prefix to them both. \fP" |
| .ti -1c |
| .RI "\fBnetsnmp_variable_list\fP * \fBsnmp_pdu_add_variable\fP (\fBnetsnmp_pdu\fP *pdu, const oid *name, size_t name_length, u_char type, const u_char *value, size_t len)" |
| .br |
| .ti -1c |
| .RI "\fBnetsnmp_variable_list\fP * \fBsnmp_varlist_add_variable\fP (\fBnetsnmp_variable_list\fP **varlist, const oid *name, size_t name_length, u_char type, const u_char *value, size_t len)" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_add_var\fP (\fBnetsnmp_pdu\fP *pdu, const oid *name, size_t name_length, char type, const char *value)" |
| .br |
| .ti -1c |
| .RI "void * \fBsnmp_sess_pointer\fP (\fBnetsnmp_session\fP *session)" |
| .br |
| .ti -1c |
| .RI "\fBnetsnmp_session\fP * \fBsnmp_sess_session\fP (void *sessp)" |
| .br |
| .ti -1c |
| .RI "\fBnetsnmp_session\fP * \fBsnmp_sess_session_lookup\fP (void *sessp)" |
| .br |
| .RI "\fILook up a session that already may have been closed. \fP" |
| .ti -1c |
| .RI "\fBnetsnmp_transport\fP * \fBsnmp_sess_transport\fP (void *sessp)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_sess_transport_set\fP (void *sp, \fBnetsnmp_transport\fP *t)" |
| .br |
| .ti -1c |
| .RI "oid * \fBsnmp_duplicate_objid\fP (const oid *objToCopy, size_t objToCopyLen)" |
| .br |
| .ti -1c |
| .RI "u_int \fBsnmp_increment_statistic\fP (int which)" |
| .br |
| .ti -1c |
| .RI "u_int \fBsnmp_increment_statistic_by\fP (int which, int count)" |
| .br |
| .ti -1c |
| .RI "u_int \fBsnmp_get_statistic\fP (int which)" |
| .br |
| .ti -1c |
| .RI "void \fBsnmp_init_statistics\fP (void)" |
| .br |
| .in -1c |
| .SS "Variables" |
| |
| .in +1c |
| .ti -1c |
| .RI "struct \fBmodule_init_list\fP * \fBinitlist\fP = NULL" |
| .br |
| .ti -1c |
| .RI "struct \fBmodule_init_list\fP * \fBnoinitlist\fP = NULL" |
| .br |
| .ti -1c |
| .RI "\fBnetsnmp_subtree\fP * \fBsubtrees\fP" |
| .br |
| .ti -1c |
| .RI "long \fBlong_return\fP" |
| .br |
| .ti -1c |
| .RI "u_char \fBreturn_buf\fP [258]" |
| .br |
| .ti -1c |
| .RI "struct timeval \fBstarttime\fP" |
| .br |
| .ti -1c |
| .RI "int \fBcallback_master_num\fP = -1" |
| .br |
| .ti -1c |
| .RI "oid \fBnullOid\fP [] = { 0, 0 }" |
| .br |
| .ti -1c |
| .RI "int \fBnullOidLen\fP = sizeof(nullOid)" |
| .br |
| .ti -1c |
| .RI "struct \fBsession_list\fP * \fBSessions\fP = NULL" |
| .br |
| .ti -1c |
| .RI "int \fBsnmp_errno\fP = 0" |
| .br |
| .in -1c |
| .SH "Define Documentation" |
| .PP |
| .SS "#define timercmp(tvp, uvp, cmp)"\fBValue:\fP |
| .PP |
| .nf |
| /* CSTYLED */ \ |
| ((tvp)->tv_sec cmp (uvp)->tv_sec || \ |
| ((tvp)->tv_sec == (uvp)->tv_sec && \ |
| /* CSTYLED */ \ |
| (tvp)->tv_usec cmp (uvp)->tv_usec)) |
| .fi |
| .PP |
| Definition at line 148 of file snmp_api.c. |
| .SH "Function Documentation" |
| .PP |
| .SS "int _sess_read (void * sessp, fd_set * fdset)" |
| .PP |
| XXX-rks: why no SNMP_FREE(isp->packet); ?? |
| .PP |
| XXX-rks: why no SNMP_FREE(isp->packet); ?? |
| .PP |
| Definition at line 5448 of file snmp_api.c. |
| .SS "int init_agent (const char * app)" |
| .PP |
| Initialize the agent. Calls into init_agent_read_config to set tha app's configuration file in the appropriate default storage space, NETSNMP_DS_LIB_APPTYPE. Need to call init_agent before calling init_snmp. |
| .PP |
| \fBParameters:\fP |
| .RS 4 |
| \fIapp\fP the configuration file to be read in, gets stored in default storage |
| .RE |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| Returns non-zero on failure and zero on success. |
| .RE |
| .PP |
| \fBSee also:\fP |
| .RS 4 |
| \fBinit_snmp\fP |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 270 of file snmp_vars.c. |
| .SS "void init_snmp (const char * type)" |
| .PP |
| Calls the functions to do config file loading and mib \fBmodule\fP parsing in the correct order. \fBParameters:\fP |
| .RS 4 |
| \fItype\fP label for the config file 'type' |
| .RE |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| void |
| .RE |
| .PP |
| \fBSee also:\fP |
| .RS 4 |
| \fBinit_agent\fP |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 787 of file snmp_api.c. |
| .SS "int netsnmp_oid_compare_ll (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2, size_t * offpt)" |
| .PP |
| lexicographical compare two object identifiers and return the point where they differ Caution: this method is called often by command responder applications (ie, agent). |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| -1 if name1 < name2, 0 if name1 = name2, 1 if name1 > name2 and offpt = len where name1 != name2 |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 6386 of file snmp_api.c. |
| .SS "int netsnmp_oid_equals (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)" |
| .PP |
| Compares 2 OIDs to determine if they are exactly equal. This should be faster than doing a snmp_oid_compare for different length OIDs, since the length is checked first and if != returns immediately. Might be very slighly faster if lengths are ==. |
| .PP |
| \fBParameters:\fP |
| .RS 4 |
| \fIin_name1\fP A pointer to the first oid. |
| .br |
| \fIlen1\fP length of the first OID (in segments, not bytes) |
| .br |
| \fIin_name2\fP A pointer to the second oid. |
| .br |
| \fIlen2\fP length of the second OID (in segments, not bytes) |
| .RE |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| 0 if they are equal, 1 if they are not. |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 6467 of file snmp_api.c. |
| .SS "int netsnmp_oid_find_prefix (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)" |
| .PP |
| Given two OIDs, determine the common prefix to them both. \fBParameters:\fP |
| .RS 4 |
| \fIin_name1\fP A pointer to the first oid. |
| .br |
| \fIlen1\fP Length of the first oid. |
| .br |
| \fIin_name2\fP A pointer to the second oid. |
| .br |
| \fIlen2\fP Length of the second oid. |
| .RE |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| length of common prefix 0 if no common prefix, -1 on error. |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 6531 of file snmp_api.c. |
| .SS "int netsnmp_oid_is_subtree (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)" |
| .PP |
| Identical to netsnmp_oid_equals, except only the length up to len1 is compared. Functionally, this determines if in_name2 is equal or a subtree of in_name1 |
| .PP |
| \fBParameters:\fP |
| .RS 4 |
| \fIin_name1\fP A pointer to the first oid. |
| .br |
| \fIlen1\fP length of the first OID (in segments, not bytes) |
| .br |
| \fIin_name2\fP A pointer to the second oid. |
| .br |
| \fIlen2\fP length of the second OID (in segments, not bytes) |
| .RE |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| 0 if one is a common prefix of the other. |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 6510 of file snmp_api.c. |
| .SS "int snmp_oid_compare (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)" |
| .PP |
| lexicographical compare two object identifiers. Caution: this method is called often by command responder applications (ie, agent). |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| -1 if name1 < name2, 0 if name1 = name2, 1 if name1 > name2 |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 6337 of file snmp_api.c. |
| .SS "int snmp_oidtree_compare (const oid * in_name1, size_t len1, const oid * in_name2, size_t len2)" |
| .PP |
| Compares 2 OIDs to determine if they are equal up until the shortest length. \fBParameters:\fP |
| .RS 4 |
| \fIin_name1\fP A pointer to the first oid. |
| .br |
| \fIlen1\fP length of the first OID (in segments, not bytes) |
| .br |
| \fIin_name2\fP A pointer to the second oid. |
| .br |
| \fIlen2\fP length of the second OID (in segments, not bytes) |
| .RE |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| 0 if they are equal, 1 if in_name1 is > in_name2, or -1 if <. |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 6439 of file snmp_api.c. |
| .SS "\fBnetsnmp_session\fP* snmp_sess_session_lookup (void * sessp)" |
| .PP |
| Look up a session that already may have been closed. \fBParameters:\fP |
| .RS 4 |
| \fIsessp\fP Opaque pointer, returned by snmp_sess_open. |
| .RE |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| Pointer to session upon success or NULL upon failure. |
| .RE |
| .PP |
| \fBSee also:\fP |
| .RS 4 |
| snmp_sess_session() |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 7197 of file snmp_api.c. |
| .SS "void snmp_shutdown (const char * type)" |
| .PP |
| Shuts down the application, saving any needed persistent storage, and appropriate clean up. \fBParameters:\fP |
| .RS 4 |
| \fItype\fP Label for the config file 'type' used |
| .RE |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| void |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 853 of file snmp_api.c. |
| .SS "int snmpv3_engineID_probe (struct \fBsession_list\fP * slp, \fBnetsnmp_session\fP * in_session)" |
| .PP |
| probe for peer engineID \fBParameters:\fP |
| .RS 4 |
| \fIslp\fP session list pointer. |
| .br |
| \fIin_session\fP session for errors |
| .RE |
| .PP |
| \fBNote:\fP |
| .RS 4 |
| .IP "\(bu" 2 |
| called by _sess_open(), snmp_sess_add_ex() |
| .IP "\(bu" 2 |
| in_session is the user supplied session provided to those functions. |
| .IP "\(bu" 2 |
| the first session in slp should the internal allocated copy of in_session |
| .PP |
| .RE |
| .PP |
| \fBReturns:\fP |
| .RS 4 |
| 0 : error |
| .PP |
| 1 : ok |
| .RE |
| .PP |
| |
| .PP |
| Definition at line 1278 of file snmp_api.c. |
| .SH "Author" |
| .PP |
| Generated automatically by Doxygen for net-snmp from the source code. |