Unix Technical Forum

Mac Adress. How to get it ?

This is a discussion on Mac Adress. How to get it ? within the Sco Unix forums, part of the Unix Operating Systems category; --> Hi all, Can anyone tell me the name of a C function to get the MAC adress ? TIA ...


Go Back   Unix Technical Forum > Unix Operating Systems > Sco Unix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-15-2008, 11:51 AM
Joćo Natal
 
Posts: n/a
Default Mac Adress. How to get it ?

Hi all,

Can anyone tell me the name of a C function to get the MAC adress ?

TIA

--


Joao Natal
jnatal@dcsoftware.pt
D&C Software, Lda.
www.dcsoftware.pt
Rua do Espido, 164 C - 3o Salas 496/7/8
4470-177 Maia
Phone: +351 22 943 92 50
Fax: +351 22 943 92 51



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-15-2008, 11:52 AM
Roberto Zini
 
Posts: n/a
Default Re: Mac Adress. How to get it ?

Joćo Natal wrote:
> Hi all,
>
> Can anyone tell me the name of a C function to get the MAC adress ?
>
> TIA
>


Well, dunno about a 'C' function but perhaps a simple system(S) with

ifconfig <if_name> | awk '/ether/ { print $2 }'

will do.

Best,
Roberto
--
Roberto Zini - Technical Support Manager - email:r.zini<AT>strhold.it
Technical Support Manager -- Strhold Evolution Division R.E. (ITALY)
---------------------------------------------------------------------
"Has anybody around here seen an aircraft carrier?"
(Pete "Maverick" Mitchell - Top Gun)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-15-2008, 11:52 AM
John Boland
 
Posts: n/a
Default Re: Mac Adress. How to get it ?

"Joćo Natal" <jnatal@dcsoftware.pt> wrote in message news:<3f8d665b$0$5481$a729d347@news.telepac.pt>...
> Hi all,
>
> Can anyone tell me the name of a C function to get the MAC adress ?


How about using ndstat and grabbing the mac address from there?

John
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-15-2008, 11:52 AM
maanas
 
Posts: n/a
Default Re: Mac Adress. How to get it ?

You can try opening the device node with "MACIOC_GETADDR" ioctl. On
SCO5 this ioctl must be supported by all the mdi drivers.

-M
"Joćo Natal" <jnatal@dcsoftware.pt> wrote in message news:<3f8d665b$0$5481$a729d347@news.telepac.pt>...
> Hi all,
>
> Can anyone tell me the name of a C function to get the MAC adress ?
>
> TIA
>
> --
>
>
> Joao Natal
> jnatal@dcsoftware.pt
> D&C Software, Lda.
> www.dcsoftware.pt
> Rua do Espido, 164 C - 3o Salas 496/7/8
> 4470-177 Maia
> Phone: +351 22 943 92 50
> Fax: +351 22 943 92 51

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:44 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com