00001
00002
00003 #ifndef __CONFIG_H__
00004 #define __CONFIG_H__
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _ALL_SOURCE
00013
00014 #endif
00015
00016
00017
00018
00019
00020
00021 #define WORDS_LITTLEENDIAN 1
00022
00023 #define WIN32 1
00024
00025 #define ERRLIST_PREDEFINED 1
00026
00027
00028 #define HAVE_SNPRINTF 1
00029
00030
00031 #define HAVE_STRERROR 1
00032
00033
00034 #define HAVE_STDLIB_H 1
00035
00036
00037 #define HAVE_STDINT_H 1
00038
00039
00040 #define HAVE_STRING_H 1
00041
00042
00043 #define HAVE_UNISTD_H 1
00044
00045
00046 #define HAVE_LIBPCAP 1
00047
00048
00049 #ifdef ENABLE_ODBC
00050 #define VERSION_ENABLE_ODBC "-ODBC"
00051 #else
00052 #define VERSION_ENABLE_ODBC
00053 #endif
00054
00055 #ifdef ENABLE_MYSQL
00056 #define VERSION_ENABLE_MYSQL "-MySQL"
00057 #else
00058 #define VERSION_ENABLE_MYSQL
00059 #endif
00060
00061 #ifdef ENABLE_MSSQL
00062 #define VERSION_ENABLE_MSSQL "-MSSQL"
00063 #else
00064 #define VERSION_ENABLE_MSSQL
00065 #endif
00066
00067 #ifdef ENABLE_ORACLE
00068 #define VERSION_ENABLE_ORACLE "-ORACLE"
00069 #else
00070 #define VERSION_ENABLE_ORACLE
00071 #endif
00072
00073 #ifdef ENABLE_RESPONSE
00074 #define VERSION_ENABLE_RESPONSE "-FlexRESP"
00075 #else
00076 #define VERSION_ENABLE_RESPONSE
00077 #endif
00078
00079 #ifdef DEBUG
00080 #define VERSION_DEBUG " [DEBUG] "
00081 #else
00082 #define VERSION_DEBUG
00083 #endif
00084
00085
00086
00087
00088
00089
00090 #define VERSION "2.4.4"VERSION_ENABLE_ODBC""VERSION_ENABLE_MYSQL""VERSION_ENABLE_MSSQL""VERSION_ENABLE_ORACLE""VERSION_ENABLE_RESPONSE"-WIN32"VERSION_DEBUG
00091 #define PACKAGE "snort"
00092
00093
00094
00095 #define IFNAMSIZ 255
00096
00097
00098 #include <winsock2.h>
00099 #include <windows.h>
00100 #ifdef _MSC_VER
00101 #pragma warning( disable : 4028 )
00102 #endif
00103 #include <io.h>
00104 #include <process.h>
00105 #ifdef _MSC_VER
00106 #pragma warning( default : 4028 )
00107 #endif
00108 #include <sys/timeb.h>
00109 #include <direct.h>
00110 #include <getopt.h>
00111 #ifndef __MINGW32__
00112 typedef int pid_t;
00113 #endif
00114 #ifndef _SSIZE_T_
00115 typedef SSIZE_T ssize_t;
00116 #endif
00117 #include "win32/WIN32-Includes/rpc/types.h"
00118
00119 #undef interface
00120
00121
00122 #ifdef u_int8_t
00123 #undef u_int8_t
00124 #endif
00125 #ifdef u_int16_t
00126 #undef u_int16_t
00127 #endif
00128 #ifdef u_int32_t
00129 #undef u_int32_t
00130 #endif
00131 #include <stdint.h>
00132
00133
00134 #if defined(WIN32) && !defined(inline)
00135 #define inline __inline
00136 #endif
00137
00138
00139
00140
00141
00142
00143 #ifndef O_SYNC
00144 #define O_SYNC 0x0080
00145 #endif
00146
00147
00148 #ifndef CDECL
00149 #define CDECL __cdecl
00150 #endif
00151
00152
00153
00154 #define SIGQUIT 3
00155 #define SIGHUP 1
00156 #define SIGUSR1 30
00157 #define SIGUSR2 31
00158 #define SIGPIPE 13
00159
00160 #ifndef W_OK
00161 #define W_OK 0x02
00162 #endif
00163 #ifndef R_OK
00164 #define R_OK 0x04
00165 #endif
00166 #define S_ISDIR(x) (((x) & 0170000) == 0040000)
00167 #define S_IRWXU 0000700
00168 #define S_IRWXG 0000070
00169 #define S_IROTH 0000004
00170 #define S_IXOTH 0000001
00171
00172 #define bcopy(src, dst, count) memcpy((void *)dst, (const void *)src, (size_t) count)
00173 #define bzero(addr, count) memset((addr), 0, (count))
00174 #define index strchr
00175 #define mkdir(x, y) _mkdir(x)
00176 #define snprintf _snprintf
00177 #define strncasecmp strnicmp
00178 #define strcasecmp stricmp
00179 #define vsnprintf _vsnprintf
00180 #define IXDR_GET_LONG(buf) ((long)ntohl((u_long)*(buf)++))
00181 #define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
00182 #define RPC_MSG_VERSION ((u_long) 2)
00183
00184 char * strtok_r(char *s1, const char *s2, char **lasts);
00185 int inet_aton(const char *cp, struct in_addr *addr);
00186
00187
00188 enum msg_type {
00189 CALL=0,
00190 REPLY=1
00191 };
00192
00193
00194
00195 struct timezone {
00196 int tz_minuteswest;
00197 int tz_dsttime;
00198 };
00199
00200
00201
00202
00203
00204
00205
00206 struct ifreq {
00207 char ifr_name[128];
00208 union {
00209 struct sockaddr ifru_addr;
00210 struct sockaddr ifru_dstaddr;
00211 struct sockaddr ifru_broadaddr;
00212 short ifru_flags;
00213 int ifru_metric;
00214 caddr_t ifru_data;
00215 } ifr_ifru;
00216 #define ifr_addr ifr_ifru.ifru_addr
00217 #define ifr_dstaddr ifr_ifru.ifru_dstaddr
00218 #define ifr_broadaddr ifr_ifru.ifru_broadaddr
00219 #define ifr_flags ifr_ifru.ifru_flags
00220 #define ifr_metric ifr_ifru.ifru_metric
00221 #define ifr_mtu ifr_ifru.ifru_metric
00222 #define ifr_media ifr_ifru.ifru_metric
00223 #define ifr_data ifr_ifru.ifru_data
00224 };
00225
00226
00227 #define RUSAGE_SELF 0
00228 #define RUSAGE_CHILDREN -1
00229 struct rusage
00230 {
00231 struct timeval ru_utime;
00232 struct timeval ru_stime;
00233 long ru_maxrss;
00234 long ru_ixrss;
00235 long ru_idrss;
00236 long ru_isrss;
00237 long ru_minflt;
00238 long ru_majflt;
00239 long ru_nswap;
00240 long ru_inblock;
00241 long ru_oublock;
00242 long ru_msgsnd;
00243 long ru_msgrcv;
00244 long ru_nsignals;
00245 long ru_nvcsw;
00246 long ru_nivcsw;
00247 };
00248
00249 int gettimeofday(struct timeval *,struct timezone *);
00250 void *GetAdapterFromList(void *, int);
00251 char *print_interface(char *);
00252 void PrintDeviceList(const char *);
00253 int init_winsock(void);
00254
00255
00256 #if defined(ENABLE_WIN32_SERVICE)
00257 #define SERVICE_CMDLINE_PARAM "/SERVICE"
00258 #define SERVICE_INSTALL_CMDLINE_PARAM "/INSTALL"
00259 #define SERVICE_UNINSTALL_CMDLINE_PARAM "/UNINSTALL"
00260 #define SERVICE_SHOW_CMDLINE_PARAM "/SHOW"
00261
00262 int SnortServiceMain(int argc, char* argv[]);
00263 #endif
00264
00265
00266 #endif
00267