17c478bd9Sstevel@tonic-gate /* 2*9b5f5885SSachidananda Urs * Copyright 2014 Sachidananda Urs <sacchi@gmail.com> 37c478bd9Sstevel@tonic-gate * Copyright 2001 Sun Microsystems, Inc. All rights reserved. 47c478bd9Sstevel@tonic-gate * Use is subject to license terms. 57c478bd9Sstevel@tonic-gate */ 67c478bd9Sstevel@tonic-gate 77c478bd9Sstevel@tonic-gate /* 87c478bd9Sstevel@tonic-gate * @(#) tcpd.h 1.5 96/03/19 16:22:24 97c478bd9Sstevel@tonic-gate * 107c478bd9Sstevel@tonic-gate * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. 117c478bd9Sstevel@tonic-gate */ 127c478bd9Sstevel@tonic-gate 13*9b5f5885SSachidananda Urs #ifndef _TCPD_H 14*9b5f5885SSachidananda Urs #define _TCPD_H 15*9b5f5885SSachidananda Urs 167c478bd9Sstevel@tonic-gate /* 177c478bd9Sstevel@tonic-gate * HAVE_IPV6 is traditionally configured at tcp_wrappers build time but for 187c478bd9Sstevel@tonic-gate * Solaris it must always be defined to keep the library interface binary 197c478bd9Sstevel@tonic-gate * compatible. 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate #define HAVE_IPV6 227c478bd9Sstevel@tonic-gate 237c478bd9Sstevel@tonic-gate /* Structure to describe one communications endpoint. */ 247c478bd9Sstevel@tonic-gate 257c478bd9Sstevel@tonic-gate #define STRING_LENGTH 128 /* hosts, users, processes */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #include <sys/socket.h> 287c478bd9Sstevel@tonic-gate #include <netinet/in.h> 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate typedef struct sockaddr_gen { 317c478bd9Sstevel@tonic-gate union { 327c478bd9Sstevel@tonic-gate struct sockaddr _sg_sa; 337c478bd9Sstevel@tonic-gate struct sockaddr_in _sg_sin; 347c478bd9Sstevel@tonic-gate #ifdef HAVE_IPV6 357c478bd9Sstevel@tonic-gate struct sockaddr_in6 _sg_sin6; 367c478bd9Sstevel@tonic-gate #endif 377c478bd9Sstevel@tonic-gate } sg_addr; 387c478bd9Sstevel@tonic-gate } sockaddr_gen; 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate typedef union gen_addr { 417c478bd9Sstevel@tonic-gate struct in_addr ga_in; 427c478bd9Sstevel@tonic-gate #ifdef HAVE_IPV6 437c478bd9Sstevel@tonic-gate struct in6_addr ga_in6; 447c478bd9Sstevel@tonic-gate #endif 457c478bd9Sstevel@tonic-gate } gen_addr; 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate extern void sockgen_simplify(); 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate #define sg_sa sg_addr._sg_sa 507c478bd9Sstevel@tonic-gate #define sg_sin sg_addr._sg_sin 517c478bd9Sstevel@tonic-gate #define sg_sin6 sg_addr._sg_sin6 527c478bd9Sstevel@tonic-gate #define sg_family sg_sa.sa_family 537c478bd9Sstevel@tonic-gate #ifdef HAVE_IPV6 547c478bd9Sstevel@tonic-gate #define SGADDRSZ(sag) ((sag)->sg_family == AF_INET6 ? \ 557c478bd9Sstevel@tonic-gate sizeof (struct in6_addr) : \ 567c478bd9Sstevel@tonic-gate sizeof (struct in_addr)) 577c478bd9Sstevel@tonic-gate #define SGSOCKADDRSZ(sag) ((sag)->sg_family == AF_INET6 ? \ 587c478bd9Sstevel@tonic-gate sizeof (struct sockaddr_in6) : \ 597c478bd9Sstevel@tonic-gate sizeof (struct sockaddr_in)) 607c478bd9Sstevel@tonic-gate #define SGPORT(sag) (*((sag)->sg_family == AF_INET6 ? \ 617c478bd9Sstevel@tonic-gate &(sag)->sg_sin6.sin6_port : \ 627c478bd9Sstevel@tonic-gate &(sag)->sg_sin.sin_port)) 637c478bd9Sstevel@tonic-gate #define SGADDRP(sag) (((sag)->sg_family == AF_INET6 ? \ 647c478bd9Sstevel@tonic-gate (char *)&(sag)->sg_sin6.sin6_addr : \ 657c478bd9Sstevel@tonic-gate (char *)&(sag)->sg_sin.sin_addr)) 667c478bd9Sstevel@tonic-gate #define SGFAM(sag) ((sag)->sg_family == AF_INET6 ? \ 677c478bd9Sstevel@tonic-gate AF_INET6 : AF_INET) 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate #define SG_IS_UNSPECIFIED(sag) \ 707c478bd9Sstevel@tonic-gate ((sag)->sg_family == AF_INET6 ? \ 717c478bd9Sstevel@tonic-gate IN6_IS_ADDR_UNSPECIFIED(&(sag)->sg_sin6.sin6_addr) : \ 727c478bd9Sstevel@tonic-gate (sag)->sg_sin.sin_addr.s_addr == 0) 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate #define VALID_ADDRTYPE(t) ((t) == AF_INET || (t) == AF_INET6) 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate #ifndef IPV6_ABITS 777c478bd9Sstevel@tonic-gate #define IPV6_ABITS 128 /* Size of IPV6 address in bits */ 787c478bd9Sstevel@tonic-gate #endif 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate #else /* HAVE_IPV6 */ 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate #define SGADDRSZ(sag) sizeof (struct in_addr) 837c478bd9Sstevel@tonic-gate #define SGSOCKADDRSZ(sag) sizeof (struct sockaddr_in) 847c478bd9Sstevel@tonic-gate #define SGPORT(sag) ((sag)->sg_sin.sin_port) 857c478bd9Sstevel@tonic-gate #define SGADDRP(sag) ((char *)&(sag)->sg_sin.sin_addr) 867c478bd9Sstevel@tonic-gate #define SGFAM(sag) AF_INET 877c478bd9Sstevel@tonic-gate #define SG_IS_UNSPECIFIED(sag) ((sag)->sg_sin.sin_addr.s_addr == 0) 887c478bd9Sstevel@tonic-gate 897c478bd9Sstevel@tonic-gate #define VALID_ADDRTYPE(t) ((t) == AF_INET) 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate #endif /* HAVE_IPV6 */ 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gate struct host_info { 947c478bd9Sstevel@tonic-gate char name[STRING_LENGTH]; /* access via eval_hostname(host) */ 957c478bd9Sstevel@tonic-gate char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */ 967c478bd9Sstevel@tonic-gate struct sockaddr_gen *sin; /* socket address or 0 */ 977c478bd9Sstevel@tonic-gate struct t_unitdata *unit; /* TLI transport address or 0 */ 987c478bd9Sstevel@tonic-gate struct request_info *request; /* for shared information */ 997c478bd9Sstevel@tonic-gate }; 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gate /* Structure to describe what we know about a service request. */ 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate struct request_info { 1047c478bd9Sstevel@tonic-gate int fd; /* socket handle */ 1057c478bd9Sstevel@tonic-gate char user[STRING_LENGTH]; /* access via eval_user(request) */ 1067c478bd9Sstevel@tonic-gate char daemon[STRING_LENGTH]; /* access via eval_daemon(request) */ 1077c478bd9Sstevel@tonic-gate char pid[10]; /* access via eval_pid(request) */ 1087c478bd9Sstevel@tonic-gate struct host_info client[1]; /* client endpoint info */ 1097c478bd9Sstevel@tonic-gate struct host_info server[1]; /* server endpoint info */ 1107c478bd9Sstevel@tonic-gate void (*sink) (); /* datagram sink function or 0 */ 1117c478bd9Sstevel@tonic-gate void (*hostname) (); /* address to printable hostname */ 1127c478bd9Sstevel@tonic-gate void (*hostaddr) (); /* address to printable address */ 1137c478bd9Sstevel@tonic-gate void (*cleanup) (); /* cleanup function or 0 */ 1147c478bd9Sstevel@tonic-gate struct netconfig *config; /* netdir handle */ 1157c478bd9Sstevel@tonic-gate }; 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate /* Common string operations. Less clutter should be more readable. */ 1187c478bd9Sstevel@tonic-gate 1197c478bd9Sstevel@tonic-gate #define STRN_CPY(d, s, l) { strncpy((d), (s), (l)); (d)[(l)-1] = 0; } 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gate #define STRN_EQ(x, y, l) (strncasecmp((x), (y), (l)) == 0) 1227c478bd9Sstevel@tonic-gate #define STRN_NE(x, y, l) (strncasecmp((x), (y), (l)) != 0) 1237c478bd9Sstevel@tonic-gate #define STR_EQ(x, y) (strcasecmp((x), (y)) == 0) 1247c478bd9Sstevel@tonic-gate #define STR_NE(x, y) (strcasecmp((x), (y)) != 0) 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate /* 1277c478bd9Sstevel@tonic-gate * Initially, all above strings have the empty value. Information that 1287c478bd9Sstevel@tonic-gate * cannot be determined at runtime is set to "unknown", so that we can 1297c478bd9Sstevel@tonic-gate * distinguish between `unavailable' and `not yet looked up'. A hostname 1307c478bd9Sstevel@tonic-gate * that we do not believe in is set to "paranoid". 1317c478bd9Sstevel@tonic-gate */ 1327c478bd9Sstevel@tonic-gate 1337c478bd9Sstevel@tonic-gate #define STRING_UNKNOWN "unknown" /* lookup failed */ 1347c478bd9Sstevel@tonic-gate #define STRING_PARANOID "paranoid" /* hostname conflict */ 1357c478bd9Sstevel@tonic-gate 1367c478bd9Sstevel@tonic-gate extern char unknown[]; 1377c478bd9Sstevel@tonic-gate extern char paranoid[]; 1387c478bd9Sstevel@tonic-gate 1397c478bd9Sstevel@tonic-gate #define HOSTNAME_KNOWN(s) (STR_NE((s), unknown) && STR_NE((s), paranoid)) 1407c478bd9Sstevel@tonic-gate 1417c478bd9Sstevel@tonic-gate #ifdef HAVE_IPV6 1427c478bd9Sstevel@tonic-gate #define NOT_INADDR(s) (strchr(s, ':') == 0 && s[strspn(s, "0123456789./")] != 0) 1437c478bd9Sstevel@tonic-gate #else 1447c478bd9Sstevel@tonic-gate #define NOT_INADDR(s) (s[strspn(s, "0123456789./")] != 0) 1457c478bd9Sstevel@tonic-gate #endif 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gate /* Global functions. */ 1487c478bd9Sstevel@tonic-gate 1497c478bd9Sstevel@tonic-gate #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) 1507c478bd9Sstevel@tonic-gate extern void fromhost(); /* get/validate client host info */ 1517c478bd9Sstevel@tonic-gate #else 1527c478bd9Sstevel@tonic-gate #define fromhost sock_host /* no TLI support needed */ 1537c478bd9Sstevel@tonic-gate #endif 1547c478bd9Sstevel@tonic-gate 155*9b5f5885SSachidananda Urs extern int hosts_ctl(); /* wrapper around request_init() */ 1567c478bd9Sstevel@tonic-gate extern int hosts_access(); /* access control */ 1577c478bd9Sstevel@tonic-gate extern void shell_cmd(); /* execute shell command */ 1587c478bd9Sstevel@tonic-gate extern char *percent_x(); /* do %<char> expansion */ 1597c478bd9Sstevel@tonic-gate extern void rfc931(); /* client name from RFC 931 daemon */ 1607c478bd9Sstevel@tonic-gate extern void clean_exit(); /* clean up and exit */ 1617c478bd9Sstevel@tonic-gate extern void refuse(); /* clean up and exit */ 1627c478bd9Sstevel@tonic-gate extern char *xgets(); /* fgets() on steroids */ 1637c478bd9Sstevel@tonic-gate extern char *split_at(); /* strchr() and split */ 1647c478bd9Sstevel@tonic-gate extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ 1657c478bd9Sstevel@tonic-gate extern int numeric_addr(); /* IP4/IP6 inet_addr (restricted) */ 1667c478bd9Sstevel@tonic-gate extern struct hostent *tcpd_gethostbyname(); 1677c478bd9Sstevel@tonic-gate /* IP4/IP6 gethostbyname */ 1687c478bd9Sstevel@tonic-gate #ifdef HAVE_IPV6 1697c478bd9Sstevel@tonic-gate extern char *skip_ipv6_addrs(); /* skip over colons in IPv6 addrs */ 1707c478bd9Sstevel@tonic-gate #else 1717c478bd9Sstevel@tonic-gate #define skip_ipv6_addrs(x) x 1727c478bd9Sstevel@tonic-gate #endif 1737c478bd9Sstevel@tonic-gate 1747c478bd9Sstevel@tonic-gate /* Global variables. */ 1757c478bd9Sstevel@tonic-gate 1767c478bd9Sstevel@tonic-gate extern int allow_severity; /* for connection logging */ 1777c478bd9Sstevel@tonic-gate extern int deny_severity; /* for connection logging */ 1787c478bd9Sstevel@tonic-gate extern char *hosts_allow_table; /* for verification mode redirection */ 1797c478bd9Sstevel@tonic-gate extern char *hosts_deny_table; /* for verification mode redirection */ 1807c478bd9Sstevel@tonic-gate extern int hosts_access_verbose; /* for verbose matching mode */ 1817c478bd9Sstevel@tonic-gate extern int rfc931_timeout; /* user lookup timeout */ 1827c478bd9Sstevel@tonic-gate extern int resident; /* > 0 if resident process */ 1837c478bd9Sstevel@tonic-gate 1847c478bd9Sstevel@tonic-gate /* 1857c478bd9Sstevel@tonic-gate * Routines for controlled initialization and update of request structure 1867c478bd9Sstevel@tonic-gate * attributes. Each attribute has its own key. 1877c478bd9Sstevel@tonic-gate */ 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate #ifdef __STDC__ 1907c478bd9Sstevel@tonic-gate extern struct request_info *request_init(struct request_info *, ...); 1917c478bd9Sstevel@tonic-gate extern struct request_info *request_set(struct request_info *, ...); 1927c478bd9Sstevel@tonic-gate #else 1937c478bd9Sstevel@tonic-gate extern struct request_info *request_init(); /* initialize request */ 1947c478bd9Sstevel@tonic-gate extern struct request_info *request_set(); /* update request structure */ 1957c478bd9Sstevel@tonic-gate #endif 1967c478bd9Sstevel@tonic-gate 1977c478bd9Sstevel@tonic-gate #define RQ_FILE 1 /* file descriptor */ 1987c478bd9Sstevel@tonic-gate #define RQ_DAEMON 2 /* server process (argv[0]) */ 1997c478bd9Sstevel@tonic-gate #define RQ_USER 3 /* client user name */ 2007c478bd9Sstevel@tonic-gate #define RQ_CLIENT_NAME 4 /* client host name */ 2017c478bd9Sstevel@tonic-gate #define RQ_CLIENT_ADDR 5 /* client host address */ 2027c478bd9Sstevel@tonic-gate #define RQ_CLIENT_SIN 6 /* client endpoint (internal) */ 2037c478bd9Sstevel@tonic-gate #define RQ_SERVER_NAME 7 /* server host name */ 2047c478bd9Sstevel@tonic-gate #define RQ_SERVER_ADDR 8 /* server host address */ 2057c478bd9Sstevel@tonic-gate #define RQ_SERVER_SIN 9 /* server endpoint (internal) */ 2067c478bd9Sstevel@tonic-gate 2077c478bd9Sstevel@tonic-gate /* 2087c478bd9Sstevel@tonic-gate * Routines for delayed evaluation of request attributes. Each attribute 2097c478bd9Sstevel@tonic-gate * type has its own access method. The trivial ones are implemented by 2107c478bd9Sstevel@tonic-gate * macros. The other ones are wrappers around the transport-specific host 2117c478bd9Sstevel@tonic-gate * name, address, and client user lookup methods. The request_info and 2127c478bd9Sstevel@tonic-gate * host_info structures serve as caches for the lookup results. 2137c478bd9Sstevel@tonic-gate */ 2147c478bd9Sstevel@tonic-gate 2157c478bd9Sstevel@tonic-gate extern char *eval_user(); /* client user */ 2167c478bd9Sstevel@tonic-gate extern char *eval_hostname(); /* printable hostname */ 2177c478bd9Sstevel@tonic-gate extern char *eval_hostaddr(); /* printable host address */ 2187c478bd9Sstevel@tonic-gate extern char *eval_hostinfo(); /* host name or address */ 2197c478bd9Sstevel@tonic-gate extern char *eval_client(); /* whatever is available */ 2207c478bd9Sstevel@tonic-gate extern char *eval_server(); /* whatever is available */ 2217c478bd9Sstevel@tonic-gate #define eval_daemon(r) ((r)->daemon) /* daemon process name */ 2227c478bd9Sstevel@tonic-gate #define eval_pid(r) ((r)->pid) /* process id */ 2237c478bd9Sstevel@tonic-gate 2247c478bd9Sstevel@tonic-gate /* Socket-specific methods, including DNS hostname lookups. */ 2257c478bd9Sstevel@tonic-gate 2267c478bd9Sstevel@tonic-gate extern void sock_host(); /* look up endpoint addresses */ 2277c478bd9Sstevel@tonic-gate extern void sock_hostname(); /* translate address to hostname */ 2287c478bd9Sstevel@tonic-gate extern void sock_hostaddr(); /* address to printable address */ 2297c478bd9Sstevel@tonic-gate #define sock_methods(r) \ 2307c478bd9Sstevel@tonic-gate { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } 2317c478bd9Sstevel@tonic-gate 2327c478bd9Sstevel@tonic-gate /* The System V Transport-Level Interface (TLI) interface. */ 2337c478bd9Sstevel@tonic-gate 2347c478bd9Sstevel@tonic-gate #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) 2357c478bd9Sstevel@tonic-gate extern void tli_host(); /* look up endpoint addresses etc. */ 2367c478bd9Sstevel@tonic-gate #endif 2377c478bd9Sstevel@tonic-gate 2387c478bd9Sstevel@tonic-gate /* 2397c478bd9Sstevel@tonic-gate * Problem reporting interface. Additional file/line context is reported 2407c478bd9Sstevel@tonic-gate * when available. The jump buffer (tcpd_buf) is not declared here, or 2417c478bd9Sstevel@tonic-gate * everyone would have to include <setjmp.h>. 2427c478bd9Sstevel@tonic-gate */ 2437c478bd9Sstevel@tonic-gate 2447c478bd9Sstevel@tonic-gate #ifdef __STDC__ 2457c478bd9Sstevel@tonic-gate extern void tcpd_warn(char *, ...); /* report problem and proceed */ 2467c478bd9Sstevel@tonic-gate extern void tcpd_jump(char *, ...); /* report problem and jump */ 2477c478bd9Sstevel@tonic-gate #else 2487c478bd9Sstevel@tonic-gate extern void tcpd_warn(); 2497c478bd9Sstevel@tonic-gate extern void tcpd_jump(); 2507c478bd9Sstevel@tonic-gate #endif 2517c478bd9Sstevel@tonic-gate 2527c478bd9Sstevel@tonic-gate struct tcpd_context { 2537c478bd9Sstevel@tonic-gate char *file; /* current file */ 2547c478bd9Sstevel@tonic-gate int line; /* current line */ 2557c478bd9Sstevel@tonic-gate }; 2567c478bd9Sstevel@tonic-gate extern struct tcpd_context tcpd_context; 2577c478bd9Sstevel@tonic-gate 2587c478bd9Sstevel@tonic-gate /* 2597c478bd9Sstevel@tonic-gate * While processing access control rules, error conditions are handled by 2607c478bd9Sstevel@tonic-gate * jumping back into the hosts_access() routine. This is cleaner than 2617c478bd9Sstevel@tonic-gate * checking the return value of each and every silly little function. The 2627c478bd9Sstevel@tonic-gate * (-1) returns are here because zero is already taken by longjmp(). 2637c478bd9Sstevel@tonic-gate */ 2647c478bd9Sstevel@tonic-gate 2657c478bd9Sstevel@tonic-gate #define AC_PERMIT 1 /* permit access */ 2667c478bd9Sstevel@tonic-gate #define AC_DENY (-1) /* deny_access */ 2677c478bd9Sstevel@tonic-gate #define AC_ERROR AC_DENY /* XXX */ 2687c478bd9Sstevel@tonic-gate 2697c478bd9Sstevel@tonic-gate /* 2707c478bd9Sstevel@tonic-gate * In verification mode an option function should just say what it would do, 2717c478bd9Sstevel@tonic-gate * instead of really doing it. An option function that would not return 2727c478bd9Sstevel@tonic-gate * should clear the dry_run flag to inform the caller of this unusual 2737c478bd9Sstevel@tonic-gate * behavior. 2747c478bd9Sstevel@tonic-gate */ 2757c478bd9Sstevel@tonic-gate 2767c478bd9Sstevel@tonic-gate extern void process_options(); /* execute options */ 2777c478bd9Sstevel@tonic-gate extern int dry_run; /* verification flag */ 2787c478bd9Sstevel@tonic-gate 2797c478bd9Sstevel@tonic-gate /* Bug workarounds. */ 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate #ifdef INET_ADDR_BUG /* inet_addr() returns struct */ 2827c478bd9Sstevel@tonic-gate #define inet_addr fix_inet_addr 2837c478bd9Sstevel@tonic-gate extern long fix_inet_addr(); 2847c478bd9Sstevel@tonic-gate #endif 2857c478bd9Sstevel@tonic-gate 2867c478bd9Sstevel@tonic-gate #ifdef BROKEN_FGETS /* partial reads from sockets */ 2877c478bd9Sstevel@tonic-gate #define fgets fix_fgets 2887c478bd9Sstevel@tonic-gate extern char *fix_fgets(); 2897c478bd9Sstevel@tonic-gate #endif 2907c478bd9Sstevel@tonic-gate 2917c478bd9Sstevel@tonic-gate #ifdef RECVFROM_BUG /* no address family info */ 2927c478bd9Sstevel@tonic-gate #define recvfrom fix_recvfrom 2937c478bd9Sstevel@tonic-gate extern int fix_recvfrom(); 2947c478bd9Sstevel@tonic-gate #endif 2957c478bd9Sstevel@tonic-gate 2967c478bd9Sstevel@tonic-gate #ifdef GETPEERNAME_BUG /* claims success with UDP */ 2977c478bd9Sstevel@tonic-gate #define getpeername fix_getpeername 2987c478bd9Sstevel@tonic-gate extern int fix_getpeername(); 2997c478bd9Sstevel@tonic-gate #endif 3007c478bd9Sstevel@tonic-gate 3017c478bd9Sstevel@tonic-gate #ifdef SOLARIS_24_GETHOSTBYNAME_BUG /* lists addresses as aliases */ 3027c478bd9Sstevel@tonic-gate #define gethostbyname fix_gethostbyname 3037c478bd9Sstevel@tonic-gate extern struct hostent *fix_gethostbyname(); 3047c478bd9Sstevel@tonic-gate #endif 3057c478bd9Sstevel@tonic-gate 3067c478bd9Sstevel@tonic-gate #ifdef USE_STRSEP /* libc calls strtok() */ 3077c478bd9Sstevel@tonic-gate #define strtok fix_strtok 3087c478bd9Sstevel@tonic-gate extern char *fix_strtok(); 3097c478bd9Sstevel@tonic-gate #endif 3107c478bd9Sstevel@tonic-gate 3117c478bd9Sstevel@tonic-gate #ifdef LIBC_CALLS_STRTOK /* libc calls strtok() */ 3127c478bd9Sstevel@tonic-gate #define strtok my_strtok 3137c478bd9Sstevel@tonic-gate extern char *my_strtok(); 3147c478bd9Sstevel@tonic-gate #endif 315*9b5f5885SSachidananda Urs 316*9b5f5885SSachidananda Urs #endif /* _TCPD_H */ 317