update patchs for 2.2.99 compile goes well on openbsd 3.4-stable (not yet tested on -current)

patch for configure.in has tested which had not made their way in tree for now
patch sessions.c solve a problem of
sessions.c:2402: incompatible types in assignment
as bpf_timeval & timeval are not the same


configureextra/OPENBSD repeat the use of "-shared" flags on openbsd

with all that, you can compile HEAD
a minor change for install, is changing LN_S from 'ln -s' to 'ln -sf' in plugins/Makefile


after
sudo gmake install
sudo mkdir -p /opt/var/lib/ntop/
sudo chown ntop:ntop /opt/var/lib/ntop/

and for the short test, i made, ntop runs well under gdb
(with a 'signal SIGPIPE' to ignore this signal)

Regards

Julien
Index: sessions.c
===================================================================
RCS file: /export/home/ntop/ntop/sessions.c,v
retrieving revision 2.107
diff -U3 -r2.107 sessions.c
--- sessions.c  1 Jan 2004 10:06:40 -0000       2.107
+++ sessions.c  25 Jan 2004 10:32:29 -0000
@@ -2399,8 +2399,10 @@
             }
             memset ((char *)theSession->activeLuns[lun], 0,
                     sizeof (ScsiLunTrafficInfo));
-            theSession->activeLuns[lun]->firstSeen = h->ts;
-            theSession->activeLuns[lun]->lastIopsTime = h->ts;
+            theSession->activeLuns[lun]->firstSeen.tv_sec = h->ts.tv_sec;
+            theSession->activeLuns[lun]->firstSeen.tv_usec = h->ts.tv_usec;
+            theSession->activeLuns[lun]->lastIopsTime.tv_sec = h->ts.tv_sec;
+            theSession->activeLuns[lun]->lastIopsTime.tv_usec = h->ts.tv_usec;
         }
 
         if (lun > theSession->lunMax) {
@@ -2427,8 +2429,10 @@
                 }
                 memset ((char *)dstHost->activeLuns[lun], 0,
                         sizeof (ScsiLunTrafficInfo));
-                dstHost->activeLuns[lun]->firstSeen = h->ts;
-                dstHost->activeLuns[lun]->lastIopsTime = h->ts;
+                dstHost->activeLuns[lun]->firstSeen.tv_sec = h->ts.tv_sec;
+                dstHost->activeLuns[lun]->firstSeen.tv_usec = h->ts.tv_usec;
+                dstHost->activeLuns[lun]->lastIopsTime.tv_sec = h->ts.tv_sec;
+                dstHost->activeLuns[lun]->lastIopsTime.tv_usec = h->ts.tv_usec;
             }
             hostLunStats = dstHost->activeLuns[lun];
         }
@@ -2449,8 +2453,10 @@
                     return;
                 }
                 memset ((char *)srcHost->activeLuns[lun], 0, sizeof 
(ScsiLunTrafficInfo));
-                srcHost->activeLuns[lun]->firstSeen = h->ts;
-                srcHost->activeLuns[lun]->lastIopsTime = h->ts;
+                srcHost->activeLuns[lun]->firstSeen.tv_sec = h->ts.tv_sec;
+                srcHost->activeLuns[lun]->firstSeen.tv_usec = h->ts.tv_usec;
+                srcHost->activeLuns[lun]->lastIopsTime.tv_sec = h->ts.tv_sec;
+                srcHost->activeLuns[lun]->lastIopsTime.tv_usec = h->ts.tv_usec;
             }
             hostLunStats = srcHost->activeLuns[lun];
         }
@@ -2470,7 +2476,8 @@
             }
 
             lunStats->cmdsFromLastIops = 0;
-            lunStats->lastIopsTime = h->ts;
+            lunStats->lastIopsTime.tv_sec = h->ts.tv_sec;
+            lunStats->lastIopsTime.tv_usec = h->ts.tv_usec;
         }
         else {
             lunStats->cmdsFromLastIops++;
@@ -2488,14 +2495,17 @@
                 hostLunStats->minIops = iops;
             }
             hostLunStats->cmdsFromLastIops = 0;
-            hostLunStats->lastIopsTime = h->ts;
+            hostLunStats->lastIopsTime.tv_sec = h->ts.tv_sec;
+            hostLunStats->lastIopsTime.tv_usec = h->ts.tv_usec;
         }
         else {
             hostLunStats->cmdsFromLastIops++;
         }
         
