diff options
author | Jean-Michel Lacroix <lacroix@lepine-lacroix.info> | 2017-01-01 12:44:56 -0500 |
---|---|---|
committer | Jean-Michel Lacroix <lacroix@lepine-lacroix.info> | 2017-01-01 12:44:56 -0500 |
commit | 5c9665a0706cd9de96a2e49f8ad3102a37acd36f (patch) | |
tree | bfeeaf12e059de2d1f270d47a15c91426e7b68e7 /utils/bandwidthd/patches | |
parent | a876e13fd614d81c6dd295e014d01738416ec9a5 (diff) |
bandwidthd: update to 2.0.1-34, sqlite support and SMTP tracking
Addition of sqlite storage
Tracking of SMTP traffic instead of P2P traffic
Based on NethServer bandwidthd implementation
Signed-off-by: Jean-Michel lacroix <lacroix@lepine-lacroix.info>
Diffstat (limited to 'utils/bandwidthd/patches')
4 files changed, 44 insertions, 67 deletions
diff --git a/utils/bandwidthd/patches/010-dont-add-host-paths-in-config.in.patch b/utils/bandwidthd/patches/010-dont-add-host-paths-in-config.in.patch new file mode 100644 index 000000000..cfaba70bd --- /dev/null +++ b/utils/bandwidthd/patches/010-dont-add-host-paths-in-config.in.patch @@ -0,0 +1,24 @@ +--- a/configure.in ++++ b/configure.in +@@ -24,11 +24,6 @@ if test -n "$x_libraries" && test "x$x_l + LDFLAGS="$LDFLAGS -L$x_libraries" + fi + +-# May be equired for BSD +-LDFLAGS="$LDFLAGS -L/usr/local/lib" +- +-CPPFLAGS="$CPPFLAGS -I/usr/local/include" +- + #Check for Darwin sw directory + AC_CHECK_FILE(/sw/lib, LDFLAGS="$LDFLAGS -L/sw/lib") + AC_CHECK_FILE(/sw/include, CPPFLAGS="$CPPFLAGS -I/sw/include") +@@ -55,8 +50,7 @@ AC_CHECK_LIB(pcap, pcap_open_live, , + [AC_CHECK_LIB(wpcap, pcap_open_live, ,[AC_MSG_ERROR([Bandwidthd requires but cannot find libpcap])])]) + + # Optional Library +-AC_CHECK_FILE(/usr/lib, LDFLAGS="$LDFLAGS -L/usr/lib") +-AC_CHECK_FILE(/usr/include/pgsql, CPPFLAGS="$CPPFLAGS -I/usr/include/pgsql") ++AC_CHECK_FILE(/usr/local/pgsql/include, CPPFLAGS="$CPPFLAGS -I/usr/local/pgsql/include") + AC_CHECK_LIB(pq, PQconnectdb, + [AC_CHECK_LIB(pq,PQexecParams, ,AC_MSG_WARN([libpq exists but is too old... bandwidthd requires support for PQexecParams]))]) + AC_CHECK_LIB(sqlite3, sqlite3_open, ,AC_MSG_WARN([sqlite3 is recommended for storage of data but cannot be found])) diff --git a/utils/bandwidthd/patches/010-dont-add-host-paths.patch b/utils/bandwidthd/patches/010-dont-add-host-paths.patch deleted file mode 100644 index 59a57373d..000000000 --- a/utils/bandwidthd/patches/010-dont-add-host-paths.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/configure b/configure -index 4c2546e..e516137 100755 ---- a/configure -+++ b/configure -@@ -2439,11 +2439,6 @@ if test -n "$x_libraries" && test "x$x_libraries" != xNONE ; then - LDFLAGS="$LDFLAGS -L$x_libraries" - fi - --# May be equired for BSD --LDFLAGS="$LDFLAGS -L/usr/local/lib" -- --CPPFLAGS="$CPPFLAGS -I/usr/local/include" -- - #Check for Darwin sw directory - echo "$as_me:2448: checking for /sw/lib" >&5 - echo $ECHO_N "checking for /sw/lib... $ECHO_C" >&6 -@@ -2505,9 +2500,6 @@ fi - fi - echo "$as_me:2506: result: $ac_cv_file__usr_pkg_lib" >&5 - echo "${ECHO_T}$ac_cv_file__usr_pkg_lib" >&6 --if test $ac_cv_file__usr_pkg_lib = yes; then -- LDFLAGS="$LDFLAGS -L/usr/pkg/lib" --fi - - echo "$as_me:2512: checking for /usr/pkg/include" >&5 - echo $ECHO_N "checking for /usr/pkg/include... $ECHO_C" >&6 -@@ -3092,9 +3084,6 @@ fi - fi - echo "$as_me:3093: result: $ac_cv_file__usr_local_pgsql_lib" >&5 - echo "${ECHO_T}$ac_cv_file__usr_local_pgsql_lib" >&6 --if test $ac_cv_file__usr_local_pgsql_lib = yes; then -- LDFLAGS="$LDFLAGS -L/usr/local/pgsql/lib" --fi - - echo "$as_me:3099: checking for /usr/local/pgsql/include" >&5 - echo $ECHO_N "checking for /usr/local/pgsql/include... $ECHO_C" >&6 diff --git a/utils/bandwidthd/patches/020-change-p2p-to-smtp.patch b/utils/bandwidthd/patches/020-change-p2p-to-smtp.patch new file mode 100644 index 000000000..d0e614476 --- /dev/null +++ b/utils/bandwidthd/patches/020-change-p2p-to-smtp.patch @@ -0,0 +1,20 @@ +--- a/graph.c ++++ b/graph.c +@@ -274,7 +274,7 @@ void MakeIndexPages(int NumIps, struct S + + // PASS 1: Write out the table + +- fprintf(file, "<TR bgcolor=lightblue><TD>Ip and Name<TD align=center>Total<TD align=center>Total Sent<TD align=center>Total Received<TD align=center>FTP<TD align=center>HTTP<TD align=center>P2P<TD align=center>TCP<TD align=center>UDP<TD align=center>ICMP\n"); ++ fprintf(file, "<TR bgcolor=lightblue><TD>Ip and Name<TD align=center>Total<TD align=center>Total Sent<TD align=center>Total Received<TD align=center>FTP<TD align=center>HTTP<TD align=center>SMTP<TD align=center>TCP<TD align=center>UDP<TD align=center>ICMP\n"); + for (Counter=0; Counter < 21 && Counter < NumIps; Counter++) + PrintTableLine(file, SummaryData[Counter], Counter); + +@@ -341,7 +341,7 @@ void MakeIndexPages(int NumIps, struct S + + // PASS 1: Write out the table + +- fprintf(file, "<TR bgcolor=lightblue><TD>Ip and Name<TD align=center>Total<TD align=center>Total Sent<TD align=center>Total Received<TD align=center>FTP<TD align=center>HTTP<TD align=center>P2P<TD align=center>TCP<TD align=center>UDP<TD align=center>ICMP\n"); ++ fprintf(file, "<TR bgcolor=lightblue><TD>Ip and Name<TD align=center>Total<TD align=center>Total Sent<TD align=center>Total Received<TD align=center>FTP<TD align=center>HTTP<TD align=center>SMTP<TD align=center>TCP<TD align=center>UDP<TD align=center>ICMP\n"); + for (tCounter=0, Counter=0; Counter < NumIps; Counter++) + { + if (SubnetTable[SubnetCounter].ip == (SummaryData[Counter]->IP & SubnetTable[SubnetCounter].mask)) diff --git a/utils/bandwidthd/patches/100-fix_config_file_location b/utils/bandwidthd/patches/100-fix_config_file_location deleted file mode 100644 index ae44cd2e4..000000000 --- a/utils/bandwidthd/patches/100-fix_config_file_location +++ /dev/null @@ -1,31 +0,0 @@ ---- bandwidthd-2.0.1/bandwidthd.c.orig 2008-05-09 10:06:37.000000000 -0500 -+++ bandwidthd-2.0.1/bandwidthd.c 2008-05-09 10:32:54.000000000 -0500 -@@ -255,22 +255,22 @@ - - openlog("bandwidthd", LOG_CONS, LOG_DAEMON); - -- if (stat("./etc/bandwidthd.conf", &StatBuf)) -+ if (stat("/etc/bandwidthd.conf", &StatBuf)) - { - chdir(INSTALL_DIR); -- if (stat("./etc/bandwidthd.conf", &StatBuf)) -+ if (stat("/etc/bandwidthd.conf", &StatBuf)) - { -- printf("Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR); -- syslog(LOG_ERR, "Cannot find ./etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR); -+ printf("Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf\n", INSTALL_DIR); -+ syslog(LOG_ERR, "Cannot find /etc/bandwidthd.conf or %s/etc/bandwidthd.conf", INSTALL_DIR); - exit(1); - } - } - -- bdconfig_in = fopen("./etc/bandwidthd.conf", "rt"); -+ bdconfig_in = fopen("/etc/bandwidthd.conf", "rt"); - if (!bdconfig_in) - { - syslog(LOG_ERR, "Cannot open bandwidthd.conf"); -- printf("Cannot open ./etc/bandwidthd.conf\n"); -+ printf("Cannot open /etc/bandwidthd.conf\n"); - exit(1); - } - bdconfig_parse(); |