Browse code

clamd-win32 - WIP

aCaB authored on 2010/01/29 07:36:37
Showing 22 changed files
... ...
@@ -104,7 +104,7 @@ int main(int argc, char **argv)
104 104
 {
105 105
         static struct cl_engine *engine = NULL;
106 106
 	const struct optstruct *opt;
107
-#ifndef	C_WINDOWS
107
+#ifndef	_WIN32
108 108
         struct passwd *user = NULL;
109 109
 	struct sigaction sa;
110 110
 #endif
... ...
@@ -25,13 +25,11 @@
25 25
 #include <stdio.h>
26 26
 #include <string.h>
27 27
 #include <sys/types.h>
28
-#ifndef	C_WINDOWS
28
+#ifndef	_WIN32
29 29
 #include <sys/socket.h>
30
-#endif
31
-#include <sys/stat.h>
32
-#ifndef	C_WINDOWS
33 30
 #include <sys/un.h>
34 31
 #endif
32
+#include <sys/stat.h>
35 33
 #include <errno.h>
36 34
 #ifdef HAVE_UNISTD_H
37 35
 #include <unistd.h>
... ...
@@ -40,13 +38,13 @@
40 40
 #include "libclamav/clamav.h"
41 41
 
42 42
 #include "shared/optparser.h"
43
+#include "shared/output.h"
43 44
 
44 45
 #include "others.h"
45 46
 #include "server.h"
46
-#include "output.h"
47 47
 #include "localserver.h"
48 48
 
49
-#ifdef C_WINDOWS
49
+#ifdef _WIN32
50 50
 int localserver(const struct optstruct *opts)
51 51
 {
52 52
     logg("!Localserver is not supported on this platform");
... ...
@@ -121,4 +119,4 @@ int localserver(const struct optstruct *opts)
121 121
 
122 122
     return sockfd;
123 123
 }
124
-#endif /* C_WINDOWS */
124
+#endif
... ...
@@ -69,11 +69,11 @@
69 69
 #include <limits.h>
70 70
 #include "shared/optparser.h"
71 71
 #include "shared/output.h"
72
+#include "shared/misc.h"
72 73
 #include "libclamav/others.h"
73 74
 
74 75
 #include "session.h"
75 76
 #include "others.h"
76
-#include "misc.h"
77 77
 
78 78
 #ifdef	_WIN32
79 79
 void virusaction(const char *filename, const char *virname, const struct optstruct *opts)
... ...
@@ -551,6 +551,7 @@ int fds_poll_recv(struct fd_data *data, int timeout, int check_signals)
551 551
 	}
552 552
     } while (retval == -1 && !check_signals && errno == EINTR);
553 553
 #else
554
+    {
554 555
     fd_set rfds;
555 556
     struct timeval tv;
556 557
     int maxfd = -1;
... ...
@@ -628,6 +629,7 @@ int fds_poll_recv(struct fd_data *data, int timeout, int check_signals)
628 628
 	    continue;
629 629
 	}
630 630
     } while (retval == -1 && !check_signals && errno == EINTR);
631
+    }
631 632
 #endif
632 633
 
