The extensible agent calls the SnmpExtensionTrap function in the extension agent DLL to retrieve traps generated by the extension agent.
BOOL SnmpExtensionTrap(
AsnObjectIdentifier *enterprise, |
// Generating enterprise |
AsnInteger *genericTrap, |
// Generating trap type |
AsnInteger *specificTrap, |
// Enterprise specific type |
AsnTimeticks *timeStamp, |
// Time stamp |
RFC1157VarBindList *variableBindings |
// Variable bindings |
); |
Value |
Meaning |
SNMP_GENERICTRAP_COLDSTART |
The agent is initializing protocol entities on the managed mode. It may alter objects in its view. |
SNMP_GENERICTRAP_WARMSTART |
The agent is re-initializing itself but will not alter objects within its view. |
SNMP_GENERICTRAP_LINKDOWN |
An attached interface has changed from the up state to the down state. The first variable identifies the interface. |
SNMP_GENERICTRAP_LINKUP |
An attached interface has changed from the down state to the up state. The first variable identifies the interface. |
SNMP_GENERICTRAP_AUTHFAILURE |
An SNMP entity has sent an SNMP message, but has falsely claimed to belong to a known community. |
SNMP_GENERICTRAP_EGPNEIGHLOSS |
An EGP peer has changed to the down state. The first variable identifies the IP address of the EGP peer. |
SNMP_GENERICTRAP_ENTERSPECIFIC |
Signals an extraordinary event that is identified in the specific-trap parameter. |
If the SnmpExtensionTrap function returns a trap in its parameters, the return value is TRUE. Otherwise, the extensible agent repeatedly calls the function until it returns a value of FALSE.
The extensible agent repeatedly calls the SnmpExtensionTrap function once the hPollForTrapEvent event handle of the SnmpExtensionInit function has been set to the signaled state. Each successful call returns data from a single trap. It returns FALSE to indicate that its parameters do not represent valid trap data and to stop the extensible agent’s repeated calls.
The extension agent must not free the memory for the variableBindings parameter. The extensible agent automatically performs this action. Use the SnmpUtilMemAlloc function to allocate memory for each RFC1157VarBind structure.
It is important to note that earlier documentation stated that the extension agent should dynamically allocate memory for the enterprise object identifier because the extensible agent would attempt to release the memory after sending a trap. The extensible agent will not release the memory associated with the enterprise object identifier. The recommendation is that you return a pointer to a static AsnObjectIdentifier structure instead.
SetEvent, SnmpUtilMemAlloc, SnmpUtilVarBindListFree, RFC1157VarBindList, SnmpExtensionInit
file: /Techref/os/win/api/win32/func/src/f86.htm, 6KB, , updated: 2000/4/7 12:19, local time: 2024/9/5 07:26,
18.225.92.217:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/Techref/os/win/api/win32/func/src/f86.htm"> SnmpExtensionTrap</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.