Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. Revision history:
  6. --*/
  7. #include <snmp.h>
  8. #include <snmpexts.h>
  9. #include "mibentry.h"
  10. SnmpTfxHandle g_tfxHandle;
  11. PSNMP_MGMTVARS ge_pMgmtVars;
  12. BOOL
  13. SnmpExtensionInit(
  14. IN DWORD uptimeReference,
  15. OUT HANDLE * lpPollForTrapEvent,
  16. OUT AsnObjectIdentifier * lpFirstSupportedView)
  17. {
  18. g_tfxHandle = SnmpTfxOpen(1,&view_snmp);
  19. if (g_tfxHandle == NULL)
  20. return FALSE;
  21. *lpFirstSupportedView = view_snmp.viewOid;
  22. *lpPollForTrapEvent = NULL;
  23. return TRUE;
  24. }
  25. // the SNMP master agent calls this function immediately after SnmpExtensionInit
  26. // in order to provide a pointer to the internal service management information.
  27. // No mutex protection is needed so far, as there is no concurrency in writing the
  28. // buffer pointed by this parameter.
  29. BOOL
  30. SnmpExtensionMonitor(
  31. IN LPVOID pAgentMgmtVars)
  32. {
  33. ge_pMgmtVars = (PSNMP_MGMTVARS)pAgentMgmtVars;
  34. return TRUE;
  35. }
  36. BOOL
  37. SnmpExtensionQuery(
  38. IN BYTE requestType,
  39. IN OUT RFC1157VarBindList * variableBindings,
  40. OUT AsnInteger * errorStatus,
  41. OUT AsnInteger * errorIndex)
  42. {
  43. // forward to framework
  44. return SnmpTfxQuery(
  45. g_tfxHandle,
  46. requestType,
  47. variableBindings,
  48. errorStatus,
  49. errorIndex);
  50. }
  51. BOOL
  52. SnmpExtensionTrap(
  53. OUT AsnObjectIdentifier *enterprise,
  54. OUT AsnInteger *genericTrap,
  55. OUT AsnInteger *specificTrap,
  56. OUT AsnTimeticks *timeStamp,
  57. OUT RFC1157VarBindList *variableBindings)
  58. {
  59. // no traps
  60. return FALSE;
  61. }
  62. BOOL WINAPI
  63. DllMain(
  64. HINSTANCE hInstDLL,
  65. DWORD fdwReason,
  66. LPVOID pReserved)
  67. {
  68. switch ( fdwReason )
  69. {
  70. case DLL_PROCESS_ATTACH :
  71. DisableThreadLibraryCalls( hInstDLL );
  72. break;
  73. case DLL_PROCESS_DETACH :
  74. break;
  75. default :
  76. break;
  77. }
  78. return TRUE;
  79. }