内核struct net结构体

354 views
Skip to first unread message

tingwei liu

unread,
Jul 4, 2011, 3:21:26 AM7/4/11
to linux-kernel
内核中的一个结构体struct net,不知道他的具体意义在哪?
如果只是为了将所有的网卡都统一管理起来,那么struct net_device结构体就可以完成这个任务啊。
还请哪位大侠分享过这块代码,给小弟说说。
多谢了。
_______________________________________________
Linux 内核开发中文邮件列表
Linux-...@zh-kernel.org
http://zh-kernel.org/mailman/listinfo/linux-kernel
Linux 内核开发中文社区: http://zh-kernel.org

徐阳

unread,
Jul 4, 2011, 4:03:54 AM7/4/11
to tingwei liu, linux-kernel
professional linux kernel architecture (英文版很容易找到) 的12.5章描述过
2.6.24开始,为了添加Networking Namespaces的支持而加入的

Américo Wang

unread,
Jul 10, 2011, 5:48:38 AM7/10/11
to tingwei liu, linux-kernel
2011/7/4 tingwei liu <ting...@gmail.com>:

> 内核中的一个结构体struct net,不知道他的具体意义在哪?
> 如果只是为了将所有的网卡都统一管理起来,那么struct net_device结构体就可以完成这个任务啊。
> 还请哪位大侠分享过这块代码,给小弟说说。

你可以看看veth的实现,drivers/net/veth.c。

它的作用是把包从一个veth设备转发到成对的另一个veth上,它们在不同的namespace中。

Reply all
Reply to author
Forward
0 new messages