Re: Suspicious URL:Re: Check Interface Status
On Friday 30 December 2011 02:06 PM, mic...@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 ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Check Interface Status
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 ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Check Interface Status
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 ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Check Interface Status
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@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Check Interface Status
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. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies