rpms/argus/devel README.fedora, NONE, 1.1 argus-2.0.6.fixes.1-build.patch, NONE, 1.1 argus-2.0.6.fixes.1-makefile.patch, NONE, 1.1 argus-clients-2.0.6.fixes.1-build.patch, NONE, 1.1 argus-clients-2.0.6.fixes.1-makefile.patch, NONE, 1.1 argus-clients-2.0.6.fixes.1-print.patch, NONE, 1.1 argus.init, NONE, 1.1 argus.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
Gabriel L. Somlo (somlo)
fedora-extras-commits at redhat.com
Fri Mar 17 19:32:36 UTC 2006
Author: somlo
Update of /cvs/extras/rpms/argus/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30170/devel
Modified Files:
.cvsignore sources
Added Files:
README.fedora argus-2.0.6.fixes.1-build.patch
argus-2.0.6.fixes.1-makefile.patch
argus-clients-2.0.6.fixes.1-build.patch
argus-clients-2.0.6.fixes.1-makefile.patch
argus-clients-2.0.6.fixes.1-print.patch argus.init argus.spec
Log Message:
auto-import argus-2.0.6.fixes.1-7 on branch devel from argus-2.0.6.fixes.1-7.src.rpm
--- NEW FILE README.fedora ---
Several issues came up during packaging argus for Fedora Extras:
1. the contrib/ subdirectory of the Argus clients source package
contains a PERL module, which causes a dependency on PERL,
even though the contrib directory was added using %doc, and
even though no executable bits were set. Here is a fix,
suggested by dgregor on #fedora-extras:
dgregor # Filter unwanted Requires:
dgregor cat << \EOF > %{name}-req
dgregor #!/bin/sh
dgregor %{__perl_provides} $* | sed -e '/.*/d'
dgregor EOF
dgregor %define __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req
dgregor chmod +x %{__perl_requires}
dgregor It seems like overkill, but everything else I tried get the broken pipe error
Currently I'm hoping for a fix to rpmbuild, allowing something like
'%doc(nodeps) foo' in a spec file. If that doesn't pan out, the above
solution will do the trick. Alternatively, creating a perl-Argus rpm
from the material in contrib is a possibility.
2. aside from build and makefile patches (fixing gcc 4.0.2 and
DESTDIR issues, respectively), I added an output formatting patch
from Peter Van Epp <vanepp at sfu.ca> which can be found on the Argus
mailing list archives
(https://lists.andrew.cmu.edu/mailman/listinfo/argus-info)
This and other fixes will be incorporated upstream into a new
release, as indicated by Argus's author on the list.
argus-2.0.6.fixes.1-build.patch:
--- NEW FILE argus-2.0.6.fixes.1-build.patch ---
diff -NarU5 argus-2.0.6.fixes.1.orig/common/argus_parse.c argus-2.0.6.fixes.1/common/argus_parse.c
--- argus-2.0.6.fixes.1.orig/common/argus_parse.c 2004-02-23 10:00:36.000000000 -0500
+++ argus-2.0.6.fixes.1/common/argus_parse.c 2006-02-24 12:00:56.000000000 -0500
@@ -1783,12 +1783,11 @@
int
ArgusReadSaslStreamSocket (struct ARGUS_INPUT *input)
{
int retn = 0, fd = input->fd, cnt;
unsigned int value = 0, *pvalue = &value;
- struct ArgusRecord *argus = NULL;
- char *output = NULL, *end = NULL, *ptr = NULL;
+ char *argus = NULL, *output = NULL, *end = NULL, *ptr = NULL;
unsigned int outputlen = 0;
if ((retn = sasl_getprop(input->sasl_conn, SASL_MAXOUTBUF, (void **) &pvalue)) != SASL_OK)
ArgusLog (LOG_ERR, "ArgusReadSaslStreamSocket: sasl_getprop %s\n", strerror(errno));
@@ -1808,26 +1807,26 @@
ArgusDebug (5, "ArgusReadSaslStreamSocket (0x%x) sasl_decoded %d bytes\n", input, outputlen);
#endif
ptr += cnt;
if (outputlen) {
- argus = (struct ArgusRecord *) output;
+ argus = output;
end = output + outputlen;
- while ((char *)argus < end) {
- input->ArgusReadSocketCnt = ntohs(argus->ahdr.length);
+ while (argus < end) {
+ input->ArgusReadSocketCnt = ntohs(((struct ArgusRecord *)argus)->ahdr.length);
bcopy (argus, input->ArgusReadBuffer, input->ArgusReadSocketCnt);
- if (ArgusHandleDatum (argus, &ArgusFilterCode) == 1) {
+ if (ArgusHandleDatum ((struct ArgusRecord *)argus, &ArgusFilterCode) == 1) {
if (!input->filename)
write (fd, "DONE: ", strlen("DONE: "));
retn = 1;
break;
} else
- (char *)argus += input->ArgusReadSocketCnt;
+ argus += input->ArgusReadSocketCnt;
}
free (output);
input->ArgusSaslBufCnt -= cnt;
diff -NarU5 argus-2.0.6.fixes.1.orig/common/gencode.c argus-2.0.6.fixes.1/common/gencode.c
--- argus-2.0.6.fixes.1.orig/common/gencode.c 2004-02-23 10:00:36.000000000 -0500
+++ argus-2.0.6.fixes.1/common/gencode.c 2006-02-24 11:54:41.000000000 -0500
@@ -57,11 +57,11 @@
#include <setjmp.h>
#include <stdarg.h>
#include <stdlib.h>
#include <syslog.h>
-#include <net/bpf.h>
+#include <pcap-bpf.h>
#include <argus_out.h>
#include <argus_filter.h>
#include <argus_def.h>
#include <ethertype.h>
diff -NarU5 argus-2.0.6.fixes.1.orig/server/ArgusOutput.c argus-2.0.6.fixes.1/server/ArgusOutput.c
--- argus-2.0.6.fixes.1.orig/server/ArgusOutput.c 2004-02-23 10:00:36.000000000 -0500
+++ argus-2.0.6.fixes.1/server/ArgusOutput.c 2006-02-24 11:54:41.000000000 -0500
@@ -1196,11 +1196,11 @@
void
ArgusCheckClientStatus ()
{
int retn, fd;
struct sockaddr from;
- int len = sizeof (from);
+ socklen_t len = sizeof (from);
if ((fd = accept (ArgusLfd, (struct sockaddr *)&from, &len)) > 0) {
if ((fcntl (fd, F_SETFL, O_NONBLOCK)) >= 0) {
if (ArgusTcpWrapper (fd, &from) >= 0) {
int i;
argus-2.0.6.fixes.1-makefile.patch:
--- NEW FILE argus-2.0.6.fixes.1-makefile.patch ---
diff -NarU5 argus-2.0.6.fixes.1.orig/common/Makefile.in argus-2.0.6.fixes.1/common/Makefile.in
--- argus-2.0.6.fixes.1.orig/common/Makefile.in 2004-02-23 10:00:36.000000000 -0500
+++ argus-2.0.6.fixes.1/common/Makefile.in 2006-03-15 11:08:37.000000000 -0500
@@ -144,18 +144,18 @@
version.c: $(srcdir)/../VERSION
@rm -f $@
sed -e 's/.*/char version[] = "&";/' $(srcdir)/../VERSION > $@
install: force
- [ -d $(LIBDEST) ] || \
- (mkdir -p $(LIBDEST); chmod 755 $(LIBDEST))
+ [ -d $(DESTDIR)/$(LIBDEST) ] || \
+ (mkdir -p $(DESTDIR)/$(LIBDEST); chmod 755 $(DESTDIR)/$(LIBDEST))
- $(INSTALL) $(srcdir)/../lib/argus_common.a $(LIBDEST)/argus_common.a
- $(INSTALL) $(srcdir)/../lib/argus_parse.a $(LIBDEST)/argus_parse.a
+ $(INSTALL) $(srcdir)/../lib/argus_common.a $(DESTDIR)/$(LIBDEST)/argus_common.a
+ $(INSTALL) $(srcdir)/../lib/argus_parse.a $(DESTDIR)/$(LIBDEST)/argus_parse.a
- $(RANLIB) $(LIBDEST)/argus_common.a
- $(RANLIB) $(LIBDEST)/argus_parse.a
+ $(RANLIB) $(DESTDIR)/$(LIBDEST)/argus_common.a
+ $(RANLIB) $(DESTDIR)/$(LIBDEST)/argus_parse.a
clean:
rm -f $(CLEANFILES)
distclean:
diff -NarU5 argus-2.0.6.fixes.1.orig/Makefile.in argus-2.0.6.fixes.1/Makefile.in
--- argus-2.0.6.fixes.1.orig/Makefile.in 2004-04-13 01:32:58.000000000 -0400
+++ argus-2.0.6.fixes.1/Makefile.in 2006-03-15 11:08:37.000000000 -0500
@@ -29,14 +29,14 @@
LIBS = @LIBS@
CFLAGS = -g
LDFLAGS = -g
-prefix = $(DESTDIR)@prefix@
+prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
-docdir = $(prefix)/share/doc/argus-2.0
+#docdir = $(prefix)/share/doc/argus-2.0
#### End of system configuration section. ####
SHELL = /bin/sh
@@ -62,82 +62,82 @@
.PHONY: all
install: force
${MAKE} installdirs
- [ -d $(prefix) ] || \
- (mkdir -p $(prefix); chmod 755 $(prefix))
+ [ -d $(DESTDIR)/$(prefix) ] || \
+ (mkdir -p $(DESTDIR)/$(prefix); chmod 755 $(DESTDIR)/$(prefix))
- [ -d @sbindir@ ] || \
- (mkdir -p @sbindir@; chmod 755 @sbindir@)
+ [ -d $(DESTDIR)/@sbindir@ ] || \
+ (mkdir -p $(DESTDIR)/@sbindir@; chmod 755 $(DESTDIR)/@sbindir@)
- [ -d $(exec_prefix)/argus ] || \
- (mkdir -p $(exec_prefix)/argus; chmod 755 $(exec_prefix)/argus)
-
- [ -d $(exec_prefix)/argus/archive ] || \
- (mkdir -p $(exec_prefix)/argus/archive; chmod 755 $(exec_prefix)/argus/archive)
-
- [ -d $(docdir) ] || \
- (mkdir -p $(docdir); chmod 755 $(docdir))
-
- [ -d $(docdir)/html ] || \
- (mkdir -p $(docdir)/html; chmod 755 $(docdir)/html)
-
- [ -d $(docdir)/html/man ] || \
- (mkdir -p $(docdir)/html/man; chmod 755 $(docdir)/html/man)
+# [ -d $(exec_prefix)/argus ] || \
+# (mkdir -p $(exec_prefix)/argus; chmod 755 $(exec_prefix)/argus)
+#
+# [ -d $(exec_prefix)/argus/archive ] || \
+# (mkdir -p $(exec_prefix)/argus/archive; chmod 755 $(exec_prefix)/argus/archive)
+#
+# [ -d $(docdir) ] || \
+# (mkdir -p $(docdir); chmod 755 $(docdir))
+#
+# [ -d $(docdir)/html ] || \
+# (mkdir -p $(docdir)/html; chmod 755 $(docdir)/html)
+#
+# [ -d $(docdir)/html/man ] || \
+# (mkdir -p $(docdir)/html/man; chmod 755 $(docdir)/html/man)
@-for d in $(DIRS); \
do \
(cd $$d; echo "### Make install in" `pwd`; \
$(MAKE) $(MFLAGS) install; \
echo "### Done with" `pwd`); \
done
- $(INSTALL) -m 0644 $(srcdir)/doc/FAQ $(docdir)
- $(INSTALL) -m 0644 $(srcdir)/doc/HOW-TO $(docdir)
- $(INSTALL) -m 0644 $(srcdir)/doc/html/man/*.html $(docdir)/html/man
-
- $(INSTALL) -m 0644 $(srcdir)/README $(prefix)/argus
- $(INSTALL) -m 0644 $(srcdir)/README $(docdir)
- $(INSTALL) -m 0644 $(srcdir)/COPYING $(prefix)/argus
- $(INSTALL) -m 0644 $(srcdir)/COPYING $(docdir)
-
- $(INSTALL) -m 0755 $(srcdir)/bin/argusbug @bindir@/argusbug
-
- [ -d @mandir@ ] || \
- (mkdir -p @mandir@; chmod 755 @mandir@)
- [ -d @mandir@/man1 ] || \
- (mkdir -p @mandir@/man1; chmod 755 @mandir@/man1)
- [ -d @mandir@/man5 ] || \
- (mkdir -p @mandir@/man5; chmod 755 @mandir@/man5)
- [ -d @mandir@/man8 ] || \
- (mkdir -p @mandir@/man8; chmod 755 @mandir@/man8)
- $(INSTALL) -m 0644 $(srcdir)/man/man5/argus.5 @mandir@/man5/argus.5
- $(INSTALL) -m 0644 $(srcdir)/man/man5/argus.conf.5 @mandir@/man5/argus.conf.5
- $(INSTALL) -m 0644 $(srcdir)/man/man5/rarc.5 @mandir@/man5/rarc.5
-
- $(INSTALL) -m 0644 $(srcdir)/man/man8/argus.8 @mandir@/man8/argus.8
-
- $(INSTALL) -m 0644 $(srcdir)/man/man1/ra.1 @mandir@/man1/ra.1
- $(INSTALL) -m 0644 $(srcdir)/man/man1/racount.1 @mandir@/man1/racount.1
- $(INSTALL) -m 0644 $(srcdir)/man/man1/ragator.1 @mandir@/man1/ragator.1
- $(INSTALL) -m 0644 $(srcdir)/man/man1/ramon.1 @mandir@/man1/ramon.1
- $(INSTALL) -m 0644 $(srcdir)/man/man1/rasort.1 @mandir@/man1/rapolicy.1
- $(INSTALL) -m 0644 $(srcdir)/man/man1/rasort.1 @mandir@/man1/rasort.1
- $(INSTALL) -m 0644 $(srcdir)/man/man1/raxml.1 @mandir@/man1/raxml.1
+# $(INSTALL) -m 0644 $(srcdir)/doc/FAQ $(docdir)
+# $(INSTALL) -m 0644 $(srcdir)/doc/HOW-TO $(docdir)
+# $(INSTALL) -m 0644 $(srcdir)/doc/html/man/*.html $(docdir)/html/man
+#
+# $(INSTALL) -m 0644 $(srcdir)/README $(prefix)/argus
+# $(INSTALL) -m 0644 $(srcdir)/README $(docdir)
+# $(INSTALL) -m 0644 $(srcdir)/COPYING $(prefix)/argus
+# $(INSTALL) -m 0644 $(srcdir)/COPYING $(docdir)
+#
+# $(INSTALL) -m 0755 $(srcdir)/bin/argusbug @bindir@/argusbug
+
+ [ -d $(DESTDIR)/@mandir@ ] || \
+ (mkdir -p $(DESTDIR)/@mandir@; chmod 755 $(DESTDIR)/@mandir@)
+# [ -d @mandir@/man1 ] || \
+# (mkdir -p @mandir@/man1; chmod 755 @mandir@/man1)
+ [ -d $(DESTDIR)/@mandir@/man5 ] || \
+ (mkdir -p $(DESTDIR)/@mandir@/man5; chmod 755 $(DESTDIR)/@mandir@/man5)
+ [ -d $(DESTDIR)/@mandir@/man8 ] || \
+ (mkdir -p $(DESTDIR)/@mandir@/man8; chmod 755 $(DESTDIR)/@mandir@/man8)
+ $(INSTALL) -m 0644 $(srcdir)/man/man5/argus.5 $(DESTDIR)/@mandir@/man5/argus.5
+ $(INSTALL) -m 0644 $(srcdir)/man/man5/argus.conf.5 $(DESTDIR)/@mandir@/man5/argus.conf.5
+# $(INSTALL) -m 0644 $(srcdir)/man/man5/rarc.5 @mandir@/man5/rarc.5
+
+ $(INSTALL) -m 0644 $(srcdir)/man/man8/argus.8 $(DESTDIR)/@mandir@/man8/argus.8
+
+# $(INSTALL) -m 0644 $(srcdir)/man/man1/ra.1 @mandir@/man1/ra.1
+# $(INSTALL) -m 0644 $(srcdir)/man/man1/racount.1 @mandir@/man1/racount.1
+# $(INSTALL) -m 0644 $(srcdir)/man/man1/ragator.1 @mandir@/man1/ragator.1
+# $(INSTALL) -m 0644 $(srcdir)/man/man1/ramon.1 @mandir@/man1/ramon.1
+# $(INSTALL) -m 0644 $(srcdir)/man/man1/rasort.1 @mandir@/man1/rapolicy.1
+# $(INSTALL) -m 0644 $(srcdir)/man/man1/rasort.1 @mandir@/man1/rasort.1
+# $(INSTALL) -m 0644 $(srcdir)/man/man1/raxml.1 @mandir@/man1/raxml.1
uninstall:
- rm -f @mandir@/man5/argus.5
- rm -f @mandir@/man5/argus.conf.5
- rm -f @mandir@/man8/argus.8
-
- rm -rf $(docdir)
- rm -f $(exec_prefix)/argus/COPYING
- rm -f $(exec_prefix)/argus/README
+ rm -f $(DESTDIR)/@mandir@/man5/argus.5
+ rm -f $(DESTDIR)/@mandir@/man5/argus.conf.5
+ rm -f $(DESTDIR)/@mandir@/man8/argus.8
+
+# rm -rf $(docdir)
+# rm -f $(exec_prefix)/argus/COPYING
+# rm -f $(exec_prefix)/argus/README
installdirs:
- ${srcdir}/config/mkinstalldirs $(bindir) $(infodir)
+ ${srcdir}/config/mkinstalldirs $(DESTDIR)/$(bindir) $(DESTDIR)/$(infodir)
Makefile: Makefile.in config.status
$(SHELL) config.status
config.status: configure
diff -NarU5 argus-2.0.6.fixes.1.orig/server/Makefile.in argus-2.0.6.fixes.1/server/Makefile.in
--- argus-2.0.6.fixes.1.orig/server/Makefile.in 2004-02-23 10:00:36.000000000 -0500
+++ argus-2.0.6.fixes.1/server/Makefile.in 2006-03-15 11:09:04.000000000 -0500
@@ -41,11 +41,11 @@
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
-prefix = $(DESTDIR)@prefix@
+prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of directory to install the system binaries
SBINDIR = @sbindir@
# Pathname of directory to install the system binaries
BINDIR = @bindir@
@@ -131,16 +131,16 @@
@rm -f $@
sed -e 's/.*/char version[] = "&";/' $(srcdir)/../VERSION > $@
install: force
- [ -d $(prefix) ] || \
- (mkdir -p $(prefix); chmod 755 $(prefix))
- [ -d $(SBINDIR) ] || \
- (mkdir -p $(SBINDIR); chmod 755 $(SBINDIR))
+ [ -d $(DESTDIR)/$(prefix) ] || \
+ (mkdir -p $(DESTDIR)/$(prefix); chmod 755 $(DESTDIR)/$(prefix))
+ [ -d $(DESTDIR)/$(SBINDIR) ] || \
+ (mkdir -p $(DESTDIR)/$(SBINDIR); chmod 755 $(DESTDIR)/$(SBINDIR))
- $(INSTALL) $(srcdir)/../bin/argus_ at V_PCAP@ $(SBINDIR)/argus
+ $(INSTALL) $(srcdir)/../bin/argus_ at V_PCAP@ $(DESTDIR)/$(SBINDIR)/argus
clean:
rm -f $(CLEANFILES)
distclean:
argus-clients-2.0.6.fixes.1-build.patch:
--- NEW FILE argus-clients-2.0.6.fixes.1-build.patch ---
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/common/argus_parse.c argus-clients-2.0.6.fixes.1/common/argus_parse.c
--- argus-clients-2.0.6.fixes.1.orig/common/argus_parse.c 2003-12-06 12:42:13.000000000 -0500
+++ argus-clients-2.0.6.fixes.1/common/argus_parse.c 2006-02-24 14:06:04.000000000 -0500
@@ -2202,12 +2202,11 @@
int
ArgusReadSaslStreamSocket (struct ARGUS_INPUT *input)
{
int retn = 0, fd = input->fd, cnt = 0;
unsigned int val = 0, *pval = &val;
- struct ArgusRecord *argus = NULL;
- char *output = NULL, *end = NULL, *ptr = NULL;
+ char *argus = NULL, *output = NULL, *end = NULL, *ptr = NULL;
unsigned int outputlen = 0;
if ((retn = sasl_getprop(input->sasl_conn, SASL_MAXOUTBUF, (void **) &pval)) != SASL_OK)
ArgusLog (LOG_ERR, "ArgusReadSaslStreamSocket: sasl_getprop %s", strerror(errno));
@@ -2226,26 +2225,26 @@
if ((retn = sasl_decode (input->sasl_conn, ptr, cnt, &output, &outputlen)) == SASL_OK) {
#ifdef ARGUSDEBUG
ArgusDebug (5, "ArgusReadSaslStreamSocket (0x%x) sasl_decoded %d bytes\n", input, outputlen);
#endif
if (outputlen) {
- argus = (struct ArgusRecord *) output;
+ argus = output;
end = output + outputlen;
- while ((char *)argus < end) {
- input->ArgusReadSocketCnt = ntohs(argus->ahdr.length);
- bcopy ((char *) argus, input->ArgusReadBuffer, input->ArgusReadSocketCnt);
+ while (argus < end) {
+ input->ArgusReadSocketCnt = ntohs(((struct ArgusRecord *)argus)->ahdr.length);
+ bcopy (argus, input->ArgusReadBuffer, input->ArgusReadSocketCnt);
- if (ArgusHandleDatum (argus, &ArgusFilterCode) == 1) {
+ if (ArgusHandleDatum ((struct ArgusRecord *)argus, &ArgusFilterCode) == 1) {
if (Sflag)
ArgusWriteConnection (input, "DONE: ", strlen("DONE: "));
retn = 1;
break;
} else
- (char *)argus += input->ArgusReadSocketCnt;
+ argus += input->ArgusReadSocketCnt;
}
free (output);
}
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/common/gencode.c argus-clients-2.0.6.fixes.1/common/gencode.c
--- argus-clients-2.0.6.fixes.1.orig/common/gencode.c 2004-04-26 12:30:23.000000000 -0400
+++ argus-clients-2.0.6.fixes.1/common/gencode.c 2006-02-24 14:05:56.000000000 -0500
@@ -230,11 +230,11 @@
#include <signal.h>
#include <sys/wait.h>
-static u_int ArgusNetMask;
+u_int ArgusNetMask;
static int snaplen;
int
ArgusFilterCompile(struct bpf_program *program, char *buf, int optimize, unsigned int mask)
{
argus-clients-2.0.6.fixes.1-makefile.patch:
--- NEW FILE argus-clients-2.0.6.fixes.1-makefile.patch ---
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/clients/Makefile.in argus-clients-2.0.6.fixes.1/clients/Makefile.in
--- argus-clients-2.0.6.fixes.1.orig/clients/Makefile.in 2003-07-10 13:28:32.000000000 -0400
+++ argus-clients-2.0.6.fixes.1/clients/Makefile.in 2006-02-24 14:35:36.000000000 -0500
@@ -42,11 +42,11 @@
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
-prefix = $(DESTDIR)@prefix@
+prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of install directory
# Pathname of directory to install the system binaries
SBINDIR = @sbindir@
@@ -163,17 +163,17 @@
OBJ = $(SRC:.c=.o)
CLEANFILES = $(OBJ) $(PROGS)
install: force
- [ -d $(prefix) ] || \
- (mkdir -p $(prefix); chmod 755 $(prefix))
+ [ -d $(DESTDIR)/$(prefix) ] || \
+ (mkdir -p $(DESTDIR)/$(prefix); chmod 755 $(DESTDIR)/$(prefix))
- [ -d $(BINDIR) ] || \
- (mkdir -p $(BINDIR); chmod 755 $(BINDIR))
+ [ -d $(DESTDIR)/$(BINDIR) ] || \
+ (mkdir -p $(DESTDIR)/$(BINDIR); chmod 755 $(DESTDIR)/$(BINDIR))
- $(INSTALL) $(srcdir)/../bin/ra* $(BINDIR)
+ $(INSTALL) $(srcdir)/../bin/ra* $(DESTDIR)/$(BINDIR)
clean:
rm -f $(CLEANFILES)
distclean:
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/common/Makefile.in argus-clients-2.0.6.fixes.1/common/Makefile.in
--- argus-clients-2.0.6.fixes.1.orig/common/Makefile.in 2003-07-10 13:28:32.000000000 -0400
+++ argus-clients-2.0.6.fixes.1/common/Makefile.in 2006-02-24 14:35:36.000000000 -0500
@@ -19,11 +19,11 @@
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
-prefix = $(DESTDIR)@prefix@
+prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of directory to install the include files
INCLDEST = @includedir@
# Pathname of directory to install the library
LIBDEST = @libdir@
@@ -129,18 +129,18 @@
version.c: $(srcdir)/../VERSION
@rm -f $@
sed -e 's/.*/char version[] = "&";/' $(srcdir)/../VERSION > $@
install: force all
- [ -d $(LIBDEST) ] || \
- (mkdir -p $(LIBDEST); chmod 755 $(LIBDEST))
+ [ -d $(DESTDIR)/$(LIBDEST) ] || \
+ (mkdir -p $(DESTDIR)/$(LIBDEST); chmod 755 $(DESTDIR)/$(LIBDEST))
- $(INSTALL) $(srcdir)/../lib/argus_common.a $(LIBDEST)/argus_common.a
- $(INSTALL) $(srcdir)/../lib/argus_parse.a $(LIBDEST)/argus_parse.a
+ $(INSTALL) $(srcdir)/../lib/argus_common.a $(DESTDIR)/$(LIBDEST)/argus_common.a
+ $(INSTALL) $(srcdir)/../lib/argus_parse.a $(DESTDIR)/$(LIBDEST)/argus_parse.a
- $(RANLIB) $(LIBDEST)/argus_common.a
- $(RANLIB) $(LIBDEST)/argus_parse.a
+ $(RANLIB) $(DESTDIR)/$(LIBDEST)/argus_common.a
+ $(RANLIB) $(DESTDIR)/$(LIBDEST)/argus_parse.a
clean:
rm -f $(CLEANFILES)
distclean:
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/Makefile.in argus-clients-2.0.6.fixes.1/Makefile.in
--- argus-clients-2.0.6.fixes.1.orig/Makefile.in 2003-07-10 13:28:29.000000000 -0400
+++ argus-clients-2.0.6.fixes.1/Makefile.in 2006-02-24 14:35:36.000000000 -0500
@@ -27,14 +27,14 @@
LIBS = @LIBS@
CFLAGS = -g
LDFLAGS = -g
-prefix = $(DESTDIR)@prefix@
+prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
-docdir = $(prefix)/share/doc/argus-2.0
+#docdir = $(prefix)/share/doc/argus-2.0
#### End of system configuration section. ####
SHELL = /bin/sh
@@ -63,108 +63,109 @@
.PHONY: all
install: force
make installdirs
- [ -d $(prefix) ] || \
- (mkdir -p $(prefix); chmod 755 $(prefix))
+ [ -d $(DESTDIR)/$(prefix) ] || \
+ (mkdir -p $(DESTDIR)/$(prefix); chmod 755 $(DESTDIR)/$(prefix))
- [ -d @sbindir@ ] || \
- (mkdir -p @sbindir@; chmod 755 @sbindir@)
+# [ -d @sbindir@ ] || \
+# (mkdir -p @sbindir@; chmod 755 @sbindir@)
- [ -d @bindir@ ] || \
- (mkdir -p @bindir@; chmod 755 @bindir@)
+ [ -d $(DESTDIR)/@bindir@ ] || \
+ (mkdir -p $(DESTDIR)/@bindir@; chmod 755 $(DESTDIR)/@bindir@)
- [ -d $(exec_prefix)/argus ] || \
- (mkdir -p $(exec_prefix)/argus; chmod 755 $(exec_prefix)/argus)
-
- [ -d $(exec_prefix)/argus/archive ] || \
- (mkdir -p $(exec_prefix)/argus/archive; chmod 755 $(exec_prefix)/argus/archive)
-
- [ -d $(docdir) ] || \
- (mkdir -p $(docdir); chmod 755 $(docdir))
-
- [ -d $(docdir)/html ] || \
- (mkdir -p $(docdir)/html; chmod 755 $(docdir)/html)
-
- [ -d $(docdir)/html/man ] || \
- (mkdir -p $(docdir)/html/man; chmod 755 $(docdir)/html/man)
+# [ -d $(exec_prefix)/argus ] || \
+# (mkdir -p $(exec_prefix)/argus; chmod 755 $(exec_prefix)/argus)
+#
+# [ -d $(exec_prefix)/argus/archive ] || \
+# (mkdir -p $(exec_prefix)/argus/archive; chmod 755 $(exec_prefix)/argus/archive)
+#
+# [ -d $(docdir) ] || \
+# (mkdir -p $(docdir); chmod 755 $(docdir))
+#
+# [ -d $(docdir)/html ] || \
+# (mkdir -p $(docdir)/html; chmod 755 $(docdir)/html)
+#
+# [ -d $(docdir)/html/man ] || \
+# (mkdir -p $(docdir)/html/man; chmod 755 $(docdir)/html/man)
@for i in $(DIRS) ; do \
if [ -d $$i ] ; then \
echo "making in $$i"; \
cd $$i; \
make install; \
cd ..; \
fi; \
done
- $(INSTALL) -m 0644 $(srcdir)/doc/FAQ $(docdir)
- $(INSTALL) -m 0644 $(srcdir)/doc/HOW-TO $(docdir)
- $(INSTALL) -m 0644 $(srcdir)/doc/html/man/*.html $(docdir)/html/man
-
- $(INSTALL) -m 0644 $(srcdir)/README $(prefix)/argus
- $(INSTALL) -m 0644 $(srcdir)/README $(docdir)
- $(INSTALL) -m 0644 $(srcdir)/COPYING $(prefix)/argus
- $(INSTALL) -m 0644 $(srcdir)/COPYING $(docdir)
-
- $(INSTALL) -m 0755 $(srcdir)/bin/argusbug @bindir@/argusbug
-
- [ -d @mandir@ ] || \
- (mkdir -p @mandir@; chmod 755 @mandir@)
- [ -d @mandir@/man1 ] || \
- (mkdir -p @mandir@/man1; chmod 755 @mandir@/man1)
+# $(INSTALL) -m 0644 $(srcdir)/doc/FAQ $(docdir)
+# $(INSTALL) -m 0644 $(srcdir)/doc/HOW-TO $(docdir)
+# $(INSTALL) -m 0644 $(srcdir)/doc/html/man/*.html $(docdir)/html/man
+#
+# $(INSTALL) -m 0644 $(srcdir)/README $(prefix)/argus
+# $(INSTALL) -m 0644 $(srcdir)/README $(docdir)
+# $(INSTALL) -m 0644 $(srcdir)/COPYING $(prefix)/argus
+# $(INSTALL) -m 0644 $(srcdir)/COPYING $(docdir)
+#
+# $(INSTALL) -m 0755 $(srcdir)/bin/argusbug @bindir@/argusbug
+
+ [ -d $(DESTDIR)/@mandir@ ] || \
+ (mkdir -p $(DESTDIR)/@mandir@; chmod 755 $(DESTDIR)/@mandir@)
+ [ -d $(DESTDIR)/@mandir@/man1 ] || \
+ (mkdir -p $(DESTDIR)/@mandir@/man1; chmod 755 $(DESTDIR)/@mandir@/man1)
$(INSTALL) -m 0644 $(srcdir)/man/man1/ra.1 \
- @mandir@/man1/ra.1
+ $(DESTDIR)/@mandir@/man1/ra.1
$(INSTALL) -m 0644 $(srcdir)/man/man1/racount.1 \
- @mandir@/man1/racount.1
+ $(DESTDIR)/@mandir@/man1/racount.1
$(INSTALL) -m 0644 $(srcdir)/man/man1/ragator.1 \
- @mandir@/man1/ragator.1
+ $(DESTDIR)/@mandir@/man1/ragator.1
$(INSTALL) -m 0644 $(srcdir)/man/man1/rahosts.1 \
- @mandir@/man1/rahosts.1
+ $(DESTDIR)/@mandir@/man1/rahosts.1
$(INSTALL) -m 0644 $(srcdir)/man/man1/ramon.1 \
- @mandir@/man1/ramon.1
+ $(DESTDIR)/@mandir@/man1/ramon.1
$(INSTALL) -m 0644 $(srcdir)/man/man1/ranonymize.1 \
- @mandir@/man1/ranonymize.1
+ $(DESTDIR)/@mandir@/man1/ranonymize.1
$(INSTALL) -m 0644 $(srcdir)/man/man1/rapolicy.1 \
- @mandir@/man1/rapolicy.1
+ $(DESTDIR)/@mandir@/man1/rapolicy.1
$(INSTALL) -m 0644 $(srcdir)/man/man1/rasort.1 \
- @mandir@/man1/rasort.1
+ $(DESTDIR)/@mandir@/man1/rasort.1
$(INSTALL) -m 0644 $(srcdir)/man/man1/rastrip.1 \
- @mandir@/man1/rastrip.1
+ $(DESTDIR)/@mandir@/man1/rastrip.1
$(INSTALL) -m 0644 $(srcdir)/man/man1/raxml.1 \
- @mandir@/man1/raxml.1
- [ -d @mandir@/man5 ] || \
- (mkdir -p @mandir@/man5; chmod 755 @mandir@/man5)
+ $(DESTDIR)/@mandir@/man1/raxml.1
+ [ -d $(DESTDIR)/@mandir@/man5 ] || \
+ (mkdir -p $(DESTDIR)/@mandir@/man5; chmod 755 $(DESTDIR)/@mandir@/man5)
$(INSTALL) -m 0644 $(srcdir)/man/man5/rarc.5 \
- @mandir@/man5/rarc.5
+ $(DESTDIR)/@mandir@/man5/rarc.5
+
uninstall:
- rm -f @bindir@/argusbug
- rm -f @bindir@/ra
- rm -f @bindir@/racount
- rm -f @bindir@/ragator
- rm -f @bindir@/rahistogram
- rm -f @bindir@/rahosts
- rm -f @bindir@/rarpwatch
- rm -f @bindir@/raseq
- rm -f @bindir@/rasrvstats
- rm -f @bindir@/ratop
- rm -f @bindir@/raxml
-
- rm -f @mandir@/man1/ra.1
- rm -f @mandir@/man1/racount.1
- rm -f @mandir@/man1/ragator.1
- rm -f @mandir@/man1/rasort.1
- rm -f @mandir@/man1/raxml.1
- rm -f @mandir@/man1/tcpdump.1
- rm -f @mandir@/man5/argus.5
- rm -f @mandir@/man5/argus.conf.5
- rm -f @mandir@/man5/rarc.5
-
- rm -rf $(docdir)
- rm -f $(exec_prefix)/argus/COPYING
- rm -f $(exec_prefix)/argus/README
+ rm -f $(DESTDIR)/@bindir@/argusbug
+ rm -f $(DESTDIR)/@bindir@/ra
+ rm -f $(DESTDIR)/@bindir@/racount
+ rm -f $(DESTDIR)/@bindir@/ragator
+ rm -f $(DESTDIR)/@bindir@/rahistogram
+ rm -f $(DESTDIR)/@bindir@/rahosts
+ rm -f $(DESTDIR)/@bindir@/rarpwatch
+ rm -f $(DESTDIR)/@bindir@/raseq
+ rm -f $(DESTDIR)/@bindir@/rasrvstats
+ rm -f $(DESTDIR)/@bindir@/ratop
+ rm -f $(DESTDIR)/@bindir@/raxml
+
+ rm -f $(DESTDIR)/@mandir@/man1/ra.1
+ rm -f $(DESTDIR)/@mandir@/man1/racount.1
+ rm -f $(DESTDIR)/@mandir@/man1/ragator.1
+ rm -f $(DESTDIR)/@mandir@/man1/rasort.1
+ rm -f $(DESTDIR)/@mandir@/man1/raxml.1
+ rm -f $(DESTDIR)/@mandir@/man1/tcpdump.1
+ rm -f $(DESTDIR)/@mandir@/man5/argus.5
+ rm -f $(DESTDIR)/@mandir@/man5/argus.conf.5
+ rm -f $(DESTDIR)/@mandir@/man5/rarc.5
+
+ #rm -rf $(docdir)
+ #rm -f $(exec_prefix)/argus/COPYING
+ #rm -f $(exec_prefix)/argus/README
installdirs:
${srcdir}/config/mkinstalldirs $(bindir) $(infodir)
Makefile: Makefile.in config.status
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/ragraph/Makefile.in argus-clients-2.0.6.fixes.1/ragraph/Makefile.in
--- argus-clients-2.0.6.fixes.1.orig/ragraph/Makefile.in 2003-07-10 13:28:32.000000000 -0400
+++ argus-clients-2.0.6.fixes.1/ragraph/Makefile.in 2006-02-24 14:35:36.000000000 -0500
@@ -20,11 +20,11 @@
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
-prefix = $(DESTDIR)@prefix@
+prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of directory to install the system binaries
SBINDIR = @sbindir@
# Pathname of directory to install the system binaries
@@ -92,18 +92,18 @@
OBJ = $(SRC:.c=.o)
CLEANFILES = $(OBJ) $(PROGS)
install: force all
- [ -d $(DESTDIR) ] || \
- (mkdir -p $(DESTDIR); chmod 755 $(DESTDIR))
+# [ -d $(DESTDIR) ] || \
+# (mkdir -p $(DESTDIR); chmod 755 $(DESTDIR))
- [ -d $(BINDIR) ] || \
- (mkdir -p $(BINDIR); chmod 755 $(BINDIR))
+ [ -d $(DESTDIR)/$(BINDIR) ] || \
+ (mkdir -p $(DESTDIR)/$(BINDIR); chmod 755 $(DESTDIR)/$(BINDIR))
- $(INSTALL) @INSTALL_BIN@/rahistogram $(BINDIR)
- $(INSTALL) @INSTALL_BIN@/ragraph $(BINDIR)
+ $(INSTALL) @INSTALL_BIN@/rahistogram $(DESTDIR)/$(BINDIR)
+ $(INSTALL) @INSTALL_BIN@/ragraph $(DESTDIR)/$(BINDIR)
clean:
rm -f $(CLEANFILES)
distclean:
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/ragrep/Makefile.in argus-clients-2.0.6.fixes.1/ragrep/Makefile.in
--- argus-clients-2.0.6.fixes.1.orig/ragrep/Makefile.in 2003-07-10 13:28:32.000000000 -0400
+++ argus-clients-2.0.6.fixes.1/ragrep/Makefile.in 2006-02-24 14:36:43.000000000 -0500
@@ -13,11 +13,11 @@
SHELL = /bin/sh
# Top level hierarchy
-prefix = $(DESTDIR)@prefix@
+prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of directory to install the system binaries
SBINDIR = @sbindir@
# Pathname of directory to install the system binaries
@@ -188,16 +188,17 @@
maintainer-clean-binPROGRAMS:
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(BINDIR)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(BINDIR)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(INSTALL_PROGRAM) $$p $(BINDIR)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
- else :; fi; \
- done
+# installation of binaries handled by toplevel makefile
+# @list='$(bin_PROGRAMS)'; for p in $$list; do \
+# if test -f $$p; then \
+# echo " $(INSTALL_PROGRAM) $$p $(BINDIR)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+# $(INSTALL_PROGRAM) $$p $(BINDIR)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+# else :; fi; \
+# done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(BINDIR)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/ratop/Makefile.in argus-clients-2.0.6.fixes.1/ratop/Makefile.in
--- argus-clients-2.0.6.fixes.1.orig/ratop/Makefile.in 2003-07-10 13:28:32.000000000 -0400
+++ argus-clients-2.0.6.fixes.1/ratop/Makefile.in 2006-02-24 14:35:36.000000000 -0500
@@ -19,11 +19,11 @@
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
-prefix = $(DESTDIR)@prefix@
+prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of directory to install the system binaries
SBINDIR = @sbindir@
# Pathname of directory to install the system binaries
BINDIR = @bindir@
@@ -86,18 +86,18 @@
OBJ = $(SRC:.c=.o)
CLEANFILES = $(OBJ) $(PROGS)
install: force all
- [ -d $(DESTDIR) ] || \
- (mkdir -p $(DESTDIR); chmod 755 $(DESTDIR))
- [ -d $(prefix) ] || \
- (mkdir -p $(prefix); chmod 755 $(prefix))
- [ -d $(BINDIR) ] || \
- (mkdir -p $(BINDIR); chmod 755 $(BINDIR))
+# [ -d $(DESTDIR) ] || \
+# (mkdir -p $(DESTDIR); chmod 755 $(DESTDIR))
+ [ -d $(DESTDIR)/$(prefix) ] || \
+ (mkdir -p $(DESTDIR)/$(prefix); chmod 755 $(DESTDIR)/$(prefix))
+ [ -d $(DESTDIR)/$(BINDIR) ] || \
+ (mkdir -p $(DESTDIR)/$(BINDIR); chmod 755 $(DESTDIR)/$(BINDIR))
- $(INSTALL) @INSTALL_BIN@/ratop $(BINDIR)
+ $(INSTALL) @INSTALL_BIN@/ratop $(DESTDIR)/$(BINDIR)
clean:
rm -f $(CLEANFILES)
distclean:
argus-clients-2.0.6.fixes.1-print.patch:
--- NEW FILE argus-clients-2.0.6.fixes.1-print.patch ---
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/common/argus_client.c argus-clients-2.0.6.fixes.1/common/argus_client.c
--- argus-clients-2.0.6.fixes.1.orig/common/argus_client.c 2004-05-10 09:41:34.000000000 -0400
+++ argus-clients-2.0.6.fixes.1/common/argus_client.c 2006-03-08 16:37:12.000000000 -0500
@@ -67,10 +67,14 @@
}
RaPrintDate = 0;
for (x = 0; x < MAX_PRINT_ALG_TYPES; x++) {
if (!strncmp (RaPrintKeyWords[x], soption, strlen(RaPrintKeyWords[x]))) {
+ if (x == 0) {
+ RaPrintStartTime = 1;
+ RaPrintLastTime = 1;
+ }
if (x < 3) RaPrintDate++;
switch (RaOptionOperation) {
case RA_ADD_OPTION:
if (RaOptionRank == -1) {
int z = 0;
@@ -3088,11 +3092,11 @@
} else
break;
}
if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0')) {
- char tmpbuf[128], *ptr = tmpbuf, *str = RaLabel, lastchr = ' ';
+ char tmpbuf[1024], *ptr = tmpbuf, *str = RaLabel, lastchr = ' ';
bzero (tmpbuf, sizeof(tmpbuf));
lastchr = RaFieldDelimiter;
while (*str) {
if (*str == ' ') {
@@ -3118,12 +3122,14 @@
void
ArgusPrintDateLabel (char *buf)
{
if (lflag)
ArgusPrintLastDateLabel (buf);
- else
+ else {
ArgusPrintStartDateLabel (buf);
+ ArgusPrintLastDateLabel (buf);
+ }
}
void
ArgusPrintStartDateLabel (char *buf)
@@ -3446,11 +3452,12 @@
if (ArgusDstUserDataLen > 10) len++;
sprintf (&buf[strlen(buf)], "%*sdstUdata%*s ", (len)/2, " ", (len)/2, " ");
if (len & 0x01)
sprintf(&buf[strlen(buf)], " ");
}
- }
+ } else
+ sprintf (&buf[strlen(buf)], " srcUdata%cdstUdata ", RaFieldDelimiter);
}
void
ArgusPrintTCPExtensionsLabel (char *buf)
{
diff -NarU5 argus-clients-2.0.6.fixes.1.orig/common/argus_util.c argus-clients-2.0.6.fixes.1/common/argus_util.c
--- argus-clients-2.0.6.fixes.1.orig/common/argus_util.c 2003-12-06 12:43:56.000000000 -0500
+++ argus-clients-2.0.6.fixes.1/common/argus_util.c 2006-03-08 16:45:56.000000000 -0500
@@ -907,39 +907,31 @@
extern char *ArgusProgramName;
void
ArgusPrintStartDate (char *date, struct ArgusRecord *ptr)
{
- char delim = ' ';
struct timeval *tvp = NULL;
if (ptr->ahdr.type & ARGUS_MAR)
tvp = &ptr->argus_mar.startime;
else
tvp = &ptr->argus_far.time.start;
- if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
- delim = RaFieldDelimiter;
-
- sprintf (&date[strlen(date)], "%s%c", print_time(tvp), delim);
+ sprintf (&date[strlen(date)], "%s", print_time(tvp));
}
void
ArgusPrintLastDate (char *date, struct ArgusRecord *ptr)
{
- char delim = ' ';
struct timeval *tvp = NULL;
if (ptr->ahdr.type & ARGUS_MAR)
tvp = &ptr->argus_mar.now;
else
tvp = &ptr->argus_far.time.last;
- if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
- delim = RaFieldDelimiter;
-
- sprintf (&date[strlen(date)], "%s%c", print_time(tvp), delim);
+ sprintf (&date[strlen(date)], "%s", print_time(tvp));
}
void
ArgusPrintDate (char *date, struct ArgusRecord *ptr)
{
@@ -965,11 +957,11 @@
if (!((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0')))
if (RaPrintStartTime && RaPrintLastTime)
sprintf (&date[strlen(date)], " ");
if (RaPrintLastTime)
- sprintf (&date[strlen(date)], "%s%c", print_time(last), delim);
+ sprintf (&date[strlen(date)], "%s", print_time(last));
}
void ArgusPrintSrcRate (char *, struct ArgusRecord *);
void ArgusPrintDstRate (char *, struct ArgusRecord *);
void ArgusPrintRate (char *, struct ArgusRecord *);
@@ -1001,21 +993,21 @@
ArgusThisAgr = (struct ArgusAGRStruct *)ArgusThisFarHdrs[ARGUS_AGR_DSR_INDEX];
if (ArgusThisAgr && (ArgusThisAgr->type == ARGUS_AGR_DSR))
hits = ArgusThisAgr->count;
- sprintf(&buf[strlen(buf)], "%5d ", hits);
+ sprintf(&buf[strlen(buf)], "%5d", hits);
}
}
void ArgusPrintAverageDuration (char *, struct ArgusRecord *);
void
ArgusPrintAvgDuration (char *date, struct ArgusRecord *ptr)
{
struct ArgusAGRStruct *ArgusThisAgr = NULL;
- char *sptr, *iptr, delim = ' ';
+ char *sptr, *iptr;
struct timeval *start = NULL, *last = NULL;
struct timeval buf, *time = &buf;
if (ptr->ahdr.type & ARGUS_MAR) {
start = &ptr->argus_mar.startime;
@@ -1063,21 +1055,16 @@
if (pflag) {
sptr = &date[strlen(date)];
sprintf(sptr, ".%06d", (int) time->tv_usec);
sptr[pflag + 1] = '\0';
}
-
- if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
- sprintf(&date[strlen(date)], "%c", delim);
- else
- sprintf(&date[strlen(date)], "%c", ' ');
}
void
ArgusPrintDuration (char *date, struct ArgusRecord *ptr)
{
- char *sptr, *iptr, delim = ' ';
+ char *sptr, *iptr;
struct timeval *start = NULL, *last = NULL;
struct timeval buf, *time = &buf;
if (ptr->ahdr.type & ARGUS_MAR) {
start = &ptr->argus_mar.startime;
@@ -1113,15 +1100,10 @@
if (pflag) {
sptr = &date[strlen(date)];
sprintf(sptr, ".%06d", (int) time->tv_usec);
sptr[pflag + 1] = '\0';
}
-
- if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
- sprintf(&date[strlen(date)], "%c", delim);
- else
- sprintf(&date[strlen(date)], "%c", ' ');
}
void ArgusGetIndicatorString (struct ArgusRecord *, char *);
@@ -1213,12 +1195,10 @@
}
}
}
}
- *ptr = RaFieldDelimiter;
-
} else {
int encdone = 0;
bcopy (" ", buf, 9);
if (argus->ahdr.type & ARGUS_MAR) {
@@ -1384,11 +1364,11 @@
if (ArgusInput->ArgusManStart.ahdr.status & ARGUS_ID_IS_IPADDR)
argusIDStr = ipaddr_string (&argus->ahdr.argusid);
else
sprintf (argusIDStr, "%u", argus->ahdr.argusid);
- sprintf(buf, "%-15.15s ", argusIDStr);
+ sprintf(buf, "%-15.15s", argusIDStr);
}
void ArgusPrintBinNumber (char *, struct ArgusRecord *);
void ArgusPrintBins (char *, struct ArgusRecord *);
@@ -1402,11 +1382,11 @@
}
void
ArgusPrintSequenceNumber (char *buf, struct ArgusRecord *argus) {
- sprintf(buf, "%d ", argus->ahdr.seqNumber);
+ sprintf(buf, "%d", argus->ahdr.seqNumber);
}
void
ArgusPrintIndicator (char *buf, struct ArgusRecord *argus) {
@@ -1422,14 +1402,25 @@
struct ArgusMacStruct *mac = (struct ArgusMacStruct *) ArgusThisFarHdrs[ARGUS_MAC_DSR_INDEX];
esrcString = etheraddr_string ((u_char *)&mac->phys_union.ether.ethersrc);
edstString = etheraddr_string ((u_char *)&mac->phys_union.ether.etherdst);
- sprintf (buf, "%17.17s %17.17s ", esrcString, edstString);
+ sprintf (buf, "%17.17s", esrcString);
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ sprintf(&buf[strlen(buf)], "%c", RaFieldDelimiter);
+ else
+ sprintf(&buf[strlen(buf)], "%c", ' ');
+ sprintf (&buf[strlen(buf)], "%17.17s", edstString);
- } else
- sprintf (buf, "%17.17s %17.17s ", blankStr, blankStr);
+ } else {
+ sprintf (buf, "%17.17s", blankStr);
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ sprintf(&buf[strlen(buf)], "%c", RaFieldDelimiter);
+ else
+ sprintf(&buf[strlen(buf)], "%c", ' ');
+ sprintf (&buf[strlen(buf)], "%17.17s", blankStr);
+ }
}
void
ArgusPrintProto (char *buf, struct ArgusRecord *argus)
{
@@ -1450,14 +1441,14 @@
protoStr = protoStrBuf;
sprintf (protoStr, "%u", proto);
protoStr = (nflag > 2) ? protoStrBuf :
(proto >= IPPROTOSTR) ? "unas" : ip_proto_string[proto];
- if ((proto == IPPROTO_UDP) && (argus->argus_far.flow.ip_flow.tp_p == ARGUS_RTP_FLOWTAG))
+ if ((nflag < 3) && (proto == IPPROTO_UDP) && (argus->argus_far.flow.ip_flow.tp_p == ARGUS_RTP_FLOWTAG))
protoStr = "rtp";
- if ((proto == IPPROTO_UDP) && (argus->argus_far.flow.ip_flow.tp_p == ARGUS_RTCP_FLOWTAG))
+ if ((nflag < 3) && (proto == IPPROTO_UDP) && (argus->argus_far.flow.ip_flow.tp_p == ARGUS_RTCP_FLOWTAG))
protoStr = "rtcp";
break;
}
@@ -1466,11 +1457,11 @@
break;
}
}
if (protoStr != NULL)
- sprintf (buf, "%4.4s ", protoStr);
+ sprintf (buf, "%4.4s", protoStr);
}
int ArgusPrintNet = 0;
void
@@ -1535,11 +1526,11 @@
{
void *addr = NULL;
struct ArgusFlow *flow;
if (argus->ahdr.type & ARGUS_MAR) {
- sprintf (&buf[strlen(buf)], "%*d ", hfield, argus->argus_mar.nextMrSequenceNum);
+ sprintf (&buf[strlen(buf)], "%*u ", hfield, argus->argus_mar.nextMrSequenceNum);
} else {
flow = &argus->argus_far.flow;
ArgusThisProto = argus->ahdr.status & 0xFFFF;
@@ -1593,13 +1584,14 @@
addrstr = etheraddr_string ((unsigned char *) addr);
break;
}
if (addr != NULL)
- sprintf (buf, "%*.*s ", thishfield, thishfield, addrstr);
+ sprintf (buf, "%*.*s", thishfield, thishfield, addrstr);
else
- sprintf (buf, "%*.*s ", thishfield, thishfield, " ");
+ sprintf (buf, "%*.*s", thishfield, thishfield, " ");
+
}
void
ArgusPrintSrcPort (char *buf, struct ArgusRecord *argus)
@@ -1629,12 +1621,10 @@
}
case ETHERTYPE_REVARP:
case ETHERTYPE_ARP:
sprintf (&buf[strlen(buf)], "%*s", pfield - 1, " ");
- if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
- sprintf (buf, "%c", RaFieldDelimiter);
break;
default:
ArgusPrintPort (&buf[strlen(buf)], argus, flow->mac_flow.ssap);
break;
@@ -1648,11 +1638,11 @@
void
ArgusPrintDstPort (char *buf, struct ArgusRecord *argus)
{
if (argus->ahdr.type & ARGUS_MAR) {
- sprintf (&buf[strlen(buf)], "%-*d", pfield + 1, argus->argus_mar.flows);
+ sprintf (&buf[strlen(buf)], "%-*u", pfield + 1, argus->argus_mar.flows);
} else {
struct ArgusFlow *flow = &argus->argus_far.flow;
ArgusThisProto = argus->ahdr.status & 0xFFFF;
@@ -1671,13 +1661,10 @@
else
sprintf (&buf[strlen(buf)], "%*s", pfield + 1, " ");
} else
sprintf (&buf[strlen(buf)], "%*s", pfield - 1, " ");
- if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
- sprintf (buf, "%c", RaFieldDelimiter);
-
break;
default:
ArgusPrintPort (&buf[strlen(buf)], argus, flow->mac_flow.dsap);
break;
@@ -1697,75 +1684,82 @@
if (port != 0xFFFF) {
if (nflag > 1) {
switch (proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
- if (RaPrintIndex > 0)
+ if ((RaPrintIndex > 0) && ((RaFieldDelimiter == ' ') ||
+ (RaFieldDelimiter == '\0'))) {
if ((RaPrintAlgorithms[RaPrintIndex - 1] == ArgusPrintSrcAddr) ||
(RaPrintAlgorithms[RaPrintIndex - 1] == ArgusPrintDstAddr))
if (RaFieldDelimiter == '\0')
if (buf[strlen(buf) - 1] == ' ')
buf[strlen(buf) - 1] = '.';
+ }
+
+ sprintf (buf, "%-*d", thispfield, port);
- sprintf (buf, "%-*d ", thispfield, port);
break;
default:
- if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
- sprintf (&buf[strlen(buf)], "%c", RaFieldDelimiter);
- else
- sprintf (buf, "%-*.*s ", thispfield, thispfield, " ");
break;
}
} else {
switch (proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
- if (RaPrintIndex > 0)
+ if ((RaPrintIndex > 0) && ((RaFieldDelimiter == ' ') ||
+ (RaFieldDelimiter == '\0'))) {
if ((RaPrintAlgorithms[RaPrintIndex - 1] == ArgusPrintSrcAddr) ||
(RaPrintAlgorithms[RaPrintIndex - 1] == ArgusPrintDstAddr))
if (RaFieldDelimiter == '\0')
if (buf[strlen(buf) - 1] == ' ')
buf[strlen(buf) - 1] = '.';
+ }
if (proto == IPPROTO_TCP)
- sprintf (buf, "%-*.*s ", thispfield, thispfield, tcpport_string(port));
+ sprintf (buf, "%-*.*s", thispfield, thispfield, tcpport_string(port));
else
- sprintf (buf, "%-*.*s ", thispfield, thispfield, udpport_string(port));
+ sprintf (buf, "%-*.*s", thispfield, thispfield, udpport_string(port));
break;
default:
- if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
- sprintf (&buf[strlen(buf)], "%c", RaFieldDelimiter);
- else
- sprintf (buf, "%-*.*s ", thispfield, thispfield, " ");
+
break;
}
}
} else {
if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0')) {
sprintf (buf, "%c", RaFieldDelimiter);
} else {
switch (proto) {
default:
- sprintf (buf, "%-*.*s ", thispfield, thispfield, " ");
+ sprintf (buf, "%-*.*s", thispfield, thispfield, " ");
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ sprintf (&buf[strlen(buf)], "%c", RaFieldDelimiter);
+ else
+ sprintf (buf, "%-*.*s ", thispfield, thispfield, " ");
break;
case IPPROTO_TCP:
case IPPROTO_UDP:
- if (RaPrintIndex > 0)
+ if ((RaPrintIndex > 0) && ((RaFieldDelimiter == ' ') ||
+ (RaFieldDelimiter == '\0'))) {
if ((RaPrintAlgorithms[RaPrintIndex - 1] == ArgusPrintSrcAddr) ||
(RaPrintAlgorithms[RaPrintIndex - 1] == ArgusPrintDstAddr))
if (RaFieldDelimiter == '\0')
if (buf[strlen(buf) - 1] == ' ')
buf[strlen(buf) - 1] = '.';
-
+ }
if (argus->ahdr.status & ARGUS_MERGED)
sprintf (buf, "%-*.*s ", thispfield, thispfield, "*");
else
- sprintf (buf, "%-*d ", thispfield, port);
+ sprintf (buf, "%-*d", thispfield, port);
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ sprintf (&buf[strlen(buf)], "%c", RaFieldDelimiter);
+ else
+ sprintf (buf, "%-*.*s ", thispfield, thispfield, " ");
break;
}
}
}
@@ -1773,20 +1767,13 @@
}
default:
thispfield -= 2;
- if ((ArgusThisProto == 0) && (proto != 0)) {
- sprintf (buf, "%-*.*s ", thispfield, thispfield, llcsap_string((unsigned char) port));
- } else {
+ if ((ArgusThisProto == 0) && (proto != 0))
+ sprintf (buf, "%-*.*s", thispfield, thispfield, llcsap_string((unsigned char) port));
- if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0')) {
- sprintf (buf, "%c", RaFieldDelimiter);
- } else {
- sprintf (buf, "%-*.*s ", thispfield, thispfield, " ");
- }
- }
}
}
@@ -1967,11 +1954,11 @@
sprintf (dirStr, " <-> ");
break;
}
}
- sprintf (buf, "%s ", dirStr);
+ sprintf (buf, "%s", dirStr);
}
void
ArgusPrintCounts (char *buf, struct ArgusRecord *argus)
{
@@ -1984,11 +1971,11 @@
} else {
src_count = argus->argus_far.src.count;
dst_count = argus->argus_far.dst.count;
}
- sprintf (buf, "%-8u %-8u ", src_count, dst_count);
+ sprintf (buf, "%-8u%c%-8u", src_count,RaFieldDelimiter, dst_count);
}
void
ArgusPrintSrcPackets (char *buf, struct ArgusRecord *argus)
{
@@ -1999,11 +1986,11 @@
} else {
src_count = argus->argus_far.src.count;
}
- sprintf (buf, "%-8u ", src_count);
+ sprintf (buf, "%-8u", src_count);
}
void
ArgusPrintDstPackets (char *buf, struct ArgusRecord *argus)
{
@@ -2014,11 +2001,11 @@
} else {
dst_count = argus->argus_far.dst.count;
}
- sprintf (buf, "%-8u ", dst_count);
+ sprintf (buf, "%-8u", dst_count);
}
void
ArgusPrintBytes (char *buf, struct ArgusRecord *argus)
{
@@ -2036,11 +2023,11 @@
src_bytes = argus->argus_far.src.bytes;
dst_bytes = argus->argus_far.dst.bytes;
}
}
- sprintf (buf, "%-12u %-12u", src_bytes, dst_bytes);
+ sprintf (buf, "%-12u%c%-12u", src_bytes, RaFieldDelimiter, dst_bytes);
}
void
ArgusPrintSrcBytes (char *buf, struct ArgusRecord *argus)
{
@@ -2075,12 +2062,10 @@
}
sprintf (buf, "%-12u", dst_bytes);
}
-
-
#include <math.h>
void
ArgusPrintSrcJitter (char *buf, struct ArgusRecord *argus)
{
@@ -2090,12 +2075,12 @@
}
void
ArgusPrintDstJitter (char *buf, struct ArgusRecord *argus)
{
- RaPrintSrcTime = 1;
- RaPrintDstTime = 0;
+ RaPrintSrcTime = 0;
+ RaPrintDstTime = 1;
ArgusPrintJitter (buf, argus);
}
void
ArgusPrintJitter (char *buf, struct ArgusRecord *argus)
@@ -2145,15 +2130,22 @@
sprintf (stdstr, "%d.%03d", istdev/1000, istdev%1000);
stdstr[6] = '\0';
sprintf (jitterstr, "%6d.%03d (%6s)", meanval/1000, meanval%1000, stdstr);
*/
sprintf (jitterstr, "%6d.%03d", meanval/1000, meanval%1000);
- sprintf (&buf[strlen(buf)], "%-12s ", jitterstr);
+ sprintf (&buf[strlen(buf)], "%-12s", jitterstr);
} else {
sprintf (jitterstr, "%6d.%03d", meanval/1000, meanval%1000);
- sprintf (&buf[strlen(buf)], "%-12s ", jitterstr);
+ sprintf (&buf[strlen(buf)], "%-12s", jitterstr);
+ }
+
+ if (RaPrintDstTime) {
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ sprintf(&buf[strlen(buf)], "%c", RaFieldDelimiter);
+ else
+ sprintf(&buf[strlen(buf)], "%c", ' ');
}
}
if (RaPrintDstTime) {
bzero (stdstr, 128);
@@ -2318,16 +2310,21 @@
else
sprintf (ptr, "%.2f", 0.0);
sprintf (buf, "%10s", ptr);
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ sprintf(&buf[strlen(buf)], "%c", RaFieldDelimiter);
+ else
+ sprintf(&buf[strlen(buf)], "%c", ' ');
+
if (dst_count > 1)
sprintf (ptr, "%.2f", ((double)(dst_count)/seconds));
else
sprintf (ptr, "%.2f", 0.0);
- sprintf (&buf[strlen(buf)], "%10s ", ptr);
+ sprintf (&buf[strlen(buf)], "%10s", ptr);
}
/*
struct ArgusTCPObjectMetrics {
@@ -2441,15 +2438,23 @@
seconds = (double)(time->tv_sec * 1.0) + (double)(time->tv_usec/1000000.0);
if (seconds) {
sprintf (ptr, "%.4f", ((double)srcLossPkts));
sprintf (buf, "%10s", ptr);
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ sprintf(&buf[strlen(buf)], "%c", RaFieldDelimiter);
+ else
+ sprintf(&buf[strlen(buf)], "%c", ' ');
sprintf (ptr, "%.4f", ((double)dstLossPkts));
- sprintf (&buf[strlen(buf)], "%10s ", ptr);
+ sprintf (&buf[strlen(buf)], "%10s", ptr);
} else {
sprintf (ptr, "%.4f", 0.0);
sprintf (buf, "%10s", ptr);
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ sprintf(&buf[strlen(buf)], "%c", RaFieldDelimiter);
+ else
+ sprintf(&buf[strlen(buf)], "%c", ' ');
sprintf (ptr, "%.4f", 0.0);
sprintf (&buf[strlen(buf)], "%10s ", ptr);
}
}
}
@@ -2490,14 +2495,14 @@
src_bytes = argus->argus_far.src.bytes;
}
if (seconds) {
sprintf (ptr, "%.2f", ((double)(src_bytes * 8.0))/seconds);
- sprintf (&buf[strlen(buf)], "%11s ", ptr);
+ sprintf (&buf[strlen(buf)], "%11s", ptr);
} else {
sprintf (ptr, "%.2f", 0.0);
- sprintf (&buf[strlen(buf)], "%11s ", ptr);
+ sprintf (&buf[strlen(buf)], "%11s", ptr);
}
}
void
@@ -2536,24 +2541,24 @@
dst_bytes = argus->argus_far.dst.bytes;
}
if (seconds) {
sprintf (ptr, "%.2f", ((double)(dst_bytes * 8.0))/seconds);
- sprintf (&buf[strlen(buf)], "%13s ", ptr);
+ sprintf (&buf[strlen(buf)], "%13s", ptr);
} else {
sprintf (ptr, "%.2f", 0.0);
- sprintf (&buf[strlen(buf)], "%13s ", ptr);
+ sprintf (&buf[strlen(buf)], "%13s", ptr);
}
}
void
ArgusPrintLoad (char *buf, struct ArgusRecord *argus)
{
int src_count = 0, dst_count = 0, src_bytes = 0, dst_bytes = 0;
struct timeval *start = NULL, *last = NULL;
struct timeval timebuf, *time = &timebuf;
- char tmpbuf[128], *ptr = tmpbuf;
+ char tmpbuf[128], *ptr = tmpbuf, delim = ' ';
double seconds;
start = &argus->argus_far.time.start;
last = &argus->argus_far.time.last;
@@ -2581,21 +2586,24 @@
dst_bytes = argus->argus_far.dst.appbytes;
} else {
src_bytes = argus->argus_far.src.bytes;
dst_bytes = argus->argus_far.dst.bytes;
}
+
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ delim = RaFieldDelimiter;
if (seconds) {
sprintf (ptr, "%.2f", ((double)(src_bytes * 8.0))/seconds);
- sprintf (buf, "%13s", ptr);
+ sprintf (buf, "%13s%c", ptr, delim);
sprintf (ptr, "%.2f", ((double)(dst_bytes * 8.0))/seconds);
- sprintf (&buf[strlen(buf)], "%13s ", ptr);
+ sprintf (&buf[strlen(buf)], "%13s", ptr);
} else {
sprintf (ptr, "%.2f", 0.0);
- sprintf (buf, "%13s", ptr);
+ sprintf (buf, "%13s%c", ptr, delim);
sprintf (ptr, "%.2f", 0.0);
- sprintf (&buf[strlen(buf)], "%13s ", ptr);
+ sprintf (&buf[strlen(buf)], "%13s", ptr);
}
}
void
ArgusPrintSrcTTL (char *buf, struct ArgusRecord *argus)
@@ -2606,13 +2614,13 @@
for (i = 1; i < 257; i <<= 1) {
if ((sdis < 0) && (argus->argus_far.attr_ip.sttl <= i)) {
sdis = i - argus->argus_far.attr_ip.sttl;
}
}
- sprintf (&buf[strlen(buf)], " %3d ", sdis);
+ sprintf (&buf[strlen(buf)], " %3d", sdis);
} else
- sprintf (&buf[strlen(buf)], " %3d ", argus->argus_far.attr_ip.sttl);
+ sprintf (&buf[strlen(buf)], " %3d", argus->argus_far.attr_ip.sttl);
}
void
ArgusPrintDstTTL (char *buf, struct ArgusRecord *argus)
{
@@ -2622,63 +2630,74 @@
for (i = 1; i < 257; i <<= 1) {
if ((ddis < 0) && (argus->argus_far.attr_ip.dttl <= i)) {
ddis = i - argus->argus_far.attr_ip.dttl;
}
}
- sprintf (&buf[strlen(buf)], " %3d ", ddis);
+ sprintf (&buf[strlen(buf)], " %3d", ddis);
} else
- sprintf (&buf[strlen(buf)], " %3d ", argus->argus_far.attr_ip.dttl);
+ sprintf (&buf[strlen(buf)], " %3d", argus->argus_far.attr_ip.dttl);
}
void
ArgusPrintVLAN (char *buf, struct ArgusRecord *argus)
{
if (ArgusThisFarStatus & ARGUS_VLAN_DSR_STATUS) {
struct ArgusVlanStruct *vlan = (struct ArgusVlanStruct *) ArgusThisFarHdrs[ARGUS_VLAN_DSR_INDEX];
if (vlan->status & ARGUS_SRC_VLAN)
- sprintf (&buf[strlen(buf)], "0x%04x ", vlan->sid);
+ sprintf (&buf[strlen(buf)], "0x%04x%c", vlan->sid, RaFieldDelimiter);
else
- sprintf(&buf[strlen(buf)], " ");
+ if (RaFieldDelimiter == ' ')
+ sprintf(&buf[strlen(buf)], " ");
+ else
+ sprintf(&buf[strlen(buf)], "%c", RaFieldDelimiter);
if (vlan->status & ARGUS_DST_VLAN)
- sprintf (&buf[strlen(buf)], "0x%04x ", vlan->did);
+ sprintf (&buf[strlen(buf)], "0x%04x", vlan->did);
else
- sprintf(&buf[strlen(buf)], " ");
+ if (RaFieldDelimiter == ' ')
+ sprintf(&buf[strlen(buf)], " ");
} else
- sprintf (&buf[strlen(buf)], " ");
+ if (RaFieldDelimiter == ' ')
+ sprintf (&buf[strlen(buf)], " ");
+ else
+ sprintf(&buf[strlen(buf)], "%c", RaFieldDelimiter);
}
void
ArgusPrintMPLS (char *buf, struct ArgusRecord *argus)
{
if (ArgusThisFarStatus & ARGUS_MPLS_DSR_STATUS) {
struct ArgusMplsStruct *mpls = (struct ArgusMplsStruct *) ArgusThisFarHdrs[ARGUS_MPLS_DSR_INDEX];
if (mpls->status & ARGUS_SRC_MPLS)
- sprintf (&buf[strlen(buf)], " %5x ", mpls->slabel);
+ sprintf (&buf[strlen(buf)], "%5x%c", mpls->slabel, RaFieldDelimiter);
else
- sprintf(&buf[strlen(buf)], " ");
+ sprintf(&buf[strlen(buf)], " %c", RaFieldDelimiter);
if (mpls->status & ARGUS_DST_MPLS)
- sprintf (&buf[strlen(buf)], " %5x ", mpls->dlabel);
+ sprintf (&buf[strlen(buf)], "%5x", mpls->dlabel);
else
- sprintf(&buf[strlen(buf)], " ");
+ if (RaFieldDelimiter == ' ')
+ sprintf(&buf[strlen(buf)], " ");
} else
- sprintf (&buf[strlen(buf)], " ");
+ if (RaFieldDelimiter == ' ')
+ sprintf(&buf[strlen(buf)], " ");
+ else
+ sprintf (&buf[strlen(buf)], "%c", RaFieldDelimiter);
}
void
ArgusPrintSrcTOS (char *buf, struct ArgusRecord *argus)
{
- sprintf (&buf[strlen(buf)], " %3d ", argus->argus_far.attr_ip.stos);
+ sprintf (&buf[strlen(buf)], " %3d ", argus->argus_far.attr_ip.stos);
}
void
ArgusPrintDstTOS (char *buf, struct ArgusRecord *argus)
{
- sprintf (&buf[strlen(buf)], " %3d ", argus->argus_far.attr_ip.dtos);
+ sprintf (&buf[strlen(buf)], " %3d" , argus->argus_far.attr_ip.dtos);
}
void
ArgusPrintWindow (char *buf, struct ArgusRecord *argus)
@@ -2692,19 +2711,19 @@
tcp = (struct ArgusTCPObject *)ArgusThisFarHdrs[ARGUS_TCP_DSR_INDEX];
if (tcp != NULL) {
srcwin = tcp->src.win;
dstwin = tcp->dst.win;
- sprintf (&buf[strlen(buf)], "%-5d %-5d ", srcwin, dstwin);
+ sprintf (&buf[strlen(buf)], "%-5d%c%-5d", srcwin, RaFieldDelimiter, dstwin);
} else {
- sprintf (&buf[strlen(buf)], "%14s", " ");
+ sprintf (&buf[strlen(buf)], "%5s%c%5s", " ", RaFieldDelimiter, " ");
}
break;
}
default:
- sprintf (&buf[strlen(buf)], "%14s", " ");
+ sprintf (&buf[strlen(buf)], "%5s%c%5s", " ", RaFieldDelimiter, " ");
}
}
void
ArgusPrintTCPExtensions (char *buf, struct ArgusRecord *argus)
@@ -2848,13 +2867,17 @@
bzero (argus_strbuf, MAXSTRLEN);
bzero (tmpbuf, MAXSTRLEN);
for (RaPrintIndex = 0; RaPrintIndex < MAX_PRINT_ALG_TYPES; RaPrintIndex++) {
- if (RaPrintAlgorithms[RaPrintIndex] != NULL)
+ if (RaPrintAlgorithms[RaPrintIndex] != NULL) {
RaPrintAlgorithms[RaPrintIndex](&argus_strbuf[strlen(argus_strbuf)], argus);
- else
+ if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
+ sprintf(&argus_strbuf[strlen(argus_strbuf)], "%c", RaFieldDelimiter);
+ else
+ sprintf(&argus_strbuf[strlen(argus_strbuf)], "%c", ' ');
+ } else
break;
}
while (isspace((int)(argus_strbuf[strlen(argus_strbuf) - 1])))
argus_strbuf[strlen(argus_strbuf) - 1] = '\0';
@@ -2880,17 +2903,12 @@
*--ptr = '\0';
}
}
while (*str) {
- if (*str == ' ') {
- if (lastchr != RaFieldDelimiter)
- *ptr++ = RaFieldDelimiter;
+ if (*str == ' ')
while (isspace((int)*str)) str++;
- }
- lastchr = *str;
-
*ptr++ = *str++;
}
if (tmpbuf[strlen(tmpbuf) - 1] == RaFieldDelimiter)
tmpbuf[strlen(tmpbuf) - 1] = '\0';
@@ -3225,11 +3243,11 @@
char delim = ' ';
if ((RaFieldDelimiter != ' ') && (RaFieldDelimiter != '\0'))
delim = RaFieldDelimiter;
- if ((ArgusSrcUserDataLen > 0) || (ArgusDstUserDataLen)) {
+ if ((ArgusSrcUserDataLen > 0) || (ArgusDstUserDataLen > 0)) {
if (ArgusSrcUserDataLen > 0) {
switch (eflag) {
case ARGUS_ENCODE_ASCII:
exlen = ArgusSrcUserDataLen;
break;
@@ -3251,26 +3269,25 @@
len = len > ArgusSrcUserDataLen ? ArgusSrcUserDataLen : len;
bzero (strbuf, sizeof(strbuf));
bzero (conbuf, sizeof(conbuf));
if ((len = ArgusEncode (&user->data, NULL, len, str, sizeof(strbuf))) > 0)
- sprintf (con, "%cs[%d]=%s", delim, len, str);
+ sprintf (con, "s[%d]=%s", len, str);
else
sprintf (con, " ");
if (delim == ' ')
- sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-*s ", exlen, con);
+ sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-*s", exlen, con);
else
- sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-s ", con);
+ sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-s", con);
- } else {
- if (delim != ' ')
- sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%c", delim);
- else
- sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-*s ", exlen, " ");
}
}
+ if (delim != ' ')
+ sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%c", delim);
+ else
+ sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-*s ", exlen, " ");
if (ArgusDstUserDataLen > 0) {
switch (eflag) {
case ARGUS_ENCODE_ASCII:
exlen = ArgusDstUserDataLen;
@@ -3294,27 +3311,31 @@
len = len > ArgusDstUserDataLen ? ArgusDstUserDataLen : len;
bzero (strbuf, sizeof(strbuf));
bzero (conbuf, sizeof(conbuf));
if ((len = ArgusEncode (&user->data, NULL, len, str, sizeof(strbuf))) > 0)
- sprintf (con, "%cd[%d]=%s", delim, len, str);
+ sprintf (con, "d[%d]=%s", len, str);
else
sprintf (con, " ");
if (delim == ' ')
sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-*s ", exlen, con);
else
- sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-s ", con);
+ sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-s", con);
- } else
- if (delim != ' ')
- sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%c", delim);
- else
- sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-*s ", exlen, " ");
+ }
}
+ if (delim != ' ')
+ sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%c", delim);
+ else
+ sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-*s ", exlen, " ");
- sprintf (&RaUserDataStr[strlen(RaUserDataStr)], " ");
+ } else {
+ if (delim != ' ')
+ sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%c", delim);
+ else
+ sprintf (&RaUserDataStr[strlen(RaUserDataStr)], "%-*s %-*s ", exlen, " ", exlen, " ");
}
}
static char basis_64[] =
--- NEW FILE argus.init ---
#!/bin/sh
#
# chkconfig: - 55 45
# description: argus generates network transaction audit records.
# processname: argus
#
# Source function library.
. /etc/init.d/functions
[ -f /usr/sbin/argus ] || exit 0
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0
# Set up argus command-line options
if [ -e /etc/argus.conf ] ; then
ARGUS_OPTIONS="-d"
else
ARGUS_OPTIONS="-d -e $HOSTNAME -B 127.0.0.1 -P 561"
fi
RETVAL=0
start() {
echo -n $"Starting argus: "
daemon argus $ARGUS_OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/argus
return $RETVAL
}
stop() {
echo -n $"Shutting down argus: "
killproc argus
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/argus
echo
return $RETVAL
}
dostatus() {
status argus
}
restart() {
stop
start
}
condrestart() {
[ -e /var/lock/subsys/argus ] && restart || :
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
condrestart)
condrestart
;;
status)
dostatus
;;
*)
echo "Usage: argus {start|stop|restart|reload|condrestart|status}"
exit 1
esac
exit $RETVAL
--- NEW FILE argus.spec ---
Name: argus
Version: 2.0.6.fixes.1
Release: 7%{?dist}
Summary: Network transaction audit tool
License: GPL
Group: Applications/Internet
Url: http://qosient.com/argus
Source0: ftp://ftp.qosient.com/dev/argus-2.0/%{name}-%{version}.tar.gz
Source1: ftp://ftp.qosient.com/dev/argus-2.0/%{name}-clients-%{version}.tar.gz
Source2: argus.init
Source3: README.fedora
Patch0: argus-2.0.6.fixes.1-makefile.patch
Patch1: argus-2.0.6.fixes.1-build.patch
Patch2: argus-clients-2.0.6.fixes.1-makefile.patch
Patch3: argus-clients-2.0.6.fixes.1-build.patch
Patch4: argus-clients-2.0.6.fixes.1-print.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
#Requires: libpcap
BuildRequires: libpcap cyrus-sasl-devel tcp_wrappers flex bison
%package clients
Summary: Client tools for argus network audit
Group: Applications/Internet
%description
Argus (Audit Record Generation and Utilization System) is an IP network
transaction audit tool. The data generated by argus can be used for a
wide range of tasks such as network operations, security and performance
management.
%description clients
Clients to the argus probe which process and display information.
%prep
%setup -a0
%setup -a1
%patch0 -p1
%patch1 -p1
pushd %{name}-clients-%{version}
%patch2 -p1
%patch3 -p1
%patch4 -p1
popd
%{__install} -p -m 0644 %{SOURCE3} .
%build
%configure --with-sasl=yes
%{__make} %{?_smp_mflags}
pushd %{name}-clients-%{version}
%configure --with-sasl=yes
%{__make} %{?_smp_mflags}
popd
%install
%{__rm} -rf %{buildroot}
%{__make} DESTDIR=%{buildroot} install
pushd %{name}-clients-%{version}
%{__make} DESTDIR=%{buildroot} install
# avoid unwanted dependencies when using these as docs (clients package):
find doc contrib support ragraph -type f -exec chmod a-x '{}' \;
popd
%{__rm} -rf %{buildroot}/%{_libdir}
%{__rm} -rf %{buildroot}/%{_bindir}/ragraph
%{__install} -d -m 0755 %{buildroot}/%{_localstatedir}/lib/argus/archive
%{__install} -D -m 0644 support/Config/argus.conf %{buildroot}/%{_sysconfdir}/argus.conf
%{__install} -D -m 0755 %{SOURCE2} %{buildroot}/%{_initrddir}/argus
# fix up argus.conf to a good default
%{__sed} -i 's|var/log/argus|var/lib/argus|' %{buildroot}/%{_sysconfdir}/argus.conf
%{__sed} -i 's|#ARGUS_BIND_IP|ARGUS_BIND_IP|' %{buildroot}/%{_sysconfdir}/argus.conf
%{__sed} -i 's|#ARGUS_ACCESS_PORT|ARGUS_ACCESS_PORT|' %{buildroot}/%{_sysconfdir}/argus.conf
# avoid unwanted dependencies when using these as docs (main package):
find support -type f -exec chmod a-x '{}' \;
%clean
%{__rm} -rf %{buildroot}
%post
# only post-install
if [ $1 -le 1 ]; then
/sbin/chkconfig --add argus
fi
%preun
# only pre-erase
if [ $1 -eq 0 ]; then
/sbin/service argus stop >/dev/null 2>&1
/sbin/chkconfig --del argus
fi
%postun
# only postun-upgrade
if [ $1 -ge 1 ]; then
/sbin/service argus condrestart >/dev/null 2>&1
fi
%files
%defattr(-,root,root)
%doc support doc/CHANGES doc/FAQ doc/HOW-TO doc/html bin/argusbug
%doc COPYING CREDITS INSTALL README VERSION
%config(noreplace) %{_sysconfdir}/argus.conf
%{_initrddir}/argus
%{_sbindir}/argus*
%{_mandir}/man5/argus*
%{_mandir}/man8/argus*
%dir %{_localstatedir}/lib/argus
%dir %{_localstatedir}/lib/argus/archive
%files clients
%doc %{name}-clients-%{version}/ChangeLog %{name}-clients-%{version}/COPYING
%doc %{name}-clients-%{version}/CREDITS %{name}-clients-%{version}/INSTALL
%doc %{name}-clients-%{version}/README %{name}-clients-%{version}/VERSION
%doc %{name}-clients-%{version}/doc/CHANGES %{name}-clients-%{version}/doc/FAQ
%doc %{name}-clients-%{version}/doc/HOW-TO %{name}-clients-%{version}/doc/html
%doc %{name}-clients-%{version}/support
%doc %{name}-clients-%{version}/ragraph/ragraph.pl
# .pm checked for dependencies regardless of permissions
#%doc %{name}-clients-%{version}/contrib
%doc README.fedora
%{_bindir}/ra*
%{_mandir}/man1/ra*
%{_mandir}/man5/ra*
%changelog
* Wed Mar 15 2006 Gabriel Somlo <somlo at cmu.edu> 2.0.6.fixes.1-7
- fixed argus makefile patch
* Fri Mar 10 2006 Gabriel Somlo <somlo at cmu.edu> 2.0.6.fixes.1-6
- argus.conf now enables listening for connections on localhost
- added README.fedora to clients subpackage explaining contrib situation and ra printing patch
* Wed Mar 08 2006 Gabriel Somlo <somlo at cmu.edu> 2.0.6.fixes.1-5
- added patch from Peter Van Epp <vanepp at sfu.ca> to fix ra printing bugs
* Mon Mar 06 2006 Gabriel Somlo <somlo at cmu.edu> 2.0.6.fixes.1-4
- removing execute flag from all documentation
- capture file location changed /var/argus -> /var/lib/argus
- init script set to default-disabled
* Sun Mar 05 2006 Gabriel Somlo <somlo at cmu.edu> 2.0.6.fixes.1-3
- backed out of __perl_requires redefine for .pm files - trouble w. rpmbuild
* Fri Feb 24 2006 Gabriel Somlo <somlo at cmu.edu> 2.0.6.fixes.1-2
- empty perl_req/prov avoids .pm's in %doc from being dep-checked at all
- misc spec file fixes
* Fri Feb 24 2006 Gabriel Somlo <somlo at cmu.edu> 2.0.6.fixes.1-1
- initial build for fedora extras
Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/argus/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 17 Mar 2006 19:31:46 -0000 1.1
+++ .cvsignore 17 Mar 2006 19:32:36 -0000 1.2
@@ -0,0 +1,2 @@
+argus-2.0.6.fixes.1.tar.gz
+argus-clients-2.0.6.fixes.1.tar.gz
Index: sources
===================================================================
RCS file: /cvs/extras/rpms/argus/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 17 Mar 2006 19:31:46 -0000 1.1
+++ sources 17 Mar 2006 19:32:36 -0000 1.2
@@ -0,0 +1,2 @@
+b90b8ea951fd0e2193b9a6bab565a139 argus-2.0.6.fixes.1.tar.gz
+59f65159070f849211685513384fa90f argus-clients-2.0.6.fixes.1.tar.gz
More information about the fedora-extras-commits
mailing list