All of lore.kernel.org
 help / color / mirror / Atom feed
From: Burton Samograd <kruhft@kruhft.dyndns.org>
To: linux-kernel@vger.kernel.org
Subject: Getting interface IP addresses with proc filesystem
Date: Tue, 7 Jan 2003 18:06:14 -0800	[thread overview]
Message-ID: <20030108020614.GA1480@kruhft.dyndns.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

Hi all,

I'm curious how one goes about getting the current IP addresses held by a
machine.  I saw some rather convoluted code in qmail that shows how to do it but
it seems like a rather difficult (and future bug ridden if the interface
changes) piece of code and was thinking that a /proc/net interface would be the
easiest solution, at least on the end user side.

My thinking goes along the lines of adding a file in /proc/net called interfaces
(or something more appropriate) which gives the following type of listing:

eth0 12.35.23.58
eth0:0 192.168.0.1
lo 127.0.0.1
ppp0 45.3.3.89

etc

for each of the registered interfaces on the machine.  Nice, simple and
shouldn't be too hard to implement, correct? Is this type of information 
already present through some other mechanism that I haven't found yet?

Thanks in advance.

-- 
burton samograd
kruhft@kruhft.dyndns.org
http://kruhftwerk.dyndns.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2003-01-08  1:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-08  2:06 Burton Samograd [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-01-08 20:16 Getting interface IP addresses with proc filesystem Juan Gomez

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=20030108020614.GA1480@kruhft.dyndns.org \
    --to=kruhft@kruhft.dyndns.org \
    --cc=linux-kernel@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.