From 0c547bf074023e05c8f0f7832d05e88a2edfeadd Mon Sep 17 00:00:00 2001 From: sapanb Date: Thu, 8 Nov 2007 19:17:40 +0000 Subject: [PATCH] git-svn-id: http://svn.planet-lab.org/svn/fprobe-ulog/trunk@5711 8c455092-636d-4788-adf5-e71def0336e8 --- Makefile | 18 +++++++++--------- config.h | 4 ++-- config.log | 44 +++++++++++++++++++++----------------------- config.status | 28 ++++++++++++++-------------- src/fprobe-ulog.c | 6 +++--- 5 files changed, 49 insertions(+), 51 deletions(-) diff --git a/Makefile b/Makefile index fce3f80..a616823 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ pkglibdir = $(libdir)/fprobe-ulog pkgincludedir = $(includedir)/fprobe-ulog top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = /bin/install -c +INSTALL = /usr/bin/install -c install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -74,13 +74,13 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run aclocal-1.9 +ACLOCAL = ${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run aclocal-1.9 AMDEP_FALSE = # AMDEP_TRUE = -AMTAR = ${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run tar -AUTOCONF = ${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run autoconf -AUTOHEADER = ${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run autoheader -AUTOMAKE = ${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run automake-1.9 +AMTAR = ${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run tar +AUTOCONF = ${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run autoconf +AUTOHEADER = ${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run autoheader +AUTOMAKE = ${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run automake-1.9 AWK = gawk CC = gcc CCDEPMODE = depmode=none @@ -88,7 +88,7 @@ CFLAGS = -g -O2 -D_BSD_SOURCE -D_REENTRANT -DWALL -W -Wall CPP = gcc -E CPPFLAGS = CYGPATH_W = echo -DATE = 2007-10-26 +DATE = 2007-11-08 DEFS = -DHAVE_CONFIG_H DEPDIR = .deps ECHO_C = @@ -104,7 +104,7 @@ LDFLAGS = LIBOBJS = LIBS = -lpthread LTLIBOBJS = -MAKEINFO = ${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run makeinfo +MAKEINFO = ${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run makeinfo OBJEXT = o PACKAGE = fprobe-ulog PACKAGE_BUGREPORT = @@ -143,7 +143,7 @@ host_os = linux-gnu host_vendor = pc includedir = ${prefix}/include infodir = ${prefix}/info -install_sh = /home/sapan/fprobe-ulog-1.1/install-sh +install_sh = /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localstatedir = ${prefix}/var diff --git a/config.h b/config.h index a268eb3..989281b 100644 --- a/config.h +++ b/config.h @@ -50,7 +50,7 @@ #define MEM_BITS 0 /* Runtime messages */ -/* #undef MESSAGES */ +#define MESSAGES /* OS type */ #define OS_LINUX @@ -89,7 +89,7 @@ #define STDC_HEADERS 1 /* Uptime trick */ -#define UPTIME_TRICK +/* #undef UPTIME_TRICK */ /* Uptime trick */ /* #undef UPTIME_TRICK_CISCO */ diff --git a/config.log b/config.log index a98ad1a..f16d7aa 100644 --- a/config.log +++ b/config.log @@ -4,7 +4,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by configure, which was generated by GNU Autoconf 2.59. Invocation command line was - $ ./configure + $ ./configure --enable-messages=yes --enable-uptime_trick=no ## --------- ## ## Platform. ## @@ -12,9 +12,9 @@ generated by GNU Autoconf 2.59. Invocation command line was hostname = joyce uname -m = i686 -uname -r = 2.6.19-skas3-v9-pre9 +uname -r = 2.6.20.1 uname -s = Linux -uname -v = #9 SMP Fri Jan 12 09:39:05 EST 2007 +uname -v = #1 SMP Thu Sep 13 13:04:46 EDT 2007 /usr/bin/uname -p = Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz /bin/uname -X = unknown @@ -27,14 +27,12 @@ hostinfo = unknown /usr/bin/oslevel = unknown /bin/universe = unknown -PATH: /bin -PATH: /sbin -PATH: /usr/bin -PATH: /usr/sbin PATH: /usr/local/bin -PATH: /usr/local/sbin +PATH: /usr/bin +PATH: /bin PATH: /opt/bin PATH: /usr/i686-pc-linux-gnu/gcc-bin/4.1.1 +PATH: /usr/qt/3/bin ## ----------- ## @@ -48,11 +46,11 @@ configure:1368: result: i686-pc-linux-gnu configure:1376: checking target system type configure:1390: result: i686-pc-linux-gnu configure:1418: checking for a BSD-compatible install -configure:1473: result: /bin/install -c +configure:1473: result: /usr/bin/install -c configure:1484: checking whether build environment is sane configure:1527: result: yes configure:1592: checking for gawk -configure:1608: found /bin/gawk +configure:1608: found /usr/bin/gawk configure:1618: result: gawk configure:1628: checking whether make sets $(MAKE) configure:1648: result: yes @@ -131,7 +129,7 @@ configure:2782: result: GNU configure:2810: checking dependency style of gcc configure:2900: result: none configure:2930: checking for a BSD-compatible install -configure:2985: result: /bin/install -c +configure:2985: result: /usr/bin/install -c configure:3037: checking for ranlib configure:3053: found /usr/bin/ranlib configure:3064: result: ranlib @@ -276,13 +274,13 @@ configure:5046: result: "ptr" configure:5055: checking which hash type and size to use configure:5098: result: "crc16" configure:5102: checking whether to enable uptime trick -configure:5113: result: yes +configure:5122: result: no configure:5128: checking whether to enable icmp trick configure:5139: result: yes configure:5163: checking whether to enable debugging configure:5174: result: no configure:5200: checking whether to enable runtime messages -configure:5220: result: no +configure:5211: result: yes configure:5226: checking directory to store pidfiles configure:5241: result: "/var/run" configure:5310: creating ./config.status @@ -346,7 +344,7 @@ ac_cv_host=i686-pc-linux-gnu ac_cv_host_alias=i686-pc-linux-gnu ac_cv_lib_pthread_pthread_create=yes ac_cv_objext=o -ac_cv_path_install='/bin/install -c' +ac_cv_path_install='/usr/bin/install -c' ac_cv_prog_AWK=gawk ac_cv_prog_CPP='gcc -E' ac_cv_prog_ac_ct_CC=gcc @@ -363,14 +361,14 @@ am_cv_CC_dependencies_compiler_type=none ## Output variables. ## ## ----------------- ## -ACLOCAL='${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run aclocal-1.9' +ACLOCAL='${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run aclocal-1.9' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' -AMTAR='${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run tar' -AUTOCONF='${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run autoconf' -AUTOHEADER='${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run autoheader' -AUTOMAKE='${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run automake-1.9' +AMTAR='${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run tar' +AUTOCONF='${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run autoconf' +AUTOHEADER='${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run autoheader' +AUTOMAKE='${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run automake-1.9' AWK='gawk' CC='gcc' CCDEPMODE='depmode=none' @@ -378,7 +376,7 @@ CFLAGS='-g -O2 -D_BSD_SOURCE -D_REENTRANT -DWALL -W -Wall' CPP='gcc -E' CPPFLAGS='' CYGPATH_W='echo' -DATE='2007-10-26' +DATE='2007-11-08' DEFS='-DHAVE_CONFIG_H' DEPDIR='.deps' ECHO_C='' @@ -394,7 +392,7 @@ LDFLAGS='' LIBOBJS='' LIBS='-lpthread ' LTLIBOBJS='' -MAKEINFO='${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run makeinfo' +MAKEINFO='${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run makeinfo' OBJEXT='o' PACKAGE='fprobe-ulog' PACKAGE_BUGREPORT='' @@ -433,7 +431,7 @@ host_os='linux-gnu' host_vendor='pc' includedir='${prefix}/include' infodir='${prefix}/info' -install_sh='/home/sapan/fprobe-ulog-1.1/install-sh' +install_sh='/home/sapan/Projects/planetlab/fprobe/fprobe-ulog/install-sh' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localstatedir='${prefix}/var' @@ -471,6 +469,7 @@ target_vendor='pc' #define HAVE_UNISTD_H 1 #define ICMP_TRICK #define MEM_BITS 0 +#define MESSAGES #define OS_LINUX #define PACKAGE "fprobe-ulog" #define PACKAGE_BUGREPORT "" @@ -480,7 +479,6 @@ target_vendor='pc' #define PACKAGE_VERSION "" #define PID_DIR "/var/run" #define STDC_HEADERS 1 -#define UPTIME_TRICK #define VERSION "1.1" configure: exit 0 diff --git a/config.status b/config.status index c463a7c..d9891e7 100755 --- a/config.status +++ b/config.status @@ -304,13 +304,13 @@ Report bugs to ." ac_cs_version="\ config.status configured by ./configure, generated by GNU Autoconf 2.59, - with options \"\" + with options \"'--enable-messages=yes' '--enable-uptime_trick=no'\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=. -INSTALL="/bin/install -c" +INSTALL="/usr/bin/install -c" # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: @@ -383,8 +383,8 @@ if $ac_cs_silent; then fi if $ac_cs_recheck; then - echo "running /bin/sh ./configure " $ac_configure_extra_args " --no-create --no-recursion" >&6 - exec /bin/sh ./configure $ac_configure_extra_args --no-create --no-recursion + echo "running /bin/sh ./configure " '--enable-messages=yes' '--enable-uptime_trick=no' $ac_configure_extra_args " --no-create --no-recursion" >&6 + exec /bin/sh ./configure '--enable-messages=yes' '--enable-uptime_trick=no' $ac_configure_extra_args --no-create --no-recursion fi # @@ -502,12 +502,12 @@ s,@INSTALL_DATA@,${INSTALL} -m 644,;t t s,@CYGPATH_W@,echo,;t t s,@PACKAGE@,fprobe-ulog,;t t s,@VERSION@,1.1,;t t -s,@ACLOCAL@,${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run aclocal-1.9,;t t -s,@AUTOCONF@,${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run autoconf,;t t -s,@AUTOMAKE@,${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run automake-1.9,;t t -s,@AUTOHEADER@,${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run autoheader,;t t -s,@MAKEINFO@,${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run makeinfo,;t t -s,@install_sh@,/home/sapan/fprobe-ulog-1.1/install-sh,;t t +s,@ACLOCAL@,${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run aclocal-1.9,;t t +s,@AUTOCONF@,${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run autoconf,;t t +s,@AUTOMAKE@,${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run automake-1.9,;t t +s,@AUTOHEADER@,${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run autoheader,;t t +s,@MAKEINFO@,${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run makeinfo,;t t +s,@install_sh@,/home/sapan/Projects/planetlab/fprobe/fprobe-ulog/install-sh,;t t s,@STRIP@,,;t t s,@ac_ct_STRIP@,,;t t s,@INSTALL_STRIP_PROGRAM@,${SHELL} $(install_sh) -c -s,;t t @@ -515,7 +515,7 @@ s,@mkdir_p@,mkdir -p --,;t t s,@AWK@,gawk,;t t s,@SET_MAKE@,,;t t s,@am__leading_dot@,.,;t t -s,@AMTAR@,${SHELL} /home/sapan/fprobe-ulog-1.1/missing --run tar,;t t +s,@AMTAR@,${SHELL} /home/sapan/Projects/planetlab/fprobe/fprobe-ulog/missing --run tar,;t t s,@am__tar@,${AMTAR} chof - "$$tardir",;t t s,@am__untar@,${AMTAR} xf -,;t t s,@CC@,gcc,;t t @@ -538,7 +538,7 @@ s,@RANLIB@,ranlib,;t t s,@ac_ct_RANLIB@,ranlib,;t t s,@CPP@,gcc -E,;t t s,@EGREP@,grep -E,;t t -s,@DATE@,2007-10-26,;t t +s,@DATE@,2007-11-08,;t t s,@LIBOBJS@,,;t t s,@LTLIBOBJS@,,;t t CEOF @@ -873,9 +873,9 @@ ${ac_dA}OS_LINUX${ac_dB}OS_LINUX${ac_dC}${ac_dD} ${ac_dA}MEM_BITS${ac_dB}MEM_BITS${ac_dC}0${ac_dD} ${ac_dA}HASH_TYPE_CRC${ac_dB}HASH_TYPE_CRC${ac_dC}${ac_dD} ${ac_dA}HASH_BITS${ac_dB}HASH_BITS${ac_dC}16${ac_dD} -${ac_dA}UPTIME_TRICK${ac_dB}UPTIME_TRICK${ac_dC}${ac_dD} ${ac_dA}ICMP_TRICK${ac_dB}ICMP_TRICK${ac_dC}${ac_dD} ${ac_dA}DEBUG${ac_dB}DEBUG${ac_dC}(0)${ac_dD} +${ac_dA}MESSAGES${ac_dB}MESSAGES${ac_dC}${ac_dD} ${ac_dA}PID_DIR${ac_dB}PID_DIR${ac_dC}"/var/run"${ac_dD} CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out @@ -912,9 +912,9 @@ ${ac_uA}OS_LINUX${ac_uB}OS_LINUX${ac_uC}${ac_uD} ${ac_uA}MEM_BITS${ac_uB}MEM_BITS${ac_uC}0${ac_uD} ${ac_uA}HASH_TYPE_CRC${ac_uB}HASH_TYPE_CRC${ac_uC}${ac_uD} ${ac_uA}HASH_BITS${ac_uB}HASH_BITS${ac_uC}16${ac_uD} -${ac_uA}UPTIME_TRICK${ac_uB}UPTIME_TRICK${ac_uC}${ac_uD} ${ac_uA}ICMP_TRICK${ac_uB}ICMP_TRICK${ac_uC}${ac_uD} ${ac_uA}DEBUG${ac_uB}DEBUG${ac_uC}(0)${ac_uD} +${ac_uA}MESSAGES${ac_uB}MESSAGES${ac_uC}${ac_uD} ${ac_uA}PID_DIR${ac_uB}PID_DIR${ac_uC}"/var/run"${ac_uD} s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, CEOF diff --git a/src/fprobe-ulog.c b/src/fprobe-ulog.c index 5e900f3..3edf32a 100644 --- a/src/fprobe-ulog.c +++ b/src/fprobe-ulog.c @@ -398,7 +398,7 @@ unsigned get_log_fd(char *fname, unsigned cur_fd) { cur_epoch = (cur_epoch + 1) % log_epochs; close(cur_fd); snprintf(nextname,MAX_PATH_LEN,"%s.%d",fname,cur_epoch); - if ((write_fd = open(nextname, O_WRONLY|O_CREAT)) < 0) { + if ((write_fd = open(nextname, O_WRONLY|O_CREAT|O_TRUNC)) < 0) { my_log(LOG_ERR, "open(): %s (%s)\n", nextname, strerror(errno)); exit(1); } @@ -769,7 +769,7 @@ void *emit_thread() if (netflow->SeqOffset) *((uint32_t *) (emit_packet + netflow->SeqOffset)) = htonl(peers[0].seq); peers[i].write_fd = get_log_fd(peers[i].fname, peers[i].write_fd); - ret = write(peers[0].write_fd, emit_packet, size); + ret = write(peers[i].write_fd, emit_packet, size); if (ret < size) { #if ((DEBUG) & DEBUG_E) || defined MESSAGES @@ -784,7 +784,7 @@ void *emit_thread() emit_count, i + 1, peers[i].seq); } #endif - peers[0].seq += emit_count; + peers[i].seq += emit_count; /* Rate limit */ if (emit_rate_bytes) { -- 2.45.2