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.

90 lines
1.9 KiB

  1. //***************************************************************************
  2. //
  3. // File:
  4. //
  5. // Module: MS SNMP Provider
  6. //
  7. // Purpose:
  8. //
  9. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  10. //
  11. //***************************************************************************
  12. /*--------------------------------------------------
  13. Filename: ophelp.hpp
  14. Author: B.Rajeev
  15. Purpose: Provides declarations for the OperationHelper class
  16. --------------------------------------------------*/
  17. #ifndef __OPERATION_HELPER__
  18. #define __OPERATION_HELPER__
  19. #include "forward.h"
  20. // The only purpose of this class is to hide the winsnmp
  21. // typedefs in its method parameters from the file providing
  22. // operation class declaration
  23. class OperationHelper
  24. {
  25. SnmpOperation &operation;
  26. public:
  27. OperationHelper(IN SnmpOperation &operation)
  28. : operation(operation)
  29. {}
  30. // calls the session to transmit the frame
  31. void TransmitFrame (
  32. OUT SessionFrameId &session_frame_id,
  33. VBList &vbl
  34. );
  35. void ReceiveResponse (
  36. ULONG var_index,
  37. SnmpVarBindList &sent_var_bind_list,
  38. SnmpVarBindList &received_var_bind_list,
  39. SnmpErrorReport &error_report
  40. );
  41. // processes the response (successful or otherwise) for the specified
  42. // frame. the frame may be retransmitted in case of a reply bearing
  43. // an errored index
  44. void ProcessResponse (
  45. FrameState *frame_state,
  46. SnmpVarBindList &a_SnmpVarBindList ,
  47. SnmpErrorReport &error_report
  48. );
  49. //static functions which turn WINSNMP objects into SNMPCL objects.
  50. //these helper functions are static so that they may be used elsewhere.
  51. static SnmpVarBind *GetVarBind(
  52. IN smiOID &instance,
  53. IN smiVALUE &value
  54. );
  55. static SnmpTransportAddress *GetTransportAddress(
  56. IN HSNMP_ENTITY &haddr
  57. );
  58. static SnmpSecurity *GetSecurityContext(
  59. IN HSNMP_CONTEXT &hctxt
  60. );
  61. };
  62. #endif // __OPERATION_HELPER__