freebsd-skq/lib/libc/net
Bill Paul 217ae63218 Improve NIS performace of getservbyname() and getservbyport(). Both these
functions are implimented as wrappers around getservent(), which means it's
up to getservent() to do all the work. The NIS support in getservent()
only allows it to scan through the services.byname map one entry at a
time until it finds the requested service name/port. This can be painfully
slow due to the overhead involved (lots and lots of successive RPCs).

To fix this, we allow getservbyname() and getservbyport() to signal
getservent() that if NIS is turned on (there's a '+' in /etc/services),
the usual yp_first()/yp_next() linear search should be abandoned and
yp_match() used instead. This causes getservent() to immediately
locate the requested entry instead of wasting time groping through the
whole map.

The downside is that this trick is accomplished by exporting a couple of
pointers from getservent.c which getservbyname.c and getservbyport.c can
preset in order to tell getservent() what to do. If all three functions
were in the same source module, then the extra cruft could be delcared
static to avoid poluting the global symbol space. Maybe they should be
combined anyway. For now I've settled on prepending lots of underscores.
1996-06-01 04:40:42 +00:00
..
byteorder.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ether_addr.c gethostbynis.c: 1996-03-16 21:25:59 +00:00
ethers.3 Correct a bunch of man page cross references and generally 1996-02-11 22:38:05 +00:00
gethostbydns.c The last of the bind-4.9.3-REL resolver merges. 1996-01-13 09:03:58 +00:00
gethostbyht.c The last of the bind-4.9.3-REL resolver merges. 1996-01-13 09:03:58 +00:00
gethostbyname.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
gethostbynis.c gethostbynis.c: 1996-03-16 21:25:59 +00:00
gethostnamadr.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
getnetbydns.c The last of the bind-4.9.3-REL resolver merges. 1996-01-13 09:03:58 +00:00
getnetbyht.c The last of the bind-4.9.3-REL resolver merges. 1996-01-13 09:03:58 +00:00
getnetbynis.c Fix other half of problem reported in PR #1079: _getnetbynisaddr() is 1996-03-23 22:16:22 +00:00
getnetent.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getnetnamadr.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
getproto.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getprotoent.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getprotoent.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getprotoname.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getservbyname.c Improve NIS performace of getservbyname() and getservbyport(). Both these 1996-06-01 04:40:42 +00:00
getservbyport.c Improve NIS performace of getservbyname() and getservbyport(). Both these 1996-06-01 04:40:42 +00:00
getservent.3 Fix the prototypes for getservby{name,port}(). 1995-07-09 08:17:01 +00:00
getservent.c Improve NIS performace of getservbyname() and getservbyport(). Both these 1996-06-01 04:40:42 +00:00
herror.c The last of the bind-4.9.3-REL resolver merges. 1996-01-13 09:03:58 +00:00
inet_addr.c The last of the bind-4.9.3-REL resolver merges. 1996-01-13 09:03:58 +00:00
inet_lnaof.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
inet_makeaddr.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
inet_netof.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
inet_network.c Fix inet_network to not dump core if passed in an address 1996-02-17 21:11:36 +00:00
inet_ntoa.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
inet.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
iso_addr.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
iso_addr.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
linkaddr.3 Do not install the now unsupported netns and netiso 1996-04-08 05:15:09 +00:00
linkaddr.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
Makefile.inc Do not install the now unsupported netns and netiso 1996-04-08 05:15:09 +00:00
ns_addr.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
ns_ntoa.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ns.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
rcmd.3 Fixed a bunch of man page cross references that were 1996-02-15 20:07:05 +00:00
rcmd.c Use the setsockopt for IP_PORTRANGE to cause rresvport() to allocate a 1996-05-31 04:00:21 +00:00
recv.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
res_comp.c Merge the 4.9.3-rel code into the res_* parts. The gethostXXXbyYYY 1996-01-07 09:15:02 +00:00
res_config.h The last of the bind-4.9.3-REL resolver merges. 1996-01-13 09:03:58 +00:00
res_data.c Part of bind-4.9.3-rel.. This is for my convenience and reference. 1996-01-07 06:57:27 +00:00
res_debug.c Remove support for OSI networking in user-land (#ifdef OSI aor CCITT) 1996-02-06 20:36:15 +00:00
res_init.c Merge the 4.9.3-rel code into the res_* parts. The gethostXXXbyYYY 1996-01-07 09:15:02 +00:00
res_mkquery.c Merge the 4.9.3-rel code into the res_* parts. The gethostXXXbyYYY 1996-01-07 09:15:02 +00:00
res_query.c Merge the 4.9.3-rel code into the res_* parts. The gethostXXXbyYYY 1996-01-07 09:15:02 +00:00
res_send.c Merge the 4.9.3-rel code into the res_* parts. The gethostXXXbyYYY 1996-01-07 09:15:02 +00:00
resolver.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
send.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00