Source code of Windows XP (NT5)
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.

488 lines
21 KiB

  1. /* WinSNMP.h */
  2. /* Copyright (C) 1993-1999 Microsoft Corporation */
  3. /* v1.0 - Sep 13, 1993 */
  4. /* v1.1 - Jun 12, 1994 */
  5. /* v2.0 - Nov 1, 1997 */
  6. /* - Nov 17, 1997: inc limits.h, tests for ULONG/UINT_MAX */
  7. /* - Mar 23, 1998: fixed typo in "lpClientData" */
  8. /* Questions/comments to Bob Natale, [email protected] */
  9. #ifndef _INC_WINSNMP /* Include WinSNMP declarations */
  10. #define _INC_WINSNMP /* Just once! */
  11. #if _MSC_VER > 1000
  12. #pragma once
  13. #endif
  14. #ifndef _INC_WINDOWS /* Include Windows declarations, if not already done */
  15. #include <windows.h>
  16. #define _INC_WINDOWS /* Just once! */
  17. #endif /* _INC_WINDOWS */
  18. #include <limits.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. /* WinSNMP API Type Definitions */
  23. typedef HANDLE HSNMP_SESSION, FAR *LPHSNMP_SESSION;
  24. typedef HANDLE HSNMP_ENTITY, FAR *LPHSNMP_ENTITY;
  25. typedef HANDLE HSNMP_CONTEXT, FAR *LPHSNMP_CONTEXT;
  26. typedef HANDLE HSNMP_PDU, FAR *LPHSNMP_PDU;
  27. typedef HANDLE HSNMP_VBL, FAR *LPHSNMP_VBL;
  28. typedef unsigned char smiBYTE, FAR *smiLPBYTE;
  29. /* SNMP-related types */
  30. #if ULONG_MAX == 4294967295U
  31. typedef signed long smiINT, FAR *smiLPINT;
  32. typedef smiINT smiINT32, FAR *smiLPINT32;
  33. typedef unsigned long smiUINT32, FAR *smiLPUINT32;
  34. #elif UINT_MAX == 4294967295U
  35. typedef int smiINT, FAR *smiLPINT;
  36. typedef smiINT smiINT32, FAR *smiLPINT32;
  37. typedef unsigned int smiUINT32, FAR *smiLPUINT32;
  38. #else
  39. #error can not define smiINT and smiUINT
  40. #endif
  41. typedef struct {
  42. smiUINT32 len;
  43. smiLPBYTE ptr;} smiOCTETS, FAR *smiLPOCTETS;
  44. typedef const smiOCTETS FAR *smiLPCOCTETS;
  45. typedef smiOCTETS smiBITS, FAR *smiLPBITS;
  46. typedef struct {
  47. smiUINT32 len;
  48. smiLPUINT32 ptr;} smiOID, FAR *smiLPOID;
  49. typedef const smiOID FAR *smiLPCOID;
  50. typedef smiOCTETS smiIPADDR, FAR *smiLPIPADDR;
  51. typedef smiUINT32 smiCNTR32, FAR *smiLPCNTR32;
  52. typedef smiUINT32 smiGAUGE32, FAR *smiLPGAUGE32;
  53. typedef smiUINT32 smiTIMETICKS, FAR *smiLPTIMETICKS;
  54. typedef smiOCTETS smiOPAQUE, FAR *smiLPOPAQUE;
  55. typedef smiOCTETS smiNSAPADDR, FAR *smiLPNSAPADDR;
  56. typedef struct {
  57. smiUINT32 hipart;
  58. smiUINT32 lopart;} smiCNTR64, FAR *smiLPCNTR64;
  59. /* ASN/BER Base Types */
  60. /* (used in forming SYNTAXes and certain SNMP types/values) */
  61. #define ASN_UNIVERSAL (0x00)
  62. #define ASN_APPLICATION (0x40)
  63. #define ASN_CONTEXT (0x80)
  64. #define ASN_PRIVATE (0xC0)
  65. #define ASN_PRIMITIVE (0x00)
  66. #define ASN_CONSTRUCTOR (0x20)
  67. /* SNMP ObjectSyntax Values */
  68. #define SNMP_SYNTAX_SEQUENCE (ASN_UNIVERSAL | ASN_CONSTRUCTOR | 0x10)
  69. /* These values are used in the "syntax" member of the smiVALUE structure which follows */
  70. #define SNMP_SYNTAX_INT (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x02)
  71. #define SNMP_SYNTAX_BITS (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03)
  72. #define SNMP_SYNTAX_OCTETS (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x04)
  73. #define SNMP_SYNTAX_NULL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x05)
  74. #define SNMP_SYNTAX_OID (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x06)
  75. #define SNMP_SYNTAX_INT32 SNMP_SYNTAX_INT
  76. #define SNMP_SYNTAX_IPADDR (ASN_APPLICATION | ASN_PRIMITIVE | 0x00)
  77. #define SNMP_SYNTAX_CNTR32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x01)
  78. #define SNMP_SYNTAX_GAUGE32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x02)
  79. #define SNMP_SYNTAX_TIMETICKS (ASN_APPLICATION | ASN_PRIMITIVE | 0x03)
  80. #define SNMP_SYNTAX_OPAQUE (ASN_APPLICATION | ASN_PRIMITIVE | 0x04)
  81. #define SNMP_SYNTAX_NSAPADDR (ASN_APPLICATION | ASN_PRIMITIVE | 0x05)
  82. #define SNMP_SYNTAX_CNTR64 (ASN_APPLICATION | ASN_PRIMITIVE | 0x06)
  83. #define SNMP_SYNTAX_UINT32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x07)
  84. /* Exception conditions in response PDUs for SNMPv2 */
  85. #define SNMP_SYNTAX_NOSUCHOBJECT (ASN_CONTEXT | ASN_PRIMITIVE | 0x00)
  86. #define SNMP_SYNTAX_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x01)
  87. #define SNMP_SYNTAX_ENDOFMIBVIEW (ASN_CONTEXT | ASN_PRIMITIVE | 0x02)
  88. typedef struct { /* smiVALUE portion of VarBind */
  89. smiUINT32 syntax; /* Insert SNMP_SYNTAX_<type> */
  90. union {
  91. smiINT sNumber; /* SNMP_SYNTAX_INT
  92. SNMP_SYNTAX_INT32 */
  93. smiUINT32 uNumber; /* SNMP_SYNTAX_UINT32
  94. SNMP_SYNTAX_CNTR32
  95. SNMP_SYNTAX_GAUGE32
  96. SNMP_SYNTAX_TIMETICKS */
  97. smiCNTR64 hNumber; /* SNMP_SYNTAX_CNTR64 */
  98. smiOCTETS string; /* SNMP_SYNTAX_OCTETS
  99. SNMP_SYNTAX_BITS
  100. SNMP_SYNTAX_OPAQUE
  101. SNMP_SYNTAX_IPADDR
  102. SNMP_SYNTAX_NSAPADDR */
  103. smiOID oid; /* SNMP_SYNTAX_OID */
  104. smiBYTE empty; /* SNMP_SYNTAX_NULL
  105. SNMP_SYNTAX_NOSUCHOBJECT
  106. SNMP_SYNTAX_NOSUCHINSTANCE
  107. SNMP_SYNTAX_ENDOFMIBVIEW */
  108. } value; /* union */
  109. } smiVALUE, FAR *smiLPVALUE;
  110. typedef const smiVALUE FAR *smiLPCVALUE;
  111. /* SNMP Limits */
  112. #define MAXOBJIDSIZE 128 /* Max number of components in an OID */
  113. #define MAXOBJIDSTRSIZE 1408 /* Max len of decoded MAXOBJIDSIZE OID */
  114. /* PDU Type Values */
  115. #define SNMP_PDU_GET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0)
  116. #define SNMP_PDU_GETNEXT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1)
  117. #define SNMP_PDU_RESPONSE (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2)
  118. #define SNMP_PDU_SET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3)
  119. /* SNMP_PDU_V1TRAP is obsolete in SNMPv2 */
  120. #define SNMP_PDU_V1TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4)
  121. #define SNMP_PDU_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5)
  122. #define SNMP_PDU_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
  123. #define SNMP_PDU_TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7)
  124. /* SNMPv1 Trap Values */
  125. /* (These values might be superfluous wrt WinSNMP applications) */
  126. #define SNMP_TRAP_COLDSTART 0
  127. #define SNMP_TRAP_WARMSTART 1
  128. #define SNMP_TRAP_LINKDOWN 2
  129. #define SNMP_TRAP_LINKUP 3
  130. #define SNMP_TRAP_AUTHFAIL 4
  131. #define SNMP_TRAP_EGPNEIGHBORLOSS 5
  132. #define SNMP_TRAP_ENTERPRISESPECIFIC 6
  133. /* SNMP Error Codes Returned in Error_status Field of PDU */
  134. /* (these are NOT WinSNMP API Error Codes */
  135. /* Error Codes Common to SNMPv1 and SNMPv2 */
  136. #define SNMP_ERROR_NOERROR 0
  137. #define SNMP_ERROR_TOOBIG 1
  138. #define SNMP_ERROR_NOSUCHNAME 2
  139. #define SNMP_ERROR_BADVALUE 3
  140. #define SNMP_ERROR_READONLY 4
  141. #define SNMP_ERROR_GENERR 5
  142. /* Error Codes Added for SNMPv2 */
  143. #define SNMP_ERROR_NOACCESS 6
  144. #define SNMP_ERROR_WRONGTYPE 7
  145. #define SNMP_ERROR_WRONGLENGTH 8
  146. #define SNMP_ERROR_WRONGENCODING 9
  147. #define SNMP_ERROR_WRONGVALUE 10
  148. #define SNMP_ERROR_NOCREATION 11
  149. #define SNMP_ERROR_INCONSISTENTVALUE 12
  150. #define SNMP_ERROR_RESOURCEUNAVAILABLE 13
  151. #define SNMP_ERROR_COMMITFAILED 14
  152. #define SNMP_ERROR_UNDOFAILED 15
  153. #define SNMP_ERROR_AUTHORIZATIONERROR 16
  154. #define SNMP_ERROR_NOTWRITABLE 17
  155. #define SNMP_ERROR_INCONSISTENTNAME 18
  156. /* WinSNMP API Values */
  157. /* Values used to indicate entity/context translation modes */
  158. #define SNMPAPI_TRANSLATED 0
  159. #define SNMPAPI_UNTRANSLATED_V1 1
  160. #define SNMPAPI_UNTRANSLATED_V2 2
  161. /* Values used to indicate "SNMP level" supported by the implementation */
  162. #define SNMPAPI_NO_SUPPORT 0
  163. #define SNMPAPI_V1_SUPPORT 1
  164. #define SNMPAPI_V2_SUPPORT 2
  165. #define SNMPAPI_M2M_SUPPORT 3
  166. /* Values used to indicate retransmit mode in the implementation */
  167. #define SNMPAPI_OFF 0 /* Refuse support */
  168. #define SNMPAPI_ON 1 /* Request support */
  169. /* WinSNMP API Function Return Codes */
  170. typedef smiUINT32 SNMPAPI_STATUS; /* Used for function ret values */
  171. #define SNMPAPI_FAILURE 0 /* Generic error code */
  172. #define SNMPAPI_SUCCESS 1 /* Generic success code */
  173. /* WinSNMP API Error Codes (for SnmpGetLastError) */
  174. /* (NOT SNMP Response-PDU error_status codes) */
  175. #define SNMPAPI_ALLOC_ERROR 2 /* Error allocating memory */
  176. #define SNMPAPI_CONTEXT_INVALID 3 /* Invalid context parameter */
  177. #define SNMPAPI_CONTEXT_UNKNOWN 4 /* Unknown context parameter */
  178. #define SNMPAPI_ENTITY_INVALID 5 /* Invalid entity parameter */
  179. #define SNMPAPI_ENTITY_UNKNOWN 6 /* Unknown entity parameter */
  180. #define SNMPAPI_INDEX_INVALID 7 /* Invalid VBL index parameter */
  181. #define SNMPAPI_NOOP 8 /* No operation performed */
  182. #define SNMPAPI_OID_INVALID 9 /* Invalid OID parameter */
  183. #define SNMPAPI_OPERATION_INVALID 10 /* Invalid/unsupported operation */
  184. #define SNMPAPI_OUTPUT_TRUNCATED 11 /* Insufficient output buf len */
  185. #define SNMPAPI_PDU_INVALID 12 /* Invalid PDU parameter */
  186. #define SNMPAPI_SESSION_INVALID 13 /* Invalid session parameter */
  187. #define SNMPAPI_SYNTAX_INVALID 14 /* Invalid syntax in smiVALUE */
  188. #define SNMPAPI_VBL_INVALID 15 /* Invalid VBL parameter */
  189. #define SNMPAPI_MODE_INVALID 16 /* Invalid mode parameter */
  190. #define SNMPAPI_SIZE_INVALID 17 /* Invalid size/length parameter */
  191. #define SNMPAPI_NOT_INITIALIZED 18 /* SnmpStartup failed/not called */
  192. #define SNMPAPI_MESSAGE_INVALID 19 /* Invalid SNMP message format */
  193. #define SNMPAPI_HWND_INVALID 20 /* Invalid Window handle */
  194. #define SNMPAPI_OTHER_ERROR 99 /* For internal/undefined errors */
  195. /* Generic Transport Layer (TL) Errors */
  196. #define SNMPAPI_TL_NOT_INITIALIZED 100 /* TL not initialized */
  197. #define SNMPAPI_TL_NOT_SUPPORTED 101 /* TL does not support protocol */
  198. #define SNMPAPI_TL_NOT_AVAILABLE 102 /* Network subsystem has failed */
  199. #define SNMPAPI_TL_RESOURCE_ERROR 103 /* TL resource error */
  200. #define SNMPAPI_TL_UNDELIVERABLE 104 /* Destination unreachable */
  201. #define SNMPAPI_TL_SRC_INVALID 105 /* Source endpoint invalid */
  202. #define SNMPAPI_TL_INVALID_PARAM 106 /* Input parameter invalid */
  203. #define SNMPAPI_TL_IN_USE 107 /* Source endpoint in use */
  204. #define SNMPAPI_TL_TIMEOUT 108 /* No response before timeout */
  205. #define SNMPAPI_TL_PDU_TOO_BIG 109 /* PDU too big for send/receive */
  206. #define SNMPAPI_TL_OTHER 199 /* Undefined TL error */
  207. /* WinSNMP API Function Prototypes */
  208. #ifndef IN
  209. #define IN
  210. #endif
  211. #ifndef OUT
  212. #define OUT
  213. #endif
  214. #define SNMPAPI_CALL WINAPI /* FAR PASCAL calling conventions */
  215. /* v2.0: Structure for SnmpGetVendorInfo() output */
  216. #define MAXVENDORINFO 32
  217. typedef struct
  218. {
  219. char vendorName[MAXVENDORINFO*2];
  220. char vendorContact[MAXVENDORINFO*2];
  221. char vendorVersionId[MAXVENDORINFO];
  222. char vendorVersionDate[MAXVENDORINFO];
  223. smiUINT32 vendorEnterprise;
  224. } smiVENDORINFO, FAR *smiLPVENDORINFO;
  225. /* v2.0: Callback format for SnmpCreateSession() fCallback parameter */
  226. typedef SNMPAPI_STATUS (CALLBACK *SNMPAPI_CALLBACK)
  227. (IN HSNMP_SESSION hSession,
  228. IN HWND hWnd,
  229. IN UINT wMsg,
  230. IN WPARAM wParam,
  231. IN LPARAM lParam,
  232. IN LPVOID lpClientData);
  233. /* Local Database Functions */
  234. SNMPAPI_STATUS SNMPAPI_CALL SnmpGetTranslateMode
  235. (OUT smiLPUINT32 nTranslateMode);
  236. SNMPAPI_STATUS SNMPAPI_CALL SnmpSetTranslateMode
  237. (IN smiUINT32 nTranslateMode);
  238. SNMPAPI_STATUS SNMPAPI_CALL SnmpGetRetransmitMode
  239. (OUT smiLPUINT32 nRetransmitMode);
  240. SNMPAPI_STATUS SNMPAPI_CALL SnmpSetRetransmitMode
  241. (IN smiUINT32 nRetransmitMode);
  242. SNMPAPI_STATUS SNMPAPI_CALL SnmpGetTimeout
  243. (IN HSNMP_ENTITY hEntity,
  244. OUT smiLPTIMETICKS nPolicyTimeout,
  245. OUT smiLPTIMETICKS nActualTimeout);
  246. SNMPAPI_STATUS SNMPAPI_CALL SnmpSetTimeout
  247. (IN HSNMP_ENTITY hEntity,
  248. IN smiTIMETICKS nPolicyTimeout);
  249. SNMPAPI_STATUS SNMPAPI_CALL SnmpGetRetry
  250. (IN HSNMP_ENTITY hEntity,
  251. OUT smiLPUINT32 nPolicyRetry,
  252. OUT smiLPUINT32 nActualRetry);
  253. SNMPAPI_STATUS SNMPAPI_CALL SnmpSetRetry
  254. (IN HSNMP_ENTITY hEntity,
  255. IN smiUINT32 nPolicyRetry);
  256. /* Following Local Database Functions added in v2.0 */
  257. SNMPAPI_STATUS SNMPAPI_CALL SnmpGetVendorInfo
  258. (OUT smiLPVENDORINFO vendorInfo);
  259. /* Communications Functions */
  260. SNMPAPI_STATUS SNMPAPI_CALL SnmpStartup
  261. (OUT smiLPUINT32 nMajorVersion,
  262. OUT smiLPUINT32 nMinorVersion,
  263. OUT smiLPUINT32 nLevel,
  264. OUT smiLPUINT32 nTranslateMode,
  265. OUT smiLPUINT32 nRetransmitMode);
  266. SNMPAPI_STATUS SNMPAPI_CALL SnmpCleanup
  267. (void);
  268. HSNMP_SESSION SNMPAPI_CALL SnmpOpen
  269. (IN HWND hWnd,
  270. IN UINT wMsg);
  271. SNMPAPI_STATUS SNMPAPI_CALL SnmpClose
  272. (IN HSNMP_SESSION session);
  273. SNMPAPI_STATUS SNMPAPI_CALL SnmpSendMsg
  274. (IN HSNMP_SESSION session,
  275. IN HSNMP_ENTITY srcEntity,
  276. IN HSNMP_ENTITY dstEntity,
  277. IN HSNMP_CONTEXT context,
  278. IN HSNMP_PDU PDU);
  279. SNMPAPI_STATUS SNMPAPI_CALL SnmpRecvMsg
  280. (IN HSNMP_SESSION session,
  281. OUT LPHSNMP_ENTITY srcEntity,
  282. OUT LPHSNMP_ENTITY dstEntity,
  283. OUT LPHSNMP_CONTEXT context,
  284. OUT LPHSNMP_PDU PDU);
  285. SNMPAPI_STATUS SNMPAPI_CALL SnmpRegister
  286. (IN HSNMP_SESSION session,
  287. IN HSNMP_ENTITY srcEntity,
  288. IN HSNMP_ENTITY dstEntity,
  289. IN HSNMP_CONTEXT context,
  290. IN smiLPCOID notification,
  291. IN smiUINT32 state);
  292. /* Following Communications Functions added in v2.0 */
  293. HSNMP_SESSION SNMPAPI_CALL SnmpCreateSession
  294. (IN HWND hWnd,
  295. IN UINT wMsg,
  296. IN SNMPAPI_CALLBACK fCallBack,
  297. IN LPVOID lpClientData);
  298. SNMPAPI_STATUS SNMPAPI_CALL SnmpListen
  299. (IN HSNMP_ENTITY hEntity,
  300. IN SNMPAPI_STATUS lStatus);
  301. SNMPAPI_STATUS SNMPAPI_CALL SnmpCancelMsg
  302. (IN HSNMP_SESSION session,
  303. IN smiINT32 reqId);
  304. /* Entity/Context Functions */
  305. HSNMP_ENTITY SNMPAPI_CALL SnmpStrToEntity
  306. (IN HSNMP_SESSION session,
  307. IN LPCSTR string);
  308. SNMPAPI_STATUS SNMPAPI_CALL SnmpEntityToStr
  309. (IN HSNMP_ENTITY entity,
  310. IN smiUINT32 size,
  311. OUT LPSTR string);
  312. SNMPAPI_STATUS SNMPAPI_CALL SnmpFreeEntity
  313. (IN HSNMP_ENTITY entity);
  314. HSNMP_CONTEXT SNMPAPI_CALL SnmpStrToContext
  315. (IN HSNMP_SESSION session,
  316. IN smiLPCOCTETS string);
  317. SNMPAPI_STATUS SNMPAPI_CALL SnmpContextToStr
  318. (IN HSNMP_CONTEXT context,
  319. OUT smiLPOCTETS string);
  320. SNMPAPI_STATUS SNMPAPI_CALL SnmpFreeContext
  321. (IN HSNMP_CONTEXT context);
  322. /* Following Entity/Context Functions added in v2.0 */
  323. SNMPAPI_STATUS SNMPAPI_CALL SnmpSetPort
  324. (IN HSNMP_ENTITY hEntity,
  325. IN UINT nPort);
  326. /* PDU Functions */
  327. HSNMP_PDU SNMPAPI_CALL SnmpCreatePdu
  328. (IN HSNMP_SESSION session,
  329. IN smiINT PDU_type,
  330. IN smiINT32 request_id,
  331. IN smiINT error_status,
  332. IN smiINT error_index,
  333. IN HSNMP_VBL varbindlist);
  334. SNMPAPI_STATUS SNMPAPI_CALL SnmpGetPduData
  335. (IN HSNMP_PDU PDU,
  336. OUT smiLPINT PDU_type,
  337. OUT smiLPINT32 request_id,
  338. OUT smiLPINT error_status,
  339. OUT smiLPINT error_index,
  340. OUT LPHSNMP_VBL varbindlist);
  341. SNMPAPI_STATUS SNMPAPI_CALL SnmpSetPduData
  342. (IN HSNMP_PDU PDU,
  343. IN const smiINT FAR *PDU_type,
  344. IN const smiINT32 FAR *request_id,
  345. IN const smiINT FAR *non_repeaters,
  346. IN const smiINT FAR *max_repetitions,
  347. IN const HSNMP_VBL FAR *varbindlist);
  348. HSNMP_PDU SNMPAPI_CALL SnmpDuplicatePdu
  349. (IN HSNMP_SESSION session,
  350. IN HSNMP_PDU PDU);
  351. SNMPAPI_STATUS SNMPAPI_CALL SnmpFreePdu
  352. (IN HSNMP_PDU PDU);
  353. /* Variable-Binding Functions */
  354. HSNMP_VBL SNMPAPI_CALL SnmpCreateVbl
  355. (IN HSNMP_SESSION session,
  356. IN smiLPCOID name,
  357. IN smiLPCVALUE value);
  358. HSNMP_VBL SNMPAPI_CALL SnmpDuplicateVbl
  359. (IN HSNMP_SESSION session,
  360. IN HSNMP_VBL vbl);
  361. SNMPAPI_STATUS SNMPAPI_CALL SnmpFreeVbl
  362. (IN HSNMP_VBL vbl);
  363. SNMPAPI_STATUS SNMPAPI_CALL SnmpCountVbl
  364. (IN HSNMP_VBL vbl);
  365. SNMPAPI_STATUS SNMPAPI_CALL SnmpGetVb
  366. (IN HSNMP_VBL vbl,
  367. IN smiUINT32 index,
  368. OUT smiLPOID name,
  369. OUT smiLPVALUE value);
  370. SNMPAPI_STATUS SNMPAPI_CALL SnmpSetVb
  371. (IN HSNMP_VBL vbl,
  372. IN smiUINT32 index,
  373. IN smiLPCOID name,
  374. IN smiLPCVALUE value);
  375. SNMPAPI_STATUS SNMPAPI_CALL SnmpDeleteVb
  376. (IN HSNMP_VBL vbl,
  377. IN smiUINT32 index);
  378. /* Utility Functions */
  379. SNMPAPI_STATUS SNMPAPI_CALL SnmpGetLastError
  380. (IN HSNMP_SESSION session);
  381. SNMPAPI_STATUS SNMPAPI_CALL SnmpStrToOid
  382. (IN LPCSTR string,
  383. OUT smiLPOID dstOID);
  384. SNMPAPI_STATUS SNMPAPI_CALL SnmpOidToStr
  385. (IN smiLPCOID srcOID,
  386. IN smiUINT32 size,
  387. OUT LPSTR string);
  388. SNMPAPI_STATUS SNMPAPI_CALL SnmpOidCopy
  389. (IN smiLPCOID srcOID,
  390. OUT smiLPOID dstOID);
  391. SNMPAPI_STATUS SNMPAPI_CALL SnmpOidCompare
  392. (IN smiLPCOID xOID,
  393. IN smiLPCOID yOID,
  394. IN smiUINT32 maxlen,
  395. OUT smiLPINT result);
  396. SNMPAPI_STATUS SNMPAPI_CALL SnmpEncodeMsg
  397. (IN HSNMP_SESSION session,
  398. IN HSNMP_ENTITY srcEntity,
  399. IN HSNMP_ENTITY dstEntity,
  400. IN HSNMP_CONTEXT context,
  401. IN HSNMP_PDU pdu,
  402. OUT smiLPOCTETS msgBufDesc);
  403. SNMPAPI_STATUS SNMPAPI_CALL SnmpDecodeMsg
  404. (IN HSNMP_SESSION session,
  405. OUT LPHSNMP_ENTITY srcEntity,
  406. OUT LPHSNMP_ENTITY dstEntity,
  407. OUT LPHSNMP_CONTEXT context,
  408. OUT LPHSNMP_PDU pdu,
  409. IN smiLPCOCTETS msgBufDesc);
  410. SNMPAPI_STATUS SNMPAPI_CALL SnmpFreeDescriptor
  411. (IN smiUINT32 syntax,
  412. IN smiLPOPAQUE descriptor);
  413. #ifdef __cplusplus
  414. }
  415. #endif
  416. #endif /* _INC_WINSNMP */