[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] How to get ethernet addr macperl?



At 10:50 AM -0500 12/17/98, Geoffrey C Kinnel wrote:
>After some further research, I found two Toolbox calls:
>
>EGetInfo and OTGetProtAddress. These are documented in Inside Macintosh,
>and there is a code example (in C) of the second call in use. It's not
>for the weak. :)

I think we left the weak behind when we mentioned 'use the toolbox, Luke'.

>
>Unless there's a way to get MacPerl to call an arbitrary Toolbox call,
>you'd have to use a C routine via XS, I imagine.
>
><http://developer.apple.com/techpubs/mac/Networking/Networking-278.html>
>for EgetInfo information.
>
><http://developer.apple.com/technotes/tn/tn1103.html#Ethernet> for
>pointers to the OT calls.
>

For those of you still bothering to pay attention ...

I earlier wrote :
>
>After a bit of research, I found
>http://developer.apple.com/techpubs/mac/NetworkingOT/NetworkingWOT-383.html#MAR
>K
>ER-9-42
>
>which describes the Internet Interface Information Structure.  You can get
>such a structure from the OTInetGetInterfaceInfo function.  This structure
>includes:
>
>fHWAddrLen
>    The length (in bytes) of the hardware address. This points into the
>fReserved field of this structure.  It can be nil if the interface has no
>hardware address or if it won't fit.
>
>fHWAddr
>    A pointer to the hardware address.


Some further further research
http://developer.apple.com/techpubs/mac/NetworkingOT/NetworkingWOT-56.html#MARKE
R-13-79

(Can we get Chris to grab a banjo and start playing a background of
"Dueling URLs" (Or are they URIs?))
#Begin Quote
OTGetProtAddress

        You use this function with the TCP and UDP protocols.

        If you bind an endpoint to an IP address of kOTAnyInetAddress in
order to accept packets from any valid TCP/IP interface, then the
OTGetProtAddress function always returns an IP address of 0. This is
because in a multihomed machine, there is a separate IP address for each
interface, and there's no way for Open Transport to know which one you
want. In that case, you must use the OTInetGetInterfaceInfo function to
determine the IP address of a running IP interface. On the other hand, if
you bind an endpoint to a specific interface, the OTGetProtAddress function
returns the address of that interface, as expected.
#End Quote

It also looks like EgetInfo might only work with NuBus ethernet cards?

So, for someone running on a multi-homing machine, it might be a good idea
to Really REALLY know what you're doing when you start looking for hardware
ethernet addresses.

-Jeff Lowrey



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch