• C

How to find out the MAC Address ?

I'd like to know how to find out the MAC Address of a ethernet card in a programatically way.
Does anybody have a C algorithm to do that ?
The program will run in MS-DOS(!!!) environment.
edsontAsked:
Who is Participating?
 
knappblCommented:
You can use the GUIDGEN utility (or the corresponding API call - CoCreateGuid.)  The last section of the GUID that is returned is actually the physical address of your ethernet card.
0
 
lekshmikrCommented:
To get the Media Access Control (MAC) address for an ethernet adapter
programmatically, you can use NetBIOS if your card is bound to NetBIOS. Use
the Netbios() NCBASTAT command and provide a "*" as the name in the
NCB.ncb_CallName field. This is demonstrated in the sample code below.
 
With the NetBEUI and IPX transports, the same information can be obtained
at a command prompt by using:
 
   net config workstation

0
 
edsontAuthor Commented:
The problem is that my application won't have access to any protocols, so I can't use those APIs.

I think I've omitted that the ethernet card that my application will work with is NE2000 compatible.

What I really would like is a routine that could use hardware I/O to get the MAC address of the card.

Maybe I've posted this question in a wrong section . . .

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.