Commit Graph

34 Commits

Author SHA1 Message Date
phantom
3cec8471a2 . Convert return type of gai_strerror() to 'const char *' as POSIX requires.
. Convert ai_errlist[] to simple 'char *' array, and appropriately
  optimize gai_strerror()
2005-02-14 11:33:12 +00:00
ume
62a74f5556 implement AI_NUMERICSERV (as defined in RFC3493).
Obtained from:	KAME
MFC after:	1 week
2005-01-27 14:45:11 +00:00
green
fafcdc5a49 Make the resolver(3) and many associated interfaces much more reentrant.
The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now
with what should be totally reentrant, and h_errno values will now
be preserved correctly, but this does not affect interfaces such as
gethostbyname(3) which are still mostly non-reentrant.

In all of these relevant functions, the thread-safety has been pushed
down as far as it seems possible right now.  This means that operations
that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected
still under global locks that getaddrinfo(3) defines, but where possible
the locking is greatly reduced.  The most noticeable improvement is
that multiple DNS lookups can now be run at the same time, and this
shows major improvement in performance of DNS-lookup threaded programs,
and solves the "Mozilla tab serialization" problem.

No single-threaded applications need to be recompiled.  Multi-threaded
applications that reference "_res" to change resolver(3) options will
need to be recompiled, and ones which reference "h_errno" will also
if they desire the correct h_errno values.  If the applications already
understood that _res and h_errno were not thread-safe and had their own
locking, they will see no performance improvement but will not
actually break in any way.

Please note that when NSS modules are used, or when nsdispatch(3)
defaults to adding any lookups of its own to the individual libc
_nsdispatch() calls, those MUST be reentrant as well.
2004-02-25 21:03:46 +00:00
ume
c71a499f64 remove EAI_NODATA aliased to EAI_NONAME.
PR:		bin/61369
2004-01-15 15:10:02 +00:00
ume
de255ea66f style.
Reported by:	bde
2003-10-24 06:53:12 +00:00
ume
1bb5f2c8d8 oops, EAI_NONAME is not EAINONAME. 2003-10-24 03:49:38 +00:00
ume
2546a3c06c workaround to have backward compatibility for EAI_NODATA.
it will be removed on 23 Apr 2004.

Submitted by:	terry
2003-10-23 17:54:17 +00:00
ume
ba5931007a oops, I forget to diable EAI_ADDRFAMILY and EAI_NODATA. 2003-10-23 16:11:46 +00:00
ume
0c85c7ec36 stop use of NI_WITHSCOPEID. it was deprecated.
Obtained from:	KAME
2003-10-21 20:11:47 +00:00
mike
5d0fbddc4d o Merge <machine/ansi.h> and <machine/types.h> into a new header
called <machine/_types.h>.
o <machine/ansi.h> will continue to live so it can define MD clock
  macros, which are only MD because of gratuitous differences between
  architectures.
o Change all headers to make use of this.  This mainly involves
  changing:
    #ifdef _BSD_FOO_T_
    typedef	_BSD_FOO_T_	foo_t;
    #undef _BSD_FOO_T_
    #endif
  to:
    #ifndef _FOO_T_DECLARED
    typedef	__foo_t	foo_t;
    #define	_FOO_T_DECLARED
    #endif

Concept by:	bde
Reviewed by:	jake, obrien
2002-08-21 16:20:02 +00:00
imp
b2c50a496f Minor libc internal-only interface change for mapv4v6. 2002-06-26 08:18:42 +00:00
imp
f05b530a33 Breath deep and take __P out of the system include files.
# This appears to not break X11, but I'm having problems compiling the
# glide part of the server with or without this patch, so I can't tell
# for sure.
2002-03-23 17:24:55 +00:00
bde
caadb350d7 Fixed order of includes. <sys/cdefs.h> must be included before
<machine/ansi.h> for the definition of __signed, unless the compiler
is gcc.

Moved the declaration of socklen_t up together with the declaration of
size_t, and removed low-quality comment about this declaration.  Declaring
socklen_t in this file is normal in POSIX-1.200x, unlike declaring size_t.
2001-10-04 10:34:30 +00:00
obrien
cf421bdc3f style(9) the structure definitions. 2001-09-05 01:36:46 +00:00
mike
4f729d6b83 Remove namespace pollution.
PR:		14327
Reviewed by:	des
Approved by:	des
MFC after:	7 days
2001-07-22 18:10:08 +00:00
alfred
a44e6455e2 give the "netgrent" functions a home in netdb.h 2001-03-27 09:49:03 +00:00
ume
0d70c14a65 Nuke non-standard EAI_RESNULL. 2001-03-17 14:25:23 +00:00
ume
d06c8a8880 Enable AI_ADDRCONFIG as a valid flag of getaddrinfo(3). Some
applications specify AI_ADDRCONFIG and fail to run under FreeBSD.
Latest mews is known.  Now, getaddrinfo(3) behaves according to
AI_ADDRCONFIG.
2001-02-19 13:13:51 +00:00
ume
eec882b4a9 Correct 2nd argument of getnameinfo(3) to socklen_t.
Reviewed by:	itojun
2001-02-15 10:35:55 +00:00
nectar
4ded299256 Add nsswitch support. By creating an /etc/nsswitch.conf file, you can
configure FreeBSD so that various databases such as passwd and group can be
looked up using flat files, NIS, or Hesiod.

= Hesiod has been added to libc (see hesiod(3)).

= A library routine for parsing nsswitch.conf and invoking callback
  functions as specified has been added to libc (see nsdispatch(3)).

= The following C library functions have been modified to use nsdispatch:
    . getgrent, getgrnam, getgrgid
    . getpwent, getpwnam, getpwuid
    . getusershell
    . getaddrinfo
    . gethostbyname, gethostbyname2, gethostbyaddr
    . getnetbyname, getnetbyaddr
    . getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr

= host.conf has been removed from src/etc.  rc.network has been modified
  to warn that host.conf is no longer used at boot time.  In addition, if
  there is a host.conf but no nsswitch.conf, the latter is created at boot
  time from the former.

Obtained from:	NetBSD
2000-09-06 18:16:48 +00:00
shin
1d5c2a4d2d Change IPv6 address scope delimeter from '@' to '%' as recent KAME change.
'@' conflicts with existing notations such as user@host, so '%' is better.

Approved by: jkh

Obtained from: KAME project
2000-02-08 05:12:45 +00:00
shin
2958040f73 Getaddrinfo(), getnameinfo(), and etc support in libc/net.
Several udp and raw apps IPv6 support.

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
1999-12-28 02:37:14 +00:00
peter
fdf6ebea46 $Id$ -> $FreeBSD$ 1999-08-27 23:45:13 +00:00
peter
47931ccb07 Update nameserver interface to bind-8.1.2 levels. We do not use IRS (yet?)
since it has far wider impact than hostname lookups (including passwords).
Note that this has more ugly symbol hiding and binary compatability hacks
that can go away the second we bump majors.

Obtained from:  Mostly from diff against ISC bind-8.1.2 sources
1998-06-11 08:55:17 +00:00
steve
dc1265352a Make this compile with the -traditional cc flag.
PR:		misc/2189
Submitted by:	Lars Koeller <Lars_Koeller@odie.physik2.uni-rostock.de>
1997-08-16 23:32:42 +00:00
peter
07c1c7a86d merge in bind-4.9.6 changes (only effect is __res_send #define reverted) 1997-06-27 08:32:38 +00:00
peter
0e0dfca0f9 Revert $FreeBSD$ to $Id$ 1997-02-23 09:21:14 +00:00
jkh
9c0cd3f9df Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
peter
7fd89256f8 Update the resolver definitions from bind-4.9.4-P1 to 4.9.5-P1 level.
(More commits to come)
1996-12-30 13:08:54 +00:00
peter
c6b65eb556 Hand merge in the bind-4.9.4-P1 resolver updates. 1996-08-29 20:01:00 +00:00
mpp
882eb5d844 Fix a bunch of spelling errors in the comment fields
of a bunch of system include files.
1996-01-30 23:33:04 +00:00
peter
53fa6cfd89 Update the resolver include files to bind-4.9.3-beta24 level (from beta9p1)
Note: this was done by selective patching from diffs by hand, in order
to not conflict with the 4.4BSD base code.  Beta9 was done the same way.

Obtained from:	Paul Vixie <paul@vix.com>
1995-08-20 19:59:28 +00:00
rgrimes
8988b74eb8 Remove trailing whitespace. 1995-05-30 05:05:38 +00:00
rgrimes
a6ce65d368 BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00