All of lore.kernel.org
 help / color / mirror / Atom feed
* libipq question
@ 2004-06-25 20:12 Steve Ashley
  2004-06-25 20:38 ` Pablo Neira
  2004-06-25 23:56 ` Henrik Nordstrom
  0 siblings, 2 replies; 6+ messages in thread
From: Steve Ashley @ 2004-06-25 20:12 UTC (permalink / raw)
  To: netfilter-devel

Hello all,

I'm using libipq to do some user-space filter stuff.  Everything is
working great and for my application, I'm not taking a significant
enough speed hit to warrant making a new target, iptables kernel module.
However, I am getting one problem.  If my application runs for a long
time ( i.e. several hours or overnight ) with no activity, then filters
packets.  I'm getting the following error messages:

Error in recv().
Broken pipe.

Then the application exits.

I assume this is probably concerning the underlying netlink socket.  How
can I go about catching / trapping this condition?  For some errors, I
can simply destroy my ipq_handle and get a new one and keep going.

Currently I'm using the blocking version of the ipq_read() function,
with no timeout.  Would putting a timeout here, and checking on the
netlink socket every so often be a good idea?  Any thoughts or ideas
would be helpful.

Also, just for information sake.  At some point, if I add more features
into my application, I fear using a userspace application may not be
sufficient.  Where can I find a good example of a new netfilter target
kernel module code?  The most I've ever done in the kernel was to make a
"hello world" kernel module, so any help here would be greatly
appreciated.


Stephen Ashley
Ashley Professional Services, Inc. P.A.
spanishmack@mchsi.com

^ permalink raw reply	[flat|nested] 6+ messages in thread
* libipq question
@ 2004-04-22  9:04 Moshe Ashkenazi
  0 siblings, 0 replies; 6+ messages in thread
From: Moshe Ashkenazi @ 2004-04-22  9:04 UTC (permalink / raw)
  To: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

Hi, List -
 
I'm using QUEUE target in order to send TCP packets to user space, using
"IPQ_COPY_PACKET" I'm telling the kernel that I want the entire packet.
 
I know that the kernel send to user space the following structure
"ipq_packet_msg_t", and this structure include the payload member which
include the optional packet data.
 
When I'm examining the content of the payload array I see that it
include the following:
20 bytes IP header -> 20 bytes TCP header, and 20 bytes????
 
My questions are:
1.	What should the payload include?
2.	What are the last 20 bytes in the payload?
 
Example of payload array:
----- Optional packet data -----
45 10  0 3c f8 f8 40  0 3f  6 6f 64 c2 1d 28 90
c0 a8 27 f9 82 e7  4 d2 cf 1f 40 f5  0  0  0  0
a0  2 16 d0 f7 eb  0  0  2  4  5 b4  4  2  8  a
16 20 b8  d  0  0  0  0  1  3  3  0

[-- Attachment #2: Type: text/html, Size: 8002 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread
* libipq question
@ 2003-05-15  4:42 Shirshanka Das
  2003-05-23  8:22 ` Philip Ho
  0 siblings, 1 reply; 6+ messages in thread
From: Shirshanka Das @ 2003-05-15  4:42 UTC (permalink / raw)
  To: netfilter

Hi all,
  I'm new to lipipq...
  I tried using the perlipq module.. but I'm unable to figure out
  how to write a "modified" packet back to the queue..
  the documentation says :
  set_verdict(id,verdict,len,buf)

  $msg = $queue->get_message() gives me the packet (i hope)..
  however trying to do
  set_verdict(id,NF_ACCEPT,len,$msg)
  does not work properly...

  does anyone have a piece of working code.. that mangles something in a
packet.. and then writes it out ?

Thanks,
Shanky




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-06-25 23:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-25 20:12 libipq question Steve Ashley
2004-06-25 20:38 ` Pablo Neira
2004-06-25 23:56 ` Henrik Nordstrom
  -- strict thread matches above, loose matches on Subject: below --
2004-04-22  9:04 Moshe Ashkenazi
2003-05-15  4:42 Shirshanka Das
2003-05-23  8:22 ` Philip Ho

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.