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