From: bell@apple.com (Mike Bell)
Subject: Re: Ethernet identifier
Date: Mon, 12 Oct 1992 17:46:44 GMT
Reply-To: bell@apple.com (Mike Bell)
Organization: Apple Computer, Inc.

In article <3797@execu.execu.com>, kenm@execu.execu.com (Kenneth Morse) 
writes:
> Path: gallant.apple.com!mumbo.apple.com!apple!agate!ames!sun-
> barr!cs.utexas.edu!execu!kenm
> From: kenm@execu.execu.com (Kenneth Morse)
> Newsgroups: comp.sys.mac.comm
> Subject: Re: Ethernet identifier
> Message-ID: <3797@execu.execu.com>
> Date: 12 Oct 92 14:01:26 GMT
> References: <sgruby-091092200343@eagle.hm-st.claremont.edu>
> Organization: Comshare, Inc. Austin Development Center
> Lines: 25
> 
> >I am looking for a program that will give me the Ethernet address (not IP
> >address) of a Mac. I want to run the program and determine the machine's
> >ethernet address (from the ethernet card) without having to open up the
> >case.
> >
> >Please respond via email if you know where I can locate a
> >freeware/shareware program that does this.
> >
> >Scott Allen Gruby
> >sgruby@jarthur.claremont.edu
> 
> You can get the Ethernet address by holding down the option key and clicking
> on the Ethernet icon in the MacTCP cdev.
> --
>  
> *********************************************************
> *************
> |   Kenneth Morse                                       COMSHARE, Inc. |
> |   Manager, Desktop Builder Group              US Product Development |
> |   Commander Product Development                 3001 S. State Street |
> |   Phone: 313-994-8020 (direct line)          Ann Arbor, MI 48108 USA |
> |   FAX:   313-994-1373                            Phone: 313-994-4800 | 
> |----------------------------------------------------------------------|
> |   Email                                                              |   
> |     Internet:        kenm@comshare.com                               |
>  
> *********************************************************
> *************
> 


Here is the C code to find it yourself......

#include <Appletalk.h>
#include <ENET.h>
#include <Slots.h>
#include "stdio.h"


main()
{

EParamBlock mypb;
unsigned char mybuf[255];
EParamBlkPtr myptr;
OSErr myerr;
ParamBlockRec pb;
SpBlock  sp;
int ret;
Ptr addr=0L;
int total=0;





 	sp.spSlot=0;
	sp.spID=0;
	sp.spExtDev=0;
	
	sp.spCategory=catNetwork;
	sp.spCType=typeEtherNet;
	sp.spDrvrSW=0;
	sp.spDrvrHW=0;
	sp.spTBMask=0x3;
	
	while(!(ret=SNextTypeSRsrc(&sp))){
		total++;
		pb.slotDevParam.ioCompletion=0L;
		pb.slotDevParam.ioNamePtr="\p.ENET";
		pb.slotDevParam.ioMix=0L;
		pb.slotDevParam.ioFlags=0L;
		pb.slotDevParam.ioSlot=sp.spSlot;
		pb.slotDevParam.ioID=sp.spID;
	    myerr=OpenSlot(&pb,0L);
		mypb.EParms1.csCode=ENetGetInfo;
		mypb.EParms1.ioRefNum=pb.slotDevParam.ioRefNum;
		mypb.EParms1.ePointer=(Ptr)&mybuf;
		mypb.EParms1.eBuffSize=sizeof(mybuf);
		myptr=(EParamBlkPtr)&mypb;

		EGetInfo(myptr,0);
		addr=(Ptr)mybuf;
		// Add code to print it out here....

	}
}





****************************************************************************

Mike Bell										     	       	       	       	  email: bell@apple.com
Senior Engineer
68000 High Performance Software Group
MS 60-CS
Apple Computer, Inc.
20525 Mariani Ave.
Cupertino, CA 95014

****************************************************************************
Newsgroups: comp.sys.mac.comm