diff options
Diffstat (limited to 'net-mgmt/rate/files')
-rw-r--r-- | net-mgmt/rate/files/patch-colfix | 20 | ||||
-rw-r--r-- | net-mgmt/rate/files/patch-process.c | 11 | ||||
-rw-r--r-- | net-mgmt/rate/files/patch-rate_abusers.c | 41 | ||||
-rw-r--r-- | net-mgmt/rate/files/patch-streams.c | 10 | ||||
-rw-r--r-- | net-mgmt/rate/files/patch-streamstat.c | 13 |
5 files changed, 94 insertions, 1 deletions
diff --git a/net-mgmt/rate/files/patch-colfix b/net-mgmt/rate/files/patch-colfix new file mode 100644 index 0000000..a2577f8 --- /dev/null +++ b/net-mgmt/rate/files/patch-colfix @@ -0,0 +1,20 @@ +--- rate_abusers.c.orig 2010-04-28 14:58:52.000000000 -0400 ++++ rate_abusers.c 2010-04-28 14:59:29.000000000 -0400 +@@ -103,7 +103,7 @@ + + if(opt_color) printf("%s", COLOR_AB_HEADER); + +- snprintf(indent, 100, customize_format(opt_cols * 2, 65 * 2, "%%-%d.%ds"), ""); ++ snprintf(indent, 100, customize_format(opt_cols * 2, 64 * 2, "%%-%d.%ds"), ""); + + + if(opt_totals) +@@ -151,7 +151,7 @@ + + mkhuman(v, 20, sstr[k], NULL, k > 3 ? 1000 : 1024, opt_human); + } +- printf(customize_format(opt_cols * 2, 65 * 2, "%%s%%-%d.%ds %%s%%7s %%s%%7s%%c%%s%%7s %%s%%7s%%c%%s%%7s %%s%%7s%%c%%s%%7s %%s%%7s%%s\n"), ++ printf(customize_format(opt_cols * 2, 64 * 2, "%%s%%-%d.%ds %%s%%7s %%s%%7s%%c%%s%%7s %%s%%7s%%c%%s%%7s %%s%%7s%%c%%s%%7s %%s%%7s%%s\n"), + CM_AB_HOST(opt_color), + ip, + CM_AB_BMI(opt_color), sstr[BAC_BYTES_MOMENTARY_IN], diff --git a/net-mgmt/rate/files/patch-process.c b/net-mgmt/rate/files/patch-process.c new file mode 100644 index 0000000..bc18c3a --- /dev/null +++ b/net-mgmt/rate/files/patch-process.c @@ -0,0 +1,11 @@ +--- process.c.orig 2010-05-13 19:14:00.000000000 +0000 ++++ process.c 2010-05-13 19:14:05.000000000 +0000 +@@ -18,6 +18,8 @@ + */ + #ifdef STREAM_ANALYZER + #include <sys/types.h> ++#include <stdio.h> ++#include <stdlib.h> + #include <string.h> + #include <sys/time.h> + #include <sys/timeb.h> diff --git a/net-mgmt/rate/files/patch-rate_abusers.c b/net-mgmt/rate/files/patch-rate_abusers.c new file mode 100644 index 0000000..5012bfd --- /dev/null +++ b/net-mgmt/rate/files/patch-rate_abusers.c @@ -0,0 +1,41 @@ +--- rate_abusers.c.orig 2013-03-26 10:14:00.000000000 +0000 ++++ rate_abusers.c 2013-03-26 10:15:53.000000000 +0000 +@@ -195,8 +195,7 @@ + struct ip *iph; + u_int32_t sip; + u_int32_t dip; +- u_int32_t host; +- long long in = 0, out = 0; ++ int slocal = 0, dlocal = 0; + + if(caplen < sizeof(struct ip)) return; + +@@ -206,14 +205,21 @@ + sip = iph->ip_src.s_addr; + dip = iph->ip_dst.s_addr; + +- if(is_ours(ipci, sip)) out = len; +- if(is_ours(ipci, dip)) in = len; ++ if (!len) ++ return; + +- if(!(in || out)) return; +- if(in && out && (!opt_local)) return; +- +- if(in) add_entry(ntohl(dip), in, 0); +- if(out) add_entry(ntohl(sip), 0, out); ++ slocal = is_ours(ipci, sip); ++ dlocal = is_ours(ipci, dip); ++ if(slocal && dlocal && (!opt_local)) return; ++ ++ if(slocal && !dlocal) ++ add_entry(ntohl(sip), 0, (long long)len); ++ else if(!slocal && dlocal) ++ add_entry(ntohl(dip), (long long)len, 0); ++ else if(slocal && dlocal) { ++ add_entry(ntohl(dip), (long long)len, 0); ++ add_entry(ntohl(sip), 0, (long long)len); ++ } + } + + void r_abusers_setup(int argc, char ** argv, diff --git a/net-mgmt/rate/files/patch-streams.c b/net-mgmt/rate/files/patch-streams.c new file mode 100644 index 0000000..109c67a --- /dev/null +++ b/net-mgmt/rate/files/patch-streams.c @@ -0,0 +1,10 @@ +--- streams.c.orig 2010-05-13 19:15:59.000000000 +0000 ++++ streams.c 2010-05-13 19:16:37.000000000 +0000 +@@ -29,6 +29,7 @@ + #include <netinet/tcp.h> + #include <netinet/udp.h> + #include <unistd.h> ++#include <string.h> + #include "lib.h" + #include "streams.h" + diff --git a/net-mgmt/rate/files/patch-streamstat.c b/net-mgmt/rate/files/patch-streamstat.c index 8d0e5e0..c3dd76d 100644 --- a/net-mgmt/rate/files/patch-streamstat.c +++ b/net-mgmt/rate/files/patch-streamstat.c @@ -1,6 +1,17 @@ +--- streamstat.c.orig 2010-05-13 19:16:11.000000000 +0000 ++++ streamstat.c 2010-05-13 19:17:17.000000000 +0000 +@@ -31,6 +31,8 @@ + #include <netinet/udp.h> + #include <unistd.h> + #include <stdlib.h> ++#include <stdio.h> ++#include <string.h> + #include "lib.h" + #include "util.h" + #include "streams.h" --- streamstat.c.orig 2016-01-15 08:36:19 UTC +++ streamstat.c -@@ -282,6 +282,7 @@ char * customize_format(int cols, int ou +@@ -282,6 +284,7 @@ char * customize_format(int cols, int ou { static char fmtstring[256]; int n = (cols - outlen - 1) / 2; |