From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Check Interface Status
Date: Thu, 29 Dec 2011 18:53:51 +0100 [thread overview]
Message-ID: <20111229175351.GA2173@grml> (raw)
In-Reply-To: <CACLebov-juRSJZM=tT_wXFFJ5C4P5fNHbYaaqh_Kq_pZPB10XA@mail.gmail.com>
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
next prev parent reply other threads:[~2011-12-29 17:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-29 14:53 Check Interface Status Rahul Kumar
2011-12-29 17:53 ` michi1 at michaelblizek.twilightparadox.com [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111229175351.GA2173@grml \
--to=michi1@michaelblizek.twilightparadox.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).