Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Chris Wilson <chris@netservers.co.uk>
To: "Jeffrey D. Brower" <jeff@pointhere.net>
Cc: netfilter@lists.netfilter.org
Subject: Re: real-time monitor question
Date: Wed, 6 Aug 2003 10:27:08 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.44.0308061022320.21531-100000@localhost> (raw)
In-Reply-To: <042501c35b7c$e3e565c0$0b02a8c0@pointhere.net>

Hi Jeffrey,

> Based on that statement I got more deeply into the ULOG and it looks good.
> I found an extention in the CVS called ulogd_OPRINT.c which (although I can
> not find the documentation on its use) LOOKS like it is almost exactly what
> I need.  Can it be that my solution could be as simple as replacing the
> _output_print() function with my own function that prints to the circuit
> board?

It could certainly be that easy, but I'm not familiar with the code in 
question.

> Another suggestion that I got kind of steered me toward lookng at bytes
> rather than packets and I wonder if I can't just read one of the /proc files
> to see the number of bytes accepted and denyed

Unfortunately I don't think there are any counters for this either in 
/proc. You would still have to use libiptc or parse the output of 
iptables -L -n -v.

> Never having done a fork(), nor a pipe() nor reads from Netfilter - this
> sounds like a lot of fun to me (but like a heck of a learning curve).  It
> sounds like what I envisioned, but I wonder if the pipe won't get stuffed
> too fast and halt the input side causing lost packets, etc.

If you set the O_NONBLOCK option on your end of the pipe, then if the pipe 
is full the operating system will just return an EAGAIN error immediately, 
instead of waiting for the pipe to empty. In any case, it doesn't matter 
much if the input process blocks, since packet processing will continue 
anyway without interference from your process.

Cheers, Chris.
-- 
   ___ __     _
 / __// / ,__(_)_  | Chris Wilson -- UNIX Firewall Lead Developer |
/ (_ / ,\/ _/ /_ \ | NetServers.co.uk http://www.netservers.co.uk |
\ _//_/_/_//_/___/ | 21 Signet Court, Cambridge, UK. 01223 576516 |




  reply	other threads:[~2003-08-06  9:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-04 17:31 real-time monitor question Jeffrey D. Brower
2003-08-05  9:20 ` Chris Wilson
2003-08-05 18:10   ` Jeffrey D. Brower
2003-08-06  9:27     ` Chris Wilson [this message]
2003-08-06 15:49       ` Jeffrey D. Brower
2003-08-06 15:48         ` Chris Wilson
     [not found] <09B04A55822EFF4DA48D2E0BB2941D4A15C03F@wardrive.citadelcomputer.com.au>
2003-08-05  1:32 ` Jeffrey D. Brower
  -- strict thread matches above, loose matches on Subject: below --
2003-08-05  1:44 George Vieira
2003-08-05 18:10 ` Jeffrey D. Brower

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=Pine.LNX.4.44.0308061022320.21531-100000@localhost \
    --to=chris@netservers.co.uk \
    --cc=jeff@pointhere.net \
    --cc=netfilter@lists.netfilter.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