libsnmp.h

00001 #ifndef _LIBSNMP_H_
00002 #define _LIBSNMP_H_
00003 
00004 #ifdef __cplusplus
00005 extern          "C" {
00006 #endif
00007 
00008     /*
00009      * Definitions for the Simple Network Management Protocol (RFC 1067).
00010      *
00011      */
00012 /**********************************************************************
00013  *
00014  *           Copyright 1998 by Carnegie Mellon University
00015  * 
00016  *                       All Rights Reserved
00017  * 
00018  * Permission to use, copy, modify, and distribute this software and its
00019  * documentation for any purpose and without fee is hereby granted,
00020  * provided that the above copyright notice appear in all copies and that
00021  * both that copyright notice and this permission notice appear in
00022  * supporting documentation, and that the name of CMU not be
00023  * used in advertising or publicity pertaining to distribution of the
00024  * software without specific, written prior permission.
00025  * 
00026  * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
00027  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
00028  * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
00029  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00030  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
00031  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
00032  * SOFTWARE.
00033  * 
00034  * $Id: libsnmp.h 6918 2002-04-20 07:30:29Z hardaker $
00035  * 
00036  **********************************************************************/
00037 
00038 #include <ucd-snmp/ucd-snmp-config.h>
00039 
00040 #if HAVE_STDLIB_H
00041 #include <stdlib.h>
00042 #endif
00043 #if HAVE_UNISTD_H
00044 #include <unistd.h>
00045 #endif
00046 #if HAVE_STRING_H
00047 #include <string.h>
00048 #else
00049 #include <strings.h>
00050 #endif
00051 #include <sys/types.h>
00052 #if HAVE_NETINET_IN_H
00053 #include <netinet/in.h>
00054 #endif
00055 #if TIME_WITH_SYS_TIME
00056 # ifdef WIN32
00057 #  include <sys/timeb.h>
00058 # else
00059 #  include <sys/time.h>
00060 # endif
00061 # include <time.h>
00062 #else
00063 # if HAVE_SYS_TIME_H
00064 #  include <sys/time.h>
00065 # else
00066 #  include <time.h>
00067 # endif
00068 #endif
00069 #if HAVE_SYS_SELECT_H
00070 #include <sys/select.h>
00071 #endif
00072 #include <stdio.h>
00073 #include <ctype.h>
00074 #if HAVE_WINSOCK_H
00075 #include <winsock.h>
00076 #else
00077 #include <netdb.h>
00078 #endif
00079 #if HAVE_ARPA_INET_H
00080 #include <arpa/inet.h>
00081 #endif
00082 
00083 #ifdef UCD_SNMP_LIBRARY
00084 
00085 #define snmp_parse cmu_snmp_parse
00086 
00087 #include <ucd-snmp/asn1.h>
00088 #include <ucd-snmp/snmp_api.h>
00089 #include <ucd-snmp/snmp_impl.h>
00090 #include <ucd-snmp/snmp_client.h>
00091 #include <ucd-snmp/mib.h>
00092 #include <ucd-snmp/parse.h>
00093 #include <ucd-snmp/snmp.h>
00094 #include <ucd-snmp/system.h>
00095 #include <ucd-snmp/int64.h>
00096 #include <ucd-snmp/version.h>
00097 
00098 #define Version version         /* netsnmp_session member */
00099 
00100 #define SMI_NOSUCHOBJECT      SNMP_NOSUCHOBJECT
00101 #define SMI_NOSUCHINSTANCE    SNMP_NOSUCHINSTANCE
00102 #define SMI_ENDOFMIBVIEW      SNMP_ENDOFMIBVIEW
00103 
00104 
00105 #else                           /* !UCD_SNMP_LIBRARY */
00106 
00107 #include <sys/types.h>
00108 #ifndef WIN32
00109 #include <netinet/in.h>
00110 #endif
00111 
00112 #include <snmp/asn1.h>
00113 #include <snmp/snmp_error.h>
00114 #include <snmp/mibii.h>
00115 #include <snmp/snmp_extra.h>
00116 #include <snmp/snmp_dump.h>
00117 
00118 #include <snmp/snmp_session.h>
00119 
00120 #include <snmp/snmp_vars.h>
00121 #include <snmp/snmp_pdu.h>
00122 #include <snmp/snmp_msg.h>
00123 
00124 #include <snmp/snmp_coexist.h>
00125 #include <snmp/version.h>
00126 #include <snmp/snmp_api_error.h>
00127 #include <snmp/mini-client.h>
00128 
00129 #include <snmp/snmp_impl.h>
00130 #include <snmp/snmp_api.h>
00131 #include <snmp/snmp_client.h>
00132 #include <snmp/snmp-internal.h>
00133 #include <snmp/mib.h>
00134 #include <snmp/parse.h>
00135 #include <snmp/snmp_compat.h>
00136 
00137     /*
00138      * Load UC-Davis differential 
00139      */
00140 
00141 #define SNMP_MSG_GET GET_REQ_MSG
00142 #define SNMP_MSG_GETNEXT GETNEXT_REQ_MSG
00143 #define SNMP_MSG_RESPONSE GET_RSP_MSG
00144 #define SNMP_MSG_SET SET_REQ_MSG
00145 #define SNMP_MSG_TRAP TRP_REQ_MSG
00146 #define SNMP_MSG_GETBULK    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5)
00147 #define SNMP_MSG_INFORM     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
00148 #define SNMP_MSG_TRAP2      (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7)
00149 #define SNMP_MSG_REPORT     (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8)
00150 #define SNMP_NOSUCHOBJECT    SMI_NOSUCHOBJECT
00151 #define SNMP_NOSUCHINSTANCE  SMI_NOSUCHINSTANCE
00152 #define SNMP_ENDOFMIBVIEW    SMI_ENDOFMIBVIEW
00153 
00154 #define ASN_IPADDRESS   (ASN_APPLICATION | 0)
00155 #define ASN_UNSIGNED    (ASN_APPLICATION | 2)   /* RFC 1902 - same as GAUGE */
00156 #define ASN_TIMETICKS   (ASN_APPLICATION | 3)
00157 
00158 #define snmp_perror(X) perror(X)
00159 #define snmp_set_dump_packet(X)
00160 #define snmp_set_quick_print(X)
00161 #define snmp_set_do_debugging(X)
00162 #define snmp_set_full_objid(X)
00163 #define snmp_set_suffix_only(X)
00164 
00165 #define VersionInfo snmp_Version
00166 #define get_node read_objid
00167 #define version Version         /* netsnmp_session member */
00168 
00169 #define SNMP_VERSION_2c SNMP_VERSION_2
00170 #define SNMP_VERSION_2p 129
00171 
00172 #define SOCK_STARTUP winsock_startup()
00173 #define SOCK_CLEANUP winsock_cleanup()
00174 
00175 #endif                          /* !UCD_SNMP_LIBRARY */
00176 
00177 #ifdef __cplusplus
00178 }
00179 #endif
00180 #endif                          /* _LIBSNMP_H_ */

net-snmpに対してSat Sep 5 13:14:21 2009に生成されました。  doxygen 1.4.7