From: John Smith on
I'd like to find the mac address of my machine running solaris 10 (currently
on x86). Is there a way to do this programatically?

Thanks in advance.

-- John


From: jamesonang@gmail.com on
send a netbios query packet can do it. but i also want to know how to
implement it

From: John Smith on
I found two sources which looks interesting:

This seems almost the same way as I implemented it under linux:
http://rpms.alerque.com/BUILD/ooo-build-1.9.104/build/src680-m104/sal/osl/unx/util.c

I didn't test it yet because of lack of time.

Instead I went into the source code of ifconfig and wanted to do the same
way as the OS itself.

http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c#print_ifether

However theres a lot of code to rip and I got stuck with libdlpi. It seems
libdlpi and it's header file are not installed on my solaris and I failed to
find out how to do it. Of course I could just grab it's source and do it
myself but I would guess theres a better way. Any pointers are apreciated.

If you get either of these methods working I'd be interested in hearing
about it.

-- John


From: Carlos on


John Smith wrote:
> I found two sources which looks interesting:
>
> This seems almost the same way as I implemented it under linux:
> http://rpms.alerque.com/BUILD/ooo-build-1.9.104/build/src680-m104/sal/osl/unx/util.c
>
> I didn't test it yet because of lack of time.
>
> Instead I went into the source code of ifconfig and wanted to do the same
> way as the OS itself.
>
> http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c#print_ifether
>
> However theres a lot of code to rip and I got stuck with libdlpi. It seems
> libdlpi and it's header file are not installed on my solaris and I failed to
> find out how to do it. Of course I could just grab it's source and do it
> myself but I would guess theres a better way. Any pointers are apreciated.
>
> If you get either of these methods working I'd be interested in hearing
> about it.
>
> -- John
>
>

I use DLPI now, I used to parse the output of arp `hostname` (or
something like that).

From: Robert Harris on
John Smith wrote:
> I found two sources which looks interesting:
>
> This seems almost the same way as I implemented it under linux:
> http://rpms.alerque.com/BUILD/ooo-build-1.9.104/build/src680-m104/sal/osl/unx/util.c
>
> I didn't test it yet because of lack of time.
>
> Instead I went into the source code of ifconfig and wanted to do the same
> way as the OS itself.
>
> http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c#print_ifether
>
> However theres a lot of code to rip and I got stuck with libdlpi. It seems
> libdlpi and it's header file are not installed on my solaris and I failed to
> find out how to do it. Of course I could just grab it's source and do it
> myself but I would guess theres a better way. Any pointers are apreciated.
>
> If you get either of these methods working I'd be interested in hearing
> about it.
>
> -- John
>
>
Under Linux, you call ioctl with the option SIOCGIFHWADDR
It is documented in netdevice(7). I suspect Solaris might well be similar.

Robert