EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: NetBSD: implementation of"osiSockDiscoverInterfaceAddresses()"
From: "David Dudley" <[email protected]>
To: <[email protected]>
Date: Thu, 24 Aug 2006 13:07:32 -0500
I've got the file rewritten to use the "getifaddrs" function, and it's working great.  Ended up being smaller and simpler than the original, as well (probably only because now I understand how it works).

I agree that the original code probably only need some kind of tweak, and I'll look into that when I'm farther along in getting the port actually working properly.  But for right now, a quick and dirty fix was just to rewrite the code.  I can see that this may create a problem in the future, as this function is a BSD call that doesn't appear to be in Linux (although a google search shows references to redhat's website - probably just talking about what it does), so it won't be portable across OS's that don't meet BSD standards, but FreeBSD, OpenBSD, and NetBSD (along with osBSD/386 and BSD 4.3 and 4.4 variants seem to all have it).

For the moment ... it's doing its job.
Now, on to the next problem.  why dbNameToAddr fails even though I can do a dbl and see the data point names.  Probably something else simple.

David

>>> "Jeff Hill" <[email protected]> 08/24/06 10:46 AM >>>

David,

Currently we have needed only these two versions.

libCom/osi/os/default/osdNetIntf.c
libCom/osi/os/win32/osdNetIntf.c

Currently all of the UNIX systems have found the default version to be
sufficient after allowing for some small os dependent variations in the
implementation of ifreq_size().

> On NetBSD, this function returns information that is "inconsistent" with
> Linux, I believe.

As I understand it Darwin (MAC OSX) is working fine with the default
osdNetIntf.c but it does need the more advanced implementation of
ifreq_size(). Be careful to have a look at the two variants of ifreq_size()
and make certain that a proper implementation is selected for NetBSD. If
ifreq_size() was wrong you might see complete garbage in the returned
structures.

This is the default:
epics\base\src\libCom\osi\os\alpha\osdSock.h(70):
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
  
Here is Darwin (probably the closest relative of NetBSD supported so far):
epics\base\src\libCom\osi\os\Darwin\osdSock.h(80):
#define ifreq_size(pifreq) ((pifreq)->ifr_addr.sa_len +
sizeof((pifreq)->ifr_name))
  
Linux:
epics\base\src\libCom\osi\os\Linux\osdSock.h(93):
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
  
Nevertheless, the source is organized so that you could easily provide an
osdNetIntf.c override in libCom/osi/os/NetBSD based on getifaddrs should
that prove to be necessary. 

An implementation based on getifaddrs might be useful but perhaps not yet a
portability bullet as it is not in, for example, my latest vxWorks at hand
(vxWorks 5.4) nor in http://www.opengroup.org/pubs/online/7908799/.

Jeff





BEGIN:VCARD
VERSION:2.1
X-GWTYPE:USER
FN:David Dudley
TEL;WORK:880-3740
ORG:;MIS
TEL;PREF;FAX:880-3741
EMAIL;WORK;PREF;NGW:[email protected]
N:Dudley;David
END:VCARD


Navigate by Date:
Prev: Re: VME Bus Error handling on MVME3100 and 6100 boards Kate Feng
Next: Re: VME Bus Error handling on MVME3100 and 6100 boards Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: ezca and ENUM Mark Rivers
Next: NetBSD: looks like it running properly. Now for a Display Manager David Dudley
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024