Re: Check Interface Status

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


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().

programing a layer 3+4 network protocol for mesh networks

Kernelnewbies mailing list

[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