All of lore.kernel.org
 help / color / mirror / Atom feed
* errors in compiling the hooks
@ 2004-01-11  6:55 vamsi krishna
  0 siblings, 0 replies; 3+ messages in thread
From: vamsi krishna @ 2004-01-11  6:55 UTC (permalink / raw)
  To: netfilter

hai,

  i am a new bie. when i am trying to compile the
following program

#define __KERNEL__
#define MODULE
                                                      
                                                      
               
#include<linux/module.h>
#include<linux/kernel.h>
#include<linux/netfilter.h>
#include<linux/netfilter_ipv4.h>
                                                      
                                                      
               
static struct nf_hook_ops nfho;
                                                      
                                                      
               
unsigned int hook_func(unsigned int hooknum,
                      struct sk_buff **skb,
                      const struct net_device *in,
                      const struct net_device *out,
                      int (*okfn)(struct sk_buff *))
{
return NF_DROP;
}
                                                      
                                                      
               
int init_module()
{
nfho.hook=hook_func;
nfho.hooknum=NF_IP_PRE_ROUTING;
nfho.pf=PF_INET;
nfho.priority=NF_IP_PRI_FIRST;
                                                      
                                                      
               
nf_register_hook(&nfho);
                                                      
                                                      
               
return 0;
}
void cleanup_module()
{
nf_unregister_hook(&nfho);
}


i got the following errors .

[root@localhost vamsi]# gcc -c p1.c
In file included from p1.c:7:
/usr/include/linux/netfilter_ipv4.h:53: `INT_MIN'
undeclared here (not in a function)
/usr/include/linux/netfilter_ipv4.h:53: enumerator
value for `NF_IP_PRI_FIRST' not integer constant
/usr/include/linux/netfilter_ipv4.h:59: `INT_MAX'
undeclared here (not in a function)
/usr/include/linux/netfilter_ipv4.h:59: enumerator
value for `NF_IP_PRI_LAST' not integer constant
p1.c:15: warning: `struct net_device' declared inside
parameter list
p1.c:15: warning: its scope is only this definition or
declaration, which is probably not what you want
p1.c:15: warning: `struct sk_buff' declared inside
parameter list
p1.c: In function `init_module':
p1.c:22: invalid use of undefined type `struct
nf_hook_ops'
p1.c:23: invalid use of undefined type `struct
nf_hook_ops'
p1.c:24: invalid use of undefined type `struct
nf_hook_ops'
p1.c:24: `PF_INET' undeclared (first use in this
function)
p1.c:24: (Each undeclared identifier is reported only
once
p1.c:24: for each function it appears in.)
p1.c:25: invalid use of undefined type `struct
nf_hook_ops'
p1.c: At top level:
p1.c:9: storage size of `nfho' isn't known


please help me,

thanks,
vamsi

________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com


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

* Re: errors in compiling the hooks
  2004-01-11  6:55 vamsi krishna
@ 2004-01-11 14:31 ` Cedric Blancher
  0 siblings, 0 replies; 3+ messages in thread
From: Cedric Blancher @ 2004-01-11 14:31 UTC (permalink / raw)
  To: vamsi krishna; +Cc: netfilter

Le dim 11/01/2004 à 07:55, vamsi krishna a écrit :
>   i am a new bie. when i am trying to compile the
> following program
[...]

You should ask the netfilter development mailing list :

	netfilter-devel@lists.netfilter.org

-- 
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
>> Hi! I'm your friendly neighbourhood signature virus.
>> Copy me to your signature file and help me spread! 


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

* errors in compiling the hooks
@ 2004-01-11  6:55 vamsi krishna
  2004-01-11 14:31 ` Cedric Blancher
  0 siblings, 1 reply; 3+ messages in thread
From: vamsi krishna @ 2004-01-11  6:55 UTC (permalink / raw)
  To: netfilter

hai,

  i am a new bie. when i am trying to compile the
following program

#define __KERNEL__
#define MODULE
                                                      
                                                      
               
#include<linux/module.h>
#include<linux/kernel.h>
#include<linux/netfilter.h>
#include<linux/netfilter_ipv4.h>
                                                      
                                                      
               
static struct nf_hook_ops nfho;
                                                      
                                                      
               
unsigned int hook_func(unsigned int hooknum,
                      struct sk_buff **skb,
                      const struct net_device *in,
                      const struct net_device *out,
                      int (*okfn)(struct sk_buff *))
{
return NF_DROP;
}
                                                      
                                                      
               
int init_module()
{
nfho.hook=hook_func;
nfho.hooknum=NF_IP_PRE_ROUTING;
nfho.pf=PF_INET;
nfho.priority=NF_IP_PRI_FIRST;
                                                      
                                                      
               
nf_register_hook(&nfho);
                                                      
                                                      
               
return 0;
}
void cleanup_module()
{
nf_unregister_hook(&nfho);
}


i got the following errors .

[root@localhost vamsi]# gcc -c p1.c
In file included from p1.c:7:
/usr/include/linux/netfilter_ipv4.h:53: `INT_MIN'
undeclared here (not in a function)
/usr/include/linux/netfilter_ipv4.h:53: enumerator
value for `NF_IP_PRI_FIRST' not integer constant
/usr/include/linux/netfilter_ipv4.h:59: `INT_MAX'
undeclared here (not in a function)
/usr/include/linux/netfilter_ipv4.h:59: enumerator
value for `NF_IP_PRI_LAST' not integer constant
p1.c:15: warning: `struct net_device' declared inside
parameter list
p1.c:15: warning: its scope is only this definition or
declaration, which is probably not what you want
p1.c:15: warning: `struct sk_buff' declared inside
parameter list
p1.c: In function `init_module':
p1.c:22: invalid use of undefined type `struct
nf_hook_ops'
p1.c:23: invalid use of undefined type `struct
nf_hook_ops'
p1.c:24: invalid use of undefined type `struct
nf_hook_ops'
p1.c:24: `PF_INET' undeclared (first use in this
function)
p1.c:24: (Each undeclared identifier is reported only
once
p1.c:24: for each function it appears in.)
p1.c:25: invalid use of undefined type `struct
nf_hook_ops'
p1.c: At top level:
p1.c:9: storage size of `nfho' isn't known


please help me,

thanks,
vamsi

________________________________________________________________________
Yahoo! India Mobile: Download the latest polyphonic ringtones.
Go to http://in.mobile.yahoo.com


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

end of thread, other threads:[~2004-01-11 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-11  6:55 errors in compiling the hooks vamsi krishna
  -- strict thread matches above, loose matches on Subject: below --
2004-01-11  6:55 vamsi krishna
2004-01-11 14:31 ` Cedric Blancher

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.