* Check Interface Status
@ 2011-12-29 14:53 Rahul Kumar
2011-12-29 17:53 ` michi1 at michaelblizek.twilightparadox.com
2011-12-30 7:00 ` nilesh
0 siblings, 2 replies; 5+ messages in thread
From: Rahul Kumar @ 2011-12-29 14:53 UTC (permalink / raw)
To: kernelnewbies
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Check Interface Status
2011-12-29 14:53 Check Interface Status Rahul Kumar
@ 2011-12-29 17:53 ` michi1 at michaelblizek.twilightparadox.com
2011-12-30 7:00 ` nilesh
1 sibling, 0 replies; 5+ messages in thread
From: michi1 at michaelblizek.twilightparadox.com @ 2011-12-29 17:53 UTC (permalink / raw)
To: kernelnewbies
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Check Interface Status
2011-12-29 14:53 Check Interface Status Rahul Kumar
2011-12-29 17:53 ` michi1 at michaelblizek.twilightparadox.com
@ 2011-12-30 7:00 ` nilesh
2011-12-30 8:36 ` michi1 at michaelblizek.twilightparadox.com
1 sibling, 1 reply; 5+ messages in thread
From: nilesh @ 2011-12-30 7:00 UTC (permalink / raw)
To: kernelnewbies
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).
--
Thanks,
Nilesh
^ permalink raw reply [flat|nested] 5+ messages in thread
* Check Interface Status
2011-12-30 7:00 ` nilesh
@ 2011-12-30 8:36 ` michi1 at michaelblizek.twilightparadox.com
2011-12-30 9:35 ` Suspicious URL:Re: " nilesh
0 siblings, 1 reply; 5+ messages in thread
From: michi1 at michaelblizek.twilightparadox.com @ 2011-12-30 8:36 UTC (permalink / raw)
To: kernelnewbies
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Suspicious URL:Re: Check Interface Status
2011-12-30 8:36 ` michi1 at michaelblizek.twilightparadox.com
@ 2011-12-30 9:35 ` nilesh
0 siblings, 0 replies; 5+ messages in thread
From: nilesh @ 2011-12-30 9:35 UTC (permalink / raw)
To: kernelnewbies
On Friday 30 December 2011 02:06 PM,
michi1 at michaelblizek.twilightparadox.com wrote:
> 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".
Oh yes, it will just tell us if the carrier is available.
IFF_UP flag is the right way, as you suggested in the other email.
>
> -Michi
--
Thanks,
Nilesh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-12-30 9:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-29 14:53 Check Interface Status Rahul Kumar
2011-12-29 17:53 ` michi1 at michaelblizek.twilightparadox.com
2011-12-30 7:00 ` nilesh
2011-12-30 8:36 ` michi1 at michaelblizek.twilightparadox.com
2011-12-30 9:35 ` Suspicious URL:Re: " nilesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).