关于 netfilter module

rhzhzh 2003-09-08 01:51:42
有没有人看过write new netfilter module ,我看了后按照他上面的代码写了一道,在编译的时候就是通不过,老是冒一些莫名其妙的警告和错误,我的系统是redhat 9 内核没有编译,编译
gcc -O -c -Wall testmodules.c ,能够提供点问题出现的原因吗?谢谢!
...全文
106 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
rhzhzh 2003-09-09
  • 打赏
  • 举报
回复
哦!对不起错误是:
In file included from testmodules.c:9:

/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

testmodules.c:15: warning: `struct net_device' declared inside parameter list

testmodules.c:15: warning: its scope is only this definition or declaration, which is probably not what you want

testmodules.c:15: warning: `struct sk_buff' declared inside parameter
list
testmodules.c: In function `linuxmag_hook':

testmodules.c:17: dereferencing pointer to incomplete type
testmodules.c:17: dereferencing pointer to incomplete type

testmodules.c:18: dereferencing pointer to incomplete type
testmodules.c:19: dereferencing pointer to incomplete type

testmodules.c:21: warning: implicit declaration of function `prink'

testmodules.c:23: dereferencing pointer to incomplete type

testmodules.c: At top level:

testmodules.c:34: variable `linuxmag_ops' has initializer but incomplete type

testmodules.c:34: extra brace group at end of initializer
testmodules.c:34: (near initialization for `linuxmag_ops')

testmodules.c:34: warning: excess elements in struct initializer

testmodules.c:34: warning: (near initialization for `linuxmag_ops')

testmodules.c:34: warning: excess elements in struct initializer

testmodules.c:34: warning: (near initialization for `linuxmag_ops')

testmodules.c:34: warning: excess elements in struct initializer

testmodules.c:34: warning: (near initialization for `linuxmag_ops')

testmodules.c:34: warning: excess elements in struct initializer

testmodules.c:34: warning: (near initialization for `linuxmag_ops')

testmodules.c:34: warning: excess elements in struct initializer

testmodules.c:34: warning: (near initialization for `linuxmag_ops')

testmodules.c: In function `init_module':
testmodules.c:39: warning: implicit declaration of function `nf_register_hook'

testmodules.c: In function `cleanup_module':

testmodules.c:43: warning: implicit declaration of function `nf_unregister_hook'

testmodules.c: At top level:

testmodules.c:34: storage size of `linuxmag_ops' isn't known
zeng_xiangyang 2003-09-08
  • 打赏
  • 举报
回复
有没有搞错啊,错误都不贴出来怎么给你说啊
prqin 2003-09-08
  • 打赏
  • 举报
回复
把错误信息贴出来

23,223

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