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.

75 lines
1.9 KiB

  1. /*****************************************************************************
  2. *
  3. * $Workfile: StdMib.h $
  4. *
  5. * Copyright (C) 1997 Hewlett-Packard Company.
  6. * Copyright (C) 1997 Microsoft Corporation.
  7. * All rights reserved.
  8. *
  9. * 11311 Chinden Blvd.
  10. * Boise, Idaho 83714
  11. *
  12. *****************************************************************************/
  13. #ifndef INC_STDMIB_H
  14. #define INC_STDMIB_H
  15. #define IFTYPE_OTHER 1
  16. #define IFTYPE_ETHERNET 6
  17. enum SNMPCMD { SNMP_GET, // SNMP commands
  18. SNMP_WALK,
  19. SNMP_GETNEXT,
  20. SNMP_SET };
  21. class CMemoryDebug;
  22. class CTcpMib;
  23. class CStdMib
  24. #if defined _DEBUG || defined DEBUG
  25. : public CMemoryDebug
  26. #endif
  27. {
  28. public:
  29. CStdMib( CTcpMib *pParent );
  30. CStdMib(const char *pHost,
  31. const char *pszCommunity,
  32. DWORD dwDevIndex,
  33. CTcpMib *pParent );
  34. ~CStdMib();
  35. BOOL GetDeviceDescription(LPTSTR pszPortDescription, DWORD dwDescLen);
  36. DWORD GetDeviceStatus( );
  37. DWORD GetJobStatus( );
  38. DWORD GetDeviceHWAddress( LPTSTR psztHWAddress, DWORD dwSize);
  39. DWORD GetDeviceName( LPTSTR psztDescription, DWORD dwSize );
  40. BOOL TestPrinterMIB( );
  41. DWORD MapJobErrorToSpooler( const DWORD dwStatus);
  42. private: // method
  43. DWORD OIDQuery( AsnObjectIdentifier *pMibObjId,
  44. SNMPCMD eSnmpCmd);
  45. DWORD OIDQuery( RFC1157VarBindList *pVarBindList,
  46. SNMPCMD eSnmpCmd );
  47. BOOL OIDVarBindCpy( RFC1157VarBindList *pVarBindList );
  48. static BOOL GetAsnOctetString( char *pszStr,
  49. DWORD dwCount,
  50. RFC1157VarBindList *pVarBindList,
  51. UINT i);
  52. private: // attributes
  53. char m_szAgent[MAX_NETWORKNAME_LEN];
  54. char m_szCommunity[MAX_SNMP_COMMUNITY_STR_LEN];
  55. DWORD m_dwDevIndex;
  56. CTcpMib *m_pParent;
  57. RFC1157VarBindList m_VarBindList;
  58. };
  59. #endif // INC_STDMIB_H