2008-01-28 21:37:16 +00:00
|
|
|
/* source: sysincludes.h */
|
2016-07-22 06:54:31 +00:00
|
|
|
/* Copyright Gerhard Rieger and contributors (see file CHANGES) */
|
2008-01-27 12:00:08 +00:00
|
|
|
/* Published under the GNU General Public License V.2, see file COPYING */
|
|
|
|
|
|
|
|
#ifndef __sysincludes_h_included
|
|
|
|
#define __sysincludes_h_included 1
|
|
|
|
|
2023-10-26 17:08:26 +00:00
|
|
|
/* Sorry for this... */
|
|
|
|
#if defined(__sun) || defined(__sun__) || defined(__SunOS)
|
|
|
|
# define BSD_COMP 1 /* for SIOCGIFFLAGS */
|
|
|
|
#endif
|
|
|
|
|
2016-02-06 14:56:11 +00:00
|
|
|
#include <stddef.h> /* ptrdiff_t */
|
2014-11-23 14:03:54 +00:00
|
|
|
#if HAVE_STDBOOL_H
|
|
|
|
#include <stdbool.h> /* bool, true, false */
|
|
|
|
#endif
|
2011-11-26 13:56:19 +00:00
|
|
|
#if HAVE_INTTYPES_H
|
|
|
|
#include <inttypes.h> /* uint16_t */
|
|
|
|
#endif
|
2008-01-27 12:00:08 +00:00
|
|
|
#if HAVE_LIMITS_H
|
|
|
|
#include <limits.h> /* USHRT_MAX */
|
|
|
|
#endif
|
|
|
|
#include <math.h> /* HUGE_VAL */
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdarg.h> /* for msg() */
|
|
|
|
#include <string.h> /* strerror(), strchr() */
|
|
|
|
#if HAVE_STRINGS_H
|
|
|
|
#include <strings.h> /* strcasecmp(), bzero() for FD_ZERO */
|
|
|
|
#endif
|
|
|
|
#include <stdlib.h> /* malloc(), free() */
|
|
|
|
#include <ctype.h> /* isdigit() */
|
|
|
|
#include <stdio.h> /* FILE */
|
|
|
|
#include <errno.h> /* errno */
|
|
|
|
#if HAVE_SYSLOG_H
|
|
|
|
#include <syslog.h> /* openlog(), syslog(), closelog() */
|
|
|
|
#endif
|
|
|
|
#include <signal.h> /* signal(), SIGPIPE, SIG_IGN */
|
2015-01-12 20:46:16 +00:00
|
|
|
#include <time.h> /* struct timeval, strftime(), clock_gettime() */
|
2008-10-12 10:01:49 +00:00
|
|
|
#if 0
|
2008-01-27 12:00:08 +00:00
|
|
|
#include <sys/timeb.h> /* struct timeb */
|
2008-10-12 10:01:49 +00:00
|
|
|
#endif
|
2008-01-27 12:00:08 +00:00
|
|
|
#if HAVE_UNISTD_H
|
|
|
|
#include <unistd.h> /* select(), read(), write(), stat(), fork() */
|
|
|
|
#endif
|
|
|
|
#if HAVE_PWD_H
|
|
|
|
#include <pwd.h> /* getpwnam() */
|
|
|
|
#endif
|
|
|
|
#if HAVE_GRP_H
|
|
|
|
#include <grp.h> /* getgrnam() */
|
|
|
|
#endif
|
2009-04-02 08:29:06 +00:00
|
|
|
#if HAVE_PTY_H && (_WITH_TERMIOS || HAVE_OPENPTY)
|
2008-01-27 12:00:08 +00:00
|
|
|
#include <pty.h>
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_PARAM_H
|
|
|
|
#include <sys/param.h> /* Linux 2.4 NGROUPS */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_TIME_H
|
|
|
|
#include <sys/time.h> /* select(); OpenBSD: struct timespec */
|
|
|
|
#endif
|
|
|
|
#if HAVE_STDINT_H
|
|
|
|
#include <stdint.h> /* uint8_t */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h> /* pid_t, select(), socket(), connect(), open(), u_short */
|
|
|
|
#endif
|
2015-01-12 21:22:38 +00:00
|
|
|
#if HAVE_POLL_H
|
|
|
|
#include <poll.h> /* poll() */
|
|
|
|
#elif HAVE_SYS_POLL_H
|
2008-01-27 12:00:08 +00:00
|
|
|
#include <sys/poll.h> /* poll() */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_SOCKET_H
|
|
|
|
#include <sys/socket.h> /* struct sockaddr, struct linger, socket(), connect() */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_UIO_H
|
|
|
|
#include <sys/uio.h> /* struct iovec */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_STAT_H
|
|
|
|
#include <sys/stat.h> /* struct stat, stat(), open() */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_WAIT_H
|
|
|
|
#include <sys/wait.h> /* WNOHANG */
|
|
|
|
#endif
|
|
|
|
#if HAVE_FCNTL_H
|
|
|
|
#include <fcntl.h> /* open(), O_RDWR */
|
|
|
|
#endif
|
|
|
|
#if HAVE_NETDB_H && (_WITH_IP4 || _WITH_IP6)
|
|
|
|
#include <netdb.h> /* struct hostent, gethostbyname() */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_UN_H && WITH_UNIX
|
|
|
|
#include <sys/un.h> /* struct sockaddr_un, unix domain sockets */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_IOCTL_H
|
|
|
|
#include <sys/ioctl.h> /* ioctl() */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_SELECT_H
|
|
|
|
#include <sys/select.h> /* select(), fdset on AIX 4.1 */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_FILE_H
|
|
|
|
#include <sys/file.h> /* LOCK_EX, on AIX directly included */
|
|
|
|
#endif
|
2014-03-01 14:58:06 +00:00
|
|
|
#if WITH_IP4 || WITH_IP6
|
2008-01-27 12:00:08 +00:00
|
|
|
# if HAVE_NETINET_IN_H
|
|
|
|
#include <netinet/in.h> /* struct sockaddr_in, htonl() */
|
|
|
|
# endif
|
|
|
|
#endif /* _WITH_SOCKET */
|
|
|
|
#if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6)
|
|
|
|
# if HAVE_NETINET_IN_SYSTM_H
|
|
|
|
#include <netinet/in_systm.h> /* Solaris, FreeBSD: n_long */
|
|
|
|
# endif
|
|
|
|
# if HAVE_NETINET_IP_H
|
|
|
|
#include <netinet/ip.h> /* struct ip - past netinet/in.h on AIX! */
|
|
|
|
# endif
|
|
|
|
# if HAVE_NETINET_TCP_H
|
|
|
|
#include <netinet/tcp.h> /* TCP_RFC1323 */
|
|
|
|
# endif
|
|
|
|
# if HAVE_NETINET_IP6_H && _WITH_IP6
|
|
|
|
#include <netinet/ip6.h>
|
|
|
|
# endif
|
|
|
|
# if HAVE_NETINET6_IN6_H && _WITH_IP6
|
|
|
|
#include <netinet6/in6.h>
|
|
|
|
# endif
|
|
|
|
#include <arpa/inet.h> /* Linux: inet_aton() */
|
|
|
|
#if HAVE_ARPA_NAMESER_H
|
|
|
|
#include <arpa/nameser.h> /* req for resolv.h (esp. on MacOSX) */
|
|
|
|
#endif
|
|
|
|
#include <net/if.h>
|
2008-09-22 20:17:55 +00:00
|
|
|
#if HAVE_NET_IF_DL_H
|
|
|
|
#include <net/if_dl.h> /* FreeBSD: struct sockaddr_dl */
|
|
|
|
#endif
|
2008-01-27 12:00:08 +00:00
|
|
|
#if HAVE_RESOLV_H
|
|
|
|
#include <resolv.h> /* _res */
|
|
|
|
#endif
|
|
|
|
#endif /* _WITH_IP4 || _WITH_IP6 */
|
|
|
|
/*#include <linux/sockios.h>*/
|
|
|
|
#if HAVE_NET_IF_H
|
|
|
|
#include <net/if.h>
|
|
|
|
#endif /* HAVE_NET_IF_H */
|
2008-09-22 20:17:55 +00:00
|
|
|
#if HAVE_LINUX_TYPES_H
|
|
|
|
#include <linux/types.h> /* __u32 for linux/errqueue.h */
|
|
|
|
#endif
|
|
|
|
#if HAVE_LINUX_ERRQUEUE_H
|
|
|
|
#include <linux/errqueue.h> /* struct sock_extended_err */
|
|
|
|
#endif
|
2008-09-20 21:37:56 +00:00
|
|
|
#if HAVE_NETPACKET_PACKET_H
|
|
|
|
#include <netpacket/packet.h>
|
|
|
|
#endif
|
|
|
|
#if HAVE_NETINET_IF_ETHER_H
|
|
|
|
#include <netinet/if_ether.h>
|
|
|
|
#endif
|
2008-01-27 12:00:08 +00:00
|
|
|
#if HAVE_LINUX_IF_TUN_H
|
|
|
|
#include <linux/if_tun.h>
|
|
|
|
#endif
|
|
|
|
|
2008-09-24 06:31:00 +00:00
|
|
|
#if HAVE_TERMIOS_H && _WITH_TERMIOS
|
2008-01-27 12:00:08 +00:00
|
|
|
#include <termios.h>
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_UTSNAME_H
|
|
|
|
#include <sys/utsname.h> /* uname(), struct utsname */
|
|
|
|
#endif
|
|
|
|
#if HAVE_UTIL_H
|
|
|
|
#include <util.h> /* NetBSD, OpenBSD openpty() */
|
|
|
|
#endif
|
2011-12-04 14:14:34 +00:00
|
|
|
#if HAVE_BSD_LIBUTIL_H
|
|
|
|
#include <bsd/libutil.h> /* FreeBSD openpty() */
|
|
|
|
#elif HAVE_LIBUTIL_H
|
2008-01-27 12:00:08 +00:00
|
|
|
#include <libutil.h> /* FreeBSD openpty() */
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_STROPTS_H
|
|
|
|
#include <sys/stropts.h> /* SunOS I_PUSH ... */
|
|
|
|
#endif
|
|
|
|
#if HAVE_REGEX_H
|
|
|
|
#include <regex.h>
|
|
|
|
#endif
|
|
|
|
#if HAVE_LINUX_FS_H
|
2020-12-28 11:37:49 +00:00
|
|
|
#include <linux/fs.h> /* Linux filesystem definitions */
|
2008-01-27 12:00:08 +00:00
|
|
|
#endif
|
|
|
|
#if HAVE_LINUX_EXT2_FS_H
|
|
|
|
#include <linux/ext2_fs.h> /* Linux ext2 filesystem definitions */
|
|
|
|
#endif
|
|
|
|
#if WITH_READLINE
|
|
|
|
# if HAVE_READLINE_READLINE_H
|
|
|
|
#include <readline/readline.h>
|
|
|
|
# endif
|
|
|
|
# if HAVE_READLINE_HISTORY_H
|
|
|
|
#include <readline/history.h>
|
|
|
|
# endif
|
|
|
|
#endif /* WITH_READLINE */
|
|
|
|
#if WITH_OPENSSL
|
|
|
|
#include <openssl/ssl.h>
|
|
|
|
#include <openssl/err.h>
|
|
|
|
#include <openssl/rand.h>
|
2021-01-03 06:43:00 +00:00
|
|
|
#include <openssl/dh.h>
|
|
|
|
#include <openssl/bn.h>
|
2008-01-27 12:00:08 +00:00
|
|
|
#endif
|
2020-12-26 21:46:36 +00:00
|
|
|
#if HAVE_LINUX_VM_SOCKETS_H
|
|
|
|
#include <linux/vm_sockets.h>
|
|
|
|
#endif
|
2008-01-27 12:00:08 +00:00
|
|
|
|
|
|
|
#endif /* !defined(__sysincludes_h_included) */
|