00001 #ifndef NET_SNMP_TYPES_H
00002 #define NET_SNMP_TYPES_H
00003
00008 #include <stdio.h>
00009
00010 #ifndef NET_SNMP_CONFIG_H
00011 #error "Please include <net-snmp/net-snmp-config.h> before this file"
00012 #endif
00013
00014
00015
00016
00017 #if TIME_WITH_SYS_TIME
00018 # ifdef WIN32
00019 # include <sys/timeb.h>
00020 # else
00021 # include <sys/time.h>
00022 # endif
00023 # include <time.h>
00024 #else
00025 # if HAVE_SYS_TIME_H
00026 # include <sys/time.h>
00027 # else
00028 # include <time.h>
00029 # endif
00030 #endif
00031
00032 #ifdef HAVE_INTTYPES_H
00033 #include <inttypes.h>
00034 #endif
00035 #include <sys/types.h>
00036 #ifdef HAVE_WINSOCK_H
00037 #include <winsock.h>
00038 #endif
00039
00040 #if HAVE_NETINET_IN_H
00041 #include <netinet/in.h>
00042 #endif
00043
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00048 #ifndef MAX_SUBID
00049 #ifndef EIGHTBIT_SUBIDS
00050 typedef u_long oid;
00051 #define MAX_SUBID 0xFFFFFFFF
00052 #else
00053 typedef u_char oid;
00054 #define MAX_SUBID 0xFF
00055 #endif
00056 #endif
00057
00058 #ifndef HAVE_SOCKLEN_T
00059 typedef u_int socklen_t;
00060 #endif
00061
00062 #ifndef HAVE_IN_ADDR_T
00063 typedef uint32_t in_addr_t;
00064 #endif
00065
00066 #ifndef HAVE_SSIZE_T
00067 #if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
00068 typedef int ssize_t;
00069 #else
00070 typedef long ssize_t;
00071 #endif
00072 #endif
00073
00074
00075
00076
00077
00078
00079 #ifndef HAVE_INT8_T
00080 typedef signed char int8_t;
00081 #endif
00082
00083 #ifndef HAVE_UINT8_T
00084 #ifdef HAVE_U_INT8_T
00085 typedef u_int8_t uint8_t;
00086 #else
00087 typedef unsigned char uint8_t;
00088 #endif
00089 #endif
00090
00091 #ifndef HAVE_INT16_T
00092 #if SIZEOF_INT == 2
00093 #define INT16_T int
00094 #elif SIZEOF_SHORT == 2
00095 #define INT16_T short
00096 #else
00097 #define _INT16_IS_NOT_16BIT
00098 #define INT16_T short
00099 #endif
00100 typedef INT16_T int16_t;
00101 #endif
00102
00103 #ifndef HAVE_UINT16_T
00104 #ifdef HAVE_U_INT16_T
00105 typedef u_int16_t uint16_t;
00106 #else
00107 #ifdef INT16_T
00108 typedef unsigned INT16_T uint16_t;
00109 #else
00110 typedef unsigned short uint16_t;
00111 #endif
00112 #endif
00113 #endif
00114
00115 #ifndef HAVE_INT32_T
00116 #if SIZEOF_INT == 4
00117 #define INT32_T int
00118 #elif SIZEOF_LONG == 4
00119 #define INT32_T long
00120 #elif SIZEOF_SHORT == 4
00121 #define INT32_T short
00122 #else
00123 #define _INT32_IS_NOT_32BIT
00124 #define INT32_T int
00125 #endif
00126 typedef INT32_T int32_t;
00127 #endif
00128
00129 #ifndef HAVE_UINT32_T
00130 #ifdef HAVE_U_INT32_T
00131 typedef u_int32_t uint32_t;
00132 #else
00133 #ifdef INT32_T
00134 typedef unsigned INT32_T uint32_t;
00135 #else
00136 typedef unsigned int uint32_t;
00137 #endif
00138 #endif
00139 #endif
00140
00141 #ifndef HAVE_INT64_T
00142 #if SIZEOF_LONG == 8
00143 #define INT64_T long
00144 #elif SIZEOF_LONG_LONG == 8
00145 #define INT64_T long long
00146 #elif SIZEOF_INT == 8
00147 #define INT64_T int
00148 #elif SIZEOF_LONG >= 8
00149 #define INT64_T long
00150 #define _INT64_IS_NOT_64BIT
00151 #endif
00152 #ifdef INT64_T
00153 typedef INT64_T int64_t;
00154 #define HAVE_INT64_T 1
00155 #endif
00156 #endif
00157
00158 #ifndef HAVE_UINT64_T
00159 #ifdef HAVE_U_INT64_T
00160 typedef u_int64_t uint64_t;
00161 #elif defined(INT64_T)
00162 typedef unsigned INT64_T uint64_t;
00163 #endif
00164 #define HAVE_UINT64_T 1
00165 #endif
00166
00167 #ifndef HAVE_INTMAX_T
00168 #ifdef SIZEOF_LONG_LONG
00169 typedef long long intmax_t;
00170 #define SIZEOF_INTMAX_T SIZEOF_LONG_LONG
00171 #elif defined(HAVE_INT64_T) && !defined(_INT64_IS_NOT_64BIT)
00172 typedef int64_t intmax_t;
00173 #define SIZEOF_INTMAX_T 8
00174 #else
00175 typedef long intmax_t;
00176 #define SIZEOF_INTMAX_T SIZEOF_LONG
00177 #endif
00178 #define HAVE_INTMAX_T 1
00179 #endif
00180
00181 #ifndef HAVE_UINTMAX_T
00182 #ifdef SIZEOF_LONG_LONG
00183 typedef unsigned long long uintmax_t;
00184 #elif defined(HAVE_UINT64_T) && !defined(_INT64_IS_NOT_64BIT)
00185 typedef uint64_t uintmax_t;
00186 #else
00187 typedef unsigned long uintmax_t;
00188 #endif
00189 #define HAVE_UINTMAX_T 1
00190 #endif
00191
00192 #ifndef HAVE_UINTPTR_T
00193 #if SIZEOF_LONG == 8
00194
00195 typedef unsigned long uintptr_t;
00196 #else
00197 typedef unsigned uintptr_t;
00198 #endif
00199 #endif
00200
00201 #ifndef HAVE_INTPTR_T
00202 #if SIZEOF_LONG == 8
00203
00204 typedef long intptr_t;
00205 #else
00206 typedef int intptr_t;
00207 #endif
00208 #endif
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221 #include <net-snmp/definitions.h>
00222 #include <net-snmp/library/snmp_api.h>
00223
00224
00225
00226
00227 typedef struct netsnmp_index_s {
00228 size_t len;
00229 oid *oids;
00230 } netsnmp_index;
00231
00232
00233 typedef struct netsnmp_void_array_s {
00234 size_t size;
00235 void * *array;
00236 } netsnmp_void_array;
00237
00238
00239
00240
00241 typedef struct netsnmp_ref_void {
00242 void * val;
00243 } netsnmp_ref_void;
00244
00245 typedef union {
00246 u_long ul;
00247 u_int ui;
00248 u_short us;
00249 u_char uc;
00250 long sl;
00251 int si;
00252 short ss;
00253 char sc;
00254 char * cp;
00255 void * vp;
00256 } netsnmp_cvalue;
00257
00258 #if 0
00259 typedef struct netsnmp_ref_u_char {
00260 u_char * val;
00261 } netsnmp_ref_U_char;
00262
00263 typedef struct netsnmp_ref_char {
00264 char * val;
00265 } netsnmp_ref_void;
00266
00267 typedef struct netsnmp_ref_int_s {
00268 int val;
00269 } netsnmp_ref_int;
00270
00271 typedef struct netsnmp_ref_u_int_s {
00272 u_int val;
00273 } netsnmp_ref_int;
00274
00275 typedef struct netsnmp_ref_u_long_s {
00276 u_long val;
00277 } netsnmp_ref_u_long;
00278 #endif
00279
00280 typedef struct netsnmp_ref_size_t_s {
00281 size_t val;
00282 } * netsnmp_ref_size_t;
00283
00284 #ifdef __cplusplus
00285 }
00286 #endif
00287
00288 #endif