Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Srinivasa T N <seenutn@linux.vnet.ibm.com>
To: Mail List - Netfilter <netfilter@vger.kernel.org>
Subject: Re: Double rules for using NETFLOW?
Date: Fri, 04 Feb 2011 10:32:39 +0530	[thread overview]
Message-ID: <4D4B886F.70705@linux.vnet.ibm.com> (raw)
In-Reply-To: <4D4B0CAE.5000105@riverviewtech.net>

On Friday 04 February 2011 01:44 AM, Grant Taylor wrote:
> On 02/02/11 23:15, Srinivasa T N wrote:
>> But how will I have access to the counters from my user land app?
>
> I'd be extremely surprised if there were APIs that you can use to query
> the kernel. - Though, I don't work on programming (like that) so I don't
> know first hand.
>
> At the very least, you can find the counters via the output of the
> iptables command. I.e. I can issue the following command:
>
> iptables -t filter -L FORWARD -n -v -x
>
> This will give me a packet / byte count (-v) that is exact (-x) that
> have match various rules. I.e. the above command produced the following
> output:
>
> Chain FORWARD (policy DROP 0 packets, 0 bytes)
> pkts bytes target prot opt in out source destination
> 3783934 4488563274 ACCEPT all -- eth0 eth1 0.0.0.0/0 0.0.0.0/0 state
> RELATED,ESTABLISHED
> 2632183 290464220 ACCEPT all -- eth1 eth0 0.0.0.0/0 0.0.0.0/0
>
> If you are worried about knowing which rule you want to read the
> counters on, use the comment match extension that will allow you to put
> a comment / string to flag on in the output. This will allow you to grep
> for that line of output.
>
> There might even be some way via /proc or /sys to find what you are
> asking, but I don't know.
>
>
>
> Grant. . . .
> --
I was interested in knowing programmatic way as the performance is of 
utmost importance to me.

Seenu.

      reply	other threads:[~2011-02-04  5:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 10:01 Double rules for using NETFLOW? Srinivasa T N
2011-02-02 10:09 ` Giles Coochey
2011-02-02 17:56 ` Grant Taylor
2011-02-03  5:15   ` Srinivasa T N
2011-02-03 20:14     ` Grant Taylor
2011-02-04  5:02       ` Srinivasa T N [this message]

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=4D4B886F.70705@linux.vnet.ibm.com \
    --to=seenutn@linux.vnet.ibm.com \
    --cc=netfilter@vger.kernel.org \
    /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