633 634
     if (retval == -1 && errno != EINTR) {
... ...
@@ -390,7 +390,8 @@ int scanstream(int odesc, unsigned long int *scanned, const struct cl_engine *en
390 390
 	return -1;
391 391
     }
392 392
 
393
-    snprintf(peer_addr, sizeof(peer_addr), "%s", inet_ntoa(peer.sin_addr));
393
+    *peer_addr = '\0';
394
+    inet_ntop(peer.sin_family, &peer, peer_addr, sizeof(peer_addr));
394 395
     logg("*Accepted connection from %s on port %u, fd %d\n", peer_addr, port, acceptd);
395 396
 
396 397
     if(cli_gentempfd(optget(opts, "TemporaryDirectory")->strarg, &tmpname, &tmpd)) {
... ...
@@ -40,11 +40,11 @@
40 40
 
41 41
 #include "shared/optparser.h"
42 42
 #include "shared/output.h"
43
+#include "shared/misc.h"
43 44
 
44 45
 #include "others.h"
45 46
 #include "server.h"
46 47
 #include "tcpserver.h"
47
-#include "misc.h"
48 48
 
49 49
 int tcpserver(const struct optstruct *opts)
50 50
 {
... ...
@@ -46,6 +46,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LLVMjit", "LLVMjit.vcproj",
46 46
 EndProject
47 47
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LLVMcodegen", "LLVMcodegen.vcproj", "{7472FD2F-DDE7-44B1-91FB-65C0BE81932B}"
48 48
 EndProject
49
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "clamd", "clamd.vcproj", "{B3CA73CF-E71E-42F3-95DE-43797A86C798}"
50
+	ProjectSection(ProjectDependencies) = postProject
51
+		{3AD5B16C-340A-40AC-96AD-6017B941A316} = {3AD5B16C-340A-40AC-96AD-6017B941A316}
52
+	EndProjectSection
53
+EndProject
49 54
 Global
50 55
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
51 56
 		Debug|Win32 = Debug|Win32
... ...
@@ -100,6 +105,8 @@ Global
100 100
 		{7472FD2F-DDE7-44B1-91FB-65C0BE81932B}.Debug|Win32.Build.0 = Debug|Win32
101 101
 		{7472FD2F-DDE7-44B1-91FB-65C0BE81932B}.Release|Win32.ActiveCfg = Release|Win32
102 102
 		{7472FD2F-DDE7-44B1-91FB-65C0BE81932B}.Release|Win32.Build.0 = Release|Win32
103
+		{B3CA73CF-E71E-42F3-95DE-43797A86C798}.Debug|Win32.ActiveCfg = Debug|Win32
104
+		{B3CA73CF-E71E-42F3-95DE-43797A86C798}.Release|Win32.ActiveCfg = Release|Win32
103 105
 	EndGlobalSection
104 106
 	GlobalSection(SolutionProperties) = preSolution
105 107
 		HideSolutionNode = FALSE
... ...
@@ -269,10 +269,10 @@
269 269
 #define HAVE_OPENDIR 1
270 270
 
271 271
 /* Define to 1 if you have the `poll' function. */
272
-#define HAVE_POLL 1
272
+/* #undef HAVE_POLL */
273 273
 
274 274
 /* Define to 1 if you have the <poll.h> header file. */
275
-#define HAVE_POLL_H 1
275
+/* #undef HAVE_POLL_H */
276 276
 
277 277
 /* "pragma pack" */
278 278
 #define HAVE_PRAGMA_PACK 1
... ...
@@ -493,7 +493,7 @@
493 493
 /* #undef USE_SYSLOG */
494 494
 
495 495
 /* Version number of package */
496
-#define VERSION "devel-r5076-703-g0222ee6"
496
+#define VERSION "devel-r5076-706-g0380088"
497 497
 
498 498
 /* Version suffix for package */
499 499
 #define VERSION_SUFFIX ""
... ...
@@ -185,10 +185,6 @@
185 185
 				>
186 186
 			</File>
187 187
 			<File
188
-				RelativePath="..\shared\getopt.c"
189
-				>
190
-			</File>
191
-			<File
192 188
 				RelativePath="..\shared\misc.c"
193 189
 				>
194 190
 			</File>
... ...
@@ -6,7 +6,7 @@
6 6
 	ProjectType="Visual C++"
7 7
 	RootNamespace="clamconf"
8 8
 	TargetFrameworkVersion="196613"
9
-	Version="9.00"
9
+	Version="9,00"
10 10
 	>
11 11
 	<Platforms>
12 12
 		<Platform
... ...
@@ -188,10 +188,6 @@
188 188
 				Name="shared"
189 189
 				>
190 190
 				<File
191
-					RelativePath="..\shared\getopt.c"
192
-					>
193
-				</File>
194
-				<File
195 191
 					RelativePath="..\shared\misc.c"
196 192
 					>
197 193
 				</File>
198 194
new file mode 100644
... ...
@@ -0,0 +1,251 @@
0
+<?xml version="1.0" encoding="Windows-1252"?>
1
+<VisualStudioProject
2
+	Keyword="Win32Proj"
3
+	Name="clamd"
4
+	ProjectGUID="{B3CA73CF-E71E-42F3-95DE-43797A86C798}"
5
+	ProjectType="Visual C++"
6
+	RootNamespace="clamd"
7
+	TargetFrameworkVersion="196613"
8
+	Version="9,00"
9
+	>
10
+	<Platforms>
11
+		<Platform
12
+			Name="Win32"
13
+		/>
14
+	</Platforms>
15
+	<ToolFiles>
16
+	</ToolFiles>
17
+	<Configurations>
18
+		<Configuration
19
+			CharacterSet="2"
20
+			ConfigurationType="1"
21
+			IntermediateDirectory="$(SolutionDir)build\$(ProjectName)\$(ConfigurationName)"
22
+			Name="Debug|Win32"
23
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
24
+			>
25
+			<Tool
26
+				Name="VCPreBuildEventTool"
27
+			/>
28
+			<Tool
29
+				Name="VCCustomBuildTool"
30
+			/>
31
+			<Tool
32
+				Name="VCXMLDataGeneratorTool"
33
+			/>
34
+			<Tool
35
+				Name="VCWebServiceProxyGeneratorTool"
36
+			/>
37
+			<Tool
38
+				Name="VCMIDLTool"
39
+			/>
40
+			<Tool
41
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)..\libclamav&quot;;&quot;$(SolutionDir)compat&quot;;&quot;$(SolutionDir)3rdparty\zlib&quot;;&quot;$(SolutionDir)3rdparty\pthreads&quot;;&quot;$(SolutionDir)3rdparty\bzip2&quot;;&quot;$(SolutionDir)..&quot;"
42
+				BasicRuntimeChecks="3"
43
+				CompileAs="1"
44
+				DebugInformationFormat="3"
45
+				DisableSpecificWarnings="4996;4244"
46
+				MinimalRebuild="true"
47
+				Name="VCCLCompilerTool"
48
+				Optimization="0"
49
+				PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;_BIND_TO_CURRENT_VCLIBS_VERSION=1"
50
+				RuntimeLibrary="3"
51
+				UsePrecompiledHeader="0"
52
+				WarningLevel="3"
53
+			/>
54
+			<Tool
55
+				Name="VCManagedResourceCompilerTool"
56
+			/>
57
+			<Tool
58
+				Name="VCResourceCompilerTool"
59
+			/>
60
+			<Tool
61
+				Name="VCPreLinkEventTool"
62
+			/>
63
+			<Tool
64
+				GenerateDebugInformation="true"
65
+				LinkIncremental="1"
66
+				Name="VCLinkerTool"
67
+				SubSystem="1"
68
+				TargetMachine="1"
69
+			/>
70
+			<Tool
71
+				Name="VCALinkTool"
72
+			/>
73
+			<Tool
74
+				Name="VCManifestTool"
75
+			/>
76
+			<Tool
77
+				Name="VCXDCMakeTool"
78
+			/>
79
+			<Tool
80
+				Name="VCBscMakeTool"
81
+			/>
82
+			<Tool
83
+				Name="VCFxCopTool"
84
+			/>
85
+			<Tool
86
+				Name="VCAppVerifierTool"
87
+			/>
88
+			<Tool
89
+				Name="VCPostBuildEventTool"
90
+			/>
91
+		</Configuration>
92
+		<Configuration
93
+			CharacterSet="2"
94
+			ConfigurationType="1"
95
+			IntermediateDirectory="$(SolutionDir)build\$(ProjectName)\$(ConfigurationName)"
96
+			Name="Release|Win32"
97
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
98
+			WholeProgramOptimization="1"
99
+			>
100
+			<Tool
101
+				Name="VCPreBuildEventTool"
102
+			/>
103
+			<Tool
104
+				Name="VCCustomBuildTool"
105
+			/>
106
+			<Tool
107
+				Name="VCXMLDataGeneratorTool"
108
+			/>
109
+			<Tool
110
+				Name="VCWebServiceProxyGeneratorTool"
111
+			/>
112
+			<Tool
113
+				Name="VCMIDLTool"
114
+			/>
115
+			<Tool
116
+				AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;&quot;$(SolutionDir)..\libclamav&quot;;&quot;$(SolutionDir)compat&quot;;&quot;$(SolutionDir)3rdparty\zlib&quot;;&quot;$(SolutionDir)3rdparty\pthreads&quot;;&quot;$(SolutionDir)3rdparty\bzip2&quot;;&quot;$(SolutionDir)..&quot;"
117
+				CompileAs="1"
118
+				DebugInformationFormat="3"
119
+				DisableSpecificWarnings="4996;4244"
120
+				EnableFunctionLevelLinking="true"
121
+				EnableIntrinsicFunctions="true"
122
+				Name="VCCLCompilerTool"
123
+				Optimization="2"
124
+				PreprocessorDefinitions="WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;_BIND_TO_CURRENT_VCLIBS_VERSION=1"
125
+				RuntimeLibrary="2"
126
+				UsePrecompiledHeader="0"
127
+				WarningLevel="3"
128
+			/>
129
+			<Tool
130
+				Name="VCManagedResourceCompilerTool"
131
+			/>
132
+			<Tool
133
+				Name="VCResourceCompilerTool"
134
+			/>
135
+			<Tool
136
+				Name="VCPreLinkEventTool"
137
+			/>
138
+			<Tool
139
+				EnableCOMDATFolding="2"
140
+				GenerateDebugInformation="true"
141
+				LinkIncremental="1"
142
+				Name="VCLinkerTool"
143
+				OptimizeReferences="2"
144
+				SubSystem="1"
145
+				TargetMachine="1"
146
+			/>
147
+			<Tool
148
+				Name="VCALinkTool"
149
+			/>
150
+			<Tool
151
+				Name="VCManifestTool"
152
+			/>
153
+			<Tool
154
+				Name="VCXDCMakeTool"
155
+			/>
156
+			<Tool
157
+				Name="VCBscMakeTool"
158
+			/>
159
+			<Tool
160
+				Name="VCFxCopTool"
161
+			/>
162
+			<Tool
163
+				Name="VCAppVerifierTool"
164
+			/>
165
+			<Tool
166
+				Name="VCPostBuildEventTool"
167
+			/>
168
+		</Configuration>
169
+	</Configurations>
170
+	<References>
171
+	</References>
172
+	<Files>
173
+		<Filter
174
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
175
+			Name="Source Files"
176
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
177
+			>
178
+			<File
179
+				RelativePath="..\clamd\clamd.c"
180
+				>
181
+			</File>
182
+			<File
183
+				RelativePath="..\clamd\localserver.c"
184
+				>
185
+			</File>
186
+			<File
187
+				RelativePath="..\clamd\others.c"
188
+				>
189
+			</File>
190
+			<File
191
+				RelativePath="..\clamd\scanner.c"
192
+				>
193
+			</File>
194
+			<File
195
+				RelativePath="..\clamd\server-th.c"
196
+				>
197
+			</File>
198
+			<File
199
+				RelativePath="..\clamd\session.c"
200
+				>
201
+			</File>
202
+			<File
203
+				RelativePath="..\clamd\tcpserver.c"
204
+				>
205
+			</File>
206
+			<File
207
+				RelativePath="..\clamd\thrmgr.c"
208
+				>
209
+			</File>
210
+			<Filter
211
+				Name="shared"
212
+				>
213
+				<File
214
+					RelativePath="..\shared\misc.c"
215
+					>
216
+				</File>
217
+				<File
218
+					RelativePath="..\shared\output.c"
219
+					>
220
+				</File>
221
+			</Filter>
222
+			<Filter
223
+				Name="compat"
224
+				>
225
+				<File
226
+					RelativePath=".\compat\libgen.c"
227
+					>
228
+				</File>
229
+				<File
230
+					RelativePath=".\compat\setargv.c"
231
+					>
232
+				</File>
233
+			</Filter>
234
+		</Filter>
235
+		<Filter
236
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
237
+			Name="Header Files"
238
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
239
+			>
240
+		</Filter>
241
+		<Filter
242
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
243
+			Name="Resource Files"
244
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
245
+			>
246
+		</Filter>
247
+	</Files>
248
+	<Globals>
249
+	</Globals>
250
+</VisualStudioProject>
... ...
@@ -209,10 +209,6 @@
209 209
 					>
210 210
 				</File>
211 211
 				<File
212
-					RelativePath="..\shared\getopt.c"
213
-					>
214
-				</File>
215
-				<File
216 212
 					RelativePath="..\shared\misc.c"
217 213
 					>
218 214
 				</File>
... ...
@@ -324,3 +324,27 @@ int w32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, s
324 324
     }
325 325
     return ret;
326 326
 }
