All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: Getting a network interface list from within the kernel
Date: Fri, 13 Apr 2007 12:37:18 +0100	[thread overview]
Message-ID: <25286.1176464238@redhat.com> (raw)
In-Reply-To: <20070412.135951.38690236.davem@davemloft.net>

David Miller <davem@davemloft.net> wrote:

> Issue a RTM_GETLINK rtnetlink request, and parse the response.

Okay, I've managed to find code that does this.  However, RTM_GETLINK does not
appear to return any IPv4 addressing information.  It does, however, contain
the MTU details which is one of the three things I wanted.

I found that RTM_GETADDR will give me the IPv4 address and something from
which I can calculate the netmask.

I don't suppose there's a single op that will allow me to get all three in one
go?

Oh, and can I assume that the interface index numbers returned by RTM_GETLINK
match those returned by RTM_GETADDR?  Even if an interface is removed between
issuing the two calls?  Alternatively, do I need to compare interface names as
those are available between both?

David

      reply	other threads:[~2007-04-13 11:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12 20:51 Getting a network interface list from within the kernel David Howells
2007-04-12 20:59 ` David Miller
2007-04-13 11:37   ` David Howells [this message]

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=25286.1176464238@redhat.com \
    --to=dhowells@redhat.com \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.