HyperNews Linux KHG 讨论页面

Question: 关于网络接口的问题

论坛: 网络缓冲区和内存管理
关键词: 网络接口
日期: 1996年5月19日 星期日 17:46:31 GMT
发件人: Vijay Gupta <vijay@crhc.uiuc.edu>

嗨,

        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)


消息

2. Feedback: 回复:关于网络接口的问题 作者:Pedro Roque
1. None: 无标题
1. Note: 查找网络信息 作者:Alan Cox