327
+
328
+int w32_accept(int sockfd, const struct sockaddr *addr, socklen_t *addrlen) {
329
+    if(accept((SOCKET)sockfd, addr, addrlen)) {
330
+	wsock2errno();
331
+	return -1;
332
+    }
333
+    return 0;
334
+}
335
+
336
+int w32_listen(int sockfd, int backlog) {
337
+    if(listen((SOCKET)sockfd, backlog)) {
338
+	wsock2errno();
339
+	return -1;
340
+    }
341
+    return 0;
342
+}
343
+
344
+int w32_shutdown(int sockfd, int how) {
345
+    if(shutdown((SOCKET)sockfd, how)) {
346
+	wsock2errno();
347
+	return -1;
348
+    }
349
+    return 0;
350
+}
... ...
@@ -39,5 +39,8 @@ void w32_freeaddrinfo(struct addrinfo *res);
39 39
 const char *w32_inet_ntop(int af, const void *src, char *dst, socklen_t size);
40 40
 struct hostent *w32_gethostbyname(const char *name);
41 41
 int w32_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
42
+int w32_accept(int sockfd, const struct sockaddr *addr, socklen_t *addrlen);
43
+int w32_listen(int sockfd, int backlog);
44
+int w32_shutdown(int sockfd, int how);
42 45
 
