[PATCH v2 0/4] iptraf-ng: use struct rate in ipmon()
by Vitezslav Samel
The first two patches are needed for the third patch, the last one
kills now unused files.
v2:
move the printed flow rate one char left
v1:
initial version
Vitezslav Samel (4):
rename rate_init() to rate_alloc()
split up rate_alloc() into rate_alloc() and rate_init()
ipmon(): use struct rate to print TCP flow rate
remove now unused bar.c and bar.h
Makefile | 2 -
src/bar.c | 32 ----------------
src/bar.h | 7 ----
src/detstats.c | 12 +++---
src/hostmon.c | 4 +-
src/ifstats.c | 4 +-
src/itrafmon.c | 108 +++++++++++++++++--------------------------------------
src/rate.c | 16 +++++++--
src/rate.h | 3 +-
src/serv.c | 6 ++--
src/tcptable.c | 8 ++++
src/tcptable.h | 3 ++
12 files changed, 73 insertions(+), 132 deletions(-)
delete mode 100644 src/bar.c
delete mode 100644 src/bar.h
--
1.7.8.4
11 years, 3 months
[PATCH 0/4] iptraf-ng: use struct rate in ipmon()
by Vitezslav Samel
The first two patches are needed for the third patch, the last one
kills now unused files.
Vitezslav Samel (4):
rename rate_init() to rate_alloc()
split up rate_alloc() into rate_alloc() and rate_init()
ipmon(): use struct rate to print TCP flow rate
remove now unused bar.c and bar.h
Makefile | 2 -
src/bar.c | 32 ----------------
src/bar.h | 7 ----
src/detstats.c | 12 +++---
src/hostmon.c | 4 +-
src/ifstats.c | 4 +-
src/itrafmon.c | 108 +++++++++++++++++--------------------------------------
src/rate.c | 16 +++++++--
src/rate.h | 3 +-
src/serv.c | 6 ++--
src/tcptable.c | 8 ++++
src/tcptable.h | 3 ++
12 files changed, 73 insertions(+), 132 deletions(-)
delete mode 100644 src/bar.c
delete mode 100644 src/bar.h
--
1.7.8.4
11 years, 3 months
[PATCH] Remove the mention of `less' from INSTALL
by Ricardo Catalinas Jiménez
Signed-off-by: Ricardo Catalinas Jiménez <jimenezrick(a)gmail.com>
---
INSTALL | 5 -----
Makefile | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/INSTALL b/INSTALL
index c2ab230..a2c8722 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,3 @@
- This file describes how to build and install less using
-the "configure" script. This only works on Unix systems.
-To install on other systems, read the README file.
-
-
Basic Installation
==================
diff --git a/Makefile b/Makefile
index 21ebadc..f187e50 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# The default target of this Makefile is...
+# The default target of this Makefile is this
all::
# Define V=1 to have a more verbose compile.
--
1.7.10.3
11 years, 3 months
[PATCH] iptraf.c: main(): fix command line checks
by Vitezslav Samel
https://bugzilla.redhat.com/show_bug.cgi?id=825793
Reported-by: Frantisek Hanzlik <franta(a)hanzlici.cz>
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/iptraf.c | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/iptraf.c b/src/iptraf.c
index 084385f..947f8dc 100644
--- a/src/iptraf.c
+++ b/src/iptraf.c
@@ -334,7 +334,6 @@ static void sanitize_dir(const char *dir)
int main(int argc, char **argv)
{
struct OPTIONS options;
- int command = 0;
int current_log_interval = 0;
if (geteuid() != 0)
@@ -349,16 +348,16 @@ int main(int argc, char **argv)
if (help_opt)
parse_usage_and_die(iptraf_ng_usage, iptraf_ng_options);
- int status = 0;
+ int command = 0;
- status |= (i_opt) ? (1 << 0) : 0;
- status |= (d_opt) ? (1 << 1) : 0;
- status |= (s_opt) ? (1 << 2) : 0;
- status |= (z_opt) ? (1 << 3) : 0;
- status |= (l_opt) ? (1 << 4) : 0;
- status |= (g_opt) ? (1 << 5) : 0;
+ command |= (i_opt) ? (1 << 0) : 0;
+ command |= (d_opt) ? (1 << 1) : 0;
+ command |= (s_opt) ? (1 << 2) : 0;
+ command |= (z_opt) ? (1 << 3) : 0;
+ command |= (l_opt) ? (1 << 4) : 0;
+ command |= (g_opt) ? (1 << 5) : 0;
- if (__builtin_popcount(status) > 1)
+ if (__builtin_popcount(command) > 1)
die("only one of -i|-d|-s|-z|-l|-g options must be used");
strcpy(current_logfile, "");
@@ -371,7 +370,7 @@ int main(int argc, char **argv)
}
if (B_opt) {
- if (!status)
+ if (!command)
die("one of -i|-d|-s|-z|-l|-g option is missing\n");
daemonized = 1;
setenv("TERM", "linux", 1);
@@ -420,7 +419,7 @@ int main(int argc, char **argv)
* a daemonization request
*/
- if ((daemonized) && (command != 0)) {
+ if (daemonized && command) {
switch (fork()) {
case 0: /* child */
setsid();
--
1.7.8.4
11 years, 3 months
[PATCH 0/2] use struct rate for hostmon()
by Vitezslav Samel
Vitezslav Samel (2):
hostmon.c: remove unused variables
hostmon.c: use struct rate to print traffic rates
src/hostmon.c | 118 +++++++++++++++++++++++++++------------------------------
src/rate.c | 14 +++++++
src/rate.h | 1 +
3 files changed, 71 insertions(+), 62 deletions(-)
--
1.7.8.4
11 years, 3 months
[PATCH v2 0/4] serv.c: counters, struct rate
by Vitezslav Samel
The first two patches are fixes, the third one is cleanup and the last
one is enhancenment. The last one also cleans up the mess with set_barptr().
Please, apply.
v2:
use enum in call to update_proto_counter()
v1:
initial version
Vitezslav Samel (4):
serv.c: updateportent(): count packets even if dport is the same as sport
serv.c: writeutslog(): fix the printed rate in non-KBITS mode
serv.c: use struct proto_counter to count packets and bytes
serv.c: use struct rate to compute traffic flow rate
src/serv.c | 289 +++++++++++++++++++++++++-----------------------------------
1 files changed, 119 insertions(+), 170 deletions(-)
--
1.7.8.4
11 years, 3 months
[PATCH 0/4] iptraf-ng: fixes, ...
by Vitezslav Samel
The first two patches are fixes, the third one is cleanup and the last
one is enhancenment. The last one also cleans up the mess with set_barptr().
Please, apply.
Vitezslav Samel (4):
serv.c: updateportent(): count packets even if dport is the same as sport
serv.c: writeutslog(): fix the printed rate in non-KBITS mode
serv.c: use struct proto_counter to count packets and bytes
serv.c: use struct rate to compute traffic flow rate
src/serv.c | 275 ++++++++++++++++++++++++------------------------------------
1 files changed, 111 insertions(+), 164 deletions(-)
--
1.7.8.4
11 years, 4 months