Revision: 11565 http://gar.svn.sourceforge.net/gar/?rev=11565&view=rev Author: dmichelsen Date: 2010-11-11 11:52:33 +0000 (Thu, 11 Nov 2010)
Log Message: ----------- ntop: Builds cleanly now, start/stop/smf still missing Modified Paths: -------------- csw/mgar/pkg/ntop/trunk/Makefile csw/mgar/pkg/ntop/trunk/checksums Added Paths: ----------- csw/mgar/pkg/ntop/trunk/files/0001-Fix-misplaced-endif.patch csw/mgar/pkg/ntop/trunk/files/0002-Do-not-redeclare-__builtin_alloca.patch csw/mgar/pkg/ntop/trunk/files/0003-Check-for-uint_-in-addition-to-u_int_.patch csw/mgar/pkg/ntop/trunk/files/0004-Strip-default-Solaris-library-pathes-as-we-set-our-o.patch csw/mgar/pkg/ntop/trunk/files/cswntop csw/mgar/pkg/ntop/trunk/files/postinstall csw/mgar/pkg/ntop/trunk/files/postremove csw/mgar/pkg/ntop/trunk/files/request Removed Paths: ------------- csw/mgar/pkg/ntop/trunk/files/configure.in.diff csw/mgar/pkg/ntop/trunk/files/configureextra_opencsw.diff csw/mgar/pkg/ntop/trunk/files/intdef.diff Modified: csw/mgar/pkg/ntop/trunk/Makefile =================================================================== --- csw/mgar/pkg/ntop/trunk/Makefile 2010-11-11 10:48:07 UTC (rev 11564) +++ csw/mgar/pkg/ntop/trunk/Makefile 2010-11-11 11:52:33 UTC (rev 11565) @@ -1,8 +1,8 @@ GARNAME = ntop -GARVERSION = 3.3.10 +GARVERSION = 4.0.3 CATEGORIES = net -DESCRIPTION = A network traffic usage monitor. +DESCRIPTION = A network traffic usage monitor define BLURB ntop is a network probe that shows network usage in a way similar to what top does for processes. In interactive mode, it displays the network status on the @@ -13,29 +13,75 @@ endef MASTER_SITES = $(SF_MIRRORS) -DISTFILES = $(GARNAME)-$(GARVERSION).tar.gz +DISTFILES = $(GARNAME)-$(GARVERSION).tgz -PATCHFILES = configure.in.diff -PATCHFILES += configureextra_opencsw.diff +PATCHFILES = 0001-Fix-misplaced-endif.patch +PATCHFILES += 0002-Do-not-redeclare-__builtin_alloca.patch +PATCHFILES += 0003-Check-for-uint_-in-addition-to-u_int_.patch +PATCHFILES += 0004-Strip-default-Solaris-library-pathes-as-we-set-our-o.patch +# PATCHFILES = configure.in.diff +# PATCHFILES += configureextra_opencsw.diff + # We define upstream file regex so we can be notifed of new upstream software release UPSTREAM_MASTER_SITES = $(SF_PROJECT_SHOWFILE)=17233 UPSTREAM_USE_SF = 1 UFILES_REGEX = (\d+(?:\.\d+)*) +RUNTIME_DEP_PKGS_CSWntop += CSWlibpython2-6-1-0 +RUNTIME_DEP_PKGS_CSWntop += CSWlibpcap +RUNTIME_DEP_PKGS_CSWntop += CSWosslrt +RUNTIME_DEP_PKGS_CSWntop += CSWrrd +RUNTIME_DEP_PKGS_CSWntop += CSWgeoip +RUNTIME_DEP_PKGS_CSWntop += CSWpython +RUNTIME_DEP_PKGS_CSWntop += CSWgdbm +RUNTIME_DEP_PKGS_CSWntop += CSWzlib +RUNTIME_DEP_PKGS_CSWntop += CSWiconv + +BUILD_DEP_PKGS = $(RUNTIME_DEP_PKGS_CSWntop) +BUILD_DEP_PKGS += CSWlibtool CSWautoconf CSWautomake +BUILD_DEP_PKGS += CSWlibpcapdevel CSWossldevel + +CONFIGURE_SCRIPTS = $(WORKSRC)/autogen.sh + +sysconfdir = /etc/opt/csw +localstatedir = /var/opt/csw + CONFIGURE_ARGS = $(DIRPATHS) -CONFIGURE_ARGS += --with-pcap-lib=/opt/csw/lib -CONFIGURE_ARGS += --with-pcap-include=/opt/csw/include CONFIGURE_ARGS += --with-gdbm-lib=/opt/csw/lib CONFIGURE_ARGS += --with-gdbm-include=/opt/csw/include CONFIGURE_ARGS += --with-zlib-lib=/opt/csw/lib CONFIGURE_ARGS += --with-zlib-include=/opt/csw/include CONFIGURE_ARGS += --with-ossl-lib=/opt/csw/lib CONFIGURE_ARGS += --with-ossl-include=/opt/csw/include +CONFIGURE_ARGS += --enable-jumbo-frames +# CONFIGURE_ARGS += --enable-fc +# CONFIGURE_ARGS += --enable-mysql +TEST_TARGET = check + +# We don't have a separate devel-package, so this is ok +CHECKPKG_OVERRIDES_CSWntop += shared-lib-package-contains-so-symlink|file=/opt/csw/lib/libcpacketPlugin.so +CHECKPKG_OVERRIDES_CSWntop += shared-lib-package-contains-so-symlink|file=/opt/csw/lib/libicmpPlugin.so +CHECKPKG_OVERRIDES_CSWntop += shared-lib-package-contains-so-symlink|file=/opt/csw/lib/libnetflowPlugin.so +CHECKPKG_OVERRIDES_CSWntop += shared-lib-package-contains-so-symlink|file=/opt/csw/lib/libntop.so +CHECKPKG_OVERRIDES_CSWntop += shared-lib-package-contains-so-symlink|file=/opt/csw/lib/libntopreport.so +CHECKPKG_OVERRIDES_CSWntop += shared-lib-package-contains-so-symlink|file=/opt/csw/lib/librrdPlugin.so +CHECKPKG_OVERRIDES_CSWntop += shared-lib-package-contains-so-symlink|file=/opt/csw/lib/libsflowPlugin.so + +# Upstream has chosen it that way... +CHECKPKG_OVERRIDES_CSWntop += soname-not-part-of-filename|soname=libcpacketPlugin-4.0.3.so|filename=cpacketPlugin.so +CHECKPKG_OVERRIDES_CSWntop += soname-not-part-of-filename|soname=libicmpPlugin-4.0.3.so|filename=icmpPlugin.so +CHECKPKG_OVERRIDES_CSWntop += soname-not-part-of-filename|soname=libnetflowPlugin-4.0.3.so|filename=netflowPlugin.so +CHECKPKG_OVERRIDES_CSWntop += soname-not-part-of-filename|soname=librrdPlugin-4.0.3.so|filename=rrdPlugin.so +CHECKPKG_OVERRIDES_CSWntop += soname-not-part-of-filename|soname=libsflowPlugin-4.0.3.so|filename=sflowPlugin.so +#CHECKPKG_OVERRIDES_CSWntop += shared-lib-pkgname-mismatch|sonames=['libcpacketPlugin-4.0.3.so',|'libicmpPlugin-4.0.3.so',|'libnetflowPlugin-4.0.3.so',|'libntop-4.0.3.so',|'libntopreport-4.0.3.so',|'librrdPlugin-4.0.3.so',|'libsflowPlugin-4.0.3.so']|pkgname=CSWntop|expected=['CSWlib4-0-3']| +CHECKPKG_OVERRIDES_CSWntop += shared-lib-pkgname-mismatch + include gar/category.mk pre-configure-modulated: - ( cd $(WORKSRC) ; ./autogen.sh --noconfig) + @# This brainded autogen.sh script search in /usr and /usr/local *only* + cp /opt/csw/share/aclocal/libtool.m4 $(WORKSRC)/libtool.m4.in @$(MAKECOOKIE) Modified: csw/mgar/pkg/ntop/trunk/checksums =================================================================== --- csw/mgar/pkg/ntop/trunk/checksums 2010-11-11 10:48:07 UTC (rev 11564) +++ csw/mgar/pkg/ntop/trunk/checksums 2010-11-11 11:52:33 UTC (rev 11565) @@ -1,3 +1 @@ -1615818e06d4a503b6a52426e88aaed4 configure.in.diff -257b92864fc22a475e23191c60dd100c configureextra_opencsw.diff -6e2ffa90d5f935c8f03d88a5dd19a866 ntop-3.3.10.tar.gz +f064393a2090e5bda102cd49c2707789 ntop-4.0.3.tgz Added: csw/mgar/pkg/ntop/trunk/files/0001-Fix-misplaced-endif.patch =================================================================== --- csw/mgar/pkg/ntop/trunk/files/0001-Fix-misplaced-endif.patch (rev 0) +++ csw/mgar/pkg/ntop/trunk/files/0001-Fix-misplaced-endif.patch 2010-11-11 11:52:33 UTC (rev 11565) @@ -0,0 +1,27 @@ +From 7ba230598efb6fc4636c0bb18b0d340d723e3d75 Mon Sep 17 00:00:00 2001 +From: Dagobert Michelsen <d...@opencsw.org> +Date: Thu, 11 Nov 2010 10:46:42 +0100 +Subject: [PATCH 1/4] Fix misplaced #endif + +--- + address.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/address.c b/address.c +index 73d8046..59436e1 100644 +--- a/address.c ++++ b/address.c +@@ -239,9 +239,9 @@ void* dequeueAddress(void *_i) { + he = &_hp; + else + he = NULL; +-#endif + } else + he = NULL; ++#endif + #else + he = gethostbyaddr(theAddr, size, family); + #endif +-- +1.7.3 + Added: csw/mgar/pkg/ntop/trunk/files/0002-Do-not-redeclare-__builtin_alloca.patch =================================================================== --- csw/mgar/pkg/ntop/trunk/files/0002-Do-not-redeclare-__builtin_alloca.patch (rev 0) +++ csw/mgar/pkg/ntop/trunk/files/0002-Do-not-redeclare-__builtin_alloca.patch 2010-11-11 11:52:33 UTC (rev 11565) @@ -0,0 +1,24 @@ +From b41a4c15c708ee01cf91a9d20dca3b6ae095370a Mon Sep 17 00:00:00 2001 +From: Dagobert Michelsen <d...@opencsw.org> +Date: Thu, 11 Nov 2010 10:50:20 +0100 +Subject: [PATCH 2/4] Do not redeclare __builtin_alloca + +--- + argv.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/argv.c b/argv.c +index 9212e85..84b02c6 100644 +--- a/argv.c ++++ b/argv.c +@@ -28,6 +28,7 @@ Cambridge, MA 02139, USA. */ + #else /* not __GNUC__ */ + #ifdef sparc + #include <alloca.h> ++/* This is declared at least on Solaris 9, maybe this should better be detected during configure-time? + extern char *__builtin_alloca(); /* Stupid include file doesn't declare it */ + #else + #ifdef _AIX +-- +1.7.3 + Added: csw/mgar/pkg/ntop/trunk/files/0003-Check-for-uint_-in-addition-to-u_int_.patch =================================================================== --- csw/mgar/pkg/ntop/trunk/files/0003-Check-for-uint_-in-addition-to-u_int_.patch (rev 0) +++ csw/mgar/pkg/ntop/trunk/files/0003-Check-for-uint_-in-addition-to-u_int_.patch 2010-11-11 11:52:33 UTC (rev 11565) @@ -0,0 +1,95 @@ +From a4b0c017045180b7fb5ddcd9a1b7433f2a7b55ea Mon Sep 17 00:00:00 2001 +From: Dagobert Michelsen <d...@opencsw.org> +Date: Thu, 11 Nov 2010 12:34:45 +0100 +Subject: [PATCH 3/4] Check for uint_* in addition to u_int_* + +--- + configure.in | 6 ++++++ + globals-structtypes.h | 20 ++++++++++++++++++++ + 2 files changed, 26 insertions(+), 0 deletions(-) + +diff --git a/configure.in b/configure.in +index 652e409..5c6fa98 100644 +--- a/configure.in ++++ b/configure.in +@@ -207,7 +207,10 @@ AH_TEMPLATE([HAVE_INT16_T], [Define for int16 typedef]) + AH_TEMPLATE([HAVE_INT32_T], [Define for int32 typedef]) + AH_TEMPLATE([HAVE_INT64_T], [Define for int64 typedef]) + AH_TEMPLATE([HAVE_INT8_T], [Define for int8 typedef]) ++AH_TEMPLATE([HAVE_UINT16_T], [Define for unsigned int 16 typedef]) ++AH_TEMPLATE([HAVE_UINT32_T], [Define for unsigned int 32 typedef]) + AH_TEMPLATE([HAVE_UINT64_T], [Define for unsigned int 64 typedef]) ++AH_TEMPLATE([HAVE_UINT8_T], [Define for unsigned int 8 typedef]) + AH_TEMPLATE([HAVE_U_INT16_T], [Define for unsigned int 16 typedef]) + AH_TEMPLATE([HAVE_U_INT32_T], [Define for unsigned int 32 typedef]) + AH_TEMPLATE([HAVE_U_INT64_T], [Define for unsigned int 64 typedef]) +@@ -1122,8 +1125,11 @@ AC_STRUCT_TIMEZONE + AC_CHECK_TYPEDEF(u_int64_t, sys/types.h) + AC_CHECK_TYPEDEF(uint64_t, sys/types.h) + AC_CHECK_TYPEDEF(u_int32_t, sys/types.h) ++AC_CHECK_TYPEDEF(uint32_t, sys/types.h) + AC_CHECK_TYPEDEF(u_int16_t, sys/types.h) ++AC_CHECK_TYPEDEF(uint16_t, sys/types.h) + AC_CHECK_TYPEDEF(u_int8_t, sys/types.h) ++AC_CHECK_TYPEDEF(uint8_t, sys/types.h) + AC_CHECK_TYPEDEF(int64_t, sys/types.h) + AC_CHECK_TYPEDEF(int32_t, sys/types.h) + AC_CHECK_TYPEDEF(int16_t, sys/types.h) +diff --git a/globals-structtypes.h b/globals-structtypes.h +index 2de7c6f..61a1632 100644 +--- a/globals-structtypes.h ++++ b/globals-structtypes.h +@@ -71,22 +71,38 @@ typedef u_int u_int32_t; + #if defined(HAVE_u_int64_T) + #define u_int64_t u_int64_t + #else ++#if defined(HAVE_UINT64_T) ++#define u_int64_t uint64_t ++#else + #error "Sorry, I'm unable to define u_int64_t on your platform" + #endif + #endif + #endif ++#endif + + #if !defined(HAVE_U_INT32_T) ++#if defined(HAVE_UINT32_T) ++#define u_int32_t uint32_t ++#else + typedef unsigned int u_int32_t; + #endif ++#endif + + #if !defined(HAVE_U_INT16_T) ++#if defined(HAVE_UINT16_T) ++#define u_int16_t uint16_t ++#else + typedef unsigned short u_int16_t; + #endif ++#endif + + #if !defined(HAVE_U_INT8_T) ++#if defined(HAVE_UINT8_T) ++#define u_int8_t uint8_t ++#else + typedef unsigned char u_int8_t; + #endif ++#endif + + #if !defined(HAVE_INT32_T) + typedef int int32_t; +@@ -312,7 +328,11 @@ typedef struct protocolsList { + #define pthread_rwlock_wrlock pthread_mutex_lock + #define pthread_rwlock_unlock pthread_mutex_unlock + #define pthread_rwlock_destroy pthread_mutex_destroy ++#ifdef SOLARIS ++#define pthread_rwlock_trywrlock pthread_mutex_trylock ++#else /* SOLARIS */ + #define pthread_rwlock_trywrlock pthread_mutex_trywrlock ++#endif /* SOLARIS */ + #endif + #endif + +-- +1.7.3 + Added: csw/mgar/pkg/ntop/trunk/files/0004-Strip-default-Solaris-library-pathes-as-we-set-our-o.patch =================================================================== --- csw/mgar/pkg/ntop/trunk/files/0004-Strip-default-Solaris-library-pathes-as-we-set-our-o.patch (rev 0) +++ csw/mgar/pkg/ntop/trunk/files/0004-Strip-default-Solaris-library-pathes-as-we-set-our-o.patch 2010-11-11 11:52:33 UTC (rev 11565) @@ -0,0 +1,52 @@ +From ef3ce9708fb1625f97fd8eff7665052602bb6429 Mon Sep 17 00:00:00 2001 +From: Dagobert Michelsen <d...@opencsw.org> +Date: Thu, 11 Nov 2010 12:35:04 +0100 +Subject: [PATCH 4/4] Strip default Solaris library pathes as we set our own + +--- + configureextra/SOLARIS10 | 6 +++--- + configureextra/SOLARIS9 | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/configureextra/SOLARIS10 b/configureextra/SOLARIS10 +index 5e12960..6f1a6ea 100644 +--- a/configureextra/SOLARIS10 ++++ b/configureextra/SOLARIS10 +@@ -5,9 +5,9 @@ + # + + echo " Setting Solaris 10 specific flag values" +-LDFLAGS="-L/opt/sfw/lib -L/usr/local/lib -R/opt/sfw/lib -R/usr/local/lib ${LDFLAGS}" ++#LDFLAGS="-L/opt/sfw/lib -L/usr/local/lib -R/opt/sfw/lib -R/usr/local/lib ${LDFLAGS}" + LIBS="-lnsl -lsocket ${LIBS}" +-CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/sfw/include" ++#CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/sfw/include" + + . configureextra/functions + +@@ -28,4 +28,4 @@ echo "- cd /usr/local/lib" + echo "- ln -s libpcap.so.0.X.Y libpcap.so" + echo "- rm libpcap.a" + echo "" +-echo "*************************************************" +\ No newline at end of file ++echo "*************************************************" +diff --git a/configureextra/SOLARIS9 b/configureextra/SOLARIS9 +index f968ea1..4323773 100755 +--- a/configureextra/SOLARIS9 ++++ b/configureextra/SOLARIS9 +@@ -1,9 +1,9 @@ + #!/bin/sh + + echo " Setting Solaris 9 specific flag values" +-LDFLAGS="-L/opt/sfw/lib -L/usr/local/lib -R/opt/sfw/lib -R/usr/local/lib ${LDFLAGS}" ++# LDFLAGS="-L/opt/sfw/lib -L/usr/local/lib -R/opt/sfw/lib -R/usr/local/lib ${LDFLAGS}" + LIBS="-lnsl -lsocket ${LIBS}" +-CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/sfw/include" ++# CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/sfw/include" + + . configureextra/functions + +-- +1.7.3 + Deleted: csw/mgar/pkg/ntop/trunk/files/configure.in.diff =================================================================== --- csw/mgar/pkg/ntop/trunk/files/configure.in.diff 2010-11-11 10:48:07 UTC (rev 11564) +++ csw/mgar/pkg/ntop/trunk/files/configure.in.diff 2010-11-11 11:52:33 UTC (rev 11565) @@ -1,44 +0,0 @@ ---- ntop-3.3.10.old/configure.in 2009-05-06 16:55:22.000000000 +0200 -+++ ntop-3.3.10/configure.in 2009-12-24 02:57:08.602866458 +0100 -@@ -274,6 +274,15 @@ - [ --with-pcap-root=DIR LBNL pcap located in DIR], - PCAP_ROOT="$withval", - PCAP_ROOT=) -+AC_ARG_WITH( pcap-lib, -+ [ --with-pcap-lib=DIR or libpcap located in DIR], -+ PCAP_LIB="$withval", -+ PCAP_LIB=) -+AC_ARG_WITH( pcap-include, -+ [ --with-pcap-include=DIR or pcap.h located in DIR], -+ PCAP_INCLUDE="$withval", -+ PCAP_INCLUDE=) -+ - AC_ARG_WITH( gdbm-root, - [ --with-gdbm-root=DIR gdbm located in DIR], - GDBM_DIRECTORY="$withval", -@@ -670,6 +679,7 @@ - INCS="${INCS} -I/usr/include/pcap" - AC_MSG_RESULT([found in $PCAP_ROOT]) - else -+ NTOP_APPENDS([${PCAP_INCLUDE}], [${PCAP_LIB}], [pcap]) - AC_CHECK_LIB(pcap, pcap_lookupdev, , [ - AC_MSG_RESULT([ *** FATAL ERROR *** ]) - AC_MSG_RESULT([ It looks that you don't have the libpcap distribution installed.]) -@@ -1659,7 +1669,7 @@ - wget http://www.lua.org/ftp/$LUA_VERSION.tar.gz - fi - --tar xvfz $LUA_VERSION.tar.gz -+gtar xvfz $LUA_VERSION.tar.gz - cat $LUA_VERSION/src/Makefile | sed -e s,'MYCFLAGS=-DLUA_USE_POSIX',' MYCFLAGS="-fPIC -DLUA_USE_POSIX"',g > /tmp/lua.temp - cat /tmp/lua.temp > $LUA_VERSION/src/Makefile - #rm -f /tmp/lua.temp -@@ -1968,7 +1978,7 @@ - else - wget http://www.maxmind.com/download/geoip/api/c/GeoIP.tar.gz - fi --tar xvfz GeoIP.tar.gz -+gtar xvfz GeoIP.tar.gz - GEO_DIR=`find $PWD -type d -name "GeoIP-*"` - cd $GEO_DIR; ./configure --prefix=${prefix}; make; cd .. - # OSX Fix Deleted: csw/mgar/pkg/ntop/trunk/files/configureextra_opencsw.diff =================================================================== --- csw/mgar/pkg/ntop/trunk/files/configureextra_opencsw.diff 2010-11-11 10:48:07 UTC (rev 11564) +++ csw/mgar/pkg/ntop/trunk/files/configureextra_opencsw.diff 2010-11-11 11:52:33 UTC (rev 11565) @@ -1,51 +0,0 @@ -diff -ru ntop-3.3.10.old/configureextra/SOLARIS10 ntop-3.3.10/configureextra/SOLARIS10 ---- ntop-3.3.10.old/configureextra/SOLARIS10 2007-05-03 23:31:40.000000000 +0200 -+++ ntop-3.3.10/configureextra/SOLARIS10 2009-12-24 02:31:19.464874160 +0100 -@@ -5,9 +5,9 @@ - # - - echo " Setting Solaris 10 specific flag values" --LDFLAGS="-L/opt/sfw/lib -L/usr/local/lib -R/opt/sfw/lib -R/usr/local/lib ${LDFLAGS}" -+LDFLAGS="-L/opt/csw/lib -R/opt/csw/lib ${LDFLAGS}" - LIBS="-lnsl -lsocket ${LIBS}" --CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/sfw/include" -+CPPFLAGS="${CPPFLAGS} -I/opt/csw/include" - - . configureextra/functions - -@@ -28,4 +28,4 @@ - echo "- ln -s libpcap.so.0.X.Y libpcap.so" - echo "- rm libpcap.a" - echo "" --echo "*************************************************" -\ No newline at end of file -+echo "*************************************************" -diff -ru ntop-3.3.10.old/configureextra/SOLARIS8 ntop-3.3.10/configureextra/SOLARIS8 ---- ntop-3.3.10.old/configureextra/SOLARIS8 2005-09-29 10:42:23.000000000 +0200 -+++ ntop-3.3.10/configureextra/SOLARIS8 2009-12-24 02:33:36.592681360 +0100 -@@ -1,8 +1,9 @@ - #!/bin/sh - - echo " Setting Solaris 8 specific flag values" --LDFLAGS="-L/usr/local/lib" -+LDFLAGS="-L/opt/csw/lib -R/opt/csw/lib ${LDFLAGS}" - LIBS="-lnsl -lsocket ${LIBS}" -+CPPFLAGS="${CPPFLAGS} -I/opt/csw/include" - - . configureextra/functions - -diff -ru ntop-3.3.10.old/configureextra/SOLARIS9 ntop-3.3.10/configureextra/SOLARIS9 ---- ntop-3.3.10.old/configureextra/SOLARIS9 2003-12-02 13:03:47.000000000 +0100 -+++ ntop-3.3.10/configureextra/SOLARIS9 2009-12-24 02:33:21.611018077 +0100 -@@ -1,9 +1,9 @@ - #!/bin/sh - - echo " Setting Solaris 9 specific flag values" --LDFLAGS="-L/opt/sfw/lib -L/usr/local/lib -R/opt/sfw/lib -R/usr/local/lib ${LDFLAGS}" -+LDFLAGS="-L/opt/csw/lib -R/opt/csw/lib ${LDFLAGS}" - LIBS="-lnsl -lsocket ${LIBS}" --CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/sfw/include" -+CPPFLAGS="${CPPFLAGS} -I/opt/csw/include" - - . configureextra/functions - Added: csw/mgar/pkg/ntop/trunk/files/cswntop =================================================================== --- csw/mgar/pkg/ntop/trunk/files/cswntop (rev 0) +++ csw/mgar/pkg/ntop/trunk/files/cswntop 2010-11-11 11:52:33 UTC (rev 11565) @@ -0,0 +1,110 @@ +#!/sbin/sh +# +# ntop startup script for ntop v3.0 +# v1.0 +# +BINDIR=/opt/csw/bin +CONF=/opt/csw/etc/ntop/ntop.conf + + if [ ! -f "$CONF" ]; then + echo "Configuration file not found." + exit 1 + else + DATADIR=`/usr/bin/egrep "^\--db-file-path|^-P" "$CONF" | /usr/bin/cut -f2 -d" "` + if [ -z "$DATADIR" ]; then + DATADIR=/var/opt/csw/ntop + EXTRA="-P ${DATADIR}" + fi + fi + PIDFILE=${DATADIR}/ntop.pid + +case $1 in +'start') + DAEMON_MODE=`/usr/bin/egrep "^\--daemon|^-d" "$CONF"` + if [ -z "$DAEMON_MODE" ];then + echo "No configured as a daemon." + exit 1 + fi + NTOPUSER=`/usr/bin/egrep "^\--user|^-u" "$CONF" | /usr/bin/cut -f2 -d" "` + NTOPGROUP=`/usr/bin/egrep "^${NTOPUSER}:" /etc/passwd | /usr/bin/cut -f4 -d":" ` + if [ -z "$NTOPGROUP" ]; then + echo "Invalid ntop user ${NTOPUSER}" + exit 1 + fi + if [ -z "$NTOPUSER" ]; then + NTOPUSER=nobody + EXTRA="${EXTRA} -u ${NTOPUSER}" + fi + if [ ! -d "$DATADIR" ];then + /usr/bin/mkdir -p ${DATADIR} + /usr/bin/chown ${NTOPUSER}:${NTOPGROUP} ${DATADIR} + /usr/bin/chmod 0711 ${DATADIR} + fi + if [ ! -f "$DATADIR/ntop_pw.db" ];then + echo "No password database !" + exit 1; + fi + HTTP=`/usr/bin/egrep "^\--http-server|^-w" "$CONF" | /usr/bin/cut -f2 -d" "` + if [ -z "$HTTP" ];then + EXTRA=" ${EXTRA} -w 3000" + fi + HTTPS=`/usr/bin/egrep "^\--http-servers|^-W" "$CONF" | /usr/bin/cut -f2 -d" "` + if [ -z "$HTTPS" ];then + EXTRA=" ${EXTRA} -W 0" + fi + INTERFACES=`/usr/bin/egrep "^\--interfaces|^-i" "$CONF" | /usr/bin/cut -f2 -d" "` + if [ -z "$INTERFACES" ];then + for i in `/sbin/ifconfig -a |/usr/bin/grep "^[a-z0-9]*:"` + do + /usr/bin/echo $i | /usr/bin/grep "^[a-z0-9]*:" >/dev/null 2>&1 + if [ $? -eq 1 ]; then + continue + fi + m=`/usr/bin/echo ${i} | /usr/bin/sed 's/:[0-9]*:*//'` + if [ "$m" = "lo0" ]; then + continue + fi + net_device_list="${net_device_list} ${m}" + done + net_device_list=`/usr/bin/echo $net_device_list | /usr/bin/sort -u` + interfaces=0; + set -- $net_device_list + for i + do + if [ ${interfaces} -gt 0 ]; then + INTERFACES="${i},${INTERFACES}" + else + INTERFACES="${i}" + fi + interfaces=`/usr/bin/expr ${interfaces} + 1` + done + fi + if [ ${interfaces} -gt 1 ]; then + EXTRA=" ${EXTRA} -i ${INTERFACES}" + fi + LOG=`/usr/bin/egrep "^\--use-syslog|^-L" "$CONF" | /usr/bin/cut -f2 -d" "` + if [ -z "$LOG" ];then + EXTRA=" ${EXTRA} --use-syslog=local3" + fi + + /usr/bin/echo "Start ntop network traffic usage monitor..." + if [ -z "$EXTRA" ];then + $BINDIR/ntop @${CONF} + else + $BINDIR/ntop ${EXTRA} @${CONF} + fi + + ;; +'stop') + + echo "Stop ntop network traffic usage monitor..." + if [ -f "$PIDFILE" ]; then + /usr/bin/kill -TERM `/usr/bin/cat $PIDFILE` + fi + ;; + +*) + echo "Usage: $0 { start | stop }" + exit 1 + ;; +esac Deleted: csw/mgar/pkg/ntop/trunk/files/intdef.diff =================================================================== --- csw/mgar/pkg/ntop/trunk/files/intdef.diff 2010-11-11 10:48:07 UTC (rev 11564) +++ csw/mgar/pkg/ntop/trunk/files/intdef.diff 2010-11-11 11:52:33 UTC (rev 11565) @@ -1,767 +0,0 @@ -diff -Nru ntop-3.0pre2.orig/globals-structtypes.h ntop-3.0pre2/globals-structtypes.h ---- ntop-3.0pre2.orig/globals-structtypes.h 2004-03-03 17:14:48.000000000 -0800 -+++ ntop-3.0pre2/globals-structtypes.h 2004-03-11 11:39:45.793529000 -0800 -@@ -138,7 +138,7 @@ - - struct { - unsigned naa:4; -- u_int64_t vendor_specific:60; -+ uint64_t vendor_specific:60; - } wwn_format3; - - struct { -@@ -150,7 +150,7 @@ - struct { - unsigned naa :4; - unsigned ieee_company_id:24; -- u_int64_t vsid :36; /* vendor specific ID */ -+ uint64_t vsid :36; /* vendor specific ID */ - } wwn_format5; - #else - struct { -@@ -166,23 +166,23 @@ - } wwn_format2; - - struct { -- u_int64_t vendor_specific:60; -+ uint64_t vendor_specific:60; - unsigned naa:4; - } wwn_format3; - - struct { -- u_int32_t ip_addr; -+ uint32_t ip_addr; - unsigned reserved :28; - unsigned naa :4; - } wwn_format4; - - struct { -- u_int64_t vsid :36; -+ uint64_t vsid :36; - unsigned ieee_company_id:24; - unsigned naa :4; - } wwn_format5; - #endif -- u_int64_t num; -+ uint64_t num; - } wwn_t; - - typedef struct hostAddr { -diff -Nru ntop-3.0pre2.orig/plugins/sflowPlugin.c ntop-3.0pre2/plugins/sflowPlugin.c ---- ntop-3.0pre2.orig/plugins/sflowPlugin.c 2004-02-23 19:49:44.000000000 -0800 -+++ ntop-3.0pre2/plugins/sflowPlugin.c 2004-03-11 11:41:24.411656000 -0800 -@@ -115,45 +115,45 @@ - /* define my own IP header struct - to ease portability */ - struct myiphdr - { -- u_int8_t version_and_headerLen; -- u_int8_t tos; -- u_int16_t tot_len; -- u_int16_t id; -- u_int16_t frag_off; -- u_int8_t ttl; -- u_int8_t protocol; -- u_int16_t check; -- u_int32_t saddr; -- u_int32_t daddr; -+ uint8_t version_and_headerLen; -+ uint8_t tos; -+ uint16_t tot_len; -+ uint16_t id; -+ uint16_t frag_off; -+ uint8_t ttl; -+ uint8_t protocol; -+ uint16_t check; -+ uint32_t saddr; -+ uint32_t daddr; - }; - - /* same for tcp */ - struct mytcphdr - { -- u_int16_t th_sport; /* source port */ -- u_int16_t th_dport; /* destination port */ -- u_int32_t th_seq; /* sequence number */ -- u_int32_t th_ack; /* acknowledgement number */ -- u_int8_t th_off_and_unused; -- u_int8_t th_flags; -- u_int16_t th_win; /* window */ -- u_int16_t th_sum; /* checksum */ -- u_int16_t th_urp; /* urgent pointer */ -+ uint16_t th_sport; /* source port */ -+ uint16_t th_dport; /* destination port */ -+ uint32_t th_seq; /* sequence number */ -+ uint32_t th_ack; /* acknowledgement number */ -+ uint8_t th_off_and_unused; -+ uint8_t th_flags; -+ uint16_t th_win; /* window */ -+ uint16_t th_sum; /* checksum */ -+ uint16_t th_urp; /* urgent pointer */ - }; - - /* and UDP */ - struct myudphdr { -- u_int16_t uh_sport; /* source port */ -- u_int16_t uh_dport; /* destination port */ -- u_int16_t uh_ulen; /* udp length */ -- u_int16_t uh_sum; /* udp checksum */ -+ uint16_t uh_sport; /* source port */ -+ uint16_t uh_dport; /* destination port */ -+ uint16_t uh_ulen; /* udp length */ -+ uint16_t uh_sum; /* udp checksum */ - }; - - /* and ICMP */ - struct myicmphdr - { -- u_int8_t type; /* message type */ -- u_int8_t code; /* type sub-code */ -+ uint8_t type; /* message type */ -+ uint8_t code; /* type sub-code */ - /* ignore the rest */ - }; - -@@ -163,9 +163,9 @@ - { - union - { -- u_int8_t u6_addr8[16]; -- u_int16_t u6_addr16[8]; -- u_int32_t u6_addr32[4]; -+ uint8_t u6_addr8[16]; -+ uint16_t u6_addr16[8]; -+ uint32_t u6_addr32[4]; - } in6_u; - }; - #endif /* HAVE_IN6_ADDR */ -@@ -181,7 +181,7 @@ - } INMAddress_value; - - typedef struct _INMAddress { -- u_int32_t type; /* enum INMAddress_type */ -+ uint32_t type; /* enum INMAddress_type */ - INMAddress_value address; - } INMAddress; - -@@ -206,38 +206,38 @@ - }; - - typedef struct _INMSampled_header { -- u_int32_t header_protocol; /* (enum INMHeader_protocol) */ -- u_int32_t frame_length; /* Original length of packet before sampling */ -- u_int32_t header_length; /* length of sampled header bytes to follow */ -- u_int8_t header[INM_MAX_HEADER_SIZE]; /* Header bytes */ -+ uint32_t header_protocol; /* (enum INMHeader_protocol) */ -+ uint32_t frame_length; /* Original length of packet before sampling */ -+ uint32_t header_length; /* length of sampled header bytes to follow */ -+ uint8_t header[INM_MAX_HEADER_SIZE]; /* Header bytes */ - } INMSampled_header; - - /* Packet IP version 4 data */ - - typedef struct _INMSampled_ipv4 { -- u_int32_t length; /* The length of the IP packet -+ uint32_t length; /* The length of the IP packet - excluding lower layer encapsulations */ -- u_int32_t protocol; /* IP Protocol type (for example, TCP = 6, UDP = 17) */ -+ uint32_t protocol; /* IP Protocol type (for example, TCP = 6, UDP = 17) */ - struct in_addr src_ip; /* Source IP Address */ - struct in_addr dst_ip; /* Destination IP Address */ -- u_int32_t src_port; /* TCP/UDP source port number or equivalent */ -- u_int32_t dst_port; /* TCP/UDP destination port number or equivalent */ -- u_int32_t tcp_flags; /* TCP flags */ -- u_int32_t tos; /* IP type of service */ -+ uint32_t src_port; /* TCP/UDP source port number or equivalent */ -+ uint32_t dst_port; /* TCP/UDP destination port number or equivalent */ -+ uint32_t tcp_flags; /* TCP flags */ -+ uint32_t tos; /* IP type of service */ - } INMSampled_ipv4; - - /* Packet IP version 6 data */ - - typedef struct _INMSampled_ipv6 { -- u_int32_t length; /* The length of the IP packet -+ uint32_t length; /* The length of the IP packet - excluding lower layer encapsulations */ -- u_int32_t protocol; /* IP Protocol type (for example, TCP = 6, UDP = 17) */ -+ uint32_t protocol; /* IP Protocol type (for example, TCP = 6, UDP = 17) */ - struct in6_addr src_ip; /* Source IP Address */ - struct in6_addr dst_ip; /* Destination IP Address */ -- u_int32_t src_port; /* TCP/UDP source port number or equivalent */ -- u_int32_t dst_port; /* TCP/UDP destination port number or equivalent */ -- u_int32_t tcp_flags; /* TCP flags */ -- u_int32_t tos; /* IP type of service */ -+ uint32_t src_port; /* TCP/UDP source port number or equivalent */ -+ uint32_t dst_port; /* TCP/UDP destination port number or equivalent */ -+ uint32_t tcp_flags; /* TCP flags */ -+ uint32_t tos; /* IP type of service */ - } INMSampled_ipv6; - - -@@ -260,35 +260,35 @@ - /* Extended switch data */ - - typedef struct _INMExtended_switch { -- u_int32_t src_vlan; /* The 802.1Q VLAN id of incomming frame */ -- u_int32_t src_priority; /* The 802.1p priority */ -- u_int32_t dst_vlan; /* The 802.1Q VLAN id of outgoing frame */ -- u_int32_t dst_priority; /* The 802.1p priority */ -+ uint32_t src_vlan; /* The 802.1Q VLAN id of incomming frame */ -+ uint32_t src_priority; /* The 802.1p priority */ -+ uint32_t dst_vlan; /* The 802.1Q VLAN id of outgoing frame */ -+ uint32_t dst_priority; /* The 802.1p priority */ - } INMExtended_switch; - - /* Extended router data */ - - typedef struct _INMExtended_router { - INMAddress nexthop; /* IP address of next hop router */ -- u_int32_t src_mask; /* Source address prefix mask bits */ -- u_int32_t dst_mask; /* Destination address prefix mask bits */ -+ uint32_t src_mask; /* Source address prefix mask bits */ -+ uint32_t dst_mask; /* Destination address prefix mask bits */ - } INMExtended_router; - - /* Extended gateway data */ - - typedef struct _INMExtended_gateway { -- u_int32_t as; /* AS number for this gateway */ -- u_int32_t src_as; -- u_int32_t src_peer_as; -- u_int32_t dst_as_path_length; -- u_int32_t *dst_as_path; -+ uint32_t as; /* AS number for this gateway */ -+ uint32_t src_as; -+ uint32_t src_peer_as; -+ uint32_t dst_as_path_length; -+ uint32_t *dst_as_path; - } INMExtended_gateway; - - /* Extended user data */ - typedef struct _INMExtended_user { -- u_int32_t src_user_len; -+ uint32_t src_user_len; - char *src_user; -- u_int32_t dst_user_len; -+ uint32_t dst_user_len; - char *dst_user; - } INMExtended_user; - -@@ -304,18 +304,18 @@ - /* Format of a single sample */ - - typedef struct _INMFlow_sample { -- u_int32_t sequence_number; /* Incremented with each flow sample -+ uint32_t sequence_number; /* Incremented with each flow sample - generated */ -- u_int32_t source_id; /* fsSourceId */ -- u_int32_t sampling_rate; /* fsPacketSamplingRate */ -- u_int32_t sample_pool; /* Total number of packets that could have been -+ uint32_t source_id; /* fsSourceId */ -+ uint32_t sampling_rate; /* fsPacketSamplingRate */ -+ uint32_t sample_pool; /* Total number of packets that could have been - sampled (i.e. packets skipped by sampling - process + total number of samples) */ -- u_int32_t drops; /* Number of times a packet was dropped due to -+ uint32_t drops; /* Number of times a packet was dropped due to - lack of resources */ -- u_int32_t input; /* SNMP ifIndex of input interface. -+ uint32_t input; /* SNMP ifIndex of input interface. - 0 if interface is not known. */ -- u_int32_t output; /* SNMP ifIndex of output interface, -+ uint32_t output; /* SNMP ifIndex of output interface, - 0 if interface is not known. - Set most significant bit to indicate - multiple destination interfaces -@@ -330,7 +330,7 @@ - 0x80000000 indicates a packet sent to - an unknown number of - interfaces greater than 1.*/ -- u_int32_t packet_data_tag; /* enum INMPacket_information_type */ -+ uint32_t packet_data_tag; /* enum INMPacket_information_type */ - INMPacket_data_type packet_data; /* Information about sampled packet */ - - /* in the sFlow packet spec the next field is the number of extended objects -@@ -352,46 +352,46 @@ - /* Generic interface counters - see RFC 1573, 2233 */ - - typedef struct _INMIf_counters { -- u_int32_t ifIndex; -- u_int32_t ifType; -- u_int64_t ifSpeed; -- u_int32_t ifDirection; /* Derived from MAU MIB (RFC 2239) -+ uint32_t ifIndex; -+ uint32_t ifType; -+ uint64_t ifSpeed; -+ uint32_t ifDirection; /* Derived from MAU MIB (RFC 2239) - 0 = unknown, 1 = full-duplex, - 2 = half-duplex, 3 = in, 4 = out */ -- u_int32_t ifStatus; /* bit field with the following bits assigned: -+ uint32_t ifStatus; /* bit field with the following bits assigned: - bit 0 = ifAdminStatus (0 = down, 1 = up) - bit 1 = ifOperStatus (0 = down, 1 = up) */ -- u_int64_t ifInOctets; -- u_int32_t ifInUcastPkts; -- u_int32_t ifInMulticastPkts; -- u_int32_t ifInBroadcastPkts; -- u_int32_t ifInDiscards; -- u_int32_t ifInErrors; -- u_int32_t ifInUnknownProtos; -- u_int64_t ifOutOctets; -- u_int32_t ifOutUcastPkts; -- u_int32_t ifOutMulticastPkts; -- u_int32_t ifOutBroadcastPkts; -- u_int32_t ifOutDiscards; -- u_int32_t ifOutErrors; -- u_int32_t ifPromiscuousMode; -+ uint64_t ifInOctets; -+ uint32_t ifInUcastPkts; -+ uint32_t ifInMulticastPkts; -+ uint32_t ifInBroadcastPkts; -+ uint32_t ifInDiscards; -+ uint32_t ifInErrors; -+ uint32_t ifInUnknownProtos; -+ uint64_t ifOutOctets; -+ uint32_t ifOutUcastPkts; -+ uint32_t ifOutMulticastPkts; -+ uint32_t ifOutBroadcastPkts; -+ uint32_t ifOutDiscards; -+ uint32_t ifOutErrors; -+ uint32_t ifPromiscuousMode; - } INMIf_counters; - - /* Ethernet interface counters - see RFC 2358 */ - typedef struct _INMEthernet_specific_counters { -- u_int32_t dot3StatsAlignmentErrors; -- u_int32_t dot3StatsFCSErrors; -- u_int32_t dot3StatsSingleCollisionFrames; -- u_int32_t dot3StatsMultipleCollisionFrames; -- u_int32_t dot3StatsSQETestErrors; -- u_int32_t dot3StatsDeferredTransmissions; -- u_int32_t dot3StatsLateCollisions; -- u_int32_t dot3StatsExcessiveCollisions; -- u_int32_t dot3StatsInternalMacTransmitErrors; -- u_int32_t dot3StatsCarrierSenseErrors; -- u_int32_t dot3StatsFrameTooLongs; -- u_int32_t dot3StatsInternalMacReceiveErrors; -- u_int32_t dot3StatsSymbolErrors; -+ uint32_t dot3StatsAlignmentErrors; -+ uint32_t dot3StatsFCSErrors; -+ uint32_t dot3StatsSingleCollisionFrames; -+ uint32_t dot3StatsMultipleCollisionFrames; -+ uint32_t dot3StatsSQETestErrors; -+ uint32_t dot3StatsDeferredTransmissions; -+ uint32_t dot3StatsLateCollisions; -+ uint32_t dot3StatsExcessiveCollisions; -+ uint32_t dot3StatsInternalMacTransmitErrors; -+ uint32_t dot3StatsCarrierSenseErrors; -+ uint32_t dot3StatsFrameTooLongs; -+ uint32_t dot3StatsInternalMacReceiveErrors; -+ uint32_t dot3StatsSymbolErrors; - } INMEthernet_specific_counters; - - typedef struct _INMEthernet_counters { -@@ -407,24 +407,24 @@ - /* Token ring counters - see RFC 1748 */ - - typedef struct _INMTokenring_specific_counters { -- u_int32_t dot5StatsLineErrors; -- u_int32_t dot5StatsBurstErrors; -- u_int32_t dot5StatsACErrors; -- u_int32_t dot5StatsAbortTransErrors; -- u_int32_t dot5StatsInternalErrors; -- u_int32_t dot5StatsLostFrameErrors; -- u_int32_t dot5StatsReceiveCongestions; -- u_int32_t dot5StatsFrameCopiedErrors; -- u_int32_t dot5StatsTokenErrors; -- u_int32_t dot5StatsSoftErrors; -- u_int32_t dot5StatsHardErrors; -- u_int32_t dot5StatsSignalLoss; -- u_int32_t dot5StatsTransmitBeacons; -- u_int32_t dot5StatsRecoverys; -- u_int32_t dot5StatsLobeWires; -- u_int32_t dot5StatsRemoves; -- u_int32_t dot5StatsSingles; -- u_int32_t dot5StatsFreqErrors; -+ uint32_t dot5StatsLineErrors; -+ uint32_t dot5StatsBurstErrors; -+ uint32_t dot5StatsACErrors; -+ uint32_t dot5StatsAbortTransErrors; -+ uint32_t dot5StatsInternalErrors; -+ uint32_t dot5StatsLostFrameErrors; -+ uint32_t dot5StatsReceiveCongestions; -+ uint32_t dot5StatsFrameCopiedErrors; -+ uint32_t dot5StatsTokenErrors; -+ uint32_t dot5StatsSoftErrors; -+ uint32_t dot5StatsHardErrors; -+ uint32_t dot5StatsSignalLoss; -+ uint32_t dot5StatsTransmitBeacons; -+ uint32_t dot5StatsRecoverys; -+ uint32_t dot5StatsLobeWires; -+ uint32_t dot5StatsRemoves; -+ uint32_t dot5StatsSingles; -+ uint32_t dot5StatsFreqErrors; - } INMTokenring_specific_counters; - - typedef struct _INMTokenring_counters { -@@ -435,20 +435,20 @@ - /* 100 BaseVG interface counters - see RFC 2020 */ - - typedef struct _INMVg_specific_counters { -- u_int32_t dot12InHighPriorityFrames; -- u_int64_t dot12InHighPriorityOctets; -- u_int32_t dot12InNormPriorityFrames; -- u_int64_t dot12InNormPriorityOctets; -- u_int32_t dot12InIPMErrors; -- u_int32_t dot12InOversizeFrameErrors; -- u_int32_t dot12InDataErrors; -- u_int32_t dot12InNullAddressedFrames; -- u_int32_t dot12OutHighPriorityFrames; -- u_int64_t dot12OutHighPriorityOctets; -- u_int32_t dot12TransitionIntoTrainings; -- u_int64_t dot12HCInHighPriorityOctets; -- u_int64_t dot12HCInNormPriorityOctets; -- u_int64_t dot12HCOutHighPriorityOctets; -+ uint32_t dot12InHighPriorityFrames; -+ uint64_t dot12InHighPriorityOctets; -+ uint32_t dot12InNormPriorityFrames; -+ uint64_t dot12InNormPriorityOctets; -+ uint32_t dot12InIPMErrors; -+ uint32_t dot12InOversizeFrameErrors; -+ uint32_t dot12InDataErrors; -+ uint32_t dot12InNullAddressedFrames; -+ uint32_t dot12OutHighPriorityFrames; -+ uint64_t dot12OutHighPriorityOctets; -+ uint32_t dot12TransitionIntoTrainings; -+ uint64_t dot12HCInHighPriorityOctets; -+ uint64_t dot12HCInNormPriorityOctets; -+ uint64_t dot12HCOutHighPriorityOctets; - } INMVg_specific_counters; - - typedef struct _INMVg_counters { -@@ -463,12 +463,12 @@ - } INMWan_counters; - - typedef struct _INMVlan_counters { -- u_int32_t vlan_id; -- u_int64_t octets; -- u_int32_t ucastPkts; -- u_int32_t multicastPkts; -- u_int32_t broadcastPkts; -- u_int32_t discards; -+ uint32_t vlan_id; -+ uint64_t octets; -+ uint32_t ucastPkts; -+ uint32_t multicastPkts; -+ uint32_t broadcastPkts; -+ uint32_t discards; - } INMVlan_counters; - - /* Counters data */ -@@ -494,15 +494,15 @@ - } INMCounters_type; - - typedef struct _INMCounters_sample_hdr { -- u_int32_t sequence_number; /* Incremented with each counters sample -+ uint32_t sequence_number; /* Incremented with each counters sample - generated by this source_id */ -- u_int32_t source_id; /* fsSourceId */ -- u_int32_t sampling_interval; /* fsCounterSamplingInterval */ -+ uint32_t source_id; /* fsSourceId */ -+ uint32_t sampling_interval; /* fsCounterSamplingInterval */ - } INMCounters_sample_hdr; - - typedef struct _INMCounters_sample { - INMCounters_sample_hdr hdr; -- u_int32_t counters_type_tag; /* Enum INMCounters_version */ -+ uint32_t counters_type_tag; /* Enum INMCounters_version */ - INMCounters_type counters; /* Counter set for this interface type */ - } INMCounters_sample; - -@@ -523,14 +523,14 @@ - }; - - typedef struct _INMSample_datagram_hdr { -- u_int32_t datagram_version; /* (enum INMDatagram_version) = VERSION2 */ -+ uint32_t datagram_version; /* (enum INMDatagram_version) = VERSION2 */ - INMAddress agent_address; /* IP address of sampling agent */ -- u_int32_t sequence_number; /* Incremented with each sample datagram -+ uint32_t sequence_number; /* Incremented with each sample datagram - generated */ -- u_int32_t uptime; /* Current time (in milliseconds since device -+ uint32_t uptime; /* Current time (in milliseconds since device - last booted). Should be set as close to - datagram transmission time as possible.*/ -- u_int32_t num_samples; /* Number of flow and counters samples to follow */ -+ uint32_t num_samples; /* Number of flow and counters samples to follow */ - } INMSample_datagram_hdr; - - typedef struct _SFSample { -@@ -539,15 +539,15 @@ - - /* the raw pdu */ - u_char *rawSample; -- u_int rawSampleLen; -+ uint rawSampleLen; - -- u_int sampleType; -- u_int samplerId; -+ uint sampleType; -+ uint samplerId; - - /* interface info */ - u_long ifIndex; - u_long networkType; -- u_int64_t ifSpeed; -+ uint64_t ifSpeed; - u_long ifDirection; - u_long ifStatus; - -@@ -570,12 +570,12 @@ - int offsetToIPV4; - struct in_addr dcd_srcIP; - struct in_addr dcd_dstIP; -- u_int dcd_ipProtocol; -- u_int dcd_ipTos; -- u_int dcd_ipTTL; -- u_int dcd_sport; -- u_int dcd_dport; -- u_int dcd_tcpFlags; -+ uint dcd_ipProtocol; -+ uint dcd_ipTos; -+ uint dcd_ipTTL; -+ uint dcd_sport; -+ uint dcd_dport; -+ uint dcd_tcpFlags; - - /* ports */ - u_long inputPort; -@@ -608,9 +608,9 @@ - - /* user id */ - #define SA_MAX_EXTENDED_USER_LEN 200 -- u_int src_user_len; -+ uint src_user_len; - char src_user[SA_MAX_EXTENDED_USER_LEN+1]; -- u_int dst_user_len; -+ uint dst_user_len; - char dst_user[SA_MAX_EXTENDED_USER_LEN+1]; - - /* counter blocks */ -@@ -622,7 +622,7 @@ - #define GETDATA32(target, datap) (target) = ntohl(*(datap)++) - #define GETDATA32_NOBSWAP(target, datap) (target) = *(datap)++ - #define GETDATA64(target, datap) \ -- do { u_int64_t tmpLo, tmpHi; \ -+ do { uint64_t tmpLo, tmpHi; \ - GETDATA32(tmpHi, (datap)); \ - GETDATA32(tmpLo, (datap)); \ - (target) = (tmpHi << 32) + tmpLo; \ -@@ -707,7 +707,7 @@ - u_char *start = (u_char *)sample->header; - u_char *end = start + sample->headerLen; - u_char *ptr = start; -- u_int16_t type_len; -+ uint16_t type_len; - - /* assume not found */ - sample->offsetToIPV4 = -1; -@@ -725,9 +725,9 @@ - - if(type_len == 0x8100) { - /* VLAN - next two bytes */ -- u_int32_t vlanData = (ptr[0] << 8) + ptr[1]; -- u_int32_t vlan = vlanData & 0x0fff; -- u_int32_t priority = vlanData >> 13; -+ uint32_t vlanData = (ptr[0] << 8) + ptr[1]; -+ uint32_t vlan = vlanData & 0x0fff; -+ uint32_t priority = vlanData >> 13; - /* _____________________________________ */ - /* | pri | c | vlan-id | */ - /* ------------------------------------- */ -@@ -973,7 +973,7 @@ - - static u_long *readExtendedRouter(SFSample *sample, u_long *datap, u_char *endPtr) - { -- u_int32_t addrType; -+ uint32_t addrType; - char buf[51]; - GETDATA32(addrType, datap); - if(addrType == INMADDRESSTYPE_IP_V4) GETDATA32_NOBSWAP(sample->nextHop.s_addr, datap); -@@ -1025,7 +1025,7 @@ - traceEvent(CONST_TRACE_INFO, "SFLOW_DEBUG: dst_as_path_len %lu", sample->dst_as_path_len); - } - if(sample->dst_as_path_len > 0) { -- u_int i = 0; -+ uint i = 0; - for(; i < sample->dst_as_path_len; i++) { - if(i == 0) if(debug) traceEvent(CONST_TRACE_INFO, "SFLOW_DEBUG: dst_as_path "); - else if(debug) traceEvent(CONST_TRACE_INFO, "-"); -@@ -1081,11 +1081,11 @@ - - static void receiveSflowSample(SFSample *sample) - { -- u_int numFlowSamples = 0; -- u_int32_t datagramVersion; -- u_int32_t addressType; -+ uint numFlowSamples = 0; -+ uint32_t datagramVersion; -+ uint32_t addressType; - struct in_addr agentIP; -- u_int32_t samplesInPacket; -+ uint32_t samplesInPacket; - struct timeval now; - u_long *datap = (u_long *)sample->rawSample; - -@@ -1129,7 +1129,7 @@ - } - - { /* now iterate and pull out the flows and counters samples */ -- u_int32_t samp = 0; -+ uint32_t samp = 0; - u_char *endPtr = (u_char *)sample->rawSample + sample->rawSampleLen; - - for(; samp < samplesInPacket; samp++) { -@@ -1144,8 +1144,8 @@ - GETDATA32(sample->samplesGenerated, datap); - GETDATA32(sample->samplerId, datap); - if(debug) { -- u_int32_t ds_class = sample->samplerId >> 24; -- u_int32_t ds_index = sample->samplerId & 0x00ffffff; -+ uint32_t ds_class = sample->samplerId >> 24; -+ uint32_t ds_index = sample->samplerId & 0x00ffffff; - traceEvent(CONST_TRACE_INFO, "SFLOW_DEBUG: sampleSequenceNo %lu", sample->samplesGenerated); - traceEvent(CONST_TRACE_INFO, "SFLOW_DEBUG: sourceId %lu:%lu", ds_class, ds_index); - } -@@ -1276,10 +1276,10 @@ - /* assume no extended data */ - sample->extended_data_tag = 0; - { -- u_int x; -+ uint x; - GETDATA32(sample->num_extended, datap); - for(x = 0; x < sample->num_extended; x++) { -- u_int32_t extended_tag; -+ uint32_t extended_tag; - GETDATA32(extended_tag, datap); - switch(extended_tag) { - case INMEXTENDED_SWITCH: -@@ -1344,7 +1344,7 @@ - - /* the generic counters always come first */ - if(debug) { -- u_int64_t cntr64; -+ uint64_t cntr64; - GETDATA64(cntr64, datap); - traceEvent(CONST_TRACE_INFO, "SFLOW_DEBUG: ifInOctets %Lu", cntr64); - GETDATA32(cntr64, datap); -@@ -1393,7 +1393,7 @@ - break; - case INMCOUNTERSVERSION_ETHERNET: - if(debug) { -- u_int32_t cntr32; -+ uint32_t cntr32; - GETDATA32(cntr32, datap); - traceEvent(CONST_TRACE_INFO, "SFLOW_DEBUG: dot3StatsAlignmentErrors %lu", cntr32); - GETDATA32(cntr32, datap); -@@ -1424,7 +1424,7 @@ - break; - case INMCOUNTERSVERSION_TOKENRING: - { -- u_int32_t cntr32; -+ uint32_t cntr32; - GETDATA32(cntr32, datap); - traceEvent(CONST_TRACE_INFO, "SFLOW_DEBUG: dot5StatsLineErrors %lu", cntr32); - GETDATA32(cntr32, datap); -@@ -1468,7 +1468,7 @@ - break; - case INMCOUNTERSVERSION_VG: - if(debug) { -- u_int64_t cntr64; -+ uint64_t cntr64; - GETDATA32(cntr64, datap); - traceEvent(CONST_TRACE_INFO, "SFLOW_DEBUG: dot12InHighPriorityFrames %Lu", cntr64); - GETDATA64(cntr64, datap); -@@ -1504,7 +1504,7 @@ - break; - case INMCOUNTERSVERSION_VLAN: - if(debug) { -- u_int64_t cntr64; -+ uint64_t cntr64; - GETDATA32(sample->in_vlan, datap); - traceEvent(CONST_TRACE_INFO, "SFLOW_DEBUG: in_vlan %lu", sample->in_vlan); - GETDATA64(cntr64, datap); -@@ -1969,26 +1969,26 @@ - /* ****************************** */ - - typedef struct sflowSample { -- u_int32_t datagramVersion; -- u_int32_t addressType; -- u_int32_t agentAddress; -- u_int32_t sequenceNo; -- u_int32_t sysUpTime; -- u_int32_t samplesInPacket; -- u_int32_t sampleType; -- u_int32_t sampleSequenceNo; -- u_int32_t samplerId; -- u_int32_t meanSkipCount; -- u_int32_t samplePool; -- u_int32_t dropEvents; -- u_int32_t inputPort; -- u_int32_t outputPort; -- u_int32_t packet_data_tag; -- u_int32_t headerProtocol; -- u_int32_t sampledPacketSize; -- u_int32_t headerLen; -+ uint32_t datagramVersion; -+ uint32_t addressType; -+ uint32_t agentAddress; -+ uint32_t sequenceNo; -+ uint32_t sysUpTime; -+ uint32_t samplesInPacket; -+ uint32_t sampleType; -+ uint32_t sampleSequenceNo; -+ uint32_t samplerId; -+ uint32_t meanSkipCount; -+ uint32_t samplePool; -+ uint32_t dropEvents; -+ uint32_t inputPort; -+ uint32_t outputPort; -+ uint32_t packet_data_tag; -+ uint32_t headerProtocol; -+ uint32_t sampledPacketSize; -+ uint32_t headerLen; - u_char packetData[DEFAULT_SNAPLEN]; -- u_int32_t extended_data_tag; -+ uint32_t extended_data_tag; - } SflowSample; - - /* **************************************** */ -@@ -2004,10 +2004,10 @@ - /* ntop is reading packets from a file */ - - struct ether_header ehdr; -- u_int caplen = h->caplen; -- u_int length = h->len; -+ uint caplen = h->caplen; -+ uint length = h->len; - unsigned short eth_type; -- u_int8_t flags = 0; -+ uint8_t flags = 0; - struct ip ip; - struct udphdr up; - -@@ -2016,11 +2016,11 @@ - eth_type = ntohs(ehdr.ether_type); - - if(eth_type == ETHERTYPE_IP) { -- u_int plen, hlen; -+ uint plen, hlen; - u_short sport, dport; - - memcpy(&ip, p+sizeof(struct ether_header), sizeof(struct ip)); -- hlen = (u_int)ip.ip_hl * 4; -+ hlen = (uint)ip.ip_hl * 4; - NTOHL(ip.ip_dst.s_addr); NTOHL(ip.ip_src.s_addr); - - plen = length-sizeof(struct ether_header); Added: csw/mgar/pkg/ntop/trunk/files/postinstall =================================================================== --- csw/mgar/pkg/ntop/trunk/files/postinstall (rev 0) +++ csw/mgar/pkg/ntop/trunk/files/postinstall 2010-11-11 11:52:33 UTC (rev 11565) @@ -0,0 +1,21 @@ +#!/sbin/sh + +CONFDIR=$BASEDIR/opt/csw/etc/ntop +DATADIR=$BASEDIR/var/opt/csw/ntop + +PATH=/bin:/usr/bin:"$PATH" +export PATH + +if [ ! -f "$CONFDIR/ntop.conf" ]; then + cp -p $CONFDIR/ntop.conf.CSW $CONFDIR/ntop.conf +fi + +if [ ! -f "$DATADIR/ntop_pw.db" ]; then + if [ ! -d "$DATADIR" ]; then + mkdir -p $DATADIR + chown nobody:nobody $DATADIR + chmod 0711 $DATADIR + fi + $BASEDIR/opt/csw/bin/ntop -P $DATADIR -u nobody --set-admin-password=$ADMIN_PW +fi +echo "\nURL to access ntop is http://hostname:3000" Added: csw/mgar/pkg/ntop/trunk/files/postremove =================================================================== --- csw/mgar/pkg/ntop/trunk/files/postremove (rev 0) +++ csw/mgar/pkg/ntop/trunk/files/postremove 2010-11-11 11:52:33 UTC (rev 11565) @@ -0,0 +1,8 @@ +#!/sbin/sh + +CONFDIR=$BASEDIR/opt/csw/etc/ntop + +if [ -d "$CONFDIR" ]; then + echo "" + echo "You might want to manually remove files in $CONFDIR." +fi Added: csw/mgar/pkg/ntop/trunk/files/request =================================================================== --- csw/mgar/pkg/ntop/trunk/files/request (rev 0) +++ csw/mgar/pkg/ntop/trunk/files/request 2010-11-11 11:52:33 UTC (rev 11565) @@ -0,0 +1,29 @@ +#!/sbin/sh +# +DATADIR=$BASEDIR/var/opt/csw/ntop + +if [ ! -f $DATADIR/ntop_pw.db ]; then + stty -echo + trap "stty echo ; echo 'Interrupted' ; exit 1" 1 2 3 15 + while [ true ]; do + echo "\nPlease enter the password for the admin user: \c" + read admin_pw + if [ `expr "$admin_pw" : '.*'` -ge 5 ];then + echo "\nPlease enter the password again: \c" + read admin_pw1 + if [ "$admin_pw" != "$admin_pw1" ];then + echo "\nPasswords don't match. Please try again." + else + break + fi + else + echo "\nPassword too short (5 characters or more). Please try again." + fi + done + echo "\n" + stty echo +fi +cat > $1 << ! +ADMIN_PW=$admin_pw +! +exit 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ devel mailing list devel@lists.opencsw.org https://lists.opencsw.org/mailman/listinfo/devel