Google
  Web www.spinics.net

Re: NFQUEUE hello world-style program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hello,

On Thursday, 2008 July  3 at 16:07:21 -0400, Simon Perreault wrote:
> 
> #include <stdio.h>
> 
> int cb( struct nfq_q_handle* q, struct nfgenmsg *nfmsg,
>         struct nfq_data *nfad, void *data )
> {
>     char* payload;
>     printf( "received %d bytes\n", nfq_get_payload(nfad, &payload) );
>     return 0;
> }
> 
> int main()
> {
>     struct nfq_handle* h = nfq_open();

You are missing the unbind  bind 
	
	nfq_unbind_pf(h, AF_INET);
	nfq_bind_pf(h, AF_INET);

You can have a look at for working  code: 
 * utils/nfqnl_test.c in libnetfilter_queue sources
 * http://software.inl.fr/trac/browser/mirror/edenwall/nufw/trunk/nufw/src/nufw/packetsrv.c#L219

BR,
-- 
Eric Leblond
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/

Attachment: signature.asc
Description: Digital signature


[Linux Netfilter Development]     [Linux Kernel Development]     [TCP/IP Books]     [Linux Resources]     [LARTC]     [Home]     [Bugtraq]     [Consulting]     [Free Internet Dating]     [Yosemite Forum]     [Photo]

Powered by Linux