Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining MAC address from within a program 1

Status
Not open for further replies.

tllintx

Programmer
Joined
Aug 7, 2000
Messages
10
Location
US
I need to obtain my MAC address from within a C program running on AIX. I know I can get the information from the shell using the 'netstat -i' or 'lscfg -vl ent0' commands. But how do I use one of those commands or another command within my code?<br><br>Thanks!<br>TLL
 
tllintx,<br><br>Have a look at popen(), this is a function that lets you run an external command and then read its output line by line.<br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Why do you need the MAC address ???<br><br> <p> Tony ... aka chgwhat<br><a href=mailto:tony_b@technologist.com>tony_b@technologist.com</a><br><a href= > </a><br>When in doubt,,, Power out...
 
We have an old home-grown system that still communicates IEEE 802.3. It needs to know our mac address so it can respond to us correctly. so I need to be able to retrieve that information while processing so it can be relayed to the older system.
 
did the popen() idea help you or would you like some more info?
 
I haven't tried it yet. But any additional information would be great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top