From: Patrick Schaaf <bof@bof.de>
To: Xuan Chen <xuanc@isi.edu>
Cc: netfilter@lists.netfilter.org, netfilter-devel@lists.netfilter.org
Subject: Re: how to add packet or byte couters to connection tracking module
Date: Thu, 20 Feb 2003 19:33:40 +0100 [thread overview]
Message-ID: <20030220183340.GA17248@oknodo.bof.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0302200959310.13403-100000@ski.isi.edu>
> I want to add a packet or byte counter to the connection tracking module
> in netfilter. That is, I want to track how many packets and bytes having
> been sent through one connection. Where should I start?
1) Get the kernel source code.
2) Get enough RAM to hold the full kernel source code, and your normal apps.
To test whether you have enough RAM, use 'vmstat' to see whether you
start swapping on this command:
find /usr/src/linux -type f | grep -l 'struct ip_conntrack'
3) you are set up for work with the kernel. "grep for this" is the
basic navigation aid. Now that you have found the include file
(they end in '.h') where 'struct ip_conntrack' is defined,
add the neccessary counter fields to it.
4) Study the other files the find/grep above found, especially the files
with 'conntrack' in their names. Add the counter updates to the
relevant files.
5) Provide ways for userlevel to access those counters. I would be
interested to hear about the access methods you imagine.
6) Test. Test. Test.
> Any examples will be very helpful!
A concrete example, would mean writing the code. I hope you persist
and implement and share your code, because if you do, we will have
an example. I hope my six step program, above, helps you along a bit.
> btw, is there a search engine on netfilter's web page? I think that's
> really helpful if people want to search for previous work and discussions.
I'm sure that google has it indexed fully; use the advanced search
features, there, to restrict any search to a particular domain.
An example URL, searching for "byte counters" on www.netfilter.org,
would be:
http://www.google.com/search?q=+site%3Awww.netfilter.org+byte+counters
best regards
Patrick
next prev parent reply other threads:[~2003-02-20 18:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-20 18:04 how to add packet or byte couters to connection tracking module Xuan Chen
2003-02-20 18:33 ` Patrick Schaaf [this message]
2003-02-26 17:36 ` Harald Welte
2003-02-21 0:49 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030220183340.GA17248@oknodo.bof.de \
--to=bof@bof.de \
--cc=netfilter-devel@lists.netfilter.org \
--cc=netfilter@lists.netfilter.org \
--cc=xuanc@isi.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox