From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,e69b1607f6b094b7 X-Google-Attributes: gid1164f8,public From: "Laurent Yuric" Subject: Re: how to obtain ethernet address Date: 1997/06/05 Message-ID: <01bc7193$abe9d1d0$66190439@bordeaux>#1/1 X-Deja-AN: 246311518 References: <5n1t8s$2kf@slider.bme.ri.ccf.org> Organization: SITA Newsgroups: comp.sys.dec I was looking for a similar program on HP-UX. I think it may work as well on an Alpha machine (please let me know). -----------begin------------- | #include | #include | #include | #include | | int main() | { | int lan; | struct fis f; | | if ((lan = open("/dev/lan0", O_RDONLY)) == -1) { | printf("Can't open /dev/lan0\n"); | exit(1); | } | f.reqtype = LOCAL_ADDRESS; | if (ioctl(lan, NETSTAT, &f) == -1) { | printf("ioctl failed\n"); | exit(1); | } | printf("LAN Address = 0x%02x%02x%02x%02x%02x%02x\n", | f.value.s[0], | f.value.s[1], | f.value.s[2], | f.value.s[3], | f.value.s[4], | f.value.s[5]); | exit(0); | } ------------end-------------- You may have to be root to run this program. Laurent --------------------------------------------------------------------------- Laurent YURIC, SITA - Research and Development Sophia Antipolis (FRANCE) --------------------------------------------------------------------------- Michael C. Vergallen wrote in article ... > On 3 Jun 1997 20:02:36 GMT, Eric LaPresto wrote: > >Does anyone know of a way to read the Ethernet (MAC) address > >of an Alpha running Digital Unix 4.0 through a C > call? > Okey, let me make a sugestion you could try to find the source of 'route' > and have a look at the source. I don't have it on line now so I can't > really help you at the moment but their is a version of route available in > source and it does such a call to read the Ethernet address. Have a look for > 'net-tools*.tar.gz' where * stands for the version number. > > Michael > -- > Michael C. Vergallen A.k.A. Mad Mike, > Sportstraat 28 http://www.double-barrel.be/mvergall/ > B 9000 Gent ftp://ftp.double-barrel.be/pub/linux/ > Belgium tel : 32-9-2227764 Fax : 32-9-2224976 > >