Add a configuration option for TCP keepalives (SO_KEEPALIVE), default off.
[u/mdw/putty] / network.h
index 9a7a50c..4574207 100644 (file)
--- a/network.h
+++ b/network.h
@@ -75,15 +75,24 @@ struct plug_function_table {
 };
 
 /* proxy indirection layer */
+/* NB, control of 'addr' is passed via new_connection, which takes
+ * responsibility for freeing it */
 Socket new_connection(SockAddr addr, char *hostname,
                      int port, int privport,
-                     int oobinline, int nodelay, Plug plug,
-                     const Config *cfg);
+                     int oobinline, int nodelay, int keepalive,
+                     Plug plug, const Config *cfg);
 Socket new_listener(char *srcaddr, int port, Plug plug, int local_host_only,
                    const Config *cfg);
 SockAddr name_lookup(char *host, int port, char **canonicalname,
                     const Config *cfg);
 
+/* platform-dependent callback from new_connection() */
+/* (same caveat about addr as new_connection()) */
+Socket platform_new_connection(SockAddr addr, char *hostname,
+                              int port, int privport,
+                              int oobinline, int nodelay, int keepalive,
+                              Plug plug, const Config *cfg);
+
 /* socket functions */
 
 void sk_init(void);                   /* called once at program startup */
@@ -99,8 +108,10 @@ int sk_addrtype(SockAddr addr);
 void sk_addrcopy(SockAddr addr, char *buf);
 void sk_addr_free(SockAddr addr);
 
+/* NB, control of 'addr' is passed via sk_new, which takes responsibility
+ * for freeing it, as for new_connection() */
 Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
-             int nodelay, Plug p);
+             int nodelay, int keepalive, Plug p);
 
 Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only);