🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.linux.programowanie
Article #60325

Re: mac adres

#60325
From: Irek
Date: Thu, 17 Nov 2005 13:30
37 lines
2168 bytes
Dnia Mon, 07 Nov 2005 19:04:30 +0000, Tomasz Torcz napisał(a):

>  Dzięki, Kuba_O, za post o treści: 
>> 03.11.2005, Abanowicz Tomasz:
>>>  Witajcie
>>>  W jaki sposob w C
>>>  moge wyciagnac
>>>  adresy macowe
>>>  wszystkich kart
>>>  sieciowych ?
>>
>> Pierwsze co mi przychodzi do głowy to wywołanie ifconfig i obróbka
>> wyników, nie jest to oczywiście sexowny sposób i wymaga roota. Ale co
>> tam...
> 
>  Ależ gdzie tam! ~% strace -etrace=ioctl /sbin/ifconfig ep0
> ioctl(5, SIOCGIFFLAGS, 0xbf8ce740)      = 0
> ioctl(5, SIOCGIFHWADDR, 0xbf8ce740)     = 0
> ioctl(5, SIOCGIFMETRIC, 0xbf8ce740)     = 0
> ioctl(5, SIOCGIFMTU, 0xbf8ce740)        = 0
> ioctl(5, SIOCGIFMAP, 0xbf8ce740)        = 0
> ioctl(5, SIOCGIFMAP, 0xbf8ce740)        = 0
> ioctl(5, SIOCGIFTXQLEN, 0xbf8ce740)     = 0
> ioctl(4, SIOCGIFADDR, 0xbf8ce740)       = 0
> ioctl(4, SIOCGIFDSTADDR, 0xbf8ce740)    = 0
> ioctl(4, SIOCGIFBRDADDR, 0xbf8ce740)    = 0
> ioctl(4, SIOCGIFNETMASK, 0xbf8ce740)    = 0
> ep0       Link encap:Ethernet  HWaddr 00:07:E9:15:0E:CB 
> 	[...]
> 
>  Pomijający to, że w Linuksie wystarczy cat /sys/class/net/*/address

Wystarczy też:

$/usr/bin/ifconfig eth0 | grep HWaddr

Pozdr.
Technical Details
Message-ID: <pan.2005.11.17.13.30.40.732811@op.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
References: <dkcpau$1lls$1@news.rtcomm.ru> <slrndmv983.4j1.this@localhost.localdomain> <slrndmv93q.3mp.zdzichu@mother.invalid>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!newsfeed.tpinternet.pl!nemesis.news.tpi.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
From: Irek <write2me_bez_spamu_@op.pl>
Newsgroups: pl.comp.os.linux.programowanie
Subject: Re: mac adres
Date: Thu, 17 Nov 2005 14:30:42 +0100
Organization: tp.internet - http://www.tpi.pl/
Lines: 39
Message-ID: <pan.2005.11.17.13.30.40.732811@op.pl>
References: <dkcpau$1lls$1@news.rtcomm.ru> <slrndmv983.4j1.this@localhost.localdomain> <slrndmv93q.3mp.zdzichu@mother.invalid>
NNTP-Posting-Host: ask70.internetdsl.tpnet.pl
Mime-Version: 1.0
X-Trace: atlantis.news.tpi.pl 1132234804 10610 83.17.222.70 (17 Nov 2005 13:40:04 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Thu, 17 Nov 2005 13:40:04 +0000 (UTC)
User-Agent: Pan/0.14.2.91 (As She Crawled Across the Table)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit