diff dbutil.h @ 1024:aac0095dc3b4 fastopen

work in progress for async connect
author Matt Johnston <matt@ucc.asn.au>
date Wed, 18 Feb 2015 00:05:27 +0800
parents a00303a7d247
children 02baa0b334e8
line wrap: on
line diff
--- a/dbutil.h	Sun Feb 15 22:34:05 2015 +0800
+++ b/dbutil.h	Wed Feb 18 00:05:27 2015 +0800
@@ -76,7 +76,7 @@
 void set_sock_nodelay(int sock);
 void set_sock_priority(int sock, enum dropbear_prio prio);
 
-#ifdef __linux__
+#if defined(__linux__) && HAVE_SENDMSG
 #define DROPBEAR_TCP_FAST_OPEN
 void set_listen_fast_open(int sock);
 #endif
@@ -89,7 +89,6 @@
 #ifdef ENABLE_CONNECT_UNIX
 int connect_unix(const char* addr);
 #endif
-int connect_remote(const char* remotehost, const char* remoteport, char ** errstring);
 int buf_readfile(buffer* buf, const char* filename);
 int buf_getline(buffer * line, FILE * authfile);
 
@@ -118,4 +117,16 @@
 
 char * expand_tilde(const char *inpath);
 
+struct dropbear_progress_connection;
+
+/* result is DROPBEAR_SUCCESS or DROPBEAR_FAILURE.
+errstring is only set on DROPBEAR_FAILURE, returns failure message for the last attempted socket */
+typedef void(*connect_callback)(int result, int sock, void* data, const char* errstring);
+
+struct dropbear_progress_connection * connect_remote (const char* remotehost, const char* remoteport,
+	connect_callback cb, void *cb_data);
+
+void set_connect_fds(fd_set *writefd);
+void handle_connect_fds(fd_set *writefd);
+
 #endif /* _DBUTIL_H_ */