debian/0000755000000000000000000000000011634346134007173 5ustar debian/source/0000755000000000000000000000000011452474556010503 5ustar debian/source/format0000644000000000000000000000001411452474556011711 0ustar 3.0 (quilt) debian/compat0000644000000000000000000000000211452475521010372 0ustar 7 debian/rules0000755000000000000000000000467511452506345010267 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif config.status: configure dh_testdir # Add here commands to configure the package. ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info build: build-stamp build-stamp: config.status dh_testdir # Add here commands to compile the package. $(MAKE) #/usr/bin/docbook-to-man debian/jnettop.sgml > jnettop.1 touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. [ ! -f Makefile ] || $(MAKE) distclean #ifneq "$(wildcard /usr/share/misc/config.sub)" "" # cp -f /usr/share/misc/config.sub config.sub #endif #ifneq "$(wildcard /usr/share/misc/config.guess)" "" # cp -f /usr/share/misc/config.guess config.guess #endif dh_clean install: build dh_testdir dh_testroot dh_installdirs # Add here commands to install the package into debian/jnettop. $(MAKE) install prefix=$(CURDIR)/debian/jnettop/usr mv $(CURDIR)/debian/jnettop/usr/bin $(CURDIR)/debian/jnettop/usr/sbin install -D $(CURDIR)/.jnettop \ $(CURDIR)/debian/jnettop/usr/share/doc/jnettop/dot.jnettop # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_installinit dh_installcron dh_installman dh_installinfo # dh_undocumented dh_installchangelogs ChangeLog dh_link dh_strip dh_compress dh_fixperms # dh_makeshlibs dh_installdeb # dh_perl dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debian/patches/0000755000000000000000000000000011634346142010621 5ustar debian/patches/0002-Fix-up-some-help-text.patch0000644000000000000000000000404411452505046016242 0ustar From: Ari Pollak Date: Mon, 4 Oct 2010 22:07:03 -0400 Subject: [PATCH] Fix up some help text --- jnettop.8 | 4 ---- jnettop.c | 3 +-- 2 files changed, 1 insertions(+), 6 deletions(-) diff --git a/jnettop.8 b/jnettop.8 index 300b233..14af8ea 100644 --- a/jnettop.8 +++ b/jnettop.8 @@ -40,9 +40,6 @@ Show summary of options. .B \-v, \-\-version Show version of program. .TP -.B \-b, \-\-bit-units -show BPS In bits per second, not bytes per second -.TP .B \-c, \-\-content-filter disable content filtering .TP @@ -51,7 +48,6 @@ write debug information into file .TP .B \-f, \-\-config-file filename reads configuration from filename. defaults to ~/.jnettop. an example can be found at /usr/share/doc/jnettop/dot.jnettop. -or in .jnettop file from original distribution package. .TP .B \-i, \-\-interface name capture packets on specified interface diff --git a/jnettop.c b/jnettop.c index 7053532..1ed45a8 100644 --- a/jnettop.c +++ b/jnettop.c @@ -84,7 +84,6 @@ void parseCommandLineAndConfig(int argc, char ** argv) { "\n" " -h, --help display this help message\n" " -v, --version display version information\n\n" - " -b, --bit-units show BPS in bits per second, not bytes per second\n" " -c, --content-filter disable content filtering\n" " -d, --debug filename write debug information into file (or syslog)\n" " --display type type of display (curses, text, uia)\n" @@ -100,7 +99,7 @@ void parseCommandLineAndConfig(int argc, char ** argv) { " -t, --timeout sec timeout in seconds after which jnettop ends (text display)\n" " -x, --filter rule allows for specification of custom filtering rule\n" " this follows tcpdump(1) syntax. don't forget to\n" - " enclose the filter into quotes when running from shell\n" + " enclose the filter in quotes when running from shell\n" "\n" "Report bugs to \n" "\n" -- debian/patches/debian-changes-0.13.0-1ubuntu10000644000000000000000000000405111634346142015573 0ustar Description: Upstream changes introduced in version 0.13.0-1ubuntu1 This patch has been created by dpkg-source during the package build. Here's the last changelog entry, hopefully it gives details on why those changes were made: . jnettop (0.13.0-1ubuntu1) oneiric; urgency=low . * Fix FTBFS with ld --as-needed. LP: #770990. . The person named in the Author field signed this changelog entry. Author: Matthias Klose Bug-Ubuntu: https://bugs.launchpad.net/bugs/770990 --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: http://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- jnettop-0.13.0.orig/Makefile.am +++ jnettop-0.13.0/Makefile.am @@ -1,7 +1,7 @@ # $Header: /cvsroot/jnettop/jnettop/Makefile.am,v 1.14 2006/04/11 15:59:59 merunka Exp $ INCLUDES = -I$(top_srcdir)/include @GLIB_CFLAGS@ -AM_LDFLAGS = @GLIB_LIBS@ @NSL_LIBS@ @SOCKET_LIBS@ +jnettop_LDADD = @GLIB_LIBS@ @NSL_LIBS@ @SOCKET_LIBS@ CFLAGS = -g -O0 man_MANS = jnettop.8 --- jnettop-0.13.0.orig/Makefile.in +++ jnettop-0.13.0/Makefile.in @@ -86,7 +86,7 @@ am__quote = @am__quote@ install_sh = @install_sh@ INCLUDES = -I$(top_srcdir)/include @GLIB_CFLAGS@ -AM_LDFLAGS = @GLIB_LIBS@ @NSL_LIBS@ @SOCKET_LIBS@ +jnettop_LDADD = @GLIB_LIBS@ @NSL_LIBS@ @SOCKET_LIBS@ CFLAGS = -g -O0 man_MANS = jnettop.8 @@ -111,7 +111,6 @@ am_jnettop_OBJECTS = jnettop.$(OBJEXT) j jtxtdisplay.$(OBJEXT) jcursesdisplay.$(OBJEXT) \ jfilter.$(OBJEXT) juiadisplay.$(OBJEXT) jnetdisplay.$(OBJEXT) jnettop_OBJECTS = $(am_jnettop_OBJECTS) -jnettop_LDADD = $(LDADD) jnettop_DEPENDENCIES = jnettop_LDFLAGS = SCRIPTS = $(dist_pkgdata_SCRIPTS) debian/patches/0001-Use-64-bit-integers-for-byte-totals-support-bigger-u.patch0000644000000000000000000000726711452505046024051 0ustar From: Ari Pollak Date: Mon, 4 Oct 2010 22:01:20 -0400 Subject: [PATCH] Use 64-bit integers for byte totals; support bigger units than GiB Closes: #448264 --- jbase.h | 4 ++-- jprocessor.c | 8 ++++---- jprocessor.h | 8 ++++---- jutil.c | 6 +++--- jutil.h | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/jbase.h b/jbase.h index 9f49ade..25073ab 100644 --- a/jbase.h +++ b/jbase.h @@ -171,8 +171,8 @@ typedef struct __jbase_stream { int rxtx; // stream statistics information - guint32 srcbytes, dstbytes, totalbytes; - guint32 srcpackets, dstpackets, totalpackets; + guint64 srcbytes, dstbytes, totalbytes; + guint64 srcpackets, dstpackets, totalpackets; GTimeVal firstSeen; GTimeVal lastSeen; guint hsrcbytes[HISTORY_LENGTH], hdstbytes[HISTORY_LENGTH]; diff --git a/jprocessor.c b/jprocessor.c index 2d04ba2..5b23e07 100644 --- a/jprocessor.c +++ b/jprocessor.c @@ -145,10 +145,10 @@ void jprocessor_ResetStats() { void jprocessor_UpdateBPS() { GTimeVal currentDateTime; uint i; - guint32 srcbps = 0; - guint32 dstbps = 0; - guint32 srcpps = 0; - guint32 dstpps = 0; + guint64 srcbps = 0; + guint64 dstbps = 0; + guint64 srcpps = 0; + guint64 dstpps = 0; g_get_current_time(¤tDateTime); currentDateTime.tv_sec ++; diff --git a/jprocessor.h b/jprocessor.h index d198597..16a9eed 100644 --- a/jprocessor.h +++ b/jprocessor.h @@ -28,10 +28,10 @@ typedef struct __jprocessor_stats { GTimeVal startTime; - guint32 totalSrcBytes, totalDstBytes, totalBytes; - guint32 totalSrcPackets, totalDstPackets, totalPackets; - guint32 totalSrcBPS, totalDstBPS, totalBPS; - guint32 totalSrcPPS, totalDstPPS, totalPPS; + guint64 totalSrcBytes, totalDstBytes, totalBytes; + guint64 totalSrcPackets, totalDstPackets, totalPackets; + guint64 totalSrcBPS, totalDstBPS, totalBPS; + guint64 totalSrcPPS, totalDstPPS, totalPPS; } jprocessor_stats; typedef void (*ProcessStreamsFunc) (GPtrArray *streamArray); diff --git a/jutil.c b/jutil.c index 180d598..d5c0907 100644 --- a/jutil.c +++ b/jutil.c @@ -135,8 +135,8 @@ gboolean jutil_String2Address(const char *address, jbase_mutableaddress *dest, i #endif } -void jutil_formatNumber(guint32 n, gboolean onoffPackets, gchar *buf, int len) { - gchar suffixes[] = {'b','k','m','g','t'}; +void jutil_formatNumber(guint64 n, gboolean onoffPackets, gchar *buf, int len) { + gchar suffixes[] = {'b','K','M','G','T','P','E','Z'}; gchar fmt[64]; int mag = 0; int ipart,fpart = 0; @@ -185,7 +185,7 @@ void jutil_InterpretStreamFormat(GString *str, const char *formatString, const j } #define PRINT_GUINT(id,fld) if (!strcmp(fmt, id)) { \ - g_string_append_printf(str, "%d", fld); \ + g_string_append_printf(str, "%lld", fld); \ goto nexteitem; \ } diff --git a/jutil.h b/jutil.h index 435dea2..12deab4 100644 --- a/jutil.h +++ b/jutil.h @@ -31,7 +31,7 @@ const char * jutil_Address2String(int af, const jbase_mutableaddress *src, char const char * jutil_StorageAddress2String(const struct sockaddr_storage *hwaddr, char *dst, size_t cnt); gboolean jutil_String2Address(const char *address, jbase_mutableaddress *dest, int *af); guint jutil_ParseAggregation(const char *agg); -void jutil_formatNumber(guint32 n, gboolean onoffPackets, gchar *buf, int len); +void jutil_formatNumber(guint64 n, gboolean onoffPackets, gchar *buf, int len); void memand(char *buf1, const char *buf2, int length); gboolean jutil_IsInNetwork(const jbase_mutableaddress *address, int address_af, const jbase_mutableaddress *network, const jbase_mutableaddress *netmask, int network_af); void jutil_InterpretStreamFormat(GString *str, const char *format, const jbase_stream *s); -- debian/patches/0003-Add-host-port-aggregation.patch0000644000000000000000000003004011452505046017127 0ustar From: Ari Pollak Date: Mon, 4 Oct 2010 22:08:49 -0400 Subject: [PATCH] Add host+port aggregation Closes: #250032 --- README | 29 +++++++++++++++-------------- jbase.c | 2 +- jbase.h | 3 +-- jconfig.c | 6 +++++- jcursesdisplay.c | 10 +++++----- jnettop.8 | 12 ++++++------ jnettop.c | 8 ++++---- jprocessor.c | 12 ++++++++++++ jutil.c | 17 +++++++++-------- 9 files changed, 58 insertions(+), 41 deletions(-) diff --git a/README b/README index 940ba4b..54fa773 100644 --- a/README +++ b/README @@ -38,10 +38,11 @@ Is jnettop crashing under your FreeBSD? Try passing (What is it?) Aggregation is a way, how to modify packet classicication rules. There are -two types of aggregation in jnettop: host and port. If there is port -aggregation enabled, it means, that all packets seem to come(go to) same port -numbers. If there is host aggregation enabled, it means, that all packets -seem to come(go to) same host. Let's have an example: +two types of aggregation in jnettop: host, port, and host+port. If there +is port aggregation enabled, it means, that all packets seem to come(go +to) same port numbers. If there is host aggregation enabled, it means, +that all packets seem to come(go to) same host. If host+port +aggregation is enabled, it aggregates both. Let's have an example: Suppose we have following configuration: +--- host0 @@ -51,14 +52,14 @@ Suppose we have following configuration: i.e. typical border router with eth0 interface looking into internet and eth1 interface looking to intranet. Suppose we're running jnettop on router sniffing on interface eth0. To see how many bytes every host consumes out -of the internet connection, we enable remote host aggregation and local port -aggregation. i.e. All internet will behave as one endpoint and all programs -on one host will, too, behave as one endpoint. This way, every stream we see -in jnettop will be from one of the hosts in intranet to a public internet. -Aggregation is very powerfull laser-knife in network traffic analysis. -I understand, that it is not very user friendly implementation in jnettop and -I will gratefully welcome every suggestion on how to make this topic clear and -more clear-to-use. +of the internet connection, we enable remote host+port aggregation and +local port aggregation. i.e. All internet will behave as one endpoint +and all programs on one host will, too, behave as one endpoint. This +way, every stream we see in jnettop will be from one of the hosts in +intranet to a public internet. Aggregation is very powerfull laser-knife +in network traffic analysis. I understand, that it is not very user +friendly implementation in jnettop and I will gratefully welcome every +suggestion on how to make this topic clear and more clear-to-use. -- .jnettop configuration file -- @@ -105,14 +106,14 @@ which interface to listen after you start it up. Example: Since version 0.9, jnettop supports following new keywors: - local_aggregation [none|host|port] + local_aggregation [none|host|port|host+port] this keyword sets startup local aggregation value ex. local_aggregation port - remote_aggregation [none|host|port] + remote_aggregation [none|host|port|host+port] this keyword sets startup remote aggregation value ex. diff --git a/jbase.c b/jbase.c index 5af47b2..aebdbf1 100644 --- a/jbase.c +++ b/jbase.c @@ -26,5 +26,5 @@ char pcap_errbuf[PCAP_ERRBUF_SIZE]; gchar *JBASE_PROTOCOLS[] = { "UNK.", "IP", "TCP", "UDP", "ARP", "ETHER", "SLL", "AGGR.", "ICMP", "IP6", "TCP6", "UDP6", "ICMP6" }; -gchar *JBASE_AGGREGATION[] = { "none", "port", "host" }; +gchar *JBASE_AGGREGATION[] = { "none", "port", "host", "host+port" }; diff --git a/jbase.h b/jbase.h index 25073ab..6a5b84b 100644 --- a/jbase.h +++ b/jbase.h @@ -250,12 +250,11 @@ typedef struct _jbase_network_mask_list { #define JBASE_AF_SIZE(a) (a == AF_INET6 ? sizeof(struct in6_addr) : sizeof(struct in_addr)) -extern gchar *JBASE_PROTOCOLS[]; - #define AGG_UNKNOWN (-1) #define AGG_NONE 0 #define AGG_PORT 1 #define AGG_HOST 2 +#define AGG_BOTH 3 extern gchar *JBASE_PROTOCOLS[]; extern gchar *JBASE_AGGREGATION[]; diff --git a/jconfig.c b/jconfig.c index 0a1fe80..bc8edf1 100644 --- a/jconfig.c +++ b/jconfig.c @@ -115,6 +115,10 @@ gboolean jconfig_ParseFile(char *configFileName) { } s = g_scanner_new(NULL); + /* Add + to accepted identifier characters: */ + s->config->cset_identifier_nth = g_strjoin(NULL, + s->config->cset_identifier_nth, "+", NULL); + g_scanner_input_file(s, fileno(f)); while (!g_scanner_eof(s)) { GTokenType tt; @@ -211,7 +215,7 @@ gboolean jconfig_ParseFile(char *configFileName) { if (!g_ascii_strcasecmp(s->value.v_identifier, "local_aggregation")) { int val = parse_aggregation(s); if (val == AGG_UNKNOWN) { - fprintf(stderr, "Parse error on line %d: expecting none or host or port.\n", line); + fprintf(stderr, "Parse error on line %d: expecting none, host, port, or host+port.\n", line); return FALSE; } if (jconfig_Settings.localAggregation == AGG_UNKNOWN) diff --git a/jcursesdisplay.c b/jcursesdisplay.c index 897078c..197a291 100644 --- a/jcursesdisplay.c +++ b/jcursesdisplay.c @@ -84,7 +84,7 @@ static void drawScreen() { attrset(A_NORMAL); mvprintw(0, 0, "run XXX:XX:XX device XXXXXXXXXX pkt[f]ilter: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); - mvprintw(1, 0, "[c]ntfilter: XXX [b]ps=XXXXXXX [l]ocal aggr.: XXXX [r]emote aggr.: XXXX "); + mvprintw(1, 0, "[c]ntfilter: XXX [b]ps=XXXXXXX [l]ocal aggr: XXXX [r]emote aggr: XXXX "); mvprintw(0, activeColumns-1, "."); { @@ -138,8 +138,8 @@ static void drawHeader() { mvprintw(0, 45, "%-29.29s", jconfig_GetSelectedBpfFilterName()); mvprintw(1, 13, "%s", jprocessor_ContentFiltering?"on ":"off"); mvprintw(1, 23, "%s", onoffPackets ? "pckts/s" : (onoffBitValues?"bits/s ":"bytes/s")); - mvprintw(1, 46, "%s", JBASE_AGGREGATION[jprocessor_LocalAggregation]); - mvprintw(1, 67, "%s", JBASE_AGGREGATION[jprocessor_RemoteAggregation]); + mvprintw(1, 45, "%-9s", JBASE_AGGREGATION[jprocessor_LocalAggregation]); + mvprintw(1, 70, "%-9s", JBASE_AGGREGATION[jprocessor_RemoteAggregation]); attroff(A_BOLD); @@ -340,10 +340,10 @@ static void displayLoop() { displayMode = DISPLAYMODE_HELP; break; case 'l': - jprocessor_SetLocalAggregation((jprocessor_LocalAggregation + 1) % 3); + jprocessor_SetLocalAggregation((jprocessor_LocalAggregation + 1) % 4); break; case 'r': - jprocessor_SetRemoteAggregation((jprocessor_RemoteAggregation + 1) % 3); + jprocessor_SetRemoteAggregation((jprocessor_RemoteAggregation + 1) % 4); break; case '0': case '1': diff --git a/jnettop.8 b/jnettop.8 index 14af8ea..2564a5e 100644 --- a/jnettop.8 +++ b/jnettop.8 @@ -52,7 +52,7 @@ reads configuration from filename. defaults to ~/.jnettop. an example can be fou .B \-i, \-\-interface name capture packets on specified interface .TP -.B \-\-local-aggr [none|host|port] +.B \-\-local-aggr [none|host|port|host+port] set local aggregation to specified value .TP .B \-n, \-\-no-resolver @@ -61,7 +61,7 @@ disable resolving of ip addresses .B \-p, \-\-promiscuous enables promiscuous mode on the sniffed interface .TP -.B \-\-remote-aggr [none|host|port] +.B \-\-remote-aggr [none|host|port|host+port] set remote aggregation to specified value .TP .B \-s, \-\-select-rule name @@ -83,8 +83,8 @@ The \fBinterface\fP keyword specifies network interface on which to start listen interface "eth0" .RE .TP -\fBlocal_aggregation [none|host|port]\fR -The \fBlocal_aggregation\fP keyword specifies initial active local aggregation. Valid values are \fBnone\fP, \fBhost\fP and \fBport\fP. Example: +\fBlocal_aggregation [none|host|port|host+port]\fR +The \fBlocal_aggregation\fP keyword specifies initial active local aggregation. Valid values are \fBnone\fP, \fBhost\fP, \fBport\fP, and \fBhost+port\fP. Example: .RS .PP local_aggregation host @@ -97,8 +97,8 @@ The \fBpromisc\fP keyword specifies, whether jnettop captures packets in promisc promisc on .RE .TP -\fBremote_aggregation [none|host|port]\fR -The \fBremote_aggregation\fP keyword specifies initial active remote aggregation. Valid values are \fBnone\fP, \fBhost\fP and \fBport\fP. Example: +\fBremote_aggregation [none|host|port|host+port]\fR +The \fBremote_aggregation\fP keyword specifies initial active remote aggregation. Valid values are \fBnone\fP, \fBhost\fP, \fBport\fP, and \fBhost+port\fP. Example: .RS .PP remote_aggregation port diff --git a/jnettop.c b/jnettop.c index 1ed45a8..a4fe553 100644 --- a/jnettop.c +++ b/jnettop.c @@ -90,10 +90,10 @@ void parseCommandLineAndConfig(int argc, char ** argv) { " -f, --config-file name reads configuration from file. defaults to ~/.jnettop\n" " --format format list of fields to list in text output\n" " -i, --interface name capture packets on specified interface\n" - " --local-aggr arg set local aggregation to none/host/port\n" + " --local-aggr arg set local aggregation to none/host/port/host+port\n" " -n, --no-resolver disable resolving of addresses\n" " -p, --promiscuous enable promisc mode on the devices\n" - " --remote-aggr arg set remote aggregation to none/host/port\n" + " --remote-aggr arg set remote aggregation to none/host/port/host+port\n" " -s, --select-rule rule selects one of the rules defined in config file\n" " by it's name\n" " -t, --timeout sec timeout in seconds after which jnettop ends (text display)\n" @@ -215,14 +215,14 @@ void parseCommandLineAndConfig(int argc, char ** argv) { } if (!strcmp(argv[a], "--local-aggr")) { if (a+1>=argc || (jconfig_Settings.localAggregation = jutil_ParseAggregation(argv[++a]))==-1) { - fprintf(stderr, "%s switch requires none, host or port as an argument\n", argv[a]); + fprintf(stderr, "%s switch requires none, host, port, or host+port as an argument\n", argv[a]); exit(255); } continue; } if (!strcmp(argv[a], "--remote-aggr")) { if (a+1>=argc || (jconfig_Settings.remoteAggregation = jutil_ParseAggregation(argv[++a]))==-1) { - fprintf(stderr, "%s switch requires none, host or port as an argument\n", argv[a]); + fprintf(stderr, "%s switch requires none, host, port, or host+port as an argument\n", argv[a]); exit(255); } continue; diff --git a/jprocessor.c b/jprocessor.c index 5b23e07..cf10121 100644 --- a/jprocessor.c +++ b/jprocessor.c @@ -211,14 +211,26 @@ static void aggregateStream(jbase_stream *stream) { switch (jprocessor_LocalAggregation) { case AGG_HOST: setToHostAggregation(JBASE_AF(stream->proto), &stream->src); + break; case AGG_PORT: stream->srcport = -1; + break; + case AGG_BOTH: + setToHostAggregation(JBASE_AF(stream->proto), &stream->src); + stream->srcport = -1; + break; } switch (jprocessor_RemoteAggregation) { case AGG_HOST: setToHostAggregation(JBASE_AF(stream->proto), &stream->dst); + break; case AGG_PORT: stream->dstport = -1; + break; + case AGG_BOTH: + setToHostAggregation(JBASE_AF(stream->proto), &stream->dst); + stream->dstport = -1; + break; } } diff --git a/jutil.c b/jutil.c index d5c0907..16c1810 100644 --- a/jutil.c +++ b/jutil.c @@ -98,15 +98,16 @@ const char * jutil_Address2String(int af, const jbase_mutableaddress *src, char } guint jutil_ParseAggregation(const char *agg) { - if (strcmp(agg, "none") && strcmp(agg,"host") && strcmp(agg,"port")) { + if (strcmp(agg, "none") == 0) + return AGG_NONE; + else if (strcmp(agg,"host") == 0) + return AGG_HOST; + else if (strcmp(agg,"port") == 0) + return AGG_PORT; + else if (strcmp(agg,"host+port") == 0) + return AGG_BOTH; + else return AGG_UNKNOWN; - } - switch (*agg) { - case 'n': return AGG_NONE; - case 'h': return AGG_HOST; - case 'p': return AGG_PORT; - } - return AGG_UNKNOWN; } void memand(char *buf1, const char *buf2, int length) { -- debian/patches/series0000644000000000000000000000024511634346142012037 0ustar 0001-Use-64-bit-integers-for-byte-totals-support-bigger-u.patch 0002-Fix-up-some-help-text.patch 0003-Add-host-port-aggregation.patch debian-changes-0.13.0-1ubuntu1 debian/control0000644000000000000000000000113211452475736010604 0ustar Source: jnettop Section: net Priority: extra Maintainer: Ari Pollak Build-Depends: debhelper (>> 7), libglib2.0-dev, libncurses5-dev, libpcap-dev Standards-Version: 3.6.1 Package: jnettop Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: View hosts/ports taking up the most network traffic jNettop captures traffic coming across the host it is running on and displays streams sorted by bandwidth they use. Result is a nice listing of communication on network by host and port, how many bytes went through this transport and the bandwidth it is consuming. debian/copyright0000644000000000000000000000052711452475716011141 0ustar This package was debianized by Ari Pollak on Tue, 18 Feb 2003 15:00:38 -0500. It was downloaded from Upstream Author: Jakup Skopal Copyright: Jakub Skopal License: GNU General Public License version 2 or later. On Debian systems this can be found at /usr/share/common-licenses/GPL-2. debian/menu0000644000000000000000000000035311452474503010063 0ustar ?package(jnettop):needs="text" section="Applications/Network/Monitoring" \ title="jnettop" \ hints="Monitoring" \ longtitle="View hosts/ports taking up the most network traffic" \ command="/usr/bin/su-to-root -c /usr/sbin/jnettop" debian/docs0000644000000000000000000000001411452474503010041 0ustar NEWS README debian/changelog0000644000000000000000000000671011634346133011050 0ustar jnettop (0.13.0-1ubuntu1) oneiric; urgency=low * Fix FTBFS with ld --as-needed. LP: #770990. -- Matthias Klose Thu, 15 Sep 2011 11:58:16 +0200 jnettop (0.13.0-1) unstable; urgency=low * New upstream release * Update debian/watch file * Switch to source format 3.0 (quilt) and try to split out patches -- Ari Pollak Mon, 04 Oct 2010 21:02:59 -0400 jnettop (0.12.0-4) unstable; urgency=low * Use 64-bit integers for byte totals (Closes: #448264) * Support bigger units than GiB * Update menu section -- Ari Pollak Sat, 27 Oct 2007 16:10:00 -0400 jnettop (0.12.0-3) unstable; urgency=low * Remove -b option from help texts, since it's unimplemented * Fix spelling mistake (Closes: #363987) -- Ari Pollak Fri, 18 May 2007 21:55:47 -0400 jnettop (0.12.0-2) unstable; urgency=low * Fix a small display bug that wasn't fixed in the previous revision -- Ari Pollak Wed, 19 Apr 2006 22:44:18 -0400 jnettop (0.12.0-1) unstable; urgency=low * New upstream release - Thanks to Jose Parrella for doing all of the work to port & test the aggregation patch for this release. * Correct path to su-to-root in menu file -- Ari Pollak Wed, 19 Apr 2006 22:19:39 -0400 jnettop (0.11.0-2) unstable; urgency=low * Apply patch from Laszlo Kupor to fix a typo that caused remote host+port aggregation not to work properly (Closes: #326568) -- Ari Pollak Thu, 8 Dec 2005 10:53:55 -0500 jnettop (0.11.0-1) unstable; urgency=low * New upstream release -- Ari Pollak Sun, 3 Jul 2005 13:02:32 -0400 jnettop (0.10.1-1) unstable; urgency=low * New upstream release * Added host+port options to man page * jnettop.c: Fixed parsing of host+port config file option by adding '+' to list of allowed config identifiers (Thanks to Henrik Riomar for providing an initial fix) -- Ari Pollak Mon, 29 Nov 2004 12:20:00 -0500 jnettop (0.9-3) unstable; urgency=low * Add a new host+port aggregation option, and correct README to reflect this. Hopefully this should clear up the documented behavior while still allowing host-only aggregation. And hopefully I got it right this time. (Closes: #250032) -- Ari Pollak Thu, 3 Jun 2004 12:43:16 -0400 jnettop (0.9-2) unstable; urgency=low * Apply fix for host aggregation (Closes: #250032) * Move jnettop to /usr/sbin, this is really only useful when run as root -- Ari Pollak Thu, 20 May 2004 11:35:50 -0400 jnettop (0.9-1) unstable; urgency=low * New upstream release -- Ari Pollak Wed, 30 Jul 2003 17:24:15 -0400 jnettop (0.8.1-1) unstable; urgency=low * Change location of homepage * Add watch file * Add menu entry, since upstream now includes an interface parameter (Closes: #18202) * Man page is now included upstream * Use debian/compat -- Ari Pollak Tue, 29 Apr 2003 00:48:48 -0400 jnettop (0.7-4) unstable; urgency=low * Add libpcap-dev to build-depends -- Ari Pollak Fri, 21 Feb 2003 19:33:50 -0500 jnettop (0.7-2) unstable; urgency=low * Add libncurses5-dev to build-depends (Closes: #181965) -- Ari Pollak Fri, 21 Feb 2003 17:07:38 -0500 jnettop (0.7-1) unstable; urgency=low * Initial Release. (Closes: #181533) -- Ari Pollak Tue, 18 Feb 2003 15:00:38 -0500 debian/watch0000644000000000000000000000016211452474516010227 0ustar version=3 http://jnettop.kubs.info/wiki/?id=Download \ http://jnettop.kubs.info/dist/jnettop-([\d\.]*).tar.gz