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.

67 lines
1.7 KiB

  1. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  2. /*-------------------------------------------------
  3. filename: vbl.hpp
  4. author: B.Rajeev
  5. purpose: To provide declarations for the VBList class.
  6. It encapsulates an association between a
  7. VarBindList and a winSNMP VBL.
  8. ------------------------------------------------*/
  9. #ifndef __VBL__
  10. #define __VBL__
  11. #include "forward.h"
  12. #include "encap.h"
  13. #include "common.h"
  14. #include "encdec.h"
  15. #include "vblist.h"
  16. #define WinSNMPSession HSNMP_SESSION
  17. // Given a var_bind_list creates a WinSnmpVbl. It supports deletion
  18. // of variable bindings by their index. This deletes the
  19. // binding from both var_bind_list and the WinSnmpVbl.
  20. // It also allows direct access to the var_bind_list and the WinSnmpVbl
  21. // for convenience
  22. class VBList
  23. {
  24. ULONG m_Index ;
  25. SnmpVarBindList *var_bind_list;
  26. public:
  27. VBList (
  28. IN SnmpEncodeDecode &a_SnmpEncodeDecode ,
  29. IN SnmpVarBindList &var_bind_list,
  30. IN ULONG index
  31. );
  32. ~VBList(void);
  33. // the two Get functions provide direct access to the
  34. // VarBindList and the WinSnmpVbl
  35. SnmpVarBindList &GetVarBindList(void) { return *var_bind_list; }
  36. ULONG GetIndex () { return m_Index ; }
  37. // deletes the specified variable binding from both the
  38. // var_bind_list and the WinSnmpVbl. returns a copy of the
  39. // deleted VarBind
  40. SnmpVarBind *Remove(IN UINT vbl_index);
  41. // gets the specified variable binding from both the
  42. // var_bind_list and the WinSnmpVbl. returns a copy of the
  43. // deleted VarBind
  44. SnmpVarBind *Get (IN UINT vbl_index);
  45. // deletes the specified variable binding from both the
  46. // var_bind_list and the WinSnmpVbl.
  47. void Delete (IN UINT vbl_index);
  48. };
  49. #endif // __VBL__