/*++ Copyright (c) 1992-1996 Microsoft Corporation Module Name: servtrap.c Abstract: Provides trap functionality for Proxy Agent. Environment: User Mode - Win32 Revision History: 10-May-1996 DonRyan Removed banner from Technology Dynamics, Inc. --*/ //--------------------------- STANDARD DEPENDENCIES -- #include ---- #include //--------------------------- MODULE DEPENDENCIES -- #include"xxxxx.h" ------ #include #include #include "regconf.h" //--------------------------- SELF-DEPENDENCY -- ONE #include"module.h" ----- //--------------------------- PUBLIC VARIABLES --(same as in module.h file)-- HANDLE hExitTrapThreadEvent; //--------------------------- PRIVATE CONSTANTS ----------------------------- #define TTWFMOTimeout ((DWORD)300000) //--------------------------- PRIVATE STRUCTS ------------------------------- //--------------------------- PRIVATE VARIABLES ----------------------------- //--------------------------- PRIVATE PROTOTYPES ---------------------------- //--------------------------- PRIVATE PROCEDURES ---------------------------- //--------------------------- PUBLIC PROCEDURES ----------------------------- VOID trapThread(VOID *threadParam) { INT eventListSize = 0; HANDLE *eventList = NULL; INT *eventListRegIndex = NULL; DWORD status; INT i; AsnObjectIdentifier enterprise; AsnInteger genericTrap; AsnInteger specificTrap; AsnInteger timeStamp; RFC1157VarBindList variableBindings; UNREFERENCED_PARAMETER(threadParam); // create an event to allow this thread to be signaled to terminate if ((hExitTrapThreadEvent = CreateEvent(NULL, TRUE, FALSE, NULL)) == NULL) { SNMPDBG((SNMP_LOG_ERROR, "SNMP: TRAP: error %d creating termination event.\n", GetLastError())); goto longBreak; } // add this thread's terminate event to the list... if ((eventList = (HANDLE *)SnmpUtilMemReAlloc(eventList, sizeof(HANDLE))) == NULL) { SNMPDBG((SNMP_LOG_ERROR, "SNMP: TRAP: out of memory.\n")); goto longBreak; } if ((eventListRegIndex = (INT *)SnmpUtilMemReAlloc(eventListRegIndex, sizeof(INT))) == NULL) { SNMPDBG((SNMP_LOG_ERROR, "SNMP: TRAP: out of memory.\n")); goto longBreak; } eventList[eventListSize] = hExitTrapThreadEvent; eventListRegIndex[eventListSize++] = -1; // not really used // add trap events for extension agents that have provided an event... for (i=0; i