C Program For Mac Address

Active9 years, 11 months ago

Hello there, I wish to obtain the MAC address of the primary ethernet card on a Solaris OS via C. This program is invoked many times/second so calling an external program is not really suitable. The MAC address is being obtained for the purpose of providing a low-level software lock/key system (low level meaning I am aware it's relatively trivial to circumvent). And How to get MAC Address using C++ program), In this article we are going to learn how to set MAC Address using C++ program in Linux Devices? Note: Since MAC address is assigned through manufacturer of the product, but if you are writing code for an embedded devices and needs to.

C programming get mac address windows

i want to find the mac address using a C program in linux. how to do it?

ProgramDale

C Programming Print Mac Address

9,1018 gold badges46 silver badges81 bronze badges
Rohit BangaRohit Banga
11.1k24 gold badges92 silver badges170 bronze badges

2 Answers

1 minute of searching throug google: (i haven't tested it myself, i'm working on a windows machine in the moment)

nuriaionnuriaion
2,2011 gold badge20 silver badges18 bronze badges

C Program To Display Mac Address

There is a great library to manage ethernet.If You want go to low level stuff its certainly worth to learn.It's quite hard C API to learn.

Lib PCAP.

C Program To Validate Mac Address

Some sample code:

There's also nice 'kernel functions wrapper' like library:DNET

which provides great functionality to use it on low level networking.(also getting MAC addresses).

There are UNIX & win ports for both libraries.

buabua
3,9991 gold badge18 silver badges28 bronze badges

Not the answer you're looking for? Browse other questions tagged clinux or ask your own question.