net-mgmt/flow-tools: Update version 0.68=>0.68.6
- The original development has stalled. After tthatt Andrew tried to work on this project but I believe that has also stalled. Hence I have created a git repo applied some FreeBSD patches and released a new version. PR: 224840
This commit is contained in:
parent
6afcd633a5
commit
8102f2774a
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=496516
21 changed files with 74 additions and 658 deletions
|
@ -2,56 +2,44 @@
|
|||
# $FreeBSD$
|
||||
|
||||
PORTNAME= flow-tools
|
||||
PORTVERSION= 0.68
|
||||
PORTREVISION= 10
|
||||
PORTVERSION= 0.68.6
|
||||
DISTVERSIONPREFIX= v
|
||||
CATEGORIES= net-mgmt
|
||||
MASTER_SITES= ftp://ftp.eng.oar.net/pub/flow-tools/
|
||||
|
||||
MAINTAINER= bofh@FreeBSD.org
|
||||
COMMENT= Suite of tools and library to work with netflow data
|
||||
|
||||
PORTSCOUT= skipv:0.411
|
||||
LICENSE= BSD2CLAUSE
|
||||
LICENSE_FILE= ${WRKSRC}/COPYING
|
||||
|
||||
BUILD_DEPENDS= docbook-to-man:textproc/docbook-to-man
|
||||
|
||||
USES= autoreconf libtool:keepla python:run shebangfix
|
||||
|
||||
OPTIONS_DEFINE= MYSQL OPENSSL PGSQL
|
||||
|
||||
USES= python:run shebangfix
|
||||
SHEBANG_FILES= bin/flow-*
|
||||
USE_CSTD= gnu89
|
||||
GNU_CONFIGURE= yes
|
||||
CONFIGURE_ARGS+=--localstatedir="${PREFIX}"
|
||||
MAKE_ARGS= AM_CFLAGS="${CFLAGS}"
|
||||
|
||||
SUB_FILES= pkg-install pkg-deinstall
|
||||
SUB_LIST= FLOW_CAPTURE_SPOOL="${FLOW_CAPTURE_SPOOL}" \
|
||||
FLOW_CAPTURE_USER="${FLOW_CAPTURE_USER}" \
|
||||
FLOW_CAPTURE_GROUP="${FLOW_CAPTURE_GROUP}" \
|
||||
FLOW_CAPTURE_UID="${FLOW_CAPTURE_UID}" \
|
||||
FLOW_CAPTURE_GID="${FLOW_CAPTURE_GID}" \
|
||||
FLOW_CAPTURE_PIDDIR="${FLOW_CAPTURE_PIDDIR}"
|
||||
USE_RC_SUBR= flow_capture flow_fanout
|
||||
|
||||
VARDIR?= /var
|
||||
FLOW_CAPTURE_SPOOL= ${VARDIR}/db/flows
|
||||
FLOW_CAPTURE_USER= flowtools
|
||||
FLOW_CAPTURE_GROUP= flowtools
|
||||
FLOW_CAPTURE_UID= 174
|
||||
FLOW_CAPTURE_GID= 174
|
||||
FLOW_CAPTURE_PIDDIR= ${VARDIR}/run/flow-capture
|
||||
|
||||
PGSQL_CONFIGURE_ON= --with-pgsql="${LOCALBASE}"
|
||||
PGSQL_CONFIGURE_ON= --with-postgresql
|
||||
PGSQL_USES= pgsql
|
||||
MYSQL_CONFIGURE_ON= --with-mysql="${LOCALBASE}"
|
||||
MYSQL_USES= mysql
|
||||
OPENSSL_CONFIGURE_ON= --with-openssl="${OPENSSLBASE}"
|
||||
OPENSSL_USES= ssl
|
||||
|
||||
post-patch:
|
||||
${REINPLACE_CMD}\
|
||||
-e 's|@localstatedir@/sym/|${PREFIX}/share/flow-tools/|' \
|
||||
-e 's|@localstatedir@/cfg/|${PREFIX}/etc/flow-tools/|' \
|
||||
${WRKSRC}/docs/flow-*.1.in ${WRKSRC}/docs/flow-*.html.in
|
||||
SHEBANG_FILES= bin/flow-*
|
||||
GNU_CONFIGURE= yes
|
||||
USE_LDCONFIG= yes
|
||||
|
||||
post-install:
|
||||
${INSTALL_MAN} ${WRKSRC}/docs/*.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/
|
||||
USE_GITHUB= yes
|
||||
GH_ACCOUNT= 5u623l20
|
||||
GH_TAGNAME= 6e7c849
|
||||
SUB_LIST= FLOW_CAPTURE_SPOOL="${FLOW_CAPTURE_SPOOL}" \
|
||||
FLOW_CAPTURE_PIDDIR="${FLOW_CAPTURE_PIDDIR}"
|
||||
USE_RC_SUBR= flow_capture flow_fanout
|
||||
|
||||
VARDIR?= /var
|
||||
FLOW_CAPTURE_SPOOL= ${VARDIR}/db/flows
|
||||
FLOW_CAPTURE_PIDDIR= ${VARDIR}/run/flow-capture
|
||||
|
||||
USERS= flowtools
|
||||
GROUPS= flowtools
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
SHA256 (flow-tools-0.68.tar.gz) = 69d5353b339f917fc141919db042b007d5c8d31c9ad1bc2f989a41aa41d629df
|
||||
SIZE (flow-tools-0.68.tar.gz) = 987151
|
||||
TIMESTAMP = 1553203482
|
||||
SHA256 (5u623l20-flow-tools-v0.68.6-6e7c849_GH0.tar.gz) = cea67317e205d1f52f9b8aeb980a1cda9ebbbb1886489fc4d56a61f948ecd72e
|
||||
SIZE (5u623l20-flow-tools-v0.68.6-6e7c849_GH0.tar.gz) = 1078840
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
# flow_capture_datadir (str): Base flow data directory.
|
||||
# Default is "/var/db/flows"
|
||||
# flow_capture_localip (str): IP address to bind to
|
||||
# Default to "0.0.0.0"
|
||||
# Default is "0.0.0.0"
|
||||
# flow_capture_remoteip (str): IP address to accept flows from
|
||||
# Default to "0.0.0.0" or all IPs
|
||||
# Default is "0.0.0.0" or all IPs
|
||||
# flow_capture_port (int): Port to accept flow data on
|
||||
# Default is "8787"
|
||||
# flow_capture_flags (str): Custom additional arguments to be passed
|
||||
|
@ -39,7 +39,7 @@
|
|||
# with parameters taken from appropriate
|
||||
# flow_capture_PROFILENAME_xxx variables. For
|
||||
# unspecified parameters flow_capture_xxx
|
||||
# varialbes will be used.
|
||||
# variables will be used.
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
|
@ -78,6 +78,15 @@ stop_profiles()
|
|||
done
|
||||
}
|
||||
|
||||
status_profiles()
|
||||
{
|
||||
unset status_cmd
|
||||
for _profile in ${flow_capture_profiles}; do
|
||||
setup_profile_vars $_profile
|
||||
run_rc_command "${rc_arg}"
|
||||
done
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${flow_capture_enable="NO"}
|
||||
|
@ -105,6 +114,7 @@ fi
|
|||
if [ "${flow_capture_profiles}" ]; then
|
||||
start_cmd="start_profiles"
|
||||
stop_cmd="stop_profiles"
|
||||
status_cmd="status_profiles"
|
||||
fi
|
||||
|
||||
run_rc_command "$cmd"
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
# flow_fanout_enable (bool): Set it to "YES" to enable flow-fanout daemon.
|
||||
# Set to "NO" by default.
|
||||
# flow_fanout_ip (str): IP address to bind to
|
||||
# Default to "0.0.0.0"
|
||||
# Default is "0.0.0.0"
|
||||
# flow_fanout_remoteip (str): IP address to accept flows from
|
||||
# Default to "0.0.0.0" or all IPs
|
||||
# Default is "0.0.0.0" or all IPs
|
||||
# flow_fanout_port (int): Port to accept flow data on
|
||||
# Default is "8787"
|
||||
# flow_fanout_export (str): Where to send flows to. Default is "0/0/8788"
|
||||
|
@ -36,7 +36,7 @@
|
|||
# with parameters taken from appropriate
|
||||
# flow_fanout_PROFILENAME_xxx variables. For
|
||||
# unspecified parameters flow_fanout_xxx
|
||||
# varialbes will be used.
|
||||
# variables will be used.
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
|
@ -73,6 +73,15 @@ stop_profiles()
|
|||
done
|
||||
}
|
||||
|
||||
status_profiles()
|
||||
{
|
||||
unset status_cmd
|
||||
for _profile in ${flow_fanout_profiles}; do
|
||||
setup_profile_vars $_profile
|
||||
run_rc_command "${rc_arg}"
|
||||
done
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${flow_fanout_enable="NO"}
|
||||
|
@ -99,6 +108,7 @@ fi
|
|||
if [ "${flow_fanout_profiles}" ]; then
|
||||
start_cmd="start_profiles"
|
||||
stop_cmd="stop_profiles"
|
||||
status_cmd="status_profiles"
|
||||
fi
|
||||
|
||||
run_rc_command "$cmd"
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
--- configs/Makefile.am.orig Tue Jun 7 22:43:47 2005
|
||||
+++ configs/Makefile.am Tue Jun 7 22:44:44 2005
|
||||
@@ -1,6 +1,6 @@
|
||||
-ftsymdir=$(localstatedir)/sym
|
||||
+ftsymdir=$(localstatedir)/share/flow-tools
|
||||
ftsym_DATA = ip-prot.sym ip-type.sym tcp-port.sym asn.sym tag.sym
|
||||
|
||||
-ftcfgdir=$(localstatedir)/cfg
|
||||
+ftcfgdir=$(localstatedir)/etc/flow-tools
|
||||
ftcfg_DATA = map.cfg tag.cfg filter.cfg stat.cfg mask.cfg xlate.cfg
|
||||
|
||||
--- configs/Makefile.in.orig Tue Jun 7 22:44:14 2005
|
||||
+++ configs/Makefile.in Tue Jun 7 22:45:10 2005
|
||||
@@ -88,10 +88,10 @@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
install_sh = @install_sh@
|
||||
-ftsymdir = $(localstatedir)/sym
|
||||
+ftsymdir = $(localstatedir)/share/flow-tools
|
||||
ftsym_DATA = ip-prot.sym ip-type.sym tcp-port.sym asn.sym tag.sym
|
||||
|
||||
-ftcfgdir = $(localstatedir)/cfg
|
||||
+ftcfgdir = $(localstatedir)/etc/flow-tools
|
||||
ftcfg_DATA = map.cfg tag.cfg filter.cfg stat.cfg mask.cfg xlate.cfg
|
||||
subdir = configs
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
|
@ -1,77 +0,0 @@
|
|||
--- configure.orig 2005-05-11 14:15:55 UTC
|
||||
+++ configure
|
||||
@@ -1662,7 +1662,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(inst
|
||||
|
||||
|
||||
|
||||
-CFLAGS="-g -Wall"
|
||||
+CFLAGS="-fPIC"
|
||||
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
@@ -2254,7 +2254,6 @@ echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&
|
||||
GCC=`test $ac_compiler_gnu = yes && echo yes`
|
||||
ac_test_CFLAGS=${CFLAGS+set}
|
||||
ac_save_CFLAGS=$CFLAGS
|
||||
-CFLAGS="-g"
|
||||
echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
|
||||
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
|
||||
if test "${ac_cv_prog_cc_g+set}" = set; then
|
||||
@@ -2299,21 +2298,6 @@ rm -f conftest.$ac_objext conftest.$ac_e
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
|
||||
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
|
||||
-if test "$ac_test_CFLAGS" = set; then
|
||||
- CFLAGS=$ac_save_CFLAGS
|
||||
-elif test $ac_cv_prog_cc_g = yes; then
|
||||
- if test "$GCC" = yes; then
|
||||
- CFLAGS="-g -O2"
|
||||
- else
|
||||
- CFLAGS="-g"
|
||||
- fi
|
||||
-else
|
||||
- if test "$GCC" = yes; then
|
||||
- CFLAGS="-O2"
|
||||
- else
|
||||
- CFLAGS=
|
||||
- fi
|
||||
-fi
|
||||
echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
|
||||
echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
|
||||
if test "${ac_cv_prog_cc_stdc+set}" = set; then
|
||||
@@ -3204,7 +3188,7 @@ fi;
|
||||
|
||||
|
||||
if test "x$WHERE_MYSQL" != "x"; then
|
||||
- LIBS="-L$WHERE_MYSQL/lib/mysql"
|
||||
+ LIBS="-L$WHERE_MYSQL/lib/mysql $LIBS"
|
||||
echo "$as_me:$LINENO: checking for my_init in -lmysqlclient" >&5
|
||||
echo $ECHO_N "checking for my_init in -lmysqlclient... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_mysqlclient_my_init+set}" = set; then
|
||||
@@ -3274,7 +3258,7 @@ fi
|
||||
fi
|
||||
|
||||
if test "x$WHERE_OPENSSL" != "x"; then
|
||||
- LIBS="-L$WHERE_OPENSSL/lib"
|
||||
+ LIBS="-L$WHERE_OPENSSL/lib $LIBS"
|
||||
echo "$as_me:$LINENO: checking for EVP_EncryptUpdate in -lcrypto" >&5
|
||||
echo $ECHO_N "checking for EVP_EncryptUpdate in -lcrypto... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_crypto_EVP_EncryptUpdate+set}" = set; then
|
||||
@@ -3345,7 +3329,7 @@ fi
|
||||
|
||||
|
||||
if test "x$WHERE_PGSQL" != "x"; then
|
||||
- LIBS="-L$WHERE_PGSQL/lib/pgsql"
|
||||
+ LIBS="-L$WHERE_PGSQL/lib $LIBS"
|
||||
echo "$as_me:$LINENO: checking for PQsetdbLogin in -lpq" >&5
|
||||
echo $ECHO_N "checking for PQsetdbLogin in -lpq... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_pq_PQsetdbLogin+set}" = set; then
|
||||
@@ -3402,7 +3386,7 @@ echo "$as_me:$LINENO: result: $ac_cv_lib
|
||||
echo "${ECHO_T}$ac_cv_lib_pq_PQsetdbLogin" >&6
|
||||
if test $ac_cv_lib_pq_PQsetdbLogin = yes; then
|
||||
|
||||
- PGSQLCFLAGS="-L$WHERE_PGSQL/lib -I$WHERE_PGSQL/include/pgsql"
|
||||
+ PGSQLCFLAGS="-L$WHERE_PGSQL/lib -I$WHERE_PGSQL/include"
|
||||
PGSQLLIB="-lpq"
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_PGSQL 1
|
|
@ -1,10 +0,0 @@
|
|||
--- src/flow-header.c.orig Mon Jul 26 13:21:36 2004
|
||||
+++ src/flow-header.c Mon Jul 26 13:21:45 2004
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
|
||||
void usage(void);
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
--- lib/ftpaths.h.orig Wed Dec 3 22:19:47 2003
|
||||
+++ lib/ftpaths.h Wed Jul 7 15:06:42 2004
|
||||
@@ -29,17 +29,17 @@
|
||||
#ifndef FTPATHS_H
|
||||
#define FTPATHS_H
|
||||
|
||||
-#define FT_PATH_CFG_MAP "/usr/local/netflow/var/cfg/map.cfg"
|
||||
-#define FT_PATH_CFG_TAG "/usr/local/netflow/var/cfg/tag.cfg"
|
||||
-#define FT_PATH_CFG_FILTER "/usr/local/netflow/var/cfg/filter.cfg"
|
||||
-#define FT_PATH_CFG_STAT "/usr/local/netflow/var/cfg/stat.cfg"
|
||||
-#define FT_PATH_CFG_MASK "/usr/local/netflow/var/cfg/mask.cfg"
|
||||
-#define FT_PATH_CFG_XLATE "/usr/local/netflow/var/cfg/xlate.cfg"
|
||||
+#define FT_PATH_CFG_MAP "/usr/local/etc/flow-tools/map.cfg"
|
||||
+#define FT_PATH_CFG_TAG "/usr/local/etc/flow-tools/tag.cfg"
|
||||
+#define FT_PATH_CFG_FILTER "/usr/local/etc/flow-tools/filter.cfg"
|
||||
+#define FT_PATH_CFG_STAT "/usr/local/etc/flow-tools/stat.cfg"
|
||||
+#define FT_PATH_CFG_MASK "/usr/local/etc/flow-tools/mask.cfg"
|
||||
+#define FT_PATH_CFG_XLATE "/usr/local/etc/flow-tools/xlate.cfg"
|
||||
|
||||
-#define FT_PATH_SYM_IP_PROT "/usr/local/netflow/var/sym/ip-prot.sym"
|
||||
-#define FT_PATH_SYM_IP_TYPE "/usr/local/netflow/var/sym/ip-type.sym"
|
||||
-#define FT_PATH_SYM_TCP_PORT "/usr/local/netflow/var/sym/tcp-port.sym"
|
||||
-#define FT_PATH_SYM_ASN "/usr/local/netflow/var/sym/asn.sym"
|
||||
-#define FT_PATH_SYM_TAG "/usr/local/netflow/var/sym/tag.sym"
|
||||
+#define FT_PATH_SYM_IP_PROT "/usr/local/share/flow-tools/ip-prot.sym"
|
||||
+#define FT_PATH_SYM_IP_TYPE "/usr/local/share/flow-tools/ip-type.sym"
|
||||
+#define FT_PATH_SYM_TCP_PORT "/usr/local/share/flow-tools/tcp-port.sym"
|
||||
+#define FT_PATH_SYM_ASN "/usr/local/share/flow-tools/asn.sym"
|
||||
+#define FT_PATH_SYM_TAG "/usr/local/share/flow-tools/tag.sym"
|
||||
|
||||
#endif /* FTPATHS_H */
|
||||
--- lib/ftpaths.h.in.orig Tue Nov 11 08:49:14 2003
|
||||
+++ lib/ftpaths.h.in Wed Jul 7 15:05:45 2004
|
||||
@@ -29,17 +29,17 @@
|
||||
#ifndef FTPATHS_H
|
||||
#define FTPATHS_H
|
||||
|
||||
-#define FT_PATH_CFG_MAP "@localstatedir@/cfg/map.cfg"
|
||||
-#define FT_PATH_CFG_TAG "@localstatedir@/cfg/tag.cfg"
|
||||
-#define FT_PATH_CFG_FILTER "@localstatedir@/cfg/filter.cfg"
|
||||
-#define FT_PATH_CFG_STAT "@localstatedir@/cfg/stat.cfg"
|
||||
-#define FT_PATH_CFG_MASK "@localstatedir@/cfg/mask.cfg"
|
||||
-#define FT_PATH_CFG_XLATE "@localstatedir@/cfg/xlate.cfg"
|
||||
+#define FT_PATH_CFG_MAP "@localstatedir@/etc/flow-tools/map.cfg"
|
||||
+#define FT_PATH_CFG_TAG "@localstatedir@/etc/flow-tools/tag.cfg"
|
||||
+#define FT_PATH_CFG_FILTER "@localstatedir@/etc/flow-tools/filter.cfg"
|
||||
+#define FT_PATH_CFG_STAT "@localstatedir@/etc/flow-tools/stat.cfg"
|
||||
+#define FT_PATH_CFG_MASK "@localstatedir@/etc/flow-tools/mask.cfg"
|
||||
+#define FT_PATH_CFG_XLATE "@localstatedir@/etc/flow-tools/xlate.cfg"
|
||||
|
||||
-#define FT_PATH_SYM_IP_PROT "@localstatedir@/sym/ip-prot.sym"
|
||||
-#define FT_PATH_SYM_IP_TYPE "@localstatedir@/sym/ip-type.sym"
|
||||
-#define FT_PATH_SYM_TCP_PORT "@localstatedir@/sym/tcp-port.sym"
|
||||
-#define FT_PATH_SYM_ASN "@localstatedir@/sym/asn.sym"
|
||||
-#define FT_PATH_SYM_TAG "@localstatedir@/sym/tag.sym"
|
||||
+#define FT_PATH_SYM_IP_PROT "@localstatedir@/share/flow-tools/ip-prot.sym"
|
||||
+#define FT_PATH_SYM_IP_TYPE "@localstatedir@/share/flow-tools/ip-type.sym"
|
||||
+#define FT_PATH_SYM_TCP_PORT "@localstatedir@/share/flow-tools/tcp-port.sym"
|
||||
+#define FT_PATH_SYM_ASN "@localstatedir@/share/flow-tools/asn.sym"
|
||||
+#define FT_PATH_SYM_TAG "@localstatedir@/share/flow-tools/tag.sym"
|
||||
|
||||
#endif /* FTPATHS_H */
|
|
@ -1,109 +0,0 @@
|
|||
--- lib/ftfile.c.orig 2003-02-13 05:38:42.000000000 +0300
|
||||
+++ lib/ftfile.c 2007-11-09 01:07:46.000000000 +0300
|
||||
@@ -311,7 +311,7 @@
|
||||
int ftfile_expire (struct ftfile_entries *fte, int doit, int curbytes)
|
||||
{
|
||||
u_int i;
|
||||
- struct ftfile_entry *n1;
|
||||
+ struct ftfile_entry *n1, *n2;
|
||||
u_int64 bytes;
|
||||
|
||||
/*
|
||||
@@ -323,15 +323,20 @@
|
||||
bytes = 0;
|
||||
|
||||
if (fte->max_files && (fte->num_files > fte->max_files)) {
|
||||
+ n2 = NULL;
|
||||
FT_TAILQ_FOREACH(n1, &fte->head, chain) {
|
||||
+ if (n2 != NULL) {
|
||||
+ ftfile_entry_free(n2);
|
||||
+ n2 = NULL;
|
||||
+ }
|
||||
fterr_info("remove/1 %s", n1->name);
|
||||
bytes += n1->size;
|
||||
++i;
|
||||
if (doit) {
|
||||
+ n2 = n1;
|
||||
FT_TAILQ_REMOVE(&fte->head, n1, chain);
|
||||
if (unlink(n1->name) == -1)
|
||||
fterr_warn("unlink(%s)", n1->name);
|
||||
- ftfile_entry_free(n1);
|
||||
} /* doit */
|
||||
if ((fte->num_files - i) <= fte->max_files)
|
||||
break;
|
||||
@@ -340,6 +345,10 @@
|
||||
fte->num_files -= i;
|
||||
fte->num_bytes -= bytes;
|
||||
} /* doit */
|
||||
+ if (n2 != NULL) {
|
||||
+ ftfile_entry_free(n2);
|
||||
+ n2 = NULL;
|
||||
+ }
|
||||
} /* if */
|
||||
|
||||
if (debug)
|
||||
@@ -354,15 +363,20 @@
|
||||
*/
|
||||
|
||||
if (fte->max_bytes && (fte->num_bytes+curbytes > fte->max_bytes)) {
|
||||
+ n2 = NULL;
|
||||
FT_TAILQ_FOREACH(n1, &fte->head, chain) {
|
||||
+ if (n2 != NULL) {
|
||||
+ ftfile_entry_free(n2);
|
||||
+ n2 = NULL;
|
||||
+ }
|
||||
fterr_info("remove/2 %s", n1->name);
|
||||
bytes += n1->size;
|
||||
++i;
|
||||
if (doit) {
|
||||
+ n2 = n1;
|
||||
FT_TAILQ_REMOVE(&fte->head, n1, chain);
|
||||
if (unlink(n1->name) == -1)
|
||||
fterr_warn("unlink(%s)", n1->name);
|
||||
- ftfile_entry_free(n1);
|
||||
} /* doit */
|
||||
if ((fte->num_bytes+curbytes - bytes) <= fte->max_bytes)
|
||||
break;
|
||||
@@ -371,6 +385,10 @@
|
||||
fte->num_files -= i;
|
||||
fte->num_bytes -= bytes;
|
||||
} /* doit */
|
||||
+ if (n2 != NULL) {
|
||||
+ ftfile_entry_free(n2);
|
||||
+ n2 = NULL;
|
||||
+ }
|
||||
} /* if */
|
||||
|
||||
if (debug)
|
||||
@@ -499,7 +517,7 @@
|
||||
* returns -1 on error
|
||||
*
|
||||
*/
|
||||
-int ftfile_mkpath(u_int32 ftime, int nest)
|
||||
+int ftfile_mkpath(time_t ftime, int nest)
|
||||
{
|
||||
struct tm *tm;
|
||||
char buf[32];
|
||||
@@ -762,13 +780,19 @@
|
||||
{
|
||||
struct ftfile_entry *n1, *n2;
|
||||
|
||||
+ n2 = NULL;
|
||||
FT_TAILQ_FOREACH(n1, &fte->head, chain) {
|
||||
+ if (n2 != NULL) {
|
||||
+ ftfile_entry_free(n2);
|
||||
+ n2 = NULL;
|
||||
+ }
|
||||
FT_TAILQ_REMOVE(&fte->head, n1, chain);
|
||||
n2 = n1;
|
||||
- n1 = FT_TAILQ_NEXT(n1, chain);
|
||||
+ }
|
||||
+
|
||||
+ if (n2 != NULL) {
|
||||
ftfile_entry_free(n2);
|
||||
- if (!n1)
|
||||
- break;
|
||||
+ n2 = NULL;
|
||||
}
|
||||
|
||||
} /* ftfile_free */
|
|
@ -1,11 +0,0 @@
|
|||
--- lib/ftchash.c.orig Mon Oct 2 12:30:55 2006
|
||||
+++ lib/ftchash.c Mon Oct 2 12:31:29 2006
|
||||
@@ -326,7 +326,7 @@
|
||||
(char*)ftch->traverse_chunk->base+ftch->traverse_chunk->next) {
|
||||
|
||||
ret = ftch->traverse_rec;
|
||||
- (char*)ftch->traverse_rec += ftch->d_size;
|
||||
+ ftch->traverse_rec = (char *)ftch->traverse_rec + ftch->d_size;
|
||||
return ret;
|
||||
|
||||
} else {
|
|
@ -1,20 +0,0 @@
|
|||
--- lib/ftio.c.orig Mon Oct 2 12:26:19 2006
|
||||
+++ lib/ftio.c Mon Oct 2 12:27:53 2006
|
||||
@@ -2267,7 +2267,7 @@
|
||||
break;
|
||||
|
||||
nleft -= nread;
|
||||
- (char*)ptr += nread;
|
||||
+ ptr = (char *)ptr + nread;
|
||||
}
|
||||
return (nbytes - nleft);
|
||||
} /* readn */
|
||||
@@ -2292,7 +2292,7 @@
|
||||
return(nwritten); /* error */
|
||||
|
||||
nleft -= nwritten;
|
||||
- (char*)ptr += nwritten;
|
||||
+ ptr = (char *)ptr + nwritten;
|
||||
}
|
||||
return(nbytes - nleft);
|
||||
} /* writen */
|
|
@ -1,24 +0,0 @@
|
|||
--- lib/ftlib.h.orig Wed Sep 26 16:21:50 2007
|
||||
+++ lib/ftlib.h Wed Sep 26 16:21:23 2007
|
||||
@@ -416,8 +416,8 @@
|
||||
};
|
||||
|
||||
struct fttime {
|
||||
- u_int32 secs;
|
||||
- u_int32 msecs;
|
||||
+ time_t secs;
|
||||
+ time_t msecs;
|
||||
};
|
||||
|
||||
struct ftver {
|
||||
@@ -2710,7 +2710,7 @@
|
||||
int ftfile_dump(struct ftfile_entries *fte);
|
||||
struct ftfile_entry *ftfile_entry_new(int len);
|
||||
void ftfile_entry_free(struct ftfile_entry *entry);
|
||||
-int ftfile_mkpath(u_int32 ftime, int nest);
|
||||
+int ftfile_mkpath(time_t ftime, int nest);
|
||||
void ftfile_pathname(char *buf, int bsize, int nest, struct ftver ftv,
|
||||
int done, u_int32 ftime);
|
||||
|
||||
|
||||
--XsQoSWH+UP9D9v3l--
|
|
@ -1,10 +0,0 @@
|
|||
--- lib/ftsym.c.orig Wed Nov 8 03:51:51 2006
|
||||
+++ lib/ftsym.c Wed Nov 8 03:51:56 2006
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <ctype.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
|
||||
#if HAVE_STRINGS_H
|
||||
#include <strings.h>
|
|
@ -1,100 +0,0 @@
|
|||
--- lib/fttlv.c.orig Mon Oct 2 12:27:59 2006
|
||||
+++ lib/fttlv.c Mon Oct 2 12:30:50 2006
|
||||
@@ -68,10 +68,10 @@
|
||||
}
|
||||
|
||||
bcopy(&t, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&len, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&v, buf, 4);
|
||||
|
||||
@@ -107,10 +107,10 @@
|
||||
}
|
||||
|
||||
bcopy(&t, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&len, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&v, buf, 2);
|
||||
|
||||
@@ -145,10 +145,10 @@
|
||||
}
|
||||
|
||||
bcopy(&t, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&len, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&v, buf, 1);
|
||||
|
||||
@@ -183,10 +183,10 @@
|
||||
}
|
||||
|
||||
bcopy(&t, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&len, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(v, buf, len);
|
||||
|
||||
@@ -230,16 +230,16 @@
|
||||
return -1;
|
||||
|
||||
bcopy(&t, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&len, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&ip, buf, 4);
|
||||
- (char*)buf += 4;
|
||||
+ buf = (char *)buf + 4;
|
||||
|
||||
bcopy(&ifIndex, buf, 2);
|
||||
- (char*)buf += 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(name, buf, n);
|
||||
|
||||
@@ -287,19 +287,19 @@
|
||||
}
|
||||
|
||||
bcopy(&t, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&len, buf, 2);
|
||||
- (char*)buf+= 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(&ip, buf, 4);
|
||||
- (char*)buf += 4;
|
||||
+ buf = (char *)buf + 4;
|
||||
|
||||
bcopy(&entries, buf, 2);
|
||||
- (char*)buf += 2;
|
||||
+ buf = (char *)buf + 2;
|
||||
|
||||
bcopy(ifIndex_list, buf, esize);
|
||||
- (char*)buf += esize;
|
||||
+ buf = (char *)buf + esize;
|
||||
|
||||
bcopy(name, buf, n);
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
--- lib/support.c.orig Wed Nov 8 03:50:31 2006
|
||||
+++ lib/support.c Wed Nov 8 03:51:27 2006
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <syslog.h>
|
||||
+#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- src/flow-export.c.orig Tue Jul 10 17:59:28 2007
|
||||
+++ src/flow-export.c Tue Jul 10 18:00:22 2007
|
||||
@@ -961,7 +961,7 @@
|
||||
|
||||
int fmt_xfields_type(char *buf, u_int64 xfield)
|
||||
{
|
||||
- int comma;
|
||||
+ int comma = 0;
|
||||
|
||||
buf[0] = 0;
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
--- src/flow-fanout.c.orig Tue Jun 7 22:52:16 2005
|
||||
+++ src/flow-fanout.c Tue Jun 7 22:52:39 2005
|
||||
@@ -855,6 +855,7 @@
|
||||
} /* if FD_ISSET */
|
||||
|
||||
skip1:
|
||||
+ ;
|
||||
|
||||
if (sig_quit_flag) {
|
||||
fterr_info("SIGQUIT");
|
|
@ -1,37 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
|
||||
|
||||
FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
|
||||
FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
|
||||
FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
|
||||
FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"
|
||||
|
||||
post-deinstall() {
|
||||
rmdir ${FLOW_CAPTURE_SPOOL} > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "WARNING: If you will NOT use this package anymore, please"
|
||||
echo " remove the following directory manually:"
|
||||
echo " ${FLOW_CAPTURE_SPOOL}"
|
||||
echo
|
||||
echo "Also flow-tools related user accounts and groups were not"
|
||||
echo "removed (${FLOW_CAPTURE_USER}:${FLOW_CAPTURE_GROUP})."
|
||||
echo "Do it manually, if needed."
|
||||
echo
|
||||
fi
|
||||
|
||||
#
|
||||
# Remove pid directory
|
||||
#
|
||||
rm -rf ${FLOW_CAPTURE_PIDDIR} > /dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
case $2 in
|
||||
POST-DEINSTALL)
|
||||
post-deinstall
|
||||
;;
|
||||
esac
|
|
@ -1,81 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
|
||||
|
||||
FLOW_CAPTURE_SPOOL="%%FLOW_CAPTURE_SPOOL%%"
|
||||
FLOW_CAPTURE_USER="%%FLOW_CAPTURE_USER%%"
|
||||
FLOW_CAPTURE_GROUP="%%FLOW_CAPTURE_GROUP%%"
|
||||
FLOW_CAPTURE_UID="%%FLOW_CAPTURE_UID%%"
|
||||
FLOW_CAPTURE_GID="%%FLOW_CAPTURE_GID%%"
|
||||
FLOW_CAPTURE_PIDDIR="%%FLOW_CAPTURE_PIDDIR%%"
|
||||
|
||||
if [ -x /usr/sbin/nologin ]; then
|
||||
NOLOGIN=/usr/sbin/nologin
|
||||
else
|
||||
NOLOGIN=/sbin/nologin
|
||||
fi
|
||||
|
||||
pre-install() {
|
||||
#
|
||||
# Create group
|
||||
#
|
||||
pw groupshow ${FLOW_CAPTURE_GROUP} > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -n "Creating '${FLOW_CAPTURE_GROUP}' group... "
|
||||
pw groupadd -n ${FLOW_CAPTURE_GROUP} -g ${FLOW_CAPTURE_GID} -q
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "ok"
|
||||
else
|
||||
echo "failed"
|
||||
echo "Cannot create group '${FLOW_CAPTURE_GROUP}'" >&2
|
||||
echo "Please, create it manually." >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Using existing group '${FLOW_CAPTURE_GROUP}'"
|
||||
fi
|
||||
|
||||
#
|
||||
# Create user
|
||||
#
|
||||
pw usershow ${FLOW_CAPTURE_USER} > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -n "Creating '${FLOW_CAPTURE_USER}' user... "
|
||||
pw useradd -n ${FLOW_CAPTURE_USER} -g ${FLOW_CAPTURE_GROUP} \
|
||||
-u ${FLOW_CAPTURE_UID} \
|
||||
-c "Flow-tools collector pseudo-user" \
|
||||
-d "/var/empty" -s "${NOLOGIN}" -h - -q
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "ok"
|
||||
else
|
||||
echo "failed"
|
||||
echo "Cannot create user '${FLOW_CAPTURE_USER}'" >&2
|
||||
echo "Please, create it manually." >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Using existing group '${FLOW_CAPTURE_USER}'"
|
||||
fi
|
||||
}
|
||||
|
||||
post-install() {
|
||||
/usr/bin/install -d -m 700 -o ${FLOW_CAPTURE_USER} \
|
||||
-g ${FLOW_CAPTURE_GROUP} ${FLOW_CAPTURE_PIDDIR}
|
||||
/usr/bin/install -d -m 1700 -o ${FLOW_CAPTURE_USER} \
|
||||
-g ${FLOW_CAPTURE_GROUP} ${FLOW_CAPTURE_SPOOL}
|
||||
}
|
||||
|
||||
|
||||
case $2 in
|
||||
PRE-INSTALL)
|
||||
pre-install
|
||||
;;
|
||||
POST-INSTALL)
|
||||
post-install
|
||||
;;
|
||||
esac
|
|
@ -1,4 +1,4 @@
|
|||
Tools to capture, replicate, print, filter, send and other works
|
||||
on Cisco's NetFlow Export.
|
||||
|
||||
WWW: http://www.splintered.net/sw/flow-tools/
|
||||
WWW: https://github.com/5u623l20/flow-tools/
|
||||
|
|
|
@ -22,18 +22,24 @@ bin/flow-split
|
|||
bin/flow-stat
|
||||
bin/flow-tag
|
||||
bin/flow-xlate
|
||||
etc/flow-tools/filter.cfg
|
||||
etc/flow-tools/map.cfg
|
||||
etc/flow-tools/mask.cfg
|
||||
etc/flow-tools/stat.cfg
|
||||
etc/flow-tools/tag.cfg
|
||||
etc/flow-tools/xlate.cfg
|
||||
include/ftconfig.h
|
||||
%%ETCDIR%%/asn.sym
|
||||
%%ETCDIR%%/filter.cfg
|
||||
%%ETCDIR%%/ip-prot.sym
|
||||
%%ETCDIR%%/ip-type.sym
|
||||
%%ETCDIR%%/map.cfg
|
||||
%%ETCDIR%%/mask.cfg
|
||||
%%ETCDIR%%/stat.cfg
|
||||
%%ETCDIR%%/tag.cfg
|
||||
%%ETCDIR%%/tag.sym
|
||||
%%ETCDIR%%/tcp-port.sym
|
||||
%%ETCDIR%%/xlate.cfg
|
||||
include/ftlib.h
|
||||
include/ftpaths.h
|
||||
include/ftqueue.h
|
||||
include/radix.h
|
||||
lib/libft.a
|
||||
lib/libft.la
|
||||
lib/libft.so
|
||||
lib/libft.so.0
|
||||
lib/libft.so.0.0.0
|
||||
man/man1/flow-capture.1.gz
|
||||
man/man1/flow-cat.1.gz
|
||||
man/man1/flow-dscan.1.gz
|
||||
|
@ -60,8 +66,7 @@ man/man1/flow-xlate.1.gz
|
|||
man/man1/flow-rptfmt.1.gz
|
||||
man/man1/flow-log2rrd.1.gz
|
||||
man/man1/flow-rpt2rrd.1.gz
|
||||
%%DATADIR%%/asn.sym
|
||||
%%DATADIR%%/ip-prot.sym
|
||||
%%DATADIR%%/ip-type.sym
|
||||
%%DATADIR%%/tag.sym
|
||||
%%DATADIR%%/tcp-port.sym
|
||||
%%DATADIR%%/asn2c
|
||||
%%DATADIR%%/gasn
|
||||
%%DATADIR%%/gprot
|
||||
%%DATADIR%%/gserv
|
||||
|
|
Loading…
Reference in a new issue