*BSD News Article 63641


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.cis.okstate.edu!news.ksu.ksu.edu!news.mid.net!sbctri.tri.sbc.com!newspump.wustl.edu!nntp.coast.net!oleane!jussieu.fr!Newsmaster
From: slt@lpbcsun.lpbc.jussieu.fr (Stephane Tsacas)
Newsgroups: comp.unix.questions,comp.unix.bsd,comp.unix.internals,comp.sys.sun.apps,alt.unix.wizards,can.sun-stroke,alt.sys.sun
Subject: Re: Interface MAC address SunOS 4.1.3
Date: 15 Mar 1996 21:06:50 +0000
Organization: LPBC Jussieu, univ. Paris 6
Lines: 39
Sender: slt@lpbcsun.lpbc.jussieu.fr
Message-ID: <p4trqukut.fsf@lpbcsun.lpbc.jussieu.fr>
References: <4ia1rs$1j1@sol.sun.csd.unb.ca>
NNTP-Posting-Host: lpbcsun.lpbc.jussieu.fr
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
In-reply-to: phowlett@opie.ASG.unb.ca's message of 14 Mar 1996 21:08:12 GMT
X-Newsreader: Gnus v5.1
Xref: euryale.cc.adfa.oz.au comp.unix.questions:78820 comp.unix.bsd:16770 comp.unix.internals:9895 comp.sys.sun.apps:12788 alt.unix.wizards:3317 alt.sys.sun:10105

In article <4ia1rs$1j1@sol.sun.csd.unb.ca> phowlett@opie.ASG.unb.ca (Peter Howlett) writes:

[...]
   This is great for Net/FreeBSD, the sa_data contains the MAC,
   but the SunOS box only returns AF_INET ifreq's in the buffer.
   Hmmmm. so how do I get the ethernet MAC address of an interface
   out of the !@#$% SunOS kernel? Any pointers greatly appreciated...

I've got it... :
adb -k /vmunix /dev/mem 
physmem 3fb1
le_softc/X
_le_softc:
_le_softc:      ff005000
0xff005000+0t112/X
0xff005070:     8002071
0xff005074:     d5010000

First component of struct le_softc is a struct arpcom which starts by:
struct	arpcom {
	struct	ifnet ac_if;		/* network-visible interface */
	struct	ether_addr ac_enaddr;	/* ethernet hardware address */
	struct	in_addr ac_ipaddr;	/* copy of ip address- XXX */
...

and sizeof(struct ifnet) = 112 

Don't ask me if the machine has more than one interface...

  ,
Stephane
ps; references: netinet/if_ether.h, net/if.h, sunif/le_var.h
-- 

Stephane Tsacas			slt@curie.fr
Institut Curie			slt@lpbcjussieu.fr
26 rue d'Ulm			Phone: (33-1) 4234 6772 (W)
75231 cedex 5 Paris	 	40510636(fax) 4828 4994 (H)
France				<<PUSHJ P, POPJ P, recursively>>