summaryrefslogtreecommitdiffstats
path: root/demos/tunala/tunala.h
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2001-07-23 21:03:48 +0200
committerGeoff Thorpe <geoff@openssl.org>2001-07-23 21:03:48 +0200
commit3866752e7e0d1d5e15ad4b34e5dd586ac1158a22 (patch)
treec3102005aec20ae586b76dbf47d99a42c215d851 /demos/tunala/tunala.h
parentAdditional inline reference. (diff)
downloadopenssl-3866752e7e0d1d5e15ad4b34e5dd586ac1158a22.tar.xz
openssl-3866752e7e0d1d5e15ad4b34e5dd586ac1158a22.zip
- New INSTALL document describing different ways to build "tunala" and
possible problems. - New file breakage.c handles (so far) missing functions. - Get rid of some signed/unsigned/const warnings thanks to solaris-cc - Add autoconf/automake input files, and helper scripts to populate missing (but auto-generated) files. This change adds a configure.in and Makefile.am to build everything using autoconf, automake, and libtool - and adds "gunk" scripts to generate the various files those things need (and clean then up again after). This means that "autogunk.sh" needs to be run first on a system with the autotools, but the resulting directory should be "configure"able and compilable on systems without those tools.
Diffstat (limited to '')
-rw-r--r--demos/tunala/tunala.h58
1 files changed, 55 insertions, 3 deletions
diff --git a/demos/tunala/tunala.h b/demos/tunala/tunala.h
index bc8623a182..4271a4d4a8 100644
--- a/demos/tunala/tunala.h
+++ b/demos/tunala/tunala.h
@@ -17,13 +17,57 @@
#ifndef _TUNALA_H
#define _TUNALA_H
+/* pull in autoconf fluff */
+#ifndef NO_CONFIG_H
+#include "config.h"
+#else
+/* We don't have autoconf, we have to set all of these unless a tweaked Makefile
+ * tells us not to ... */
+/* headers */
+#ifndef NO_HAVE_SELECT
+#define HAVE_SELECT
+#endif
+#ifndef NO_HAVE_SOCKET
+#define HAVE_SOCKET
+#endif
+#ifndef NO_HAVE_UNISTD_H
+#define HAVE_UNISTD_H
+#endif
+#ifndef NO_HAVE_FCNTL_H
+#define HAVE_FCNTL_H
+#endif
+#ifndef NO_HAVE_LIMITS_H
+#define HAVE_LIMITS_H
+#endif
+/* features */
+#ifndef NO_HAVE_STRSTR
+#define HAVE_STRSTR
+#endif
+#ifndef NO_HAVE_STRTOUL
+#define HAVE_STRTOUL
+#endif
+#endif
+
+#if !defined(HAVE_SELECT) || !defined(HAVE_SOCKET)
+#error "can't build without some network basics like select() and socket()"
+#endif
+
+#include <stdlib.h>
#ifndef NO_SYSTEM_H
#include <string.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
#include <netdb.h>
#include <signal.h>
#include <sys/socket.h>
+#include <sys/types.h>
#include <netinet/in.h>
#endif /* !defined(NO_SYSTEM_H) */
@@ -143,20 +187,28 @@ int ip_initialise(void);
/* ip is the 4-byte ip address (eg. 127.0.0.1 is {0x7F,0x00,0x00,0x01}), port is
* the port to listen on (host byte order), and the return value is the
* file-descriptor or -1 on error. */
-int ip_create_listener_split(const unsigned char *ip, unsigned short port);
+int ip_create_listener_split(const char *ip, unsigned short port);
/* Same semantics as above. */
-int ip_create_connection_split(const unsigned char *ip, unsigned short port);
+int ip_create_connection_split(const char *ip, unsigned short port);
/* Converts a string into the ip/port before calling the above */
int ip_create_listener(const char *address);
int ip_create_connection(const char *address);
/* Just does a string conversion on its own. NB: If accept_all_ip is non-zero,
* then the address string could be just a port. Ie. it's suitable for a
* listening address but not a connecting address. */
-int ip_parse_address(const char *address, unsigned char **parsed_ip,
+int ip_parse_address(const char *address, const char **parsed_ip,
unsigned short *port, int accept_all_ip);
/* Accepts an incoming connection through the listener. Assumes selects and
* what-not have deemed it an appropriate thing to do. */
int ip_accept_connection(int listen_fd);
#endif /* !defined(NO_IP) */
+/* These functions wrap up things that can be portability hassles. */
+int int_strtoul(const char *str, unsigned long *val);
+#ifdef HAVE_STRSTR
+#define int_strstr strstr
+#else
+char *int_strstr(const char *haystack, const char *needle);
+#endif
+
#endif /* !defined(_TUNALA_H) */