summaryrefslogtreecommitdiff
path: root/dbutil.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2015-02-18 00:05:27 +0800
committerMatt Johnston <matt@ucc.asn.au>2015-02-18 00:05:27 +0800
commitae8c94249d1df9e69d48f9998aa202a909d7074c (patch)
treeabb93c9a06635d4770de46db0bb11591c146753a /dbutil.h
parent91494d868c4d28b0bbc41d8de0c618b1bd9ba1ba (diff)
downloaddropbear-ae8c94249d1df9e69d48f9998aa202a909d7074c.tar.gz
work in progress for async connect
Diffstat (limited to 'dbutil.h')
-rw-r--r--dbutil.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/dbutil.h b/dbutil.h
index eb630a7..3f4f165 100644
--- a/dbutil.h
+++ b/dbutil.h
@@ -76,7 +76,7 @@ void getaddrstring(struct sockaddr_storage* addr,
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 @@ void run_shell_command(const char* cmd, unsigned int maxfd, char* usershell);
#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 @@ time_t monotonic_now();
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_ */