Check Interface Status

michi1 at michaelblizek.twilightparadox.com michi1 at michaelblizek.twilightparadox.com
Fri Dec 30 03:36:25 EST 2011


Hi!

On 12:30 Fri 30 Dec     , nilesh wrote:
> On Thursday 29 December 2011 08:23 PM, 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.
> >
> I think netif_carrier_ok() could help. You can refer network driver 
> code(e.g. e1000_main.c).

This looks more like "cable attached" rather than "interface up".

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



More information about the Kernelnewbies mailing list