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.
Hello, I wonder how this plugin progresses, when and if it will be included in CVS? I am using version "2.0.1+cvs20090917-3" (Debian squeeze-package).
I forgot to add; I am using OpenVPN but its encrypted traffic is not market/labeld "VPN/yellow". I would be happy if OpenVPN-traffic is marked correctly by default. OpenVPN use port 1194, both tcp and udp and the port is registerd with IANA.
Dear Anders,
First, it seems like this project has been dead for a long time. So, if you want something, you will have to code it for yourself...
I never ported this feature to the 2.0 version because the 2.0 codebase is quite different from the 1.2 one, with the graph plotting being done in PHP. As I don't have use for this tool anymore, the amount of work involved doesn't pay off.
Actually, if I were to do something, I probably would take the 1.2 codebase, strip out all the plotting and database code and use something as RRDTool as output engine instead. That would result in a smaller and far more maintainable code and possibly revive this project...
Best regards,
Gliese