libsnmp.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #ifndef _LIBSNMP_H_
  2. #define _LIBSNMP_H_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /*
  7. * Definitions for the Simple Network Management Protocol (RFC 1067).
  8. *
  9. */
  10. /**********************************************************************
  11. *
  12. * Copyright 1998 by Carnegie Mellon University
  13. *
  14. * All Rights Reserved
  15. *
  16. * Permission to use, copy, modify, and distribute this software and its
  17. * documentation for any purpose and without fee is hereby granted,
  18. * provided that the above copyright notice appear in all copies and that
  19. * both that copyright notice and this permission notice appear in
  20. * supporting documentation, and that the name of CMU not be
  21. * used in advertising or publicity pertaining to distribution of the
  22. * software without specific, written prior permission.
  23. *
  24. * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  25. * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  26. * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  27. * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  28. * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  29. * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  30. * SOFTWARE.
  31. *
  32. * $Id$
  33. *
  34. **********************************************************************/
  35. #include <ucd-snmp/ucd-snmp-config.h>
  36. #if HAVE_STDLIB_H
  37. #include <stdlib.h>
  38. #endif
  39. #if HAVE_UNISTD_H
  40. #include <unistd.h>
  41. #endif
  42. #if HAVE_STRING_H
  43. #include <string.h>
  44. #else
  45. #include <strings.h>
  46. #endif
  47. #include <sys/types.h>
  48. #if HAVE_NETINET_IN_H
  49. #include <netinet/in.h>
  50. #endif
  51. #if TIME_WITH_SYS_TIME
  52. # include <sys/time.h>
  53. # include <time.h>
  54. #else
  55. # if HAVE_SYS_TIME_H
  56. # include <sys/time.h>
  57. # else
  58. # include <time.h>
  59. # endif
  60. #endif
  61. #if HAVE_SYS_SELECT_H
  62. #include <sys/select.h>
  63. #endif
  64. #include <stdio.h>
  65. #include <ctype.h>
  66. #if HAVE_NETDB_H
  67. #include <netdb.h>
  68. #endif
  69. #if HAVE_ARPA_INET_H
  70. #include <arpa/inet.h>
  71. #endif
  72. #ifdef UCD_SNMP_LIBRARY
  73. #include <ucd-snmp/asn1.h>
  74. #include <ucd-snmp/snmp_api.h>
  75. #include <ucd-snmp/snmp_impl.h>
  76. #include <ucd-snmp/snmp_client.h>
  77. #include <ucd-snmp/mib.h>
  78. #include <ucd-snmp/parse.h>
  79. #include <ucd-snmp/snmp.h>
  80. #include <ucd-snmp/system.h>
  81. #include <ucd-snmp/int64.h>
  82. #include <ucd-snmp/version.h>
  83. #define Version version /* netsnmp_session member */
  84. #define SMI_NOSUCHOBJECT SNMP_NOSUCHOBJECT
  85. #define SMI_NOSUCHINSTANCE SNMP_NOSUCHINSTANCE
  86. #define SMI_ENDOFMIBVIEW SNMP_ENDOFMIBVIEW
  87. #else /* !UCD_SNMP_LIBRARY */
  88. #include <sys/types.h>
  89. #ifndef WIN32
  90. #include <netinet/in.h>
  91. #endif
  92. #include <snmp/asn1.h>
  93. #include <snmp/snmp_error.h>
  94. #include <snmp/mibii.h>
  95. #include <snmp/snmp_extra.h>
  96. #include <snmp/snmp_dump.h>
  97. #include <snmp/snmp_session.h>
  98. #include <snmp/snmp_vars.h>
  99. #include <snmp/snmp_pdu.h>
  100. #include <snmp/snmp_msg.h>
  101. #include <snmp/snmp_coexist.h>
  102. #include <snmp/version.h>
  103. #include <snmp/snmp_api_error.h>
  104. #include <snmp/mini-client.h>
  105. #include <snmp/snmp_impl.h>
  106. #include <snmp/snmp_api.h>
  107. #include <snmp/snmp_client.h>
  108. #include <snmp/snmp-internal.h>
  109. #include <snmp/mib.h>
  110. #include <snmp/parse.h>
  111. #include <snmp/snmp_compat.h>
  112. /*
  113. * Load UC-Davis differential
  114. */
  115. #define SNMP_MSG_GET GET_REQ_MSG
  116. #define SNMP_MSG_GETNEXT GETNEXT_REQ_MSG
  117. #define SNMP_MSG_RESPONSE GET_RSP_MSG
  118. #ifndef NETSNMP_NO_WRITE_SUPPORT
  119. #define SNMP_MSG_SET SET_REQ_MSG
  120. #endif /* !NETSNMP_NO_WRITE_SUPPORT */
  121. #define SNMP_MSG_TRAP TRP_REQ_MSG
  122. #define SNMP_MSG_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5)
  123. #define SNMP_MSG_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
  124. #define SNMP_MSG_TRAP2 (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7)
  125. #define SNMP_MSG_REPORT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8)
  126. #define SNMP_NOSUCHOBJECT SMI_NOSUCHOBJECT
  127. #define SNMP_NOSUCHINSTANCE SMI_NOSUCHINSTANCE
  128. #define SNMP_ENDOFMIBVIEW SMI_ENDOFMIBVIEW
  129. #define ASN_IPADDRESS (ASN_APPLICATION | 0)
  130. #define ASN_UNSIGNED (ASN_APPLICATION | 2) /* RFC 1902 - same as GAUGE */
  131. #define ASN_TIMETICKS (ASN_APPLICATION | 3)
  132. #define snmp_perror(X) perror(X)
  133. #define snmp_set_dump_packet(X)
  134. #define snmp_set_quick_print(X)
  135. #define snmp_set_do_debugging(X)
  136. #define snmp_set_full_objid(X)
  137. #define snmp_set_suffix_only(X)
  138. #define VersionInfo snmp_Version
  139. #define get_node read_objid
  140. #define version Version /* netsnmp_session member */
  141. #define SNMP_VERSION_2c SNMP_VERSION_2
  142. #define SNMP_VERSION_2p 129
  143. #define SOCK_STARTUP winsock_startup()
  144. #define SOCK_CLEANUP winsock_cleanup()
  145. #endif /* !UCD_SNMP_LIBRARY */
  146. #ifdef __cplusplus
  147. }
  148. #endif
  149. #endif /* _LIBSNMP_H_ */