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.

101 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1992-1997 Microsoft Corporation
  3. Module Name:
  4. snmppdus.h
  5. Abstract:
  6. Contains definitions for manipulating SNMP PDUs.
  7. Environment:
  8. User Mode - Win32
  9. Revision History:
  10. 10-Feb-1997 DonRyan
  11. Rewrote to implement SNMPv2 support.
  12. --*/
  13. #ifndef _SNMPPDUS_H_
  14. #define _SNMPPDUS_H_
  15. ///////////////////////////////////////////////////////////////////////////////
  16. // //
  17. // Public definitions //
  18. // //
  19. ///////////////////////////////////////////////////////////////////////////////
  20. typedef struct _NORMAL_PDU {
  21. AsnInteger32 nRequestId;
  22. AsnInteger32 nErrorStatus;
  23. AsnInteger32 nErrorIndex;
  24. } NORMAL_PDU, *PNORMAL_PDU;
  25. typedef struct _BULK_PDU {
  26. AsnInteger32 nRequestId;
  27. AsnInteger32 nErrorStatus;
  28. AsnInteger32 nErrorIndex;
  29. AsnInteger32 nNonRepeaters;
  30. AsnInteger32 nMaxRepetitions;
  31. } BULK_PDU, *PBULK_PDU;
  32. typedef struct _TRAP_PDU {
  33. AsnObjectIdentifier EnterpriseOid;
  34. AsnIPAddress AgentAddr;
  35. AsnInteger32 nGenericTrap;
  36. AsnInteger32 nSpecificTrap;
  37. AsnTimeticks nTimeticks;
  38. } TRAP_PDU, *PTRAP_PDU;
  39. typedef struct _SNMP_PDU {
  40. UINT nType;
  41. SnmpVarBindList Vbl;
  42. union {
  43. TRAP_PDU TrapPdu;
  44. BULK_PDU BulkPdu;
  45. NORMAL_PDU NormPdu;
  46. } Pdu;
  47. } SNMP_PDU, *PSNMP_PDU;
  48. #define SNMP_VERSION_1 0
  49. #define SNMP_VERSION_2C 1
  50. ///////////////////////////////////////////////////////////////////////////////
  51. // //
  52. // Public prototypes //
  53. // //
  54. ///////////////////////////////////////////////////////////////////////////////
  55. BOOL
  56. BuildMessage(
  57. AsnInteger32 nVersion,
  58. AsnOctetString * pCommunity,
  59. PSNMP_PDU pPdu,
  60. PBYTE pMessage,
  61. PDWORD pMessageSize
  62. );
  63. BOOL
  64. ParseMessage(
  65. AsnInteger32 * pVersion,
  66. AsnOctetString * pCommunity,
  67. PSNMP_PDU pPdu,
  68. PBYTE pMessage,
  69. DWORD dwMessageSize
  70. );
  71. #endif // _SNMPPDUS_H_