netsnmp_library.3
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:23k
- .TH "The Net-SNMP library" 3 "28 Nov 2005" "Version 5.2.1.rc3" "net-snmp" " -*- nroff -*-
- .ad l
- .nh
- .SH NAME
- The Net-SNMP library -
- .SS "Modules"
- .in +1c
- .ti -1c
- .RI "fBasn1 parsing and datatype manipulation routines.fP"
- .br
- .RI "fINote on. fP"
- .PP
- .in +1c
- .ti -1c
- .RI "fBA generic callback mechanismfP"
- .br
- .ti -1c
- .RI "fBgeneric linked-list data handling with a string as a key.fP"
- .br
- .ti -1c
- .RI "fBstorage space for defaultsfP"
- .br
- .RI "fIThe purpose of the default storage is three-fold:. fP"
- .PP
- .in +1c
- .ti -1c
- .RI "fBmib parsing and datatype manipulation routines.fP"
- .br
- .ti -1c
- .RI "fBStore and retrieve data referenced by an OID.fP"
- .br
- .RI "fIThis is essentially a way of storing data associated with a given OID. fP"
- .PP
- .in +1c
- .ti -1c
- .RI "fBparsing various configuration files at run timefP"
- .br
- .RI "fIThe read_config related functions are a fairly extensible system of parsing various configuration files at the run time. fP"
- .PP
- .in +1c
- .ti -1c
- .RI "fBgeneric library based alarm timers for various parts of an applicationfP"
- .br
- .ti -1c
- .RI "fBvarious PDU processing routinesfP"
- .br
- .ti -1c
- .RI "fBgeneric logging for net-snmpfP"
- .br
- .ti -1c
- .RI "fBMemory Utility RoutinesfP"
- .br
- .in -1c
- .SS "Data Structures"
- .in +1c
- .ti -1c
- .RI "struct fBsnmp_internal_sessionfP"
- .br
- .ti -1c
- .RI "struct fBsession_listfP"
- .br
- .in -1c
- .SS "Defines"
- .in +1c
- .ti -1c
- .RI "#define fBMINfP(a, b) (((a) < (b)) ? (a) : (b))"
- .br
- .ti -1c
- .RI "#define fBMIB_CLIENTS_ARE_EVILfP 1"
- .br
- .ti -1c
- .RI "#define fB_init_agent_callback_transportfP()"
- .br
- .ti -1c
- .RI "#define fBSNMP_NEED_REQUEST_LISTfP"
- .br
- .ti -1c
- .RI "#define fBtimercmpfP(tvp, uvp, cmp)"
- .br
- .ti -1c
- .RI "#define fBtimerclearfP(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0"
- .br
- .ti -1c
- .RI "#define fBMAX_PACKET_LENGTHfP (0x7fffffff)"
- .br
- .ti -1c
- .RI "#define fBNETSNMP_STREAM_QUEUE_LENfP 5"
- .br
- .ti -1c
- .RI "#define fBBSD4_2fP"
- .br
- .ti -1c
- .RI "#define fBNFDBITSfP (sizeof(fBfd_maskfP) * NBBY)"
- .br
- .ti -1c
- .RI "#define fBFD_SETfP(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))"
- .br
- .ti -1c
- .RI "#define fBFD_CLRfP(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))"
- .br
- .ti -1c
- .RI "#define fBFD_ISSETfP(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))"
- .br
- .ti -1c
- .RI "#define fBFD_ZEROfP(p) memset((p), 0, sizeof(*(p)))"
- .br
- .ti -1c
- .RI "#define fBDEFAULT_COMMUNITYfP 'public'"
- .br
- .ti -1c
- .RI "#define fBDEFAULT_RETRIESfP 5"
- .br
- .ti -1c
- .RI "#define fBDEFAULT_TIMEOUTfP 1000000L"
- .br
- .ti -1c
- .RI "#define fBDEFAULT_REMPORTfP SNMP_PORT"
- .br
- .ti -1c
- .RI "#define fBDEFAULT_ENTERPRISEfP default_enterprise"
- .br
- .ti -1c
- .RI "#define fBDEFAULT_TIMEfP 0"
- .br
- .ti -1c
- .RI "#define fBMAXIMUM_PACKET_SIZEfP 0x7fffffff"
- .br
- .ti -1c
- .RI "#define fBDEBUGPRINTPDUTYPEfP(token, type) DEBUGDUMPSECTION(token, snmp_pdu_type(type))"
- .br
- .ti -1c
- .RI "#define fBERROR_STAT_LENGTHfP 11"
- .br
- .in -1c
- .SS "Typedefs"
- .in +1c
- .ti -1c
- .RI "typedef long fBfd_maskfP"
- .br
- .in -1c
- .SS "Functions"
- .in +1c
- .ti -1c
- .RI "int fBinit_agentfP (const char *app)"
- .br
- .RI "fIInitialize the agent. fP"
- .ti -1c
- .RI "void fBshutdown_agentfP (void)"
- .br
- .ti -1c
- .RI "void fBadd_to_init_listfP (char *module_list)"
- .br
- .ti -1c
- .RI "int fBshould_initfP (const char *module_name)"
- .br
- .ti -1c
- .RI "int fBsnmp_buildfP (u_char **pkt, size_t *pkt_len, size_t *offset, fBnetsnmp_sessionfP *pss, fBnetsnmp_pdufP *pdu)"
- .br
- .ti -1c
- .RI "int fBsnmp_get_errnofP (void)"
- .br
- .ti -1c
- .RI "void fBsnmp_synch_resetfP (fBnetsnmp_sessionfP *notused)"
- .br
- .ti -1c
- .RI "void fBsnmp_synch_setupfP (fBnetsnmp_sessionfP *notused)"
- .br
- .ti -1c
- .RI "const char * fBstrerrorfP (int err)"
- .br
- .ti -1c
- .RI "const char * fBsnmp_pdu_typefP (int type)"
- .br
- .ti -1c
- .RI "long fBsnmp_get_next_reqidfP (void)"
- .br
- .ti -1c
- .RI "long fBsnmp_get_next_msgidfP (void)"
- .br
- .ti -1c
- .RI "long fBsnmp_get_next_sessidfP (void)"
- .br
- .ti -1c
- .RI "long fBsnmp_get_next_transidfP (void)"
- .br
- .ti -1c
- .RI "void fBsnmp_perrorfP (const char *prog_string)"
- .br
- .ti -1c
- .RI "void fBsnmp_set_detailfP (const char *detail_string)"
- .br
- .ti -1c
- .RI "const char * fBsnmp_api_errstringfP (int snmp_errnumber)"
- .br
- .ti -1c
- .RI "void fBsnmp_errorfP (fBnetsnmp_sessionfP *psess, int *p_errno, int *p_snmp_errno, char **p_str)"
- .br
- .ti -1c
- .RI "void fBsnmp_sess_errorfP (void *sessp, int *p_errno, int *p_snmp_errno, char **p_str)"
- .br
- .ti -1c
- .RI "void fBnetsnmp_sess_log_errorfP (int priority, const char *prog_string, fBnetsnmp_sessionfP *ss)"
- .br
- .ti -1c
- .RI "void fBsnmp_sess_perrorfP (const char *prog_string, fBnetsnmp_sessionfP *ss)"
- .br
- .ti -1c
- .RI "void fBsnmp_sess_initfP (fBnetsnmp_sessionfP *session)"
- .br
- .ti -1c
- .RI "void fBinit_snmp_enumsfP (void)"
- .br
- .ti -1c
- .RI "void fBinit_snmpfP (const char *type)"
- .br
- .RI "fICalls the functions to do config file loading and mib module parsing in the correct order. fP"
- .ti -1c
- .RI "void fBsnmp_storefP (const char *type)"
- .br
- .ti -1c
- .RI "void fBsnmp_shutdownfP (const char *type)"
- .br
- .RI "fIShuts down the application, saving any needed persistent storage, and appropriate clean up. fP"
- .ti -1c
- .RI "fBnetsnmp_sessionfP * fBsnmp_openfP (fBnetsnmp_sessionfP *session)"
- .br
- .ti -1c
- .RI "fBnetsnmp_sessionfP * fBsnmp_open_exfP (fBnetsnmp_sessionfP *session, int(*fpre_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_transportfP *, void *, int), int(*fparse)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char *, size_t), int(*fpost_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, int), int(*fbuild)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char *, size_t *), int(*frbuild)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char **, size_t *, size_t *), int(*fcheck)(u_char *, size_t))"
- .br
- .ti -1c
- .RI "int fBsnmpv3_engineID_probefP (struct fBsession_listfP *slp, fBnetsnmp_sessionfP *in_session)"
- .br
- .RI "fIprobe for peer engineID fP"
- .ti -1c
- .RI "fBnetsnmp_sessionfP * fBsnmp_addfP (fBnetsnmp_sessionfP *in_session, fBnetsnmp_transportfP *transport, int(*fpre_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_transportfP *, void *, int), int(*fpost_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, int))"
- .br
- .ti -1c
- .RI "fBnetsnmp_sessionfP * fBsnmp_add_fullfP (fBnetsnmp_sessionfP *in_session, fBnetsnmp_transportfP *transport, int(*fpre_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_transportfP *, void *, int), int(*fparse)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char *, size_t), int(*fpost_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, int), int(*fbuild)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char *, size_t *), int(*frbuild)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char **, size_t *, size_t *), int(*fcheck)(u_char *, size_t), fBnetsnmp_pdufP *(*fcreate_pdu)(fBnetsnmp_transportfP *, void *, size_t))"
- .br
- .ti -1c
- .RI "void * fBsnmp_sess_add_exfP (fBnetsnmp_sessionfP *in_session, fBnetsnmp_transportfP *transport, int(*fpre_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_transportfP *, void *, int), int(*fparse)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char *, size_t), int(*fpost_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, int), int(*fbuild)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char *, size_t *), int(*frbuild)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char **, size_t *, size_t *), int(*fcheck)(u_char *, size_t), fBnetsnmp_pdufP *(*fcreate_pdu)(fBnetsnmp_transportfP *, void *, size_t))"
- .br
- .ti -1c
- .RI "void * fBsnmp_sess_addfP (fBnetsnmp_sessionfP *in_session, fBnetsnmp_transportfP *transport, int(*fpre_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_transportfP *, void *, int), int(*fpost_parse)(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, int))"
- .br
- .ti -1c
- .RI "void * fBsnmp_sess_openfP (fBnetsnmp_sessionfP *pss)"
- .br
- .ti -1c
- .RI "int fBcreate_user_from_sessionfP (fBnetsnmp_sessionfP *session)"
- .br
- .ti -1c
- .RI "int fBsnmp_sess_closefP (void *sessp)"
- .br
- .ti -1c
- .RI "int fBsnmp_closefP (fBnetsnmp_sessionfP *session)"
- .br
- .ti -1c
- .RI "int fBsnmp_close_sessionsfP (void)"
- .br
- .ti -1c
- .RI "int fBsnmpv3_packet_buildfP (fBnetsnmp_sessionfP *session, fBnetsnmp_pdufP *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_buildfP (fBnetsnmp_pdufP *pdu, u_char *cp, size_t *out_length)"
- .br
- .ti -1c
- .RI "int fBsnmpv3_parsefP (fBnetsnmp_pdufP *pdu, u_char *data, size_t *length, u_char **after_header, fBnetsnmp_sessionfP *sess)"
- .br
- .ti -1c
- .RI "int fBsnmpv3_make_reportfP (fBnetsnmp_pdufP *pdu, int error)"
- .br
- .ti -1c
- .RI "int fBsnmpv3_get_report_typefP (fBnetsnmp_pdufP *pdu)"
- .br
- .ti -1c
- .RI "int fBsnmp_pdu_parsefP (fBnetsnmp_pdufP *pdu, u_char *data, size_t *length)"
- .br
- .ti -1c
- .RI "u_char * fBsnmpv3_scopedPDU_parsefP (fBnetsnmp_pdufP *pdu, u_char *cp, size_t *length)"
- .br
- .ti -1c
- .RI "int fBsnmp_sendfP (fBnetsnmp_sessionfP *session, fBnetsnmp_pdufP *pdu)"
- .br
- .ti -1c
- .RI "int fBsnmp_sess_sendfP (void *sessp, fBnetsnmp_pdufP *pdu)"
- .br
- .ti -1c
- .RI "int fBsnmp_async_sendfP (fBnetsnmp_sessionfP *session, fBnetsnmp_pdufP *pdu, snmp_callback callback, void *cb_data)"
- .br
- .ti -1c
- .RI "int fBsnmp_sess_async_sendfP (void *sessp, fBnetsnmp_pdufP *pdu, snmp_callback callback, void *cb_data)"
- .br
- .ti -1c
- .RI "void fBsnmp_free_varfP (fBnetsnmp_variable_listfP *var)"
- .br
- .ti -1c
- .RI "void fBsnmp_free_varbindfP (fBnetsnmp_variable_listfP *var)"
- .br
- .ti -1c
- .RI "void fBsnmp_free_pdufP (fBnetsnmp_pdufP *pdu)"
- .br
- .ti -1c
- .RI "fBnetsnmp_pdufP * fBsnmp_create_sess_pdufP (fBnetsnmp_transportfP *transport, void *opaque, size_t olength)"
- .br
- .ti -1c
- .RI "void fBsnmp_readfP (fd_set *fdset)"
- .br
- .ti -1c
- .RI "int fB_sess_readfP (void *sessp, fd_set *fdset)"
- .br
- .ti -1c
- .RI "int fBsnmp_sess_readfP (void *sessp, fd_set *fdset)"
- .br
- .ti -1c
- .RI "int fBsnmp_select_infofP (int *numfds, fd_set *fdset, struct timeval *timeout, int *block)"
- .br
- .ti -1c
- .RI "int fBsnmp_sess_select_infofP (void *sessp, int *numfds, fd_set *fdset, struct timeval *timeout, int *block)"
- .br
- .ti -1c
- .RI "void fBsnmp_timeoutfP (void)"
- .br
- .ti -1c
- .RI "void fBsnmp_sess_timeoutfP (void *sessp)"
- .br
- .ti -1c
- .RI "int fBsnmp_oid_ncomparefP (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_comparefP (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 fBsnmp_oidtree_comparefP (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 fBnetsnmp_oid_equalsfP (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_subtreefP (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_prefixfP (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_listfP * fBsnmp_pdu_add_variablefP (fBnetsnmp_pdufP *pdu, const oid *name, size_t name_length, u_char type, const u_char *value, size_t len)"
- .br
- .ti -1c
- .RI "fBnetsnmp_variable_listfP * fBsnmp_varlist_add_variablefP (fBnetsnmp_variable_listfP **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_varfP (fBnetsnmp_pdufP *pdu, const oid *name, size_t name_length, char type, const char *value)"
- .br
- .ti -1c
- .RI "void * fBsnmp_sess_pointerfP (fBnetsnmp_sessionfP *session)"
- .br
- .ti -1c
- .RI "fBnetsnmp_sessionfP * fBsnmp_sess_sessionfP (void *sessp)"
- .br
- .ti -1c
- .RI "fBnetsnmp_transportfP * fBsnmp_sess_transportfP (void *sessp)"
- .br
- .ti -1c
- .RI "void fBsnmp_sess_transport_setfP (void *sp, fBnetsnmp_transportfP *t)"
- .br
- .ti -1c
- .RI "oid * fBsnmp_duplicate_objidfP (const oid *objToCopy, size_t objToCopyLen)"
- .br
- .ti -1c
- .RI "u_int fBsnmp_increment_statisticfP (int which)"
- .br
- .ti -1c
- .RI "u_int fBsnmp_increment_statistic_byfP (int which, int count)"
- .br
- .ti -1c
- .RI "u_int fBsnmp_get_statisticfP (int which)"
- .br
- .ti -1c
- .RI "void fBsnmp_init_statisticsfP (void)"
- .br
- .in -1c
- .SS "Variables"
- .in +1c
- .ti -1c
- .RI "fBmodule_init_listfP * fBinitlistfP = NULL"
- .br
- .ti -1c
- .RI "fBmodule_init_listfP * fBnoinitlistfP = NULL"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBsubtreesfP"
- .br
- .ti -1c
- .RI "long fBlong_returnfP"
- .br
- .ti -1c
- .RI "u_char fBreturn_buffP [258]"
- .br
- .ti -1c
- .RI "timeval fBstarttimefP"
- .br
- .ti -1c
- .RI "int fBcallback_master_numfP = -1"
- .br
- .ti -1c
- .RI "oid fBnullOidfP [] = { 0, 0 }"
- .br
- .ti -1c
- .RI "int fBnullOidLenfP = sizeof(fBnullOidfP)"
- .br
- .ti -1c
- .RI "netsnmp_request_list * fBsnmp_internal_session::requestsEndfP"
- .br
- .ti -1c
- .RI "int(* fBsnmp_internal_session::hook_prefP )(fBnetsnmp_sessionfP *, fBnetsnmp_transportfP *, void *, int)"
- .br
- .ti -1c
- .RI "int(* fBsnmp_internal_session::hook_parsefP )(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char *, size_t)"
- .br
- .ti -1c
- .RI "int(* fBsnmp_internal_session::hook_postfP )(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, int)"
- .br
- .ti -1c
- .RI "int(* fBsnmp_internal_session::hook_buildfP )(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char *, size_t *)"
- .br
- .ti -1c
- .RI "int(* fBsnmp_internal_session::hook_realloc_buildfP )(fBnetsnmp_sessionfP *, fBnetsnmp_pdufP *, u_char **, size_t *, size_t *)"
- .br
- .ti -1c
- .RI "int(* fBsnmp_internal_session::check_packetfP )(u_char *, size_t)"
- .br
- .ti -1c
- .RI "fBnetsnmp_pdufP *(* fBsnmp_internal_session::hook_create_pdufP )(fBnetsnmp_transportfP *, void *, size_t)"
- .br
- .ti -1c
- .RI "u_char * fBsnmp_internal_session::packetfP"
- .br
- .ti -1c
- .RI "size_t fBsnmp_internal_session::packet_lenfP"
- .br
- .ti -1c
- .RI "size_t fBsnmp_internal_session::packet_sizefP"
- .br
- .ti -1c
- .RI "fBnetsnmp_sessionfP * fBsession_list::sessionfP"
- .br
- .ti -1c
- .RI "fBnetsnmp_transportfP * fBsession_list::transportfP"
- .br
- .ti -1c
- .RI "fBsnmp_internal_sessionfP * fBsession_list::internalfP"
- .br
- .ti -1c
- .RI "fBsession_listfP * fBSessionsfP = NULL"
- .br
- .ti -1c
- .RI "int fBsnmp_errnofP = 0"
- .br
- .in -1c
- .SH "Define Documentation"
- .PP
- .SS "#define timercmp(tvp, uvp, cmp)"
- .PP
- 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 146 of file snmp_api.c.
- .PP
- Referenced by netsnmp_addrcache_add(), snmp_sess_select_info(), and snmp_sess_timeout().
- .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 5340 of file snmp_api.c.
- .PP
- References asn_check_packet(), snmp_session::callback, snmp_session::callback_magic, snmp_internal_session::check_packet, netsnmp_transport_s::f_accept, netsnmp_transport_s::f_close, netsnmp_transport_s::f_recv, FD_ISSET, netsnmp_transport_s::flags, snmp_internal_session::hook_build, snmp_internal_session::hook_create_pdu, snmp_internal_session::hook_parse, snmp_internal_session::hook_post, snmp_internal_session::hook_pre, snmp_internal_session::hook_realloc_build, session_list::internal, MAX_PACKET_LENGTH, MAXIMUM_PACKET_SIZE, session_list::next, NULL, snmp_internal_session::packet, snmp_internal_session::packet_len, snmp_internal_session::packet_size, snmp_session::s_errno, snmp_session::s_snmp_errno, session_list::session, SNMP_FREE, snmp_log(), snmp_sess_add_ex(), snmp_set_detail(), netsnmp_transport_s::sock, strerror(), and session_list::transport.
- .PP
- Referenced by snmp_sess_read().
- .SS "int init_agent (const char * app)"
- .PP
- Initialize the agent.
- .PP
- 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
- fIappfP 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_snmpfP
- .RE
- .PP
- .PP
- Definition at line 272 of file snmp_vars.c.
- .PP
- References _init_agent_callback_transport, init_traps(), netsnmp_ds_get_boolean(), netsnmp_ds_set_boolean(), netsnmp_init_helpers(), NULL, setup_tree(), snmp_log(), and starttime.
- .SS "void init_snmp (const char * type)"
- .PP
- Calls the functions to do config file loading and mib module parsing in the correct order.
- .PP
- fBParameters:fP
- .RS 4
- fItypefP label for the config file 'type'
- .RE
- .PP
- fBReturns:fP
- .RS 4
- void
- .RE
- .PP
- fBSee also:fP
- .RS 4
- fBinit_agentfP
- .RE
- .PP
- .PP
- Definition at line 788 of file snmp_api.c.
- .PP
- References init_callbacks(), init_mib(), init_snmp_alarm(), init_snmp_enums(), init_snmp_logging(), netsnmp_ds_get_string(), netsnmp_ds_set_string(), read_configs(), read_premib_configs(), register_mib_handlers(), and snmp_init_statistics().
- .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.
- .PP
- 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_name1fP A pointer to the first oid.
- .br
- fIlen1fP length of the first OID (in segments, not bytes)
- .br
- fIin_name2fP A pointer to the second oid.
- .br
- fIlen2fP 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 6280 of file snmp_api.c.
- .PP
- Referenced by netsnmp_cache_find_by_oid(), netsnmp_old_api_helper(), netsnmp_subtree_free(), netsnmp_subtree_load(), netsnmp_unregister_mib_table_row(), and unregister_mib_context().
- .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.
- .PP
- fBParameters:fP
- .RS 4
- fIin_name1fP A pointer to the first oid.
- .br
- fIlen1fP Length of the first oid.
- .br
- fIin_name2fP A pointer to the second oid.
- .br
- fIlen2fP Length of the second oid.
- .RE
- .PP
- fBReturns:fP
- .RS 4
- length of largest common index of commonality. 1 = first, 0 if none * or -1 on error.
- .RE
- .PP
- .PP
- Definition at line 6336 of file snmp_api.c.
- .PP
- References SNMP_MIN.
- .PP
- Referenced by netsnmp_add_varbind_to_cache().
- .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.
- .PP
- Functionally, this determines if in_name2 is equal or a subtree of in_name1
- .PP
- fBParameters:fP
- .RS 4
- fIin_name1fP A pointer to the first oid.
- .br
- fIlen1fP length of the first OID (in segments, not bytes)
- .br
- fIin_name2fP A pointer to the second oid.
- .br
- fIlen2fP 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 6316 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.
- .PP
- 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 6212 of file snmp_api.c.
- .PP
- Referenced by check_getnext_results(), convert_v2pdu_to_v1(), find_varbind_in_list(), lookup_cache_find(), netsnmp_check_getnext_reply(), netsnmp_insert_iterator_context(), netsnmp_insert_table_row(), netsnmp_instance_helper_handler(), netsnmp_row_merge_helper_handler(), netsnmp_scalar_group_helper_handler(), netsnmp_scalar_helper_handler(), netsnmp_send_traps(), netsnmp_subtree_compare(), netsnmp_subtree_find(), netsnmp_subtree_find_next(), netsnmp_subtree_find_prev(), netsnmp_subtree_load(), netsnmp_subtree_split(), netsnmp_table_data_add_row(), netsnmp_table_data_get_from_oid(), netsnmp_table_data_helper_handler(), netsnmp_table_iterator_helper_handler(), netsnmp_watched_spinlock_handler(), netsnmp_watched_timestamp_handler(), netsnmp_watcher_helper_handler(), snmp_oidtree_compare(), and table_helper_handler().
- .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.
- .PP
- fBParameters:fP
- .RS 4
- fIin_name1fP A pointer to the first oid.
- .br
- fIlen1fP length of the first OID (in segments, not bytes)
- .br
- fIin_name2fP A pointer to the second oid.
- .br
- fIlen2fP 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 6261 of file snmp_api.c.
- .PP
- References snmp_oid_compare().
- .SS "void snmp_shutdown (const char * type)"
- .PP
- Shuts down the application, saving any needed persistent storage, and appropriate clean up.
- .PP
- fBParameters:fP
- .RS 4
- fItypefP Label for the config file 'type' used
- .RE
- .PP
- fBReturns:fP
- .RS 4
- void
- .RE
- .PP
- .PP
- Definition at line 856 of file snmp_api.c.
- .PP
- References clear_callback(), netsnmp_ds_shutdown(), NULL, shutdown_mib(), snmp_alarm_unregister_all(), snmp_call_callbacks(), snmp_close_sessions(), snmp_store(), and unregister_all_config_handlers().
- .SS "int snmpv3_engineID_probe (struct fBsession_listfP * slp, fBnetsnmp_sessionfP * in_session)"
- .PP
- probe for peer engineID
- .PP
- fBParameters:fP
- .RS 4
- fIslpfP session list pointer.
- .br
- fIin_sessionfP session for errors
- .RE
- .PP
- fBNote:fP
- .RS 4
- .IP "(bu" 2
- called by _sess_open(), fBsnmp_sess_add_ex()fP
- .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 1272 of file snmp_api.c.
- .PP
- References create_user_from_session(), snmp_session::engineBoots, snmp_session::engineTime, snmp_session::flags, NULL, snmp_session::s_snmp_errno, snmp_session::securityEngineID, snmp_session::securityEngineIDLen, session_list::session, snmp_api_errstring(), snmp_errstring(), snmp_sess_synch_response(), TRUE, and snmp_session::version.
- .PP
- Referenced by snmp_sess_add_ex().