Changing MAC address in Linux

In Linux, we can use ifconfig to change MAC address.

But, my project must have feature of changing MAC address of a network interface in Linux. If success, the program will display successful message by using GUI, else it will display error message by GUI.

Any C++ codes or library can do this?
If you can't find examples of this online somewhere (a few quick googles didn't
find much for me), then you have two options.

1) download the source code for ifconfig and see how it does it;

2) strace ifconfig and see what IOCTL request it issues to set the address,
then look that up.

Topic archived. No new replies allowed.