On Mon, Jun 04, 2012 at 04:04:14PM +0200, Nikola Pajkovsky wrote:
Vitezslav Samel <vitezslav(a)samel.cz> writes:
> Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
> ---
> src/serv.c | 125 ++++++++++++++++++++++++++---------------------------------
> 1 files changed, 55 insertions(+), 70 deletions(-)
> - sport_listent->ocount++;
> + update_proto_counter(&sport_listent->serv_count, 1, br);
> + update_proto_counter(&sport_listent->span, 1, br);
...
...
...
> + update_proto_counter(&dport_listent->serv_count, 0, br);
> + update_proto_counter(&dport_listent->span, 0, br);
using 1 and 0 for incoming and outgoing pkts are not good, because I
have to dig what that means. Could you please define or enum PKT_IN and
PKT_OUT and use them or even better you can use pkt_pkttype and values
PACKET_OUTGOING and PACKET_HOST.
In this case the outgoing param of update_proto_counter() is
overloaded: here it means for source port it is outgoing direction (from
the port), for destination port it is incoming direction (to the port); so
we can't use pkt_pkttype for this (think of iptraf-ng on router, where the
packets are forwarded from LAN interface to the ISP interface).
Vita