Re: Check Interface Status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi!

On 09:53 Thu 29 Dec     , Rahul Kumar wrote:
> Hi,
> 
> I would like to check the interface status (up/down) within linux kernel.
> Is there any routine (sort of ioctl) to do this. Any code that is
> already in use in kernel would also be helpful for me.
> Please let me know.

If you want to check the status of a given "struct net_device *dev", you can
do "dev->flags & IFF_UP". No idea how this is supposed to be locked. If you
want to be notigied of changes, you can call register_netdevice_notifier().

	-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Networking]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

Add to Google Powered by Linux