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.

66 lines
1.6 KiB

  1. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  2. /*--------------------------------------------------
  3. Filename: session.hpp
  4. Author: B.Rajeev
  5. Purpose: Provides declarations for the ErrorInfo and
  6. the SessionSentStateStore classes
  7. --------------------------------------------------*/
  8. #ifndef __SESSION_SENT_STATE_STORE
  9. #define __SESSION_SENT_STATE_STORE
  10. #include "common.h"
  11. #include "forward.h"
  12. // encapsulates the state information required to inform the SnmpOperation
  13. // of any errors in an attempt to transmit (ex. unable to encode the
  14. // security context)
  15. class ErrorInfo
  16. {
  17. SnmpOperation *operation;
  18. SnmpErrorReport error_report;
  19. public:
  20. ErrorInfo(SnmpOperation &operation, IN const SnmpErrorReport &error_report)
  21. : operation(&operation), error_report(error_report)
  22. {}
  23. SnmpOperation *GetOperation(void)
  24. {
  25. return operation;
  26. }
  27. SnmpErrorReport GetErrorReport(void)
  28. {
  29. return error_report;
  30. }
  31. };
  32. // stores the ErrorInfo data structure for frames that errored in
  33. // an attempt to transmit
  34. class SessionSentStateStore
  35. {
  36. typedef CMap<SessionFrameId, SessionFrameId, ErrorInfo *, ErrorInfo *> Store;
  37. Store store;
  38. public:
  39. // makes a copy of the error report for storage
  40. void Register(IN SessionFrameId id,
  41. IN SnmpOperation &operation,
  42. IN const SnmpErrorReport &error_report);
  43. SnmpErrorReport Remove(IN SessionFrameId id, OUT SnmpOperation *&operation);
  44. void Remove(IN SessionFrameId id);
  45. ~SessionSentStateStore(void);
  46. };
  47. #endif // __SESSION_SENT_STATE_STORE