[CalendarServer-dev] Re: [CalendarServer-changes]
 CalendarServer/branches/users/cdaboo/od-schema-1044/twistedcaldav/ dir
cdaboo at apple.com
Wed Jan 17 19:06:10 PST 2007
--On January 17, 2007 6:12:37 PM -0800 Wilfredo Sánchez Vega
<wsanchez at wsanchez.net> wrote:
> This bit assumes that en0 is the interface being used by the server.
> You actually want to check each interface used by each of the IP
> addresses in config.BindAddresses.
> Anyone know how to lookup a MAC address in python?
> This looks potentially promising, but I can't grok it and it didn't
> work on my machine:
> Seems like this should be doable without forking...
I still think using ifconfig is feasible. Just do it without the interface
parameter. That will list all interfaces, their status, bound IP and MAC
address. We can do a better job of parsing to pick the one bound to the IP
we are interested in.
However, it is possible for a server to be bound to more than one, so which
MAC to use in that case? Probably have to try all of them in queries
against the directory and see which records come back.
The alternative of course is to hard code the OD record name for the server
in the config and not rely on MAC at all.
I'm not sure what was up with that code - I do have C code that does
exactly that in Mulberry.
More information about the calendarserver-dev