netsnmp_snmp_alarm.3
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:6k
- .TH "generic library based alarm timers for various parts of an application" 3 "28 Nov 2005" "Version 5.2.1.rc3" "net-snmp" " -*- nroff -*-
- .ad l
- .nh
- .SH NAME
- generic library based alarm timers for various parts of an application -
- .SS "Functions"
- .in +1c
- .ti -1c
- .RI "int fBinit_alarm_post_configfP (int majorid, int minorid, void *serverarg, void *clientarg)"
- .br
- .ti -1c
- .RI "void fBinit_snmp_alarmfP (void)"
- .br
- .ti -1c
- .RI "void fBsa_update_entryfP (struct fBsnmp_alarmfP *a)"
- .br
- .ti -1c
- .RI "void fBsnmp_alarm_unregisterfP (unsigned int clientreg)"
- .br
- .RI "fIThis function removes the callback function from a list of registered alarms, unregistering the alarm. fP"
- .ti -1c
- .RI "void fBsnmp_alarm_unregister_allfP (void)"
- .br
- .RI "fIThis function unregisters all alarms currently stored. fP"
- .ti -1c
- .RI "fBsnmp_alarmfP * fBsa_find_nextfP (void)"
- .br
- .ti -1c
- .RI "fBsnmp_alarmfP * fBsa_find_specificfP (unsigned int clientreg)"
- .br
- .ti -1c
- .RI "void fBrun_alarmsfP (void)"
- .br
- .ti -1c
- .RI "RETSIGTYPE fBalarm_handlerfP (int a)"
- .br
- .ti -1c
- .RI "int fBget_next_alarm_delay_timefP (struct timeval *delta)"
- .br
- .ti -1c
- .RI "void fBset_an_alarmfP (void)"
- .br
- .ti -1c
- .RI "unsigned int fBsnmp_alarm_registerfP (unsigned int when, unsigned int flags, SNMPAlarmCallback *thecallback, void *clientarg)"
- .br
- .RI "fIThis function registers function callbacks to occur at a speciifc time in the future. fP"
- .ti -1c
- .RI "unsigned int fBsnmp_alarm_register_hrfP (struct timeval t, unsigned int flags, SNMPAlarmCallback *cb, void *cd)"
- .br
- .RI "fIThis function offers finer granularity as to when the callback function is called by making use of t->tv_usec value forming the 'when' aspect of fBsnmp_alarm_register()fP. fP"
- .in -1c
- .SH "Function Documentation"
- .PP
- .SS "unsigned int snmp_alarm_register (unsigned int when, unsigned int flags, SNMPAlarmCallback * thecallback, void * clientarg)"
- .PP
- This function registers function callbacks to occur at a speciifc time in the future.
- .PP
- fBParameters:fP
- .RS 4
- fIwhenfP is an unsigned integer specifying when the callback function will be called in seconds.
- .br
- fIflagsfP is an unsigned integer that specifies how frequent the callback function is called in seconds. Should be SA_REPEAT or 0. If flags is set with SA_REPEAT, then the registered callback function will be called every SA_REPEAT seconds. If flags is 0 then the function will only be called once and then removed from the registered alarm list.
- .br
- fIthecallbackfP is a pointer SNMPAlarmCallback which is the callback function being stored and registered.
- .br
- fIclientargfP is a void pointer used by the callback function. This pointer is assigned to snmp_alarm->clientarg and passed into the callback function for the client's specifc needs.
- .RE
- .PP
- fBReturns:fP
- .RS 4
- Returns a unique unsigned integer(which is also passed as the first argument of each callback), which can then be used to remove the callback from the list at a later point in the future using the fBsnmp_alarm_unregister()fP function. If memory could not be allocated for the fBsnmp_alarmfP struct 0 is returned.
- .RE
- .PP
- fBSee also:fP
- .RS 4
- fBsnmp_alarm_unregisterfP
- .PP
- fBsnmp_alarm_register_hrfP
- .PP
- fBsnmp_alarm_unregister_allfP
- .RE
- .PP
- .PP
- fBExamples: fP
- .in +1c
- fBdelayed_instance.cfP, and fBnotification.cfP.
- .PP
- Definition at line 403 of file snmp_alarm.c.
- .PP
- References NULL, sa_update_entry(), set_an_alarm(), and SNMP_MALLOC_STRUCT.
- .PP
- Referenced by netsnmp_cache_timer_start(), and release_cached_resources().
- .SS "unsigned int snmp_alarm_register_hr (struct timeval t, unsigned int flags, SNMPAlarmCallback * cb, void * cd)"
- .PP
- This function offers finer granularity as to when the callback function is called by making use of t->tv_usec value forming the 'when' aspect of fBsnmp_alarm_register()fP.
- .PP
- fBParameters:fP
- .RS 4
- fItfP is a timeval structure used to specify when the callback function(alarm) will be called. Adds the ability to specify microseconds. t.tv_sec and t.tv_usec are assigned to snmp_alarm->tv_sec and snmp_alarm->tv_usec respectively internally. The snmp_alarm_register function only assigns seconds(it's when argument).
- .br
- fIflagsfP is an unsigned integer that specifies how frequent the callback function is called in seconds. Should be SA_REPEAT or NULL. If flags is set with SA_REPEAT, then the registered callback function will be called every SA_REPEAT seconds. If flags is NULL then the function will only be called once and then removed from the registered alarm list.
- .br
- fIcbfP is a pointer SNMPAlarmCallback which is the callback function being stored and registered.
- .br
- fIcdfP is a void pointer used by the callback function. This pointer is assigned to snmp_alarm->clientarg and passed into the callback function for the client's specifc needs.
- .RE
- .PP
- fBReturns:fP
- .RS 4
- Returns a unique unsigned integer(which is also passed as the first argument of each callback), which can then be used to remove the callback from the list at a later point in the future using the fBsnmp_alarm_unregister()fP function. If memory could not be allocated for the fBsnmp_alarmfP struct 0 is returned.
- .RE
- .PP
- fBSee also:fP
- .RS 4
- fBsnmp_alarm_registerfP
- .PP
- fBsnmp_alarm_unregisterfP
- .PP
- fBsnmp_alarm_unregister_allfP
- .RE
- .PP
- .PP
- Definition at line 475 of file snmp_alarm.c.
- .PP
- References NULL, sa_update_entry(), set_an_alarm(), and SNMP_MALLOC_STRUCT.
- .SS "void snmp_alarm_unregister (unsigned int clientreg)"
- .PP
- This function removes the callback function from a list of registered alarms, unregistering the alarm.
- .PP
- fBParameters:fP
- .RS 4
- fIclientregfP is a unique unsigned integer representing a registered alarm which the client wants to unregister.
- .RE
- .PP
- fBReturns:fP
- .RS 4
- void
- .RE
- .PP
- fBSee also:fP
- .RS 4
- fBsnmp_alarm_registerfP
- .PP
- fBsnmp_alarm_register_hrfP
- .PP
- fBsnmp_alarm_unregister_allfP
- .RE
- .PP
- .PP
- Definition at line 150 of file snmp_alarm.c.
- .PP
- References clientreg, next, and NULL.
- .PP
- Referenced by netsnmp_cache_timer_stop(), and sa_update_entry().
- .SS "void snmp_alarm_unregister_all (void)"
- .PP
- This function unregisters all alarms currently stored.
- .PP
- fBReturns:fP
- .RS 4
- void
- .RE
- .PP
- fBSee also:fP
- .RS 4
- fBsnmp_alarm_registerfP
- .PP
- fBsnmp_alarm_register_hrfP
- .PP
- fBsnmp_alarm_unregisterfP
- .RE
- .PP
- .PP
- Definition at line 183 of file snmp_alarm.c.
- .PP
- References next, and NULL.
- .PP
- Referenced by snmp_shutdown().