Leaked source code of windows server 2003
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.

154 lines
3.4 KiB

  1. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  2. #ifndef __SNMPNEXT_H
  3. #define __SNMPNEXT_H
  4. class PropertyDefinition
  5. {
  6. private:
  7. protected:
  8. public:
  9. WbemSnmpProperty *m_Property ;
  10. ULONG m_KeyCount ;
  11. SnmpObjectIdentifier **m_ObjectIdentifierComponent ;
  12. SnmpObjectIdentifier **m_ObjectIdentifierStart ;
  13. SnmpObjectIdentifier **m_ObjectIdentifierEnd ;
  14. ULONG *m_PartitionIndex ;
  15. PartitionSet **m_KeyPartition ;
  16. public:
  17. PropertyDefinition ()
  18. {
  19. m_KeyCount = 0 ;
  20. m_Property = NULL ;
  21. m_ObjectIdentifierStart = NULL ;
  22. m_ObjectIdentifierEnd = NULL ;
  23. m_KeyPartition = NULL ;
  24. m_PartitionIndex = NULL ;
  25. m_ObjectIdentifierComponent = NULL ;
  26. }
  27. ~PropertyDefinition ()
  28. {
  29. for ( ULONG t_Index = 1 ; t_Index <= m_KeyCount ; t_Index ++ )
  30. {
  31. if ( m_ObjectIdentifierStart )
  32. delete m_ObjectIdentifierStart [ t_Index ] ;
  33. if ( m_ObjectIdentifierEnd )
  34. delete m_ObjectIdentifierEnd [ t_Index ] ;
  35. if ( m_ObjectIdentifierComponent )
  36. delete m_ObjectIdentifierComponent [ t_Index ] ;
  37. }
  38. delete [] m_ObjectIdentifierStart ;
  39. delete [] m_ObjectIdentifierEnd ;
  40. delete [] m_ObjectIdentifierComponent ;
  41. delete [] m_KeyPartition ;
  42. delete [] m_PartitionIndex ;
  43. }
  44. } ;
  45. class AutoRetrieveOperation : public SnmpAutoRetrieveOperation
  46. {
  47. private:
  48. PropertyDefinition *m_PropertyContainer ;
  49. ULONG m_PropertyContainerLength ;
  50. BOOL virtuals ;
  51. BOOL virtualsInitialised ;
  52. ULONG varBindsReceived ;
  53. ULONG erroredVarBindsReceived ;
  54. ULONG rowsReceived ;
  55. ULONG rowVarBindsReceived ;
  56. SnmpSession *session ;
  57. SnmpInstanceResponseEventObject *eventObject ;
  58. IWbemClassObject *snmpObject ;
  59. LONG EvaluateInitialVarBind (
  60. ULONG a_PropertyIndex ,
  61. SnmpObjectIdentifier &a_CurrentIdentifier ,
  62. SnmpObjectIdentifier &a_StartIdentifier
  63. ) ;
  64. LONG EvaluateSubsequentVarBind (
  65. ULONG a_PropertyIndex ,
  66. IN ULONG &a_CurrentIndex ,
  67. SnmpObjectIdentifier &a_CurrentIdentifier ,
  68. SnmpObjectIdentifier &a_StartIdentifier
  69. ) ;
  70. LONG EvaluateVarBind (
  71. ULONG a_PropertyIndex ,
  72. SnmpObjectIdentifier &a_StartIdentifier
  73. ) ;
  74. LONG EvaluateResponse (
  75. ULONG a_PropertyIndex ,
  76. IN ULONG &a_CurrentIndex ,
  77. SnmpObjectIdentifier &a_AdvanceIdentifier
  78. ) ;
  79. protected:
  80. void ReceiveResponse () ;
  81. void ReceiveRowResponse () ;
  82. void ReceiveRowVarBindResponse (
  83. IN const ULONG &var_bind_index,
  84. IN const SnmpVarBind &requestVarBind ,
  85. IN const SnmpVarBind &replyVarBind ,
  86. IN const SnmpErrorReport &error
  87. ) ;
  88. void ReceiveVarBindResponse (
  89. IN const ULONG &var_bind_index,
  90. IN const SnmpVarBind &requestVarBind ,
  91. IN const SnmpVarBind &replyVarBind ,
  92. IN const SnmpErrorReport &error
  93. ) ;
  94. void ReceiveErroredVarBindResponse(
  95. IN const ULONG &var_bind_index,
  96. IN const SnmpVarBind &requestVarBind ,
  97. IN const SnmpErrorReport &error
  98. ) ;
  99. LONG EvaluateNextRequest (
  100. IN const ULONG &var_bind_index,
  101. IN const SnmpVarBind &requestVarBind ,
  102. IN const SnmpVarBind &replyVarBind ,
  103. IN SnmpVarBind &sendVarBind
  104. ) ;
  105. void FrameTooBig() ;
  106. void FrameOverRun() ;
  107. public:
  108. AutoRetrieveOperation (IN SnmpSession &session, IN SnmpInstanceResponseEventObject *eventObjectArg ) ;
  109. ~AutoRetrieveOperation () ;
  110. void Send () ;
  111. void DestroyOperation () { SnmpAutoRetrieveOperation :: DestroyOperation () ; }
  112. };
  113. #endif // __SNMPNEXT_H