社区
Linux/Unix社区
帖子详情
关于 netfilter module
rhzhzh
2003-09-08 01:51:42
有没有人看过write new netfilter module ,我看了后按照他上面的代码写了一道,在编译的时候就是通不过,老是冒一些莫名其妙的警告和错误,我的系统是redhat 9 内核没有编译,编译
gcc -O -c -Wall testmodules.c ,能够提供点问题出现的原因吗?谢谢!
...全文
106
3
打赏
收藏
关于 netfilter module
有没有人看过write new netfilter module ,我看了后按照他上面的代码写了一道,在编译的时候就是通不过,老是冒一些莫名其妙的警告和错误,我的系统是redhat 9 内核没有编译,编译 gcc -O -c -Wall testmodules.c ,能够提供点问题出现的原因吗?谢谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用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
打赏
举报
回复
把错误信息贴出来
net
filter
详解
本文讨论模块编写者如何利用Net
filter
hook来实现任意目的以及如何将将网络通信在基于Libpcap的应用程序中隐藏。虽然Linux 2.4支持对IPv4、IPv6以及DECnet的hook
net
filter
module
s
how to write net
filter
module
s
2.6.30内核Net
filter
的简单例子、三(whoVisit)
显示访问者IP的内核模块。 教程地址:http://blog.csdn.net/sahusoft/archive/2009/09/11/4543918.aspx
2.6.30内核Net
filter
的简单例子、二(DropLo)
感觉上一个例子过于简单,再来一个带判断条件的:丢弃所有来自环路设备的数据包,drop lo。 教程地址:http://blog.csdn.net/sahusoft/archive/2009/09/11/4541286.aspx
nf_test_
module
.zip
nf_test_
module
.zip net
filter
注册函数并使用案例
Linux/Unix社区
23,223
社区成员
74,536
社区内容
发帖
与我相关
我的任务
Linux/Unix社区
Linux/Unix社区 应用程序开发区
复制链接
扫一扫
分享
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章