public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Clouter <alex@digriz.org.uk>
To: netdev@vger.kernel.org
Subject: Re: Use ioctl() to list all network interfaces.
Date: Thu, 6 Jan 2011 17:07:16 +0000	[thread overview]
Message-ID: <4f9hv7-kev.ln1@chipmunk.wormnet.eu> (raw)
In-Reply-To: AANLkTi=Xb4TuKcCd-DgN5ZnYzRHV1RjDScyjRkqyb4P+@mail.gmail.com

Chin Shi Hong <cshong87@gmail.com> wrote:
>
> The following codes are just part of my application's source codes:
> 
> --begin of some codes--
> ifconf ifc;
> ret = ioctl(n, SIOCGIFCONF,&ifc);
> --End of some codes--
> 
> My application's role is to display all network interfaces, including
> the network interface which are down.
> 
> However, with the above codes, my application only display the network
> interface which are already up. The network interface which are down
> will not be displayed.
> 
> So, what can I do to make my application display all network
> interfaces, including the network interface which are down?
>
getifaddrs(), you get the IPv6 ones too this way.

Cheers

-- 
Alexander Clouter
.sigmonster says: I've only got 12 cards.


  parent reply	other threads:[~2011-01-06 17:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06 15:33 Use ioctl() to list all network interfaces Chin Shi Hong
2011-01-06 16:11 ` Rémi Denis-Courmont
2011-01-07  5:40   ` Chin Shi Hong
2011-01-06 17:07 ` Alexander Clouter [this message]
2011-01-07  5:41   ` Chin Shi Hong

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=4f9hv7-kev.ln1@chipmunk.wormnet.eu \
    --to=alex@digriz.org.uk \
    --cc=netdev@vger.kernel.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