emacs-devel
[Top][All Lists]
Advanced

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

Re: Patch for network-interface-{list,info}


From: Alex Plotnick
Subject: Re: Patch for network-interface-{list,info}
Date: Tue, 18 Nov 2003 00:49:40 -0500
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (darwin)

address@hidden (Kim F. Storm) writes:

> It's definitely a cleaner interface, yes, and maybe it is as widely
> available as SIOCGIFCONF these days...?

I agree that it's much cleaner.  As far as I know, the free BSDs all have
it, and it's in glibc on GNU/Linux.  Irix doesn't have it; I don't know
about Solaris.

> But in any case, since network-interface-list is a new addition in CVS
> emacs, I think it would be alright for us to restrict its availability
> to those systems which do support getifaddrs.

This seems reasonable to me.  If anyone knows of a good reason why this is
not an acceptable course of action, please let me know.

> How does getifaddrs return the hw address?  In ifaddr->ifa_data ?
> Is that portable?  If not, maybe it could use SIOCGIFHWADDR as 
> a fallback.

getifaddrs() actually returns *two* entries for each interface: one
describes the layer-3 address, and the other the link-layer address.  Which
one is which is determined by examining the sa_family of the given sockaddr
(ifa_addr).  On BSD, this sockaddr is actually a struct sockaddr_dl and has
family AF_LINK, whereas on GNU/Linux it's an AF_PACKET and is described by
a struct sockaddr_ll.  There's no need to muck around with the raw ifa_data
field.

> If you want to modify network-interface-list and -info according to
> the suggestions above, I would appreciate it.

I'll send a patch in the next day or two.

> Are you interested in signing papers for your changes?

This is no problem.  If the relevant party contacts me privately via email,
I'll be happy to provide a mailing address for whatever paperwork is
necessary.

Thanks,

        Alex Plotnick





reply via email to

[Prev in Thread] Current Thread [Next in Thread]