[once more, this time with the patch]
On Thu, Feb 21, 2002 at 05:32:43PM +0100, Jac Engel wrote:
> The last version I compiled with MINGW was release ntop-2.0 with success.
> I tried to compile with MINGW version cvs 02-02-15 and 02-02-19
> but got errors:
Sorry about the delay; I've been out of town. Attached is a patch to
solve these problems, except for wapPlugin.c, which seems to be just
plain broken at first glance, so you can just remove it from
Makefile.mingw for now (the patch doesn't do so).
This should be committed after the appropriate review.
cheers,
--Scott
--
Scott Renfro <[EMAIL PROTECTED]>
diff -ur ntop-current\ntop\globals-core.c ntop-020309\ntop\globals-core.c
--- ntop-current\ntop\globals-core.c Fri Mar 08 15:05:08 2002
+++ ntop-020309\ntop\globals-core.c Fri Mar 08 19:25:41 2002
@@ -177,7 +177,7 @@
#ifdef ASYNC_ADDRESS_RESOLUTION
for (i = 0; i < MAX_NUM_DEQUEUE_THREADS; i ++)
- myGlobals.dequeueAddressThreadId[i] = -1;
+ myGlobals.dequeueAddressThreadId[i] = (pthread_t) -1;
myGlobals.droppedAddresses = 0;
#endif
diff -ur ntop-current\ntop\initialize.c ntop-020309\ntop\initialize.c
--- ntop-current\ntop\initialize.c Mon Feb 25 15:05:18 2002
+++ ntop-020309\ntop\initialize.c Fri Mar 08 19:37:13 2002
@@ -997,8 +997,10 @@
for(i=0; i<myGlobals.numDevices; i++) {
if((!myGlobals.device[i].virtualDevice)
- && (pcap_lookupnet(myGlobals.device[i].name,
&myGlobals.device[i].network.s_addr,
- &myGlobals.device[i].netmask.s_addr, ebuf) < 0)) {
+ && (pcap_lookupnet(myGlobals.device[i].name,
+ (bpf_u_int32*)&myGlobals.device[i].network.s_addr,
+ (bpf_u_int32*)&myGlobals.device[i].netmask.s_addr,
+ ebuf) < 0)) {
/* Fix for IP-less interfaces (e.g. bridge)
Courtesy of Diana Eichert <[EMAIL PROTECTED]>
*/
diff -ur ntop-current\ntop\Makefile.mingw ntop-020309\ntop\Makefile.mingw
--- ntop-current\ntop\Makefile.mingw Fri Jan 04 15:05:08 2002
+++ ntop-020309\ntop\Makefile.mingw Fri Mar 08 20:17:53 2002
@@ -92,8 +92,9 @@
reportUtils.c traffic.c plugin.c webInterface.c term.c \
netflow.c sql.c rules.c plugins/icmpPlugin.c \
plugins/lastSeenPlugin.c plugins/nfsPlugin.c \
- plugins/rmonPlugin.c plugins/wapPlugin.c regex.c \
- protocols.c
+ plugins/rmonPlugin.c plugins/wapPlugin.c \
+ plugins/sflowPlugin.c regex.c \
+ protocols.c sessions.c
GENSRC = version.c
diff -ur ntop-current\ntop\ntop.h ntop-020309\ntop\ntop.h
--- ntop-current\ntop\ntop.h Fri Mar 08 15:05:16 2002
+++ ntop-020309\ntop\ntop.h Fri Mar 08 20:28:04 2002
@@ -49,7 +49,11 @@
* fallbacks for essential typedefs
*/
#if !defined(HAVE_U_INT64_T)
+#if defined(WIN32) && defined(__GNUC__)
+typedef unsigned long long u_int64_t; /* on mingw unsigned long is 32 bits */
+#else
typedef unsigned long u_int64_t;
+#endif
#endif
#if !defined(HAVE_U_INT32_T)
diff -ur ntop-current\ntop\ntop_win32.h ntop-020309\ntop\ntop_win32.h
--- ntop-current\ntop\ntop_win32.h Wed Jan 02 15:06:06 2002
+++ ntop-020309\ntop\ntop_win32.h Fri Mar 08 19:30:39 2002
@@ -76,6 +76,7 @@
#else
extern int gettimeofday(struct timeval*, struct timezone*);
#endif
+char* getpass(const char *prompt);
extern unsigned long waitForNextEvent(unsigned long ulDelay /* ms */);
extern ULONG GetHostIPAddr();
diff -ur ntop-current\ntop\plugins\rmonPlugin.c ntop-020309\ntop\plugins\rmonPlugin.c
--- ntop-current\ntop\plugins\rmonPlugin.c Fri Mar 01 15:05:58 2002
+++ ntop-020309\ntop\plugins\rmonPlugin.c Fri Mar 08 19:45:01 2002
@@ -154,7 +154,9 @@
NULL, /* TermFunc */
NULL, /* PluginFunc */
handleRmonHTTPrequest,
+#ifdef SESSION_PLUGIN
NULL,
+#endif
NULL /* BPF filter */
}
};
diff -ur ntop-current\ntop\plugins\sflowPlugin.c ntop-020309\ntop\plugins\sflowPlugin.c
--- ntop-current\ntop\plugins\sflowPlugin.c Fri Mar 01 15:05:58 2002
+++ ntop-020309\ntop\plugins\sflowPlugin.c Fri Mar 08 20:20:59 2002
@@ -1581,7 +1581,7 @@
if(select(sflowSocket+1, &sflowMask, NULL, NULL, NULL) > 0) {
len = sizeof(fromHost);
- rc = recvfrom(sflowSocket, &buffer, sizeof(buffer),
+ rc = recvfrom(sflowSocket, (char*) &buffer, sizeof(buffer),
0, (struct sockaddr*)&fromHost, &len);
#ifdef DEBUG