
Здравствуйте! Как наиболее переносимо узнать какой IP повешен на интерфейc? (из своей С-программы) Заранее всем спасибо. -- With best regards, Gregory Edigarov =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

Tue, May 03, 2005 at 11:29:07, greg wrote about "[uanog] urgent code sample need (ifaddr)":
sendmail/{src|sendmail}/conf.c - там всё есть для N+1 платформы -netch- =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

Hi! On Tue, May 03, 2005 at 11:29:07AM +0300, Gregory Edigarov writes: GE> Как наиболее переносимо узнать какой IP повешен на интерфейc? GE> (из своей С-программы) GE> Заранее всем спасибо. Через ioctl(), SIOCGIFADDR. Другие варианты менее переносимы. Ну, разве что, еще выдачу ifconfig-а можно отпарсить. ;-) -- Lucky carrier, Паша. =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

On Tue, May 03, 2005 at 11:37:30AM +0300, Pavel Gulchouck wrote:
-- Best regards, Paul Arakelyan. =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

On Tue, May 03, 2005 at 12:48:06PM +0300, Paul Arakelyan wrote:
"Даже в линуксах" есть /sbin/ip.
[raven@t-rex - 14:00:22 Втр Май 03 ~]
$ ip a s
1: lo:

On Tue, May 03, 2005 at 02:00:56PM +0300, Vladimir A. Podgorny wrote:
"Даже в линуксах" есть /sbin/ip. iproute есть не везде. Лично я предпочёл бы всё-таки парсить ifconfig.
Думаю что /inet[^0-9]*(([0-9]+\.){3}[0-9]+)/ => $1 подойдёт практически всюду. p.s. не забывайте про IPv6. -- The reward of a thing well done is to have done it. -- Emerson =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

On Tue, May 03, 2005 at 02:00:56PM +0300, Vladimir A. Podgorny wrote:
"Даже в линуксах" есть /sbin/ip. Между-прочим!!!
$ ip addr show dev eth0.100
4: eth0.100:

On Tue, May 03, 2005 at 02:21:52PM +0300, Bohdan Vlasyuk wrote:
$ ip addr show dev eth1
3: eth1:
Фокус? :)))
-- To be trusted is a greater compliment than to be loved. =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

Hi! On Tue, May 03, 2005 at 02:27:04PM +0300, Bohdan Vlasyuk writes:
BV> $ ip addr show dev eth1
BV> 3: eth1:
Фокус? :)))
Ну так а "ifconfig eth1:0"? Переносимость представления алиасов никто не обещал. Иногда нужно еще на lo0 или lo смотреть, чтобы все адреса узнать. Btw, у тебя несоответствие netmask и broadcast сознательное? -- Lucky carrier, Паша. =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

On Tue, May 03, 2005 at 03:11:01PM +0300, Pavel Gulchouck wrote:
$ /sbin/ifconfig eth1:1 eth1:1 Link encap:Ethernet HWaddr 00:00:E8:DB:B4:FF UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xc400 $ /sbin/ifconfig eth1:2 eth1:2 Link encap:Ethernet HWaddr 00:00:E8:DB:B4:FF UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xc400 $ /sbin/ifconfig eth1:3 eth1:3 Link encap:Ethernet HWaddr 00:00:E8:DB:B4:FF UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:12 Base address:0xc400
Спасибо, Богдан. -- BEWARE! People acting under the influence of human nature. =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

On Tue, May 03, 2005 at 03:11:01PM +0300, Pavel Gulchouck wrote:
PG> Ну так а "ifconfig eth1:0"?
# ip addr sh dev eth1.101
29: eth1.101:

On Tue, May 03, 2005 at 07:22:59PM +0300, Alexander Trotsai wrote:
$ lynx -source http://www.iana.org/assignments/ethernet-numbers | grep 000102 000102 BBN BBN internal usage (not registered) Или сейчас уже MAC-и каждый вендор берёт как хочет? -- BOFH excuse #209: Only people with names beginning with 'A' are getting mail this week (a la Microsoft) =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

On Tue, May 03, 2005 at 08:47:21PM +0300, Bohdan Vlasyuk wrote:
BV> On Tue, May 03, 2005 at 07:22:59PM +0300, Alexander Trotsai wrote:
BV> > # ip addr sh dev eth1.101
BV> > 29: eth1.101:

On Tue, May 03, 2005 at 08:47:21PM +0300, Bohdan Vlasyuk wrote:
MAC Address Prefix Vendor 000102 3COM CORPORATION Database last updated: Mar 24, 2005 http://www.coffer.com/mac_find/?string=00%3A01%3A02 -- Dmitry Kiselev =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message

On Tue, May 03, 2005 at 02:00:56PM +0300, Vladimir A. Podgorny wrote:
Вывод одинаковый везде. А вот и нет. Думаю, что исторические наслоения тама по-любому есть.
-- Best regards, Paul Arakelyan. =================================================================== uanog mailing list. To Unsubscribe: send mail to majordomo@uanog.kiev.ua with "unsubscribe uanog" in the body of the message
participants (10)
-
Alexander Trotsai
-
Bohdan Vlasyuk
-
Dmitry Kiselev
-
Gregory Edigarov
-
Michael Petuschak
-
Oleg V. Nauman
-
Paul Arakelyan
-
Pavel Gulchouck
-
Valentin Nechayev
-
Vladimir A. Podgorny