1223304Sgavin/*	$NetBSD: tnftp.h,v 1.33 2009/11/14 08:32:42 lukem Exp $	*/
2223304Sgavin
3223304Sgavin#define	FTP_PRODUCT	PACKAGE_NAME
4223304Sgavin#define	FTP_VERSION	PACKAGE_VERSION
5223304Sgavin
6223304Sgavin#include "tnftp_config.h"
7223304Sgavin
8223304Sgavin#include <stdio.h>
9223304Sgavin#include <ctype.h>
10223304Sgavin#include <errno.h>
11223304Sgavin
12223304Sgavin#if defined(HAVE_SYS_TYPES_H)
13223304Sgavin# include <sys/types.h>
14223304Sgavin#endif
15223304Sgavin#if defined(STDC_HEADERS)
16223304Sgavin# include <stdarg.h>
17223304Sgavin# include <stdlib.h>
18223304Sgavin# include <string.h>
19223304Sgavin#endif
20223304Sgavin#if defined(HAVE_LIBGEN_H)
21223304Sgavin# include <libgen.h>
22223304Sgavin#endif
23223304Sgavin#if defined(HAVE_UNISTD_H)
24223304Sgavin# include <unistd.h>
25223304Sgavin#endif
26223304Sgavin#if defined(HAVE_POLL_H)
27223304Sgavin# include <poll.h>
28223304Sgavin#elif defined(HAVE_SYS_POLL_H)
29223304Sgavin# include <sys/poll.h>
30223304Sgavin#endif
31223304Sgavin#if defined(HAVE_SYS_SOCKET_H)
32223304Sgavin# include <sys/socket.h>
33223304Sgavin#endif
34223304Sgavin#if defined(HAVE_NETINET_IN_H)
35223304Sgavin# include <netinet/in.h>
36223304Sgavin#endif
37223304Sgavin#if defined(HAVE_NETINET_IN_SYSTM_H)
38223304Sgavin# include <netinet/in_systm.h>
39223304Sgavin#endif
40223304Sgavin#if defined(HAVE_NETINET_IP_H)
41223304Sgavin# include <netinet/ip.h>
42223304Sgavin#endif
43223304Sgavin#if defined(HAVE_NETDB_H)
44223304Sgavin# if HAVE_DECL_AI_NUMERICHOST
45223304Sgavin#  include <netdb.h>
46223304Sgavin# else	/* !HAVE_DECL_AI_NUMERICHOST */
47223304Sgavin#  define getaddrinfo non_rfc2553_getaddrinfo
48223304Sgavin#  include <netdb.h>
49223304Sgavin#  undef getaddrinfo
50223304Sgavin# endif	/* !HAVE_DECL_AI_NUMERICHOST */
51223304Sgavin#endif
52223304Sgavin#if defined(HAVE_ARPA_INET_H)
53223304Sgavin# include <arpa/inet.h>
54223304Sgavin#endif
55223304Sgavin#if defined(HAVE_DIRENT_H)
56223304Sgavin# include <dirent.h>
57223304Sgavin#else
58223304Sgavin# define dirent direct
59223304Sgavin# if defined(HAVE_SYS_NDIR_H)
60223304Sgavin#  include <sys/ndir.h>
61223304Sgavin# endif
62223304Sgavin# if defined(HAVE_SYS_DIR_H)
63223304Sgavin#  include <sys/dir.h>
64223304Sgavin# endif
65223304Sgavin# if defined(HAVE_NDIR_H)
66223304Sgavin#  include <ndir.h>
67223304Sgavin# endif
68223304Sgavin#endif
69223304Sgavin
70223304Sgavin#if defined(HAVE_SYS_IOCTL_H)
71223304Sgavin# include <sys/ioctl.h>
72223304Sgavin#endif
73223304Sgavin#if defined(HAVE_SYS_PARAM_H)
74223304Sgavin# include <sys/param.h>
75223304Sgavin#endif
76223304Sgavin#if defined(HAVE_SYS_STAT_H)
77223304Sgavin# include <sys/stat.h>
78223304Sgavin#endif
79223304Sgavin#if defined(HAVE_SYS_SYSLIMITS_H)
80223304Sgavin# include <sys/syslimits.h>
81223304Sgavin#endif
82223304Sgavin#if defined(HAVE_SYS_WAIT_H)
83223304Sgavin# include <sys/wait.h>
84223304Sgavin#endif
85223304Sgavin
86223304Sgavin#if defined(HAVE_ARPA_FTP_H)
87223304Sgavin# include <arpa/ftp.h>
88223304Sgavin#endif
89223304Sgavin
90223304Sgavin#if defined(HAVE_FCNTL_H)
91223304Sgavin# include <fcntl.h>
92223304Sgavin#endif
93223304Sgavin#if defined(HAVE_LIMITS_H)
94223304Sgavin# include <limits.h>
95223304Sgavin#endif
96223304Sgavin#if defined(HAVE_PWD_H)
97223304Sgavin# include <pwd.h>
98223304Sgavin#endif
99223304Sgavin#if defined(HAVE_SETJMP_H)
100223304Sgavin# include <setjmp.h>
101223304Sgavin#endif
102223304Sgavin#if defined(HAVE_SIGNAL_H)
103223304Sgavin# include <signal.h>
104223304Sgavin#endif
105223304Sgavin#if defined(HAVE_STDDEF_H)
106223304Sgavin# include <stddef.h>
107223304Sgavin#endif
108223304Sgavin#if defined(HAVE_TERMIOS_H)
109223304Sgavin# include <termios.h>
110223304Sgavin#endif
111223304Sgavin
112223304Sgavin#if defined(HAVE_POLL)
113223304Sgavin/* we use poll */
114223304Sgavin#elif defined(HAVE_SELECT)
115223304Sgavin/* we use select */
116223304Sgavin#else /* !defined(HAVE_POLL) && !defined(HAVE_SELECT) */
117223304Sgavin# error "no poll() or select() found"
118223304Sgavin#endif
119223304Sgavin#if !defined(POLLIN)
120223304Sgavin# define POLLIN		0x0001
121223304Sgavin#endif
122223304Sgavin#if !defined(POLLOUT)
123223304Sgavin# define POLLOUT	0x0004
124223304Sgavin#endif
125223304Sgavin#if !defined(POLLRDNORM)
126223304Sgavin# define POLLRDNORM	0x0040
127223304Sgavin#endif
128223304Sgavin#if !defined(POLLWRNORM)
129223304Sgavin# define POLLWRNORM	POLLOUT
130223304Sgavin#endif
131223304Sgavin#if !defined(POLLRDBAND)
132223304Sgavin# define POLLRDBAND	0x0080
133223304Sgavin#endif
134223304Sgavin#if !defined(INFTIM)
135223304Sgavin# define INFTIM -1
136223304Sgavin#endif
137223304Sgavin#if !defined(HAVE_STRUCT_POLLFD)
138223304Sgavinstruct pollfd {
139223304Sgavin	int	fd;
140223304Sgavin	short	events;
141223304Sgavin	short	revents;
142223304Sgavin};
143223304Sgavin#endif
144223304Sgavin
145223304Sgavin#if defined(TIME_WITH_SYS_TIME)
146223304Sgavin# include <sys/time.h>
147223304Sgavin# include <time.h>
148223304Sgavin#else
149223304Sgavin# if defined(HAVE_SYS_TIME_H)
150223304Sgavin#  include <sys/time.h>
151223304Sgavin# else
152223304Sgavin#  include <time.h>
153223304Sgavin# endif
154223304Sgavin#endif
155223304Sgavin
156223304Sgavin#if defined(HAVE_ERR_H)
157223304Sgavin# include <err.h>
158223304Sgavin#endif
159223304Sgavin
160223304Sgavin#if defined(USE_GLOB_H)	/* not set by configure; used by other build systems */
161223304Sgavin# include <glob.h>
162223304Sgavin#else
163223304Sgavin# include "ftpglob.h"
164223304Sgavin#endif
165223304Sgavin
166223304Sgavin#if defined(HAVE_PATHS_H)
167223304Sgavin# include <paths.h>
168223304Sgavin#endif
169223304Sgavin#if !defined(_PATH_BSHELL)
170223304Sgavin# define _PATH_BSHELL	"/bin/sh"
171223304Sgavin#endif
172223304Sgavin#if !defined(_PATH_TMP)
173223304Sgavin# define _PATH_TMP	"/tmp/"
174223304Sgavin#endif
175223304Sgavin
176223304Sgavintypedef struct _stringlist {
177223304Sgavin	char	**sl_str;
178223304Sgavin	size_t	  sl_max;
179223304Sgavin	size_t	  sl_cur;
180223304Sgavin} StringList;
181223304Sgavin
182223304SgavinStringList *sl_init(void);
183223304Sgavinint	 sl_add(StringList *, char *);
184223304Sgavinvoid	 sl_free(StringList *, int);
185223304Sgavinchar	*sl_find(StringList *, char *);
186223304Sgavin
187223304Sgavin#if defined(HAVE_TERMCAP_H)
188223304Sgavin# include <termcap.h>
189223304Sgavin#else
190223304Sgavinint	 tgetent(char *, const char *);
191223304Sgavinchar	*tgetstr(const char *, char **);
192223304Sgavinint	 tgetflag(const char *);
193223304Sgavinint	 tgetnum(const char *);
194223304Sgavinchar	*tgoto(const char *, int, int);
195223304Sgavinvoid	 tputs(const char *, int, int (*)(int));
196223304Sgavin#endif /* !HAVE_TERMCAP_H */
197223304Sgavin
198223304Sgavin#if defined(HAVE_VIS_H) && defined(HAVE_STRVIS) && defined(HAVE_STRUNVIS)
199223304Sgavin# include <vis.h>
200223304Sgavin#else
201223304Sgavin# include "ftpvis.h"
202223304Sgavin#endif
203223304Sgavin
204223304Sgavin#if !defined(HAVE_IN_PORT_T)
205223304Sgavintypedef unsigned short in_port_t;
206223304Sgavin#endif
207223304Sgavin
208223304Sgavin#if !defined(HAVE_SA_FAMILY_T)
209223304Sgavintypedef unsigned short sa_family_t;
210223304Sgavin#endif
211223304Sgavin
212223304Sgavin#if !defined(HAVE_SOCKLEN_T)
213223304Sgavintypedef unsigned int socklen_t;
214223304Sgavin#endif
215223304Sgavin
216223304Sgavin#if defined(USE_INET6)
217223304Sgavin# define INET6
218223304Sgavin#endif
219223304Sgavin
220223304Sgavin#if !HAVE_DECL_AI_NUMERICHOST
221223304Sgavin
222223304Sgavin				/* RFC 2553 */
223223304Sgavin#undef	EAI_ADDRFAMILY
224223304Sgavin#define	EAI_ADDRFAMILY	 1	/* address family for hostname not supported */
225223304Sgavin#undef	EAI_AGAIN
226223304Sgavin#define	EAI_AGAIN	 2	/* temporary failure in name resolution */
227223304Sgavin#undef	EAI_BADFLAGS
228223304Sgavin#define	EAI_BADFLAGS	 3	/* invalid value for ai_flags */
229223304Sgavin#undef	EAI_FAIL
230223304Sgavin#define	EAI_FAIL	 4	/* non-recoverable failure in name resolution */
231223304Sgavin#undef	EAI_FAMILY
232223304Sgavin#define	EAI_FAMILY	 5	/* ai_family not supported */
233223304Sgavin#undef	EAI_MEMORY
234223304Sgavin#define	EAI_MEMORY	 6	/* memory allocation failure */
235223304Sgavin#undef	EAI_NODATA
236223304Sgavin#define	EAI_NODATA	 7	/* no address associated with hostname */
237223304Sgavin#undef	EAI_NONAME
238223304Sgavin#define	EAI_NONAME	 8	/* hostname nor servname provided, or not known */
239223304Sgavin#undef	EAI_SERVICE
240223304Sgavin#define	EAI_SERVICE	 9	/* servname not supported for ai_socktype */
241223304Sgavin#undef	EAI_SOCKTYPE
242223304Sgavin#define	EAI_SOCKTYPE	10	/* ai_socktype not supported */
243223304Sgavin#undef	EAI_SYSTEM
244223304Sgavin#define	EAI_SYSTEM	11	/* system error returned in errno */
245223304Sgavin
246223304Sgavin				/* KAME extensions? */
247223304Sgavin#undef	EAI_BADHINTS
248223304Sgavin#define	EAI_BADHINTS	12
249223304Sgavin#undef	EAI_PROTOCOL
250223304Sgavin#define	EAI_PROTOCOL	13
251223304Sgavin#undef	EAI_MAX
252223304Sgavin#define	EAI_MAX		14
253223304Sgavin
254223304Sgavin				/* RFC 2553 */
255223304Sgavin#undef	NI_MAXHOST
256223304Sgavin#define	NI_MAXHOST	1025
257223304Sgavin#undef	NI_MAXSERV
258223304Sgavin#define	NI_MAXSERV	32
259223304Sgavin
260223304Sgavin#undef	NI_NOFQDN
261223304Sgavin#define	NI_NOFQDN	0x00000001
262223304Sgavin#undef	NI_NUMERICHOST
263223304Sgavin#define	NI_NUMERICHOST	0x00000002
264223304Sgavin#undef	NI_NAMEREQD
265223304Sgavin#define	NI_NAMEREQD	0x00000004
266223304Sgavin#undef	NI_NUMERICSERV
267223304Sgavin#define	NI_NUMERICSERV	0x00000008
268223304Sgavin#undef	NI_DGRAM
269223304Sgavin#define	NI_DGRAM	0x00000010
270223304Sgavin
271223304Sgavin				/* RFC 2553 */
272223304Sgavin#undef	AI_PASSIVE
273223304Sgavin#define	AI_PASSIVE	0x00000001 /* get address to use bind() */
274223304Sgavin#undef	AI_CANONNAME
275223304Sgavin#define	AI_CANONNAME	0x00000002 /* fill ai_canonname */
276223304Sgavin
277223304Sgavin				/* KAME extensions ? */
278223304Sgavin#undef	AI_NUMERICHOST
279223304Sgavin#define	AI_NUMERICHOST	0x00000004 /* prevent name resolution */
280223304Sgavin#undef	AI_MASK
281223304Sgavin#define	AI_MASK		(AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
282223304Sgavin
283223304Sgavin				/* RFC 2553 */
284223304Sgavin#undef	AI_ALL
285223304Sgavin#define	AI_ALL		0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
286223304Sgavin#undef	AI_V4MAPPED_CFG
287223304Sgavin#define	AI_V4MAPPED_CFG	0x00000200 /* accept IPv4-mapped if kernel supports */
288223304Sgavin#undef	AI_ADDRCONFIG
289223304Sgavin#define	AI_ADDRCONFIG	0x00000400 /* only if any address is assigned */
290223304Sgavin#undef	AI_V4MAPPED
291223304Sgavin#define	AI_V4MAPPED	0x00000800 /* accept IPv4-mapped IPv6 address */
292223304Sgavin
293223304Sgavin#endif /* !HAVE_DECL_AI_NUMERICHOST */
294223304Sgavin
295223304Sgavin
296223304Sgavin#if !HAVE_DECL_AI_NUMERICHOST && !defined(HAVE_STRUCT_ADDRINFO) \
297223304Sgavin    && !defined(USE_SOCKS)
298223304Sgavin
299223304Sgavinstruct addrinfo {
300223304Sgavin	int		ai_flags;	/* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
301223304Sgavin	int		ai_family;	/* PF_xxx */
302223304Sgavin	int		ai_socktype;	/* SOCK_xxx */
303223304Sgavin	int		ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
304223304Sgavin	socklen_t	ai_addrlen;	/* length of ai_addr */
305223304Sgavin	char		*ai_canonname;	/* canonical name for hostname */
306223304Sgavin	struct sockaddr *ai_addr;	/* binary address */
307223304Sgavin	struct addrinfo *ai_next;	/* next structure in linked list */
308223304Sgavin};
309223304Sgavin
310223304Sgavinint	getaddrinfo(const char *, const char *,
311223304Sgavin	    const struct addrinfo *, struct addrinfo **);
312223304Sgavinint	getnameinfo(const struct sockaddr *, socklen_t,
313223304Sgavin	    char *, size_t, char *, size_t, int);
314223304Sgavinvoid	freeaddrinfo(struct addrinfo *);
315223304Sgavinconst char *gai_strerror(int);
316223304Sgavin
317223304Sgavin#endif /* !HAVE_DECL_AI_NUMERICHOST && !defined(HAVE_STRUCT_ADDRINFO) \
318223304Sgavin	&& !defined(USE_SOCKS) */
319223304Sgavin
320223304Sgavin#if !defined(HAVE_STRUCT_DIRENT_D_NAMLEN)
321223304Sgavin# define DIRENT_MISSING_D_NAMLEN
322223304Sgavin#endif
323223304Sgavin
324223304Sgavin#if !HAVE_DECL_H_ERRNO
325223304Sgavinextern int	h_errno;
326223304Sgavin#endif
327223304Sgavin#define HAVE_H_ERRNO	1		/* XXX: an assumption for now... */
328223304Sgavin
329223304Sgavin#if !HAVE_DECL_FCLOSE
330223304Sgavinint	fclose(FILE *);
331223304Sgavin#endif
332223304Sgavin
333223304Sgavin#if !HAVE_DECL_GETPASS
334223304Sgavinchar	*getpass(const char *);
335223304Sgavin#endif
336223304Sgavin
337223304Sgavin#if !HAVE_DECL_OPTARG
338223304Sgavinextern char    *optarg;
339223304Sgavin#endif
340223304Sgavin
341223304Sgavin#if !HAVE_DECL_OPTIND
342223304Sgavinextern int	optind;
343223304Sgavin#endif
344223304Sgavin
345223304Sgavin#if !HAVE_DECL_PCLOSE
346223304Sgavinint	pclose(FILE *);
347223304Sgavin#endif
348223304Sgavin
349223304Sgavin#if !HAVE_DECL_DIRNAME
350223304Sgavinchar	*dirname(char *);
351223304Sgavin#endif
352223304Sgavin
353223304Sgavin#if !defined(HAVE_ERR)
354223304Sgavinvoid	err(int, const char *, ...);
355223304Sgavinvoid	errx(int, const char *, ...);
356223304Sgavinvoid	warn(const char *, ...);
357223304Sgavinvoid	warnx(const char *, ...);
358223304Sgavin#endif
359223304Sgavin
360223304Sgavin#if !defined(HAVE_FGETLN)
361223304Sgavinchar   *fgetln(FILE *, size_t *);
362223304Sgavin#endif
363223304Sgavin
364223304Sgavin#if !defined(HAVE_FSEEKO)
365223304Sgavinint	fseeko(FILE *, off_t, int);
366223304Sgavin#endif
367223304Sgavin
368223304Sgavin#if !defined(HAVE_INET_NTOP)
369223304Sgavinconst char *inet_ntop(int, const void *, char *, socklen_t);
370223304Sgavin#endif
371223304Sgavin
372223304Sgavin#if !defined(HAVE_INET_PTON)
373223304Sgavinint inet_pton(int, const char *, void *);
374223304Sgavin#endif
375223304Sgavin
376223304Sgavin#if !defined(HAVE_MKSTEMP)
377223304Sgavinint	mkstemp(char *);
378223304Sgavin#endif
379223304Sgavin
380223304Sgavin#if !defined(HAVE_SETPROGNAME)
381223304Sgavinconst char *getprogname(void);
382223304Sgavinvoid	setprogname(const char *);
383223304Sgavin#endif
384223304Sgavin
385223304Sgavin#if !defined(HAVE_SNPRINTF)
386223304Sgavinint	snprintf(char *, size_t, const char *, ...);
387223304Sgavin#endif
388223304Sgavin
389223304Sgavin#if !defined(HAVE_STRDUP)
390223304Sgavinchar   *strdup(const char *);
391223304Sgavin#endif
392223304Sgavin
393223304Sgavin#if !defined(HAVE_STRERROR)
394223304Sgavinchar   *strerror(int);
395223304Sgavin#endif
396223304Sgavin
397223304Sgavin#if !defined(HAVE_STRPTIME) || !HAVE_DECL_STRPTIME
398223304Sgavinchar   *strptime(const char *, const char *, struct tm *);
399223304Sgavin#endif
400223304Sgavin
401223304Sgavin#if defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)
402223304Sgavin# if !defined(HAVE_STRTOLL)
403223304Sgavinlong long strtoll(const char *, char **, int);
404223304Sgavin# endif
405223304Sgavin# if !defined(LLONG_MIN)
406223304Sgavin#  define LLONG_MIN	(-0x7fffffffffffffffLL-1)
407223304Sgavin# endif
408223304Sgavin# if !defined(LLONG_MAX)
409223304Sgavin#  define LLONG_MAX	(0x7fffffffffffffffLL)
410223304Sgavin# endif
411223304Sgavin#else  /* !(defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)) */
412223304Sgavin# define NO_LONG_LONG	1
413223304Sgavin#endif /* !(defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)) */
414223304Sgavin
415223304Sgavin#if !defined(HAVE_TIMEGM)
416223304Sgavintime_t	timegm(struct tm *);
417223304Sgavin#endif
418223304Sgavin
419223304Sgavin#if !defined(HAVE_STRLCAT)
420223304Sgavinsize_t	strlcat(char *, const char *, size_t);
421223304Sgavin#endif
422223304Sgavin
423223304Sgavin#if !defined(HAVE_STRLCPY)
424223304Sgavinsize_t	strlcpy(char *, const char *, size_t);
425223304Sgavin#endif
426223304Sgavin
427223304Sgavin#if !defined(HAVE_STRSEP)
428223304Sgavinchar   *strsep(char **stringp, const char *delim);
429223304Sgavin#endif
430223304Sgavin
431223304Sgavin#if !defined(HAVE_UTIMES)
432223304Sgavinint utimes(const char *, const struct timeval *);
433223304Sgavin#endif
434223304Sgavin
435223304Sgavin#if !defined(HAVE_MEMMOVE)
436223304Sgavin# define memmove(a,b,c)	bcopy((b),(a),(c))
437223304Sgavin	/* XXX: add others #defines for borken systems? */
438223304Sgavin#endif
439223304Sgavin
440223304Sgavin#if defined(HAVE_GETPASSPHRASE)
441223304Sgavin# define getpass getpassphrase
442223304Sgavin#endif
443223304Sgavin
444223304Sgavin#if !defined(MIN)
445223304Sgavin# define MIN(a, b)	((a) < (b) ? (a) : (b))
446223304Sgavin#endif
447223304Sgavin#if !defined(MAX)
448223304Sgavin# define MAX(a, b)	((a) < (b) ? (b) : (a))
449223304Sgavin#endif
450223304Sgavin
451223304Sgavin#if !defined(timersub)
452223304Sgavin# define timersub(tvp, uvp, vvp)					\
453223304Sgavin	do {								\
454223304Sgavin		(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec;		\
455223304Sgavin		(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec;	\
456223304Sgavin		if ((vvp)->tv_usec < 0) {				\
457223304Sgavin			(vvp)->tv_sec--;				\
458223304Sgavin			(vvp)->tv_usec += 1000000;			\
459223304Sgavin		}							\
460223304Sgavin	} while (0)
461223304Sgavin#endif
462223304Sgavin
463223304Sgavin#if !defined(S_ISLNK)
464223304Sgavin# define S_ISLNK(m)	((m & S_IFMT) == S_IFLNK)
465223304Sgavin#endif
466223304Sgavin
467223304Sgavin#define	EPOCH_YEAR	1970
468223304Sgavin#define	SECSPERHOUR	3600
469223304Sgavin#define	SECSPERDAY	86400
470223304Sgavin#define	TM_YEAR_BASE	1900
471223304Sgavin
472223304Sgavin#if defined(USE_SOCKS)		/* (Dante) SOCKS5 */
473223304Sgavin#define connect		Rconnect
474223304Sgavin#define bind		Rbind
475223304Sgavin#define getsockname	Rgetsockname
476223304Sgavin#define getpeername	Rgetpeername
477223304Sgavin#define accept		Raccept
478223304Sgavin#define rresvport	Rrresvport
479223304Sgavin#define bindresvport	Rbindresvport
480223304Sgavin#define gethostbyname	Rgethostbyname
481223304Sgavin#define gethostbyname2	Rgethostbyname2
482223304Sgavin#define sendto		Rsendto
483223304Sgavin#define recvfrom	Rrecvfrom
484223304Sgavin#define recvfrom	Rrecvfrom
485223304Sgavin#define write		Rwrite
486223304Sgavin#define writev		Rwritev
487223304Sgavin#define send		Rsend
488223304Sgavin#define sendmsg		Rsendmsg
489223304Sgavin#define read		Rread
490223304Sgavin#define readv		Rreadv
491223304Sgavin#define recv		Rrecv
492223304Sgavin#define recvmsg		Rrecvmsg
493223304Sgavin#define getaddrinfo	Rgetaddrinfo
494223304Sgavin#define getipnodebyname	Rgetipnodebyname
495223304Sgavin#endif /* defined(USE_SOCKS) */
496