History log of /freebsd-current/include/netdb.h
Revision Date Author Comments
# 5a1d1441 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

include: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 42b38843 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .h pattern

Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/


# 40e4e12b 02-Nov-2022 Mike Karels <karels@FreeBSD.org>

netdb.h: re-enable EAI_ADDRFAMILY, EAI_NODATA

EAI_ADDRFAMILY and EAI_NODATA are not in RFC 3493, but are available
and used in many other systems. It is desirable to have at least one
of them in order to distinguish between names that do not resolve and
those that do not have the requested address type. A change to
getaddrinfo() will use EAI_ADDRFAMILY. Both were "#if 0"; re-enable,
conditioned on __BSD_VISIBLE, and update comments. Also add comments
and __BSD_VISIBLE conditional for the last three EAI errors, which
are not in the RFC or POSIX. Note, all of these are available in
NetBSD and OpenBSD, and EAI_ADDRFAMILY and EAI_NODATA are available
in Linux (glibc).

Reviewed in https://reviews.freebsd.org/D37139 with related changes.

Reviewed by: bz
MFC after: 1 month


# 10d87233 29-Sep-2022 Hajimu UMEMOTO <ume@FreeBSD.org>

corrected RFC numbers in comments to proper ones


# a5dabd6c 23-Dec-2018 Pedro F. Giffuni <pfg@FreeBSD.org>

Fix mismatch from r342379.


# 09ed8047 23-Dec-2018 Pedro F. Giffuni <pfg@FreeBSD.org>

gai_strerror() - Update string error messages according to RFC 3493.

Error messages in gai_strerror(3) vary largely among OSs.

For new software we largely replaced the obsoleted EAI_NONAME and
with EAI_NODATA but we never updated the corresponding message to better
match the intended use. We also have references to ai_flags and ai_family
which are not very descriptive for non-developer end users.

Bring new new error messages based on informational RFC 3493, which has
obsoleted RFC 2553, and make them consistent among the header adn
manpage.

MFC after: 1 month
Differentical Revision: D18630


# 6e778a7e 08-Dec-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

SPDX: license IDs for some ISC-related files.


# 2321c474 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

include: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# b4a395a4 28-Jul-2016 Ed Schouten <ed@FreeBSD.org>

Add NI_NUMERICSCOPE.

POSIX also declares NI_NUMERICSCOPE, which makes getnameinfo() return a
numerical scope identifier. The interesting thing is that support for
this is already present in code, but #ifdef disabled. Expose this
functionality by placing a definition for it in <netdb.h>.

While there, remove references to NI_WITHSCOPEID, as that got removed 11
years ago.


# 714ac002 08-Jun-2016 Mark Johnston <markj@FreeBSD.org>

Implement an NSS backend for netgroups and add getnetgrent_r(3).

This support appears to have been documented in nsswitch.conf(5) for some
time. The implementation adds two NSS netgroup providers to libc. The
default, compat, provides the behaviour documented in netgroup(5), so this
change does not make any user-visible behaviour changes. A files provider
is also implemented.

innetgr(3) is implemented as an optional NSS method so that providers such
as NIS which are able to implement efficient reverse lookup can do so.
A fallback implementation is used otherwise. getnetgrent_r(3) is added for
convenience and to provide compatibility with glibc and Solaris.

With a small patch to net/nss_ldap, it's possible to specify an ldap
netgroup provider, allowing one to query nisNetgroupTriple entries.

Sponsored by: EMC / Isilon Storage Division


# 07acf54b 30-May-2016 Ed Schouten <ed@FreeBSD.org>

Add missing types and constants to <netdb.h>.

According to POSIX, the netdb.h header must also provide in_addr_t and
in_port_t. It should also provide IPPORT_RESERVED. Copy over the
necessary bits from <netinet/in.h> to achieve that.


# b1f9559a 20-Dec-2015 Hajimu UMEMOTO <ume@FreeBSD.org>

addrinfo.ai_family is an address family, not a protocol family.

PR: 162434
MFC after: 1 week


# 2cff354f 18-Dec-2015 Hajimu UMEMOTO <ume@FreeBSD.org>

Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3).
We need to change netdb.h to make it actually enabled.

PR: 198092
MFC after: 1 week


# f6ab8089 13-Dec-2011 Ed Schouten <ed@FreeBSD.org>

Replace __const by const in all non-contributed source code.

As C1X is close to being released, there is no need to wrap around a
feature that is already part of C90. Most of these files already use
`const' in different placed as well.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# 4deeadcb 17-Apr-2010 Hajimu UMEMOTO <ume@FreeBSD.org>

MFC r206155, r206267: Add capability to use a db version of
services. It is enabled by specifying `db' as source of
services in /etc/nsswitch.conf.


