Getting all of the MAC addresses of a computer

Hi!
I would like to ask for help with getting all the MAC addresses of a computer. I just need a "hello world!" type program, wich lists the mac addresses. Any suggestions?
Thanks.
That is OS dependent. What OS are you using?
It's Ubuntu.
ifconfig =)
man 2 ioctl_list

search for SIOCGIFCONF to get a list of interfaces from the kernel
search for SIOCGIFHWADDR to get the mac address associated with a given interface

be sure to use SIOCGIFHWADDR for interfaces that are of family PF_INET.

hey, jsmith, do you happen to do some kind *nix system programming for work? Or perhaps you maintain an open source OS in your spare time?

You seem to have a wealth of knowledge on *nix arcana and machine level details - I have to dust off Stevens to get anything close to what seems to just spill out of you!

I was just wondering because there is so much in that tome that I should really spend the time to read/learn... ...speaking of which, I think I will go find Stevens and leave it next to my computer so I can read it bit by bit in between compiles!
Yes, I've been doing unix programming since 1992 and linux specifically for almost as long.
v.nice - it's encouraging to see such a veteran developer onboard!

Have you done systems/kernel/drivers work on Linux or mostly application development?
Quite a bit of both... I have done some driver development and understand how the kernel scheduler works, how sockets work and how a few other things work even if I haven't
written any code in those parts.

The majority of my coding is at the application level though.
Topic archived. No new replies allowed.