-        lunStats->lastSeen = hostLunStats->lastSeen = h->ts;
-        lunStats->reqTime = hostLunStats->reqTime = h->ts;
+        lunStats->lastSeen.tv_sec = hostLunStats->lastSeen.tv_sec = h->ts.tv_sec;
+        lunStats->lastSeen.tv_usec = hostLunStats->lastSeen.tv_usec = h->ts.tv_usec;
+        lunStats->reqTime.tv_sec = hostLunStats->reqTime.tv_sec = h->ts.tv_sec;
+        lunStats->reqTime.tv_usec = hostLunStats->reqTime.tv_usec = h->ts.tv_usec;
 
         cmd = theSession->lastScsiCmd = lunStats->lastScsiCmd = bp[12];
         iocmdType = getScsiCmdType (cmd, &ioSize, bp);
@@ -3007,14 +3017,16 @@
           theSession->initiator = dstHost;
           theSession->remotePeer = srcHost;
       }
-      theSession->firstSeen = h->ts;
+      theSession->firstSeen.tv_sec = h->ts.tv_sec;
+      theSession->firstSeen.tv_usec = h->ts.tv_usec;
       theSession->sessionState = FLAG_STATE_ACTIVE;
       theSession->deviceId = actualDeviceId;
       theSession->initiator->numHostSessions++;
       theSession->remotePeer->numHostSessions++;
     }
 
-    theSession->lastSeen = h->ts;
+    theSession->lastSeen.tv_sec = h->ts.tv_sec;
+    theSession->lastSeen.tv_usec = h->ts.tv_usec;
 
     /* Typically in FC, the exchange originator is always the same entity in a
      * flow
Index: configureextra/OPENBSD
===================================================================
RCS file: /export/home/ntop/ntop/configureextra/OPENBSD,v
retrieving revision 1.1
diff -U3 -r1.1 OPENBSD
--- configureextra/OPENBSD      11 Dec 2003 00:04:40 -0000      1.1
+++ configureextra/OPENBSD      25 Jan 2004 10:38:47 -0000
@@ -4,5 +4,5 @@
 SO_VERSION_PATCH=.0.0
 
 # This is probably not right, but we can't seem to settle on what IS right...
-MAKE_SHARED_LIBRARY_PARM="-bundle -flat_namespace -undefined suppress"
+MAKE_SHARED_LIBRARY_PARM="-shared"
 
Index: configure.in
===================================================================
RCS file: /export/home/ntop/ntop/configure.in,v
retrieving revision 2.192
diff -U3 -r2.192 configure.in
--- configure.in        19 Jan 2004 08:17:44 -0000      2.192
+++ configure.in        24 Jan 2004 21:29:12 -0000
@@ -1842,6 +1842,9 @@
 dnl> Chris developed this for Solaris 9, confirming work I had done earlier for 
FreeBSD
 dnl> And thank to Julien TOUCHE [EMAIL PROTECTED] for the OpenBSD dependencies
 AC_CHECK_HEADERS([net/if.h], [], [], [
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif])
@@ -1865,10 +1868,19 @@
 #endif])
 AC_CHECK_HEADERS([netinet/in_systm.h])
 AC_CHECK_HEADERS([netinet/ip.h], [], [], [
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif])
 AC_CHECK_HEADERS([netinet/ip_icmp.h], [], [], [
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
@@ -1883,10 +1895,18 @@
 #endif])
 AC_CHECK_HEADERS([netinet/tcp.h])
 AC_CHECK_HEADERS([netinet/udp.h], [], [], [
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif])
-AC_CHECK_HEADERS([sys/sysctl.h net/if_dl.h])
+AC_CHECK_HEADERS([sys/param.h])
+AC_CHECK_HEADERS([net/if_dl.h])
+AC_CHECK_HEADERS([sys/sysctl.h], [], [], [
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif])
 AC_CHECK_HEADERS([net/route.h], [], [], [
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
@@ -1928,7 +1948,6 @@
 AC_CHECK_HEADERS([inttypes.h])
 AC_CHECK_HEADERS([memory.h])
 AC_CHECK_HEADERS([sys/ldr.h])
-AC_CHECK_HEADERS([sys/param.h])
 AC_CHECK_HEADERS([sys/select.h])
 AC_CHECK_HEADERS([sys/sockio.h])
 AC_CHECK_HEADERS([sys/stat.h])
@@ -1960,6 +1979,13 @@
         no)
                AC_DEFINE_UNQUOTED(INET6,  1, [Enable/disable ipv6 support])
                AC_CHECK_HEADERS([ip6.h icmp6.h])
+               AC_CHECK_HEADERS([netinet/ip6.h netinet/icmp6.h], [], [], [
+               #if HAVE_SYS_TYPES_H
+               #include <sys/types.h>
+               #endif
+               #if HAVE_NETINET_IN_H
+               #include <netinet/in.h>
+               #endif])
                AC_CHECK_FUNCS([sysctl])
                 ;;
 esac

Reply via email to