This patch implements user configurable
categories/ports for traffic tracking.
The patch is against the 1.2.0b version. To apply it
the following sequence of commands can be used:
$ tar xzf bandwidthd-1.2.0b.tgz
$ cd bandwidthd-1.2.0b
$ zcat ../configurable-ports-v2.patch.gz | patch -p1
The main changes are:
- Now the etc/bandwidthd.conf has a new "item" (could be
replaced by something more meaningfull) option that
describes a class of traffic to be monitored. I
think that
the syntax is straightfoward.
- The management of these configuration data is done
using a couple of linked lists and a hash table
implemented at the new tables.h and tables.c files.
- The htdocs/legend.gif file is replaced by a
htdocs/legend.png one rebuilt at runtime based on the
given configuration. A new function named drawLegend()
in bandwidthd.c does the magic.
- The Statistics and IPData structS where changed to
support the new design.
- The GraphData() function suffered some major changes.
- The CDF file format now depends on the number of
configured itens and should be erased on configuration
changes.
The default configuration file more or less reproduces
the old behavior, but old data files need to be
converted to the new format. It shouldn't be difficult
to write a simple script to do that conversion.
My first intention was to make the configuration
completely dynamic, but the IPC structures made this a
difficult task. So, the number of items is limited by
the MAX_ITENS configuration option in bandwidthd.h.
The hash table size is configurable by simultaneously
modifying the HASH_TABLE_SIZE and HASH_TABLE_MASK
options in tables.h. The hash function (if it can be
called so) is only a simple bitmask. A more
sophisticated one could be used, but I saw no obvious
reason for it.
Configurable categories/ports patch against version 1.2.0b
Logged In: YES
user_id=863707
Nice work! Something I'd like to integrate into the main tree,
but I'll have to spend some time getting to know it first.
Configurable categories/ports patch against version 1.2.1b
Logged In: NO
固化剂
Logged In: NO
bnhbn
Logged In: NO
look
Logged In: NO
cool
Logged In: NO
look look
Logged In: NO
well
Logged In: NO
WELL
Logged In: NO
baiyq
Logged In: NO
does anyone know if this patch works on v2 and on redhat?
Logged In: NO
ok look
Logged In: NO
ok
Logged In: NO
;;;;
Logged In: NO
ok
Logged In: NO
ok!
Logged In: NO
OK !! Thank you very much
Logged In: NO
try
Logged In: YES
user_id=1544692
fgafasfsf
Logged In: NO
ok
Logged In: NO
r
Logged In: NO
hhh
Logged In: YES
user_id=1564700
hao rangwo kankan
Logged In: NO
good