嗨,
I am working on some networking code at the kernel level using version 1.3.71. I had the following problems : 如何找到 (1) 可用的接口
(e.g. in the case of a router, you will have many interfaces, one interface for each of its IP addresses).
Many times you have both a SLIP as well as an Ethernet interface to your router computer. (2) 接口的状态
whether the interface is up or down. 有一个名为 "struct ifnet" 的结构体,在 include/linux/route.h 中使用。 struct ifnet 包含了接口名称(例如 le0 或 sl0)以及接口状态(启动或关闭)等信息。 但是我在 1.3.71 版本中找不到这个结构体的定义。 旧版本的 Linux 有这个结构体的定义(struct ifnet 也出现在 BSD 代码中)。但现在我找不到它的定义或用法。是否有替代的结构体? 如果没有替代的结构体,是否意味着无法获取有关可用接口的信息?
Thank you very much, Vijay Gupta (Email : vijay@crhc.uiuc.edu) |