ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@mivlgu.murom.ru>
To: mandrake-russian@altlinux.ru
Subject: Re: [mdk-re] Linux Programming: получить список адресов
Date: Fri Mar  1 17:53:03 2002
Message-ID: <20020301181348.3217d5cf.vsu@mivlgu.murom.ru> (raw)
In-Reply-To: <20020301143434.GA6242@darkstar.core.uslugionline.ru>

On Fri, 1 Mar 2002 17:34:34 +0300
Mikhail Nikitin <mouse@uslugionline.ru> wrote:

> Пишется некоторая программа на С++ (исп. libCommmonC++).
> Есть некоторое желание получить список всех текущих IP-адресов (и,
> желательно, девайсов, не глядя в /proc/net/dev). 
> Как бы это дело обстряпать получше?
> 
> (варианты с С, Perl, awk, etc.. не предлагать ;-)

Ну, есть такой вариант (info libc "Interface Naming"):

#include <net/if.h>
struct if_nameindex * if_nameindex (void);

После чего доставать конфигурацию через SIOCGIF... - например,
как это делает ifconfig (apt-get source net-tools,
lib/interface.c).

Хотя я не уверен, что if_nameindex работает не через
/proc/net/dev - по крайней мере, ifconfig работает через него.



  reply	other threads:[~2002-03-01 17:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-01 17:26 Mikhail Nikitin
2002-03-01 17:53 ` Sergey Vlasov [this message]
2002-03-01 18:15   ` Mikhail Nikitin
2002-03-01 21:36 ` [mdk-re] " Aleksandr Blohin
2002-03-02 12:52   ` Mikhail Nikitin

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=20020301181348.3217d5cf.vsu@mivlgu.murom.ru \
    --to=vsu@mivlgu.murom.ru \
    --cc=mandrake-russian@altlinux.ru \
    /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

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git