43 46
 #endif
... ...
@@ -43,7 +43,7 @@ for pippo in `cat "$INFILE"`; do
43 43
 	value=$((value+1000))
44 44
 	[ $value -gt $maxerr ] && maxerr=$value
45 45
 	descr=`echo $pippo | cut -d'|' -f3`
46
-	git grep $symbol > /dev/null
46
+	git grep $symbol | egrep -v '(referrno|w32_errno_defs)' > /dev/null
47 47
 	used=$?
48 48
 	[ $used -ne 0 ] && echo "#ifdef __ERRNO_INCLUDE_UNUSED" >> "$OUTFILE"
49 49
 	echo -e "#ifndef $symbol\n#define $symbol $value\n#endif\n{ $symbol, \"$descr\" }," >> "$OUTFILE"
... ...
@@ -46,7 +46,7 @@ int glob_add(const char *path, int *argc, char ***argv);
46 46
 int _setargv() {
47 47
     char *cur = GetCommandLineA(), *begparm = NULL, *endparm = NULL;
48 48
     char **argv = NULL, c;
49
-    int argc = 0, i, in_sq = 0, in_dq = 0, need_glob = 0, allarglen = 0;
49
+    int argc = 0, in_sq = 0, in_dq = 0, need_glob = 0, allarglen = 0;
50 50
     int *g_argc = __p___argc();
51 51
     char ***g_argv = __p___argv();
52 52
 
... ...
@@ -18,11 +18,20 @@
18 18
  *  MA 02110-1301, USA.
19 19
  */
20 20
 
21
-#if HAVE_CONFIG_H
22
-#include "clamav-config.h"
23
-#endif
24
-
21
+#include <string.h>
25 22
 #include "w32_errno.h"
26 23
 
24
+char *w32_strerror(int errnum) {
25
+    int i;
26
+    for(i=0; i<sizeof(w32_errnos) / sizeof(w32_errnos[0]); i++) {
27
+	if(w32_errnos[i].err == errnum)
28
+	    return w32_errnos[i].strerr;
29
+    }
30
+    return "Unknown error";
31
+}
27 32
 
28
-
33
+int w32_strerror_r(int errnum, char *buf, size_t buflen) {
34
+    strncpy(buf, w32_strerror(errnum), buflen);
35
+    if(buflen) buf[buflen-1] = '\0';
36
+    return 0;
37
+}
... ...
@@ -24,4 +24,7 @@
24 24
 #include <errno.h>
25 25
 #include "w32_errno_defs.c"
26 26
 
27
+char *w32_strerror(int errnum);
28
+int w32_strerror_r(int errnum, char *buf, size_t buflen);
29
+
27 30
 #endif
28 31
\ No newline at end of file
... ...
@@ -1,4 +1,4 @@
1
-/* Automatically generated on Wed Oct 14 14:49:39 GMT 2009 */
1
+/* Automatically generated on Thu Jan 28 23:51:23 CET 2010 */
2 2
 
3 3
 #include <errno.h>
4 4
 
... ...
@@ -336,12 +336,10 @@ static const struct errno_struct {
336 336
 #endif
337 337
 { ESRMNT, "Srmount error" },
338 338
 #endif /* __ERRNO_INCLUDE_UNUSED */
339
-#ifdef __ERRNO_INCLUDE_UNUSED
340 339
 #ifndef ECOMM
341 340
 #define ECOMM 1070
342 341
 #endif
343 342
 { ECOMM, "Communication error on send" },
344
-#endif /* __ERRNO_INCLUDE_UNUSED */
345 343
 #ifndef EPROTO
346 344
 #define EPROTO 1071
347 345
 #endif
... ...
@@ -215,10 +215,6 @@
215 215
 					>
216 216
 				</File>
217 217
 				<File
218
-					RelativePath="..\shared\getopt.c"
219
-					>
220
-				</File>
221
-				<File
222 218
 					RelativePath="..\shared\misc.c"
223 219
 					>
224 220
 				</File>
... ...
@@ -7,6 +7,10 @@ EXPORTS cl_engine_set_num
7 7
 EXPORTS cl_engine_set_str
8 8
 EXPORTS cl_engine_free
9 9
 EXPORTS cl_engine_new
10
+EXPORTS cl_engine_settings_copy
11
+EXPORTS cl_engine_settings_free
12
+EXPORTS cl_engine_settings_apply
13
+EXPORTS cl_engine_get_num
10 14
 EXPORTS cl_strerror
11 15
 EXPORTS cl_init
12 16
 EXPORTS cl_retdbdir
... ...
@@ -18,9 +22,14 @@ EXPORTS cl_retflevel
18 18
 EXPORTS cl_cvdparse
19 19
 EXPORTS cl_cvdverify
20 20
 EXPORTS cl_retver
21
+EXPORTS cl_engine_addref
22
+EXPORTS cl_statinidir
23
+EXPORTS cl_statchkdir
24
+EXPORTS cl_statfree
21 25
 
22 26
 ; cli_stuff - should be mangled or exported by ordinal only
23 27
 EXPORTS cli_gentemp
28
+EXPORTS cli_gentempfd
24 29
 EXPORTS cli_gettmpdir
25 30
 EXPORTS cli_regcomp
26 31
 EXPORTS cli_regexec
... ...
@@ -33,6 +42,11 @@ EXPORTS cli_cvdunpack
33 33
 EXPORTS cli_chomp
34 34
 EXPORTS cli_strtokenize
35 35
 EXPORTS cli_versig2
36
+EXPORTS cli_strerror
37
+EXPORTS cli_rndnum
38
+EXPORTS cli_unlink
39
+EXPORTS cli_writen
40
+EXPORTS cli_ftw
36 41
 EXPORTS have_rar
37 42
 EXPORTS have_clamjit
38 43
 
... ...
@@ -88,16 +102,37 @@ EXPORTS CONFDIR_MILTER DATA
88 88
 ; winsock - bridging for now
89 89
 EXPORTS htonl
90 90
 EXPORTS htons
91
+EXPORTS ntohl
91 92
 EXPORTS ntohs
92 93
 EXPORTS gettimeofday
93 94
 EXPORTS pthread_mutex_lock
94 95
 EXPORTS pthread_mutex_unlock
96
+EXPORTS pthread_mutex_destroy
97
+EXPORTS pthread_once
98
+EXPORTS pthread_getspecific
99
+EXPORTS pthread_setspecific
100
+EXPORTS pthread_create
101
+EXPORTS pthread_cond_timedwait
102
+EXPORTS pthread_cond_init
103
+EXPORTS pthread_cond_broadcast
104
+EXPORTS pthread_cond_signal
105
+EXPORTS pthread_cond_destroy
106
+EXPORTS pthread_join
107
+EXPORTS pthread_key_create
108
+EXPORTS pthread_cond_wait
109
+EXPORTS pthread_attr_init
110
+EXPORTS pthread_attr_setdetachstate
111
+EXPORTS pthread_attr_destroy
112
+EXPORTS pthread_mutex_init
95 113
 
96 114
 EXPORTS w32_socket
97 115
 EXPORTS w32_getsockopt
98 116
 EXPORTS w32_setsockopt
99 117
 EXPORTS w32_bind
118
+EXPORTS w32_listen
119
+EXPORTS w32_accept
100 120
 EXPORTS w32_connect
121
+EXPORTS w32_shutdown
101 122
 EXPORTS w32_send
102 123
 EXPORTS w32_recv
103 124
 EXPORTS w32_closesocket
... ...
@@ -107,5 +142,6 @@ EXPORTS w32_freeaddrinfo
107 107
 EXPORTS w32_inet_ntop
108 108
 EXPORTS w32_gethostbyname
109 109
 EXPORTS w32_select
110
-
111 110
 EXPORTS w32_stat
111
+EXPORTS w32_strerror
112
+EXPORTS w32_strerror_r
... ...
@@ -33,7 +33,10 @@ char *strptime(const char *s, const char *format, struct tm *tm);
33 33
 #define getsockopt w32_getsockopt
34 34
 #define setsockopt w32_setsockopt
35 35
 #define bind w32_bind
36
+#define listen w32_listen
37
+#define accept w32_accept
36 38
 #define connect w32_connect
39
+#define shutdown w32_shutdown
37 40
 #define send w32_send
38 41
 #define recv w32_recv
39 42
 #define closesocket w32_closesocket
... ...
@@ -43,6 +46,8 @@ char *strptime(const char *s, const char *format, struct tm *tm);
43 43
 #define inet_ntop w32_inet_ntop
44 44
 #define gethostbyname w32_gethostbyname
45 45
 #define select w32_select
46
+#define strerror w32_strerror
47
+#define strerror_r w32_strerror_r
46 48
 #define ftruncate _chsize
47 49
 #define getpid GetCurrentProcessId
48 50
 
... ...
@@ -104,8 +104,8 @@ my %CONF = (
104 104
     'HAVE_MMAP' => -1,
105 105
     'HAVE_NDIR_H' => -1,
106 106
     'HAVE_OPENDIR' => '1',
107
-    'HAVE_POLL' => '1',
108
-    'HAVE_POLL_H' => '1',
107
+    'HAVE_POLL' => -1,
108
+    'HAVE_POLL_H' => -1,
109 109
     'HAVE_PRAGMA_PACK' => '1',
110 110
     'HAVE_PRAGMA_PACK_HPPA' => -1,
111 111
     'HAVE_PRELOADED_SYMBOLS' => -1,
... ...
@@ -215,16 +215,19 @@ my @PROJECTS = (
215 215
     {makefile => 'libclamav/c++', sections => ['libclamavcxx'], output => 'win32/libclamavcxx.vcproj'},
216 216
 
217 217
     # CLAMSCAN #
218
-    {makefile => 'clamscan', sections => ['clamscan'], output => 'win32/clamscan.vcproj', makefile_only => 'optparser\\.c$', vcproj_only => 'compat\\\\'},
218
+    {makefile => 'clamscan', sections => ['clamscan'], output => 'win32/clamscan.vcproj', makefile_only => '(optparser\\.c|getopt\\.c)$', vcproj_only => 'compat\\\\'},
219
+
220
+    # CLAMD #
221
+    {makefile => 'clamd', sections => ['clamd'], output => 'win32/clamd.vcproj', makefile_only => '(optparser\\.c|getopt\\.c|(daz|clam)uko.*)$', vcproj_only => 'compat\\\\'},
219 222
 
220 223
     # FRESHCLAM #
221
-    {makefile => 'freshclam', sections => ['freshclam'], output => 'win32/freshclam.vcproj', makefile_only => 'optparser\\.c$', vcproj_only => 'compat\\\\'},
224
+    {makefile => 'freshclam', sections => ['freshclam'], output => 'win32/freshclam.vcproj', makefile_only => '(optparser\\.c|getopt\\.c)$', vcproj_only => 'compat\\\\'},
222 225
 
223 226
     # CLAMCONF #
224
-    {makefile => 'clamconf', sections => ['clamconf'], output => 'win32/clamconf.vcproj', makefile_only => 'optparser\\.c$'},
227
+    {makefile => 'clamconf', sections => ['clamconf'], output => 'win32/clamconf.vcproj', makefile_only => '(optparser\\.c$|getopt\\.c)$'},
225 228
 
226 229
     # CLAMBC #
227
-    {makefile => 'clambc', sections => ['clambc'], output => 'win32/clambc.vcproj', makefile_only => 'optparser\\.c$'},
230
+    {makefile => 'clambc', sections => ['clambc'], output => 'win32/clambc.vcproj', makefile_only => '(optparser\\.c|getopt\\.c)$'},
228 231
 
229 232
     # LLVMsystem #
230 233
     {makefile => 'libclamav/c++', sections => ['libllvmsystem'], output => 'win32/LLVMsystem.vcproj'},
... ...
@@ -232,7 +235,7 @@ my @PROJECTS = (
232 232
     # LLVMcodgen #
233 233
     {makefile => 'libclamav/c++', sections => ['libllvmcodegen'], output => 'win32/LLVMcodegen.vcproj'},
234 234
 
235
-    # LLVMcodgen #
235
+    # LLVMx86codgen #
236 236
     {makefile => 'libclamav/c++', sections => ['libllvmx86codegen'], output => 'win32/LLVMx86codegen.vcproj'},
237 237
 
238 238
     # LLVMjit #