diff options
Diffstat (limited to 'net/traff/files')
-rw-r--r-- | net/traff/files/patch-Makefile | 20 | ||||
-rw-r--r-- | net/traff/files/patch-readconfig.h | 11 | ||||
-rw-r--r-- | net/traff/files/patch-traff.c | 28 | ||||
-rw-r--r-- | net/traff/files/patch-traff.conf | 18 | ||||
-rw-r--r-- | net/traff/files/traff.sh.in | 39 |
5 files changed, 116 insertions, 0 deletions
diff --git a/net/traff/files/patch-Makefile b/net/traff/files/patch-Makefile new file mode 100644 index 000000000000..748e8e238343 --- /dev/null +++ b/net/traff/files/patch-Makefile @@ -0,0 +1,20 @@ +--- Makefile.orig Tue Sep 27 19:11:33 2005 ++++ Makefile Tue Sep 27 19:12:24 2005 +@@ -5,13 +5,13 @@ + #LFLAGS= -lcurses + + # Directories +-BINDIR = /usr/local/sbin +-ETCDIR = /etc ++BINDIR = %%PREFIX%%/sbin ++ETCDIR = %%PREFIX%%/etc + + # fuer i386 auskommentieren +-CFLAGS = -g -D_REENTRANT -DwithMYSQL -DwithPGSQL ++#CFLAGS = -g -D_REENTRANT -DwithMYSQL -DwithPGSQL + +-LFLAGS = -lpcap -lpthread -lpq -lmysqlclient ++LFLAGS = -lpcap $(EXTRA_LIBS) + + MODULES = traff.o readconfig.o ip_table.o + diff --git a/net/traff/files/patch-readconfig.h b/net/traff/files/patch-readconfig.h new file mode 100644 index 000000000000..36d7ea44b00f --- /dev/null +++ b/net/traff/files/patch-readconfig.h @@ -0,0 +1,11 @@ +--- readconfig.h.orig Wed Feb 13 06:54:06 2002 ++++ readconfig.h Tue Sep 27 19:33:19 2005 +@@ -14,7 +14,7 @@ + #endif + + #if withPGSQL +-#include <postgresql/libpq-fe.h> ++#include <libpq-fe.h> + #endif + + #include <pcap.h> diff --git a/net/traff/files/patch-traff.c b/net/traff/files/patch-traff.c new file mode 100644 index 000000000000..358781742942 --- /dev/null +++ b/net/traff/files/patch-traff.c @@ -0,0 +1,28 @@ +--- traff.c.orig Fri Feb 1 16:10:22 2002 ++++ traff.c Tue Sep 27 18:04:32 2005 +@@ -135,7 +135,7 @@ + DEBUG(printf("Reading Config\n");) + config = (t_config *) malloc(sizeof(t_config)); + // reading config file +- config_init(config,"/etc/traff.conf"); // this function will initialize configuration ++ config_init(config,"%%PREFIX%%/etc/traff.conf"); // this function will initialize configuration + config->dt = time(0); + + DEBUG(print_config();) +@@ -467,14 +467,8 @@ + bzero(my_query, QUERYLENGTH); + DEBUG(printf("Initializing Mysql\n");) + mysql_init(&mysql); +- DEBUG(printf("Connecting to host %s, db %s, table %s using login %s, password %s\n",cat->sql->host,cat->sql->db, cat->sql->table,cat->sql->user,cat->sql->password);) +- mysql_connect(&mysql,cat->sql->host,cat->sql->user,cat->sql->password); +- if (mysql_errno(&mysql)) { +- fprintf(stderr,"Error connecting to Mysql-Database in category %s:\n%d, %s\n",cat->name, mysql_errno(&mysql),mysql_error(&mysql)); +- syslog(LOG_ERR,"Error connecting to Mysql-Database in category %s:\n%d, %s\n",cat->name, mysql_errno(&mysql),mysql_error(&mysql)); +- return 1; +- } +- mysql_select_db(&mysql,cat->sql->db); ++ DEBUG(printf("Connecting to host %s, db %s, table %s using login %s, password %s\n",cat->sql->host,cat->sql->db, cat->sql->table,cat->sql->user,cat->sql->password,cat->sql->db,0,NULL,0);) ++ mysql_real_connect(&mysql,cat->sql->host,cat->sql->user,cat->sql->password,cat->sql->db,0,NULL,0); + if (mysql_errno(&mysql)) { + fprintf(stderr,"Error connecting to Mysql-Database in category %s:\n%d, %s\n",cat->name, mysql_errno(&mysql),mysql_error(&mysql)); + syslog(LOG_ERR,"Error connecting to Mysql-Database in category %s:\n%d, %s\n",cat->name, mysql_errno(&mysql),mysql_error(&mysql)); diff --git a/net/traff/files/patch-traff.conf b/net/traff/files/patch-traff.conf new file mode 100644 index 000000000000..540929016337 --- /dev/null +++ b/net/traff/files/patch-traff.conf @@ -0,0 +1,18 @@ +--- traff.conf.orig Fri Feb 1 16:11:44 2002 ++++ traff.conf Tue Sep 27 17:34:05 2005 +@@ -1,13 +1,13 @@ + # SAmple configuration File + # Lines starting with a # are comments + +-Devices eth0 eth1 #Diveces where traff should listen to ++Devices fxp0 fxp1 #Diveces where traff should listen to + Period 30 #Time in seconds in witch table is dumped + #Buffersize 800 # At the moment hardcoded to 500. This will work + + + Cat Test +- primary account 127.0.0.0 255.255.255.0 0 ++ primary account 0.0.0.0 0.0.0.0 0 # define here your class + secondary account 0.0.0.0 0.0.0.0 0 + timedivider 300 + bytedivider 1 diff --git a/net/traff/files/traff.sh.in b/net/traff/files/traff.sh.in new file mode 100644 index 000000000000..b37a8b173fc4 --- /dev/null +++ b/net/traff/files/traff.sh.in @@ -0,0 +1,39 @@ +#!/bin/sh +# +# +# PROVIDE: traff +# REQUIRE: DAEMON +# BEFORE: LOGIN +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable traff: +# +# traff_enable="YES" +# +# + +. %%RC_SUBR%% + +name=traff +rcvar=`set_rcvar` + + +command=%%PREFIX%%/sbin/traff +pidfile=/var/run/traff.pid +required_files=%%PREFIX%%/etc/traff.conf + +stop_postcmd=stop_postcmd + +stop_postcmd() +{ + rm -f $pidfile +} + +# set defaults + +traff_enable=${traff_enable:-"NO"} + +load_rc_config $name +run_rc_command "$1" + |