Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / lib / libwrap / fromhost.c
blobf4ff9fae16bc0af70d6d02cd78ac163dff220f25
1 /*
2 * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
5 #pragma ident "%Z%%M% %I% %E% SMI"
7 /*
8 * On socket-only systems, fromhost() is nothing but an alias for the
9 * socket-specific sock_host() function.
11 * On systems with sockets and TLI, fromhost() determines the type of API
12 * (sockets, TLI), then invokes the appropriate API-specific routines.
14 * Diagnostics are reported through syslog(3).
16 * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
19 static char sccsid[] = "@(#) fromhost.c 1.17 94/12/28 17:42:23";
21 #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
23 /* System libraries. */
25 #include <sys/types.h>
26 #include <sys/tiuser.h>
27 #include <stropts.h>
29 /* Local stuff. */
31 #include "tcpd.h"
33 /* fromhost - find out what network API we should use */
35 void fromhost(request)
36 struct request_info *request;
40 * On systems with streams support the IP network protocol family may be
41 * accessible via more than one programming interface: Berkeley sockets
42 * and the Transport Level Interface (TLI).
44 * Thus, we must first find out what programming interface to use: sockets
45 * or TLI. On some systems, sockets are not part of the streams system,
46 * so if request->fd is not a stream we simply assume sockets.
49 if (ioctl(request->fd, I_FIND, "timod") > 0) {
50 tli_host(request);
51 } else {
52 sock_host(request);
56 #endif /* TLI || PTX || TLI_SEQUENT */