netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: "Loke, Chetan" <Chetan.Loke@netscout.com>
Cc: "Ben Hutchings" <bhutchings@solarflare.com>,
	"Chetan Loke" <chetanloke@gmail.com>, <netdev@vger.kernel.org>
Subject: Re: [RFC] Enhance dev_ioctl to return <hwaddr>:<if_name::if_index> mapping
Date: Fri, 16 Jul 2010 11:31:13 -0700	[thread overview]
Message-ID: <20100716113113.1e2b51c7@nehalam> (raw)
In-Reply-To: <D3F292ADF945FB49B35E96C94C2061B90C55C202@nsmail.netscout.com>

On Fri, 16 Jul 2010 14:12:24 -0400
"Loke, Chetan" <Chetan.Loke@netscout.com> wrote:

> > -----Original Message-----
> > From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> > Sent: July 16, 2010 2:04 PM
>  
> > The additional API is not needed. It is trivial to find address for
> > device and do reverse mapping. Either with ioctl's 
> Sorry, I might have missed it. But which ioctl would that be?

Simple way:
   Use SIOCGIFCONF to get list of interfaces
   Use SIOCGIFHWADDR to read device addresss

If you want to handle the case where device address is set
by bonding or other protocols, use ETHTOOL_GPERMADDR to read
the original ethernet address.

> > or /sys/class/net/XXX/addr
> So, is reading /sys/ nodes preferred over get-calls?

No difference

  reply	other threads:[~2010-07-16 18:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-16 13:18 [RFC] Enhance dev_ioctl to return <hwaddr>:<if_name::if_index> mapping Chetan Loke
2010-07-16 17:10 ` Ben Hutchings
2010-07-16 18:04   ` Stephen Hemminger
2010-07-16 18:12     ` Loke, Chetan
2010-07-16 18:31       ` Stephen Hemminger [this message]
2010-07-16 19:29         ` Chetan Loke
2010-07-16 19:33           ` David Miller
2010-07-16 19:35             ` Chetan Loke
2010-07-16 19:40               ` David Miller
2010-07-16 20:02                 ` Chetan Loke
2010-07-16 20:04                   ` David Miller
2010-07-16 20:15                     ` Chetan Loke
2010-07-16 20:18                       ` David Miller
2010-07-16 20:49                         ` Loke, Chetan

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=20100716113113.1e2b51c7@nehalam \
    --to=shemminger@vyatta.com \
    --cc=Chetan.Loke@netscout.com \
    --cc=bhutchings@solarflare.com \
    --cc=chetanloke@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).