# e622b479 04-Apr-2010 Hajimu UMEMOTO <ume@FreeBSD.org>

Add capability to use a db version of services. It is enabled by
specifying `db' as source of service in /etc/nsswitch.conf.

MFC after: 2 weeks


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# f2556687 16-Feb-2010 Warner Losh <imp@FreeBSD.org>

Remove the Berkeley clause 3's.
Add a few $FreeBSD$


# 1a4cc578 14-Mar-2009 David Schultz <das@FreeBSD.org>

Hide numerous BSD extensions in the POSIX namespace.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 1bdf356b 21-May-2006 Hajimu UMEMOTO <ume@FreeBSD.org>

Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1 on 64 bit
arch.

X-MFC after: never


# 734aa104 21-May-2006 Hajimu UMEMOTO <ume@FreeBSD.org>

Return EAI_OVERFLOW instead of EAI_MEMORY when the supplied buffer is
too short. This conforms to RFC3493, POSIX and XPG6.

Obtained from: NetBSD


# 3da59cd0 12-May-2006 Hajimu UMEMOTO <ume@FreeBSD.org>

Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1:

http://www.opengroup.org/onlinepubs/009695399/functions/gethostbyaddr.html

gethostbyaddr_r() is changed as well.
It breaks ABI backward compatibility on 64 bit arch. So, we fix it
on 32 bit arch only for now.

Reported by: Rostislav Krasny <rosti.bsd@gmail.com>


# d3ac2b30 15-Apr-2006 Hajimu UMEMOTO <ume@FreeBSD.org>

- make reentrant version of netdb functions glibc style API, and
expose them to outside of libc.
- make netdb functions NSS friendly.

Reviewed by: arch@ and current@ (no objection)


# 5342d17f 21-Mar-2006 Hajimu UMEMOTO <ume@FreeBSD.org>

Update the resolver in libc to BIND9's one.

Since, res_sendsigned(3) and the friends use MD5 functions, it is
hard to include them without having MD5 functions in libc. So,
res_sendsigned(3) is not merged into libc.

Since, res_update(3) in BIND9 is not binary compatible with our
res_update(3), res_update(3) is leaved as is, except some
necessary modifications.
The res_update(3) and the friends are not essential part of the
resolver. They are not defined in resolv.h but defined in
res_update.h separately in BIND9. Further, they are not called from
our tree. So, I hide them from our resolv.h, but leave them only
for binary backward compatibility (perhaps, no one calls them).

Since, struct __res_state_ext is not exposed in BIND9, I hide it
from our resolv.h. And, global variable _res_ext is removed. It
breaks binary backward compatibility. But, since it is not used from
outside of our libc, I think it is safe.

Reviewed by: arch@ (no objection)


# 85a71a15 22-Jul-2005 Hajimu UMEMOTO <ume@FreeBSD.org>

Remove padding for ABI compatibility of ai_addrlen member
from struct addrinfo. This change break ABI compatibility
on 64 bit arch.


# ad0fab44 02-Jun-2005 Hajimu UMEMOTO <ume@FreeBSD.org>

- Remove padding for ABI compatibility of n_net member from struct
netent.
- Change 1st argument of getnetbyaddr() to an uint32_t on 64 bit
arch as well to confirm to POSIX-2001.

These changes break ABI compatibility on 64 bit arch.
There is similar padding issue for ai_addrlen of struct addrinfo.
However, it is leaved as is for now.

Discussed on: arch@, standards@ and current@
X-MFC after: never


# 2e631cd2 27-May-2005 Hajimu UMEMOTO <ume@FreeBSD.org>

disable defining NI_WITHSCOPEID. It was obsoleted, and was exist
only for backward compatibility since 5.2-RELEASE.


# 036ae3dd 15-May-2005 Hajimu UMEMOTO <ume@FreeBSD.org>

- The ai_addrlen of a struct addrinfo used to be a size_t, per
RFC 2553. In XNS5.2, and subsequently in POSIX-2001 and RFC
3493, it was changed to a socklen_t. And, the n_net of a
struct netent used to be an unsigned long integer. In XNS5,
and subsequently in POSIX-2001, it was changed to an uint32_t.
To accomodate for this while preserving ABI compatibility with
the old interface, we need to prepend or append 32 bits of
padding, depending on the (LP64) architecture's endianness.
- Correct 1st argument of getnetbyaddr() to uint32_t on 32
bit arch. Stay as is on 64 bit arch for ABI backward
compatibility for now.

Reviewed by: das, peter
MFC after: 2 weeks


# bcb131aa 27-Apr-2005 Hajimu UMEMOTO <ume@FreeBSD.org>

hide implementation specific internal functions from netdb.h.
it is needed to make get{host,net}by*() thread-safe.


# ed613866 14-Feb-2005 Alexey Zelkin <phantom@FreeBSD.org>

. Convert return type of gai_strerror() to 'const char *' as POSIX requires.
. Convert ai_errlist[] to simple 'char *' array, and appropriately
optimize gai_strerror()


# c224435e 27-Jan-2005 Hajimu UMEMOTO <ume@FreeBSD.org>

implement AI_NUMERICSERV (as defined in RFC3493).

Obtained from: KAME
MFC after: 1 week


# 33dee819 25-Feb-2004 Brian Feldman <green@FreeBSD.org>

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.


# c77fb521 15-Jan-2004 Hajimu UMEMOTO <ume@FreeBSD.org>

remove EAI_NODATA aliased to EAI_NONAME.

PR: bin/61369


# ff6322f8 24-Oct-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

style.

Reported by: bde


# fdf361fd 23-Oct-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

oops, EAI_NONAME is not EAINONAME.


# 56f88dba 23-Oct-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

workaround to have backward compatibility for EAI_NODATA.
it will be removed on 23 Apr 2004.

Submitted by: terry


# 27f9f419 23-Oct-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

oops, I forget to diable EAI_ADDRFAMILY and EAI_NODATA.


# d24cb249 21-Oct-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

stop use of NI_WITHSCOPEID. it was deprecated.

Obtained from: KAME


# abbd8902 21-Aug-2002 Mike Barcroft <mike@FreeBSD.org>

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


# baefb2ee 26-Jun-2002 Warner Losh <imp@FreeBSD.org>

Minor libc internal-only interface change for mapv4v6.


# bb28f3c2 23-Mar-2002 Warner Losh <imp@FreeBSD.org>

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.


# 3e9c0bd5 04-Oct-2001 Bruce Evans <bde@FreeBSD.org>

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.


# 17923354 04-Sep-2001 David E. O'Brien <obrien@FreeBSD.org>

style(9) the structure definitions.


# e5c24b8e 22-Jul-2001 Mike Barcroft <mike@FreeBSD.org>

Remove namespace pollution.

PR: 14327
Reviewed by: des
Approved by: des
MFC after: 7 days


# 8f150781 27-Mar-2001 Alfred Perlstein <alfred@FreeBSD.org>

give the "netgrent" functions a home in netdb.h


# 69b58b03 17-Mar-2001 Hajimu UMEMOTO <ume@FreeBSD.org>

Nuke non-standard EAI_RESNULL.


# 92826806 19-Feb-2001 Hajimu UMEMOTO <ume@FreeBSD.org>

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.


# ad9fdc8f 15-Feb-2001 Hajimu UMEMOTO <ume@FreeBSD.org>

Correct 2nd argument of getnameinfo(3) to socklen_t.

Reviewed by: itojun


# 248aee62 06-Sep-2000 Jacques Vidrine <nectar@FreeBSD.org>

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


# 12cefbcc 07-Feb-2000 Yoshinobu Inoue <shin@FreeBSD.org>

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


# 7d56d374 27-Dec-1999 Yoshinobu Inoue <shin@FreeBSD.org>

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


# a4add9a9 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 0160f9c0 11-Jun-1998 Peter Wemm <peter@FreeBSD.org>

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


# fcd57f5c 16-Aug-1997 Steve Price <steve@FreeBSD.org>

Make this compile with the -traditional cc flag.

PR: misc/2189
Submitted by: Lars Koeller <Lars_Koeller@odie.physik2.uni-rostock.de>


# 4ebe87f9 27-Jun-1997 Peter Wemm <peter@FreeBSD.org>

merge in bind-4.9.6 changes (only effect is __res_send #define reverted)


# 79403fe3 23-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

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.


# 315d6d9c 30-Dec-1996 Peter Wemm <peter@FreeBSD.org>

Update the resolver definitions from bind-4.9.4-P1 to 4.9.5-P1 level.
(More commits to come)


# 74b3fad6 29-Aug-1996 Peter Wemm <peter@FreeBSD.org>

Hand merge in the bind-4.9.4-P1 resolver updates.


# 71d9c781 30-Jan-1996 Mike Pritchard <mpp@FreeBSD.org>

Fix a bunch of spelling errors in the comment fields
of a bunch of system include files.


# d58a9efd 20-Aug-1995 Peter Wemm <peter@FreeBSD.org>

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>


# 4399be3c 29-May-1995 Rodney W. Grimes <rgrimes@FreeBSD.org>

Remove trailing whitespace.


# 59deaec5 24-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Include Sources