root/honeytrap/trunk/src/honeytrap.h

Revision 1690, 3.7 kB (checked in by till, 4 months ago)

honeytrap
- submitMWserv plugin fixed, curl handle gets only initialized in child process and first heartbeat is sent after honeytrap finished its self-setup

Line 
1 /* honeytrap.h
2  * Copyright (C) 2005-2008 Tillmann Werner <tillmann.werner@gmx.de>
3  *
4  * This file is free software; as a special exception the author gives
5  * unlimited permission to copy and/or distribute it, with or without
6  * modifications, as long as this notice is preserved.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  */
12
13 #ifndef __HONEYTRAP_MAIN_H
14 #define __HONEYTRAP_MAIN_H 1
15
16 #include <sys/types.h>
17 #include <netinet/in.h>
18 #include <pwd.h>
19 #include <grp.h>
20 #include <dlfcn.h>
21
22 #if HAVE_CONFIG_H
23 # include <config.h>
24 #endif
25
26 #if defined(__GNUG__)
27         #define MY_COMPILER "g++"
28 #elif defined(__CYGWIN__)
29         #define MY_COMPILER "cygwin"
30 #else   
31         #define MY_COMPILER "unknown Compiler"
32 #endif
33
34 #if defined(__FreeBSD__)
35 define MY_OS "FreeBSD"
36 #elif defined(linux) || defined (__linux)
37 define MY_OS "Linux"
38 #elif defined (__MACOSX__) || defined (__APPLE__)
39 define MY_OS "Mac OS X"
40 #elif defined(__NetBSD__)
41 define MY_OS "NetBSD"
42 #elif defined(__OpenBSD__)
43 define MY_OS "OpenBSD"
44 #elif defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__)
45 define MY_OS "Windows"
46 #elif defined(CYGWIN)
47 define MY_OS "Cygwin\Windows"
48 #else
49 define MY_OS "Unknown OS"
50 #endif
51
52 #if defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
53 define MY_ARCH "Alpha"
54 #elif defined(__arm__)
55 if defined(__ARMEB__)
56 #    define MY_ARCH "ARMeb"
57 else
58 #    define MY_ARCH "ARM"
59 endif
60 #elif defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_X86_) || defined(__THW_INTEL)
61 define MY_ARCH "x86"
62 #elif defined(__x86_64__) || defined(__amd64__)
63 define MY_ARCH "x86_64"
64 #elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || defined(_M_IA64)
65 define MY_ARCH "Intel Architecture-64"
66 #elif defined(__mips__) || defined(__mips) || defined(__MIPS__)
67 if defined(__mips32__) || defined(__mips32)
68 #    define MY_ARCH "MIPS32"
69 else
70 #    define MY_ARCH "MIPS"
71 endif
72 #elif defined(__hppa__) || defined(__hppa)
73 define MY_ARCH "PA RISC"
74 #elif defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || defined(__PPC) || defined(__PPC__)
75 define MY_ARCH "PowerPC"
76 #elif defined(__THW_RS6000) || defined(_IBMR2) || defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2)
77 define MY_ARCH "RS/6000"
78 #elif defined(__sparc__) || defined(sparc) || defined(__sparc)
79 define MY_ARCH "SPARC"
80 #else
81 define MY_ARCH "Unknown Architecture"
82 #endif
83
84
85
86 #ifndef MAX
87 define MAX(a, b)     ((a)>(b)?(a):(b))
88 #endif
89 #ifndef MIN
90 define MIN(a, b)     ((a)<(b)?(a):(b))
91 #endif
92
93 #define EXCL_FILE_RW    O_CREAT | O_NOCTTY | O_APPEND | O_WRONLY
94
95 #define PORTCONF_NONE   0
96 #define PORTCONF_NORMAL 1
97 #define PORTCONF_IGNORE 2
98 #define PORTCONF_MIRROR 4
99 #define PORTCONF_PROXY  8
100 #define MODE(m)         (m == PORTCONF_NONE ? "none" : (m == PORTCONF_NORMAL ? "normal" : (m == PORTCONF_IGNORE ? "ignore" : (m == PORTCONF_MIRROR ? "mirror" : (m == PORTCONF_PROXY ? "proxy" : "unknown")))))
101
102 char *conffile_name, **arg_v;
103 int arg_c;
104
105 // global variables regarding configuration
106
107 char            *pidfile_name;
108 char            *logfile_name;
109 char            *dev;
110 char            *response_dir;
111 char            *plugin_dir;
112 u_char          running;
113 u_char          daemonize;
114 u_char          promisc_mode;
115 u_char          replace_private_ips;
116 uid_t           u_id;
117 gid_t           g_id;
118 int32_t         conn_timeout;
119 int32_t         read_timeout;
120 int32_t         m_read_timeout;
121 int32_t         read_limit;
122 struct in_addr  bind_address;
123
124 /* explicit port configurations */
125 u_char  portconf_default;
126
127 typedef struct sport_flag {
128         u_int8_t tcp;
129         u_int8_t udp;
130 } port_flag;
131
132 port_flag port_flags[0x10000];
133
134 // end of global config variables
135
136 int pidfile_fd, first_init;
137 char old_cwd[1024];
138
139
140 #endif
Note: See TracBrowser for help on using the browser.