Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.arcetri.astro.it/irlab/doc/library/linux/khg/HyperNews/get/net/net-intro/1.html
Дата изменения: Thu Mar 23 12:38:17 2000 Дата индексирования: Wed Sep 15 04:17:32 2010 Кодировка: Поисковые слова: туманность андромеды |
Hi,
I am working on some networking code at the kernel level using version 1.3.71. I had the following problems : How to find : (1) the interfaces which are available :
(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) the status of the interface :
whether the interface is up or down. There is a structure called "struct ifnet" which is used in include/linux/route.h. struct ifnet has information like the name of the interface (e.g. le0 or sl0), as well as the status of the interface (whether up or down). But I could not find the definition of this structure anywhere in version 1.3.71. Older versions of linux had the definition of this structure available (struct ifnet also occurs in BSD code). But now I am unable to find its definition or use. Is there a substitute for that structure ? If there is no substitute, is it the case that the information about the available interfaces cannot be obtained ?
Thank you very much, Vijay Gupta (Email : vijay@crhc.uiuc.edu) |