Article View: aus.computers.linux
Article #56336Re: Program to find the ethernet MAC address
From: John Saunders
Date: Mon, 17 Mar 1997 00:00
Date: Mon, 17 Mar 1997 00:00
19 lines
1408 bytes
1408 bytes
John Saunders <johns@rd.scitec.com.au> wrote:
> Does anybody have a program that can be used to extract the ethernet
> hardware (MAC) address from the ethernet device?
I have found the answer by searching through the kernel sources and
header files. The answer lay in a struct ifreq from <linux/if.h> and
an ioctl() called SIOCGIFHWADDR in <linux/sockios.h>.
It seems this stuff is OS dependant as HPUX doesn't have these.
Cheers.
-- +------------------------------------------------------------+
. | John Saunders mailto:John.Saunders@scitec.com.au (Work) |
,--_|\ | mailto:john@nlc.net.au (Home) |
/ Oz \ | http://www.nlc.net.au/~john/ |
\_,--\_/ | SCITEC LIMITED Phone +61 2 9428 9563 Fax +61 2 9428 9933 |
v | "Very funny, Scotty. Now beam down my clothes." |
+------------------------------------------------------------+
Technical Details
Message-ID:
<5gi9u4$ipm@mailhub.scitec.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<5galqg$5iu@mailhub.scitec.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102983,e830ca81b7bd8de7 X-Google-Attributes: gid102983,public From: johns@rd.scitec.com.au (John Saunders) Subject: Re: Program to find the ethernet MAC address Date: 1997/03/17 Message-ID: <5gi9u4$ipm@mailhub.scitec.com.au> X-Deja-AN: 226067515 References: <5galqg$5iu@mailhub.scitec.com.au> Organization: SCITEC LIMITED, Sydney, Australia. Newsgroups: aus.computers.linux