The HyperNews Linux KHG Discussion Pages

Feedback: Re: Question on network interfaces

Forum: Network Buffers And Memory Management
Re: Question Question on network interfaces (Vijay Gupta)
Keywords: network interface
Date: Wed, 28 Aug 1996 15:33:15 GMT
From: Pedro Roque <roque@di.fc.ul.pt>

If you want to scan the interface list from kernel space you can do something like:

{
	struct device *dev;

	for (dev = dev_base; dev != NULL; dev = dev->next) 
        {
		/* your code here */
		/* example */
		
		if (dev->family == AF_INET)
		{
			/* this is an inet device */
		}

		if (dev->type == ARPHRD_ETHER)
		{
			/* this is ethernet */
		}
	}
}

./Pedro.