netsnmp_agent_registry.3
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:12k
源码类别:
SNMP编程
开发平台:
Unix_Linux
- .TH "Maintain a registry of MIB subtrees, together with related information regarding mibmodule, sessions, etc" 3 "28 Nov 2005" "Version 5.2.1.rc3" "net-snmp" " -*- nroff -*-
- .ad l
- .nh
- .SH NAME
- Maintain a registry of MIB subtrees, together with related information regarding mibmodule, sessions, etc -
- .SS "Data Structures"
- .in +1c
- .ti -1c
- .RI "struct fBlookup_cache_sfP"
- .br
- .ti -1c
- .RI "struct fBlookup_cache_context_sfP"
- .br
- .in -1c
- .SS "Defines"
- .in +1c
- .ti -1c
- .RI "#define fBIN_SNMP_VARS_CfP"
- .br
- .ti -1c
- .RI "#define fBSUBTREE_DEFAULT_CACHE_SIZEfP 8"
- .br
- .ti -1c
- .RI "#define fBSUBTREE_MAX_CACHE_SIZEfP 32"
- .br
- .in -1c
- .SS "Typedefs"
- .in +1c
- .ti -1c
- .RI "typedef fBlookup_cache_sfP fBlookup_cachefP"
- .br
- .ti -1c
- .RI "typedef fBlookup_cache_context_sfP fBlookup_cache_contextfP"
- .br
- .in -1c
- .SS "Functions"
- .in +1c
- .ti -1c
- .RI "NETSNMP_STATIC_INLINE void fBinvalidate_lookup_cachefP (const char *context)"
- .br
- .ti -1c
- .RI "void fBnetsnmp_set_lookup_cache_sizefP (int newsize)"
- .br
- .RI "fIset the lookup cache size for optimized agent registration performance. fP"
- .ti -1c
- .RI "int fBnetsnmp_get_lookup_cache_sizefP (void)"
- .br
- .RI "fIretrieves the current value of the lookup cache size fP"
- .ti -1c
- .RI "void fBnetsnmp_subtree_freefP (fBnetsnmp_subtreefP *a)"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBnetsnmp_subtree_deepcopyfP (fBnetsnmp_subtreefP *a)"
- .br
- .ti -1c
- .RI "fBsubtree_context_cachefP * fBget_top_context_cachefP (void)"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBnetsnmp_subtree_find_firstfP (const char *context_name)"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBadd_subtreefP (fBnetsnmp_subtreefP *new_tree, const char *context_name)"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBnetsnmp_subtree_replace_firstfP (fBnetsnmp_subtreefP *new_tree, const char *context_name)"
- .br
- .ti -1c
- .RI "int fBnetsnmp_subtree_comparefP (const fBnetsnmp_subtreefP *ap, const fBnetsnmp_subtreefP *bp)"
- .br
- .ti -1c
- .RI "void fBnetsnmp_subtree_joinfP (fBnetsnmp_subtreefP *root)"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBnetsnmp_subtree_splitfP (fBnetsnmp_subtreefP *current, oid name[], int name_len)"
- .br
- .ti -1c
- .RI "int fBnetsnmp_subtree_loadfP (fBnetsnmp_subtreefP *new_sub, const char *context_name)"
- .br
- .ti -1c
- .RI "int fBnetsnmp_register_mibfP (const char *moduleName, struct fBvariablefP *var, size_t varsize, size_t numvars, oid *mibloc, size_t mibloclen, int priority, int range_subid, oid range_ubound, fBnetsnmp_sessionfP *ss, const char *context, int timeout, int flags, fBnetsnmp_handler_registrationfP *reginfo, int perform_callback)"
- .br
- .ti -1c
- .RI "void fBregister_mib_reattachfP (void)"
- .br
- .ti -1c
- .RI "void fBregister_mib_detachfP (void)"
- .br
- .ti -1c
- .RI "int fBregister_mib_contextfP (const char *moduleName, struct fBvariablefP *var, size_t varsize, size_t numvars, oid *mibloc, size_t mibloclen, int priority, int range_subid, oid range_ubound, fBnetsnmp_sessionfP *ss, const char *context, int timeout, int flags)"
- .br
- .ti -1c
- .RI "int fBregister_mib_rangefP (const char *moduleName, struct fBvariablefP *var, size_t varsize, size_t numvars, oid *mibloc, size_t mibloclen, int priority, int range_subid, oid range_ubound, fBnetsnmp_sessionfP *ss)"
- .br
- .ti -1c
- .RI "int fBregister_mib_priorityfP (const char *moduleName, struct fBvariablefP *var, size_t varsize, size_t numvars, oid *mibloc, size_t mibloclen, int priority)"
- .br
- .ti -1c
- .RI "int fBregister_mibfP (const char *moduleName, struct fBvariablefP *var, size_t varsize, size_t numvars, oid *mibloc, size_t mibloclen)"
- .br
- .ti -1c
- .RI "void fBnetsnmp_subtree_unloadfP (fBnetsnmp_subtreefP *sub, fBnetsnmp_subtreefP *prev, const char *context)"
- .br
- .ti -1c
- .RI "int fBunregister_mib_contextfP (oid *name, size_t len, int priority, int range_subid, oid range_ubound, const char *context)"
- .br
- .RI "fIUnregisters an OID that has an associated context name value. fP"
- .ti -1c
- .RI "int fBnetsnmp_unregister_mib_table_rowfP (oid *name, size_t len, int priority, int var_subid, oid range_ubound, const char *context)"
- .br
- .ti -1c
- .RI "int fBunregister_mib_rangefP (oid *name, size_t len, int priority, int range_subid, oid range_ubound)"
- .br
- .ti -1c
- .RI "int fBunregister_mib_priorityfP (oid *name, size_t len, int priority)"
- .br
- .ti -1c
- .RI "int fBunregister_mibfP (oid *name, size_t len)"
- .br
- .ti -1c
- .RI "void fBunregister_mibs_by_sessionfP (fBnetsnmp_sessionfP *ss)"
- .br
- .ti -1c
- .RI "int fBin_a_viewfP (oid *name, size_t *namelen, fBnetsnmp_pdufP *pdu, int type)"
- .br
- .ti -1c
- .RI "int fBcheck_accessfP (fBnetsnmp_pdufP *pdu)"
- .br
- .ti -1c
- .RI "int fBnetsnmp_acm_check_subtreefP (fBnetsnmp_pdufP *pdu, oid *name, size_t namelen)"
- .br
- .RI "fIchecks to see if everything within a given subtree is either: in view, not in view, or possibly both. fP"
- .ti -1c
- .RI "NETSNMP_STATIC_INLINE fBlookup_cache_contextfP * fBget_context_lookup_cachefP (const char *context)"
- .br
- .ti -1c
- .RI "NETSNMP_STATIC_INLINE void fBlookup_cache_addfP (const char *context, fBnetsnmp_subtreefP *next, fBnetsnmp_subtreefP *previous)"
- .br
- .ti -1c
- .RI "NETSNMP_STATIC_INLINE void fBlookup_cache_replacefP (fBlookup_cachefP *ptr, fBnetsnmp_subtreefP *next, fBnetsnmp_subtreefP *previous)"
- .br
- .ti -1c
- .RI "NETSNMP_STATIC_INLINE fBlookup_cachefP * fBlookup_cache_findfP (const char *context, oid *name, size_t name_len, int *retcmp)"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBnetsnmp_subtree_find_prevfP (oid *name, size_t len, fBnetsnmp_subtreefP *subtree, const char *context_name)"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBnetsnmp_subtree_find_nextfP (oid *name, size_t len, fBnetsnmp_subtreefP *subtree, const char *context_name)"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBnetsnmp_subtree_findfP (oid *name, size_t len, fBnetsnmp_subtreefP *subtree, const char *context_name)"
- .br
- .ti -1c
- .RI "fBnetsnmp_sessionfP * fBget_session_for_oidfP (oid *name, size_t len, const char *context_name)"
- .br
- .ti -1c
- .RI "void fBsetup_treefP (void)"
- .br
- .ti -1c
- .RI "int fBremove_tree_entryfP (oid *name, size_t len)"
- .br
- .ti -1c
- .RI "void fBshutdown_treefP (void)"
- .br
- .ti -1c
- .RI "void fBclear_subtreefP (fBnetsnmp_subtreefP *sub)"
- .br
- .ti -1c
- .RI "void fBclear_lookup_cachefP (void)"
- .br
- .ti -1c
- .RI "void fBclear_contextfP (void)"
- .br
- .ti -1c
- .RI "void fBdump_idx_registryfP (void)"
- .br
- .ti -1c
- .RI "void fBdump_registryfP (void)"
- .br
- .ti -1c
- .RI "int fBregister_readfdfP (int fd, void(*func)(int, void *), void *data)"
- .br
- .ti -1c
- .RI "int fBregister_writefdfP (int fd, void(*func)(int, void *), void *data)"
- .br
- .ti -1c
- .RI "int fBregister_exceptfdfP (int fd, void(*func)(int, void *), void *data)"
- .br
- .ti -1c
- .RI "int fBunregister_readfdfP (int fd)"
- .br
- .ti -1c
- .RI "int fBunregister_writefdfP (int fd)"
- .br
- .ti -1c
- .RI "int fBunregister_exceptfdfP (int fd)"
- .br
- .ti -1c
- .RI "RETSIGTYPE fBagent_SIGCHLD_handlerfP (int sig)"
- .br
- .ti -1c
- .RI "int fBregister_signalfP (int sig, void(*func)(int))"
- .br
- .ti -1c
- .RI "int fBunregister_signalfP (int sig)"
- .br
- .in -1c
- .SS "Variables"
- .in +1c
- .ti -1c
- .RI "fBsubtree_context_cachefP * fBcontext_subtreesfP = NULL"
- .br
- .ti -1c
- .RI "int fBlookup_cache_sizefP = 0"
- .br
- .ti -1c
- .RI "fBnetsnmp_subtreefP * fBlookup_cache_s::previousfP"
- .br
- .ti -1c
- .RI "fBlookup_cache_context_sfP * fBlookup_cache_context_s::nextfP"
- .br
- .ti -1c
- .RI "int fBlookup_cache_context_s::thecachecountfP"
- .br
- .ti -1c
- .RI "int fBlookup_cache_context_s::currentposfP"
- .br
- .ti -1c
- .RI "fBlookup_cachefP fBlookup_cache_context_s::cachefP [SUBTREE_MAX_CACHE_SIZE]"
- .br
- .ti -1c
- .RI "int fBexternal_readfdfP [NUM_EXTERNAL_FDS]"
- .br
- .ti -1c
- .RI "int fBexternal_readfdlenfP = 0"
- .br
- .ti -1c
- .RI "int fBexternal_writefdfP [NUM_EXTERNAL_FDS]"
- .br
- .ti -1c
- .RI "int fBexternal_writefdlenfP = 0"
- .br
- .ti -1c
- .RI "int fBexternal_exceptfdfP [NUM_EXTERNAL_FDS]"
- .br
- .ti -1c
- .RI "int fBexternal_exceptfdlenfP = 0"
- .br
- .ti -1c
- .RI "void(* fBexternal_readfdfuncfP [NUM_EXTERNAL_FDS])(int, void *)"
- .br
- .ti -1c
- .RI "void(* fBexternal_writefdfuncfP [NUM_EXTERNAL_FDS])(int, void *)"
- .br
- .ti -1c
- .RI "void(* fBexternal_exceptfdfuncfP [NUM_EXTERNAL_FDS])(int, void *)"
- .br
- .ti -1c
- .RI "void * fBexternal_readfd_datafP [NUM_EXTERNAL_FDS]"
- .br
- .ti -1c
- .RI "void * fBexternal_writefd_datafP [NUM_EXTERNAL_FDS]"
- .br
- .ti -1c
- .RI "void * fBexternal_exceptfd_datafP [NUM_EXTERNAL_FDS]"
- .br
- .ti -1c
- .RI "int fBexternal_signal_scheduledfP [NUM_EXTERNAL_SIGS]"
- .br
- .ti -1c
- .RI "void(* fBexternal_signal_handlerfP [NUM_EXTERNAL_SIGS])(int)"
- .br
- .in -1c
- .SH "Function Documentation"
- .PP
- .SS "int netsnmp_acm_check_subtree (fBnetsnmp_pdufP * pdu, oid * name, size_t namelen)"
- .PP
- checks to see if everything within a given subtree is either: in view, not in view, or possibly both.
- .PP
- If the entire subtree is not-in-view we can use this information to skip calling the sub-handlers entirely.
- .PP
- fBReturns:fP
- .RS 4
- 0 if entire subtree is accessible, 5 if not and 7 if portions are both. 1 on error (illegal pdu version).
- .RE
- .PP
- .PP
- Definition at line 1265 of file agent_registry.c.
- .PP
- References view_parameters::check_subtree, view_parameters::errorcode, snmp_pdu::flags, view_parameters::name, view_parameters::namelen, view_parameters::pdu, snmp_call_callbacks(), and snmp_pdu::version.
- .PP
- Referenced by netsnmp_add_varbind_to_cache().
- .SS "int netsnmp_get_lookup_cache_size (void)"
- .PP
- retrieves the current value of the lookup cache size
- .PP
- fBReturns:fP
- .RS 4
- the current lookup cache size
- .RE
- .PP
- .PP
- Definition at line 1338 of file agent_registry.c.
- .PP
- Referenced by netsnmp_register_mib(), and unregister_mib_context().
- .SS "void netsnmp_set_lookup_cache_size (int newsize)"
- .PP
- set the lookup cache size for optimized agent registration performance.
- .PP
- fBParameters:fP
- .RS 4
- fInewsizefP set to the maximum size of a cache for a given context. Set to 0 to completely disable caching, or to -1 to set to the default cache size (8), or to a number of your chosing. The rough guide is that it should be equal to the maximum number of simultanious managers you expect to talk to the agent (M) times 80% (or so, he says randomly) the average number (N) of varbinds you expect to receive in a given request for a manager. ie, M times N. Bigger does NOT necessarily mean better. Certainly 16 should be an upper limit. 32 is the hard coded limit.
- .RE
- .PP
- .PP
- Definition at line 1325 of file agent_registry.c.
- .PP
- References SUBTREE_DEFAULT_CACHE_SIZE, and SUBTREE_MAX_CACHE_SIZE.
- .PP
- Referenced by init_master_agent(), netsnmp_register_mib(), and unregister_mib_context().
- .SS "int unregister_mib_context (oid * name, size_t len, int priority, int range_subid, oid range_ubound, const char * context)"
- .PP
- Unregisters an OID that has an associated context name value.
- .PP
- Typically used when a module has multiple contexts defined. The parameters priority, range_subid, and range_ubound should be used in conjunction with agentx, see RFC 2741, otherwise these values should always be 0.
- .PP
- fBParameters:fP
- .RS 4
- fInamefP the specific OID to unregister if it conatins the associated context.
- .br
- fIlenfP the length of the OID, use OID_LENGTH macro.
- .br
- fIpriorityfP a value between 1 and 255, used to achieve a desired configuration when different sessions register identical or overlapping regions. Subagents with no particular knowledge of priority should register with the default value of 127.
- .br
- fIrange_subidfP permits specifying a range in place of one of a subtree sub-identifiers. When this value is zero, no range is being specified.
- .br
- fIrange_uboundfP the upper bound of a sub-identifier's range. This field is present only if range_subid is not 0.
- .br
- fIcontextfP a context name that has been created
- .RE
- .PP
- fBReturns:fP
- .RS 4
- .RE
- .PP
- .PP
- Definition at line 937 of file agent_registry.c.
- .PP
- References netsnmp_subtree_s::children, invalidate_lookup_cache(), netsnmp_subtree_s::name_a, netsnmp_subtree_s::namelen, netsnmp_get_lookup_cache_size(), netsnmp_oid_equals(), netsnmp_set_lookup_cache_size(), netsnmp_subtree_find(), netsnmp_subtree_find_first(), netsnmp_subtree_free(), netsnmp_subtree_unload(), netsnmp_subtree_s::next, NULL, netsnmp_subtree_s::priority, and snmp_call_callbacks().
- .PP
- Referenced by netsnmp_register_mib(), netsnmp_unregister_handler(), remove_tree_entry(), and unregister_mib_range().