unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Patch for network-interface-{list,info}
Date: 18 Nov 2003 10:46:33 +0100	[thread overview]
Message-ID: <m3oeva57ra.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <8765hi2pl7.fsf@Dora.local.>

Alex Plotnick <shrike@netaxs.com> writes:

> storm@cua.dk (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.

We really want emacs to be as portable as possible, and that includes
the Emacs Lisp code.  So if you say that getifaddrs is not really as
widely available as SIOCGIFCONF -- and getifaddrs has its own problems
with portability (as you indicate below) -- I think we should keep
SIOCGIFCONF as a fallback -- at least for the moment.

Of course, the version based on SIOCGIFCONF will also have to be
reworked to return the additional information like the getifaddrs
version will do.

> 
> > 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.

This doesn't sound very portable to me.  Is there any way to know how
a given getifaddrs behave in this respect?

> 
> > 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.

Good, thanks.

> 
> > 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.

Richard?

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  parent reply	other threads:[~2003-11-18  9:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87ad6w2hm6.fsf@Dora.local.>
2003-11-17 12:23 ` Patch for network-interface-{list,info} Kim F. Storm
2003-11-18  5:49   ` Alex Plotnick
     [not found]   ` <8765hi2pl7.fsf@Dora.local.>
2003-11-18  9:46     ` Kim F. Storm [this message]
2003-11-16 20:17 Alex Plotnick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3oeva57ra.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).