Cleanups of the GSSAPI support. On Windows, standard GSS libraries
[u/mdw/putty] / mac / macnet.c
index 34d6885..fc022dc 100644 (file)
@@ -1,6 +1,7 @@
 #include "putty.h"
 #include "network.h"
 #include "mac.h"
+#include "ssh.h"
 
 struct macnet_stack {
     SockAddr (*namelookup)(char const *, char **);
@@ -12,8 +13,8 @@ struct macnet_stack {
     void (*addrcopy)(SockAddr, char *);
     void (*addr_free)(SockAddr);
     Socket (*skregister)(void *, Plug); /* "register" is a reserved word */
-    Socket (*new)(SockAddr, int, int, int, int, Plug);
-    Socket (*newlistener)(char *, int, Plug, int);
+    Socket (*new)(SockAddr, int, int, int, int, int, Plug);
+    Socket (*newlistener)(char *, int, Plug, int, int);
     char *(*addr_error)(SockAddr);
     void (*poll)(void);
     void (*cleanup)(void);
@@ -27,24 +28,28 @@ static struct macnet_stack ot = {
     ot_register, ot_new, ot_newlistener, ot_addr_error, ot_poll, ot_cleanup
 };
 
+#if !TARGET_API_MAC_CARBON
 static struct macnet_stack mactcp = {
     mactcp_namelookup, mactcp_nonamelookup, mactcp_getaddr,
     mactcp_hostname_is_local, mactcp_address_is_local, mactcp_addrtype,
     mactcp_addrcopy, mactcp_addr_free, mactcp_register, mactcp_new,
     mactcp_newlistener, mactcp_addr_error, mactcp_poll, mactcp_cleanup
 };
+#endif
 
 void sk_init(void)
 {
 
-#if 0
+#ifndef NO_OT
     if (ot_init() == noErr)
        stack = &ot;
     else
 #endif
+#if !TARGET_API_MAC_CARBON
     if (mactcp_init() == noErr)
        stack = &mactcp;
     else
+#endif
        stack = NULL;
 }
 
@@ -52,7 +57,7 @@ void sk_init(void)
  * Network functions exported to the world.  These choose whether to call
  * MacTCP or OpenTransport and behave accordingly.
  */
-SockAddr sk_namelookup(char const *host, char **canonicalname)
+SockAddr sk_namelookup(char const *host, char **canonicalname, int address_family)
 {
 
     if (stack != NULL)
@@ -124,23 +129,24 @@ Socket sk_register(void *sock, Plug plug)
 }
 
 Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
-             int nodelay, Plug plug)
+             int nodelay, int keepalive, Plug plug)
 {
 
     if (stack != NULL)
-       return stack->new(addr, port, privport, oobinline, nodelay, plug);
+       return stack->new(addr, port, privport, oobinline, nodelay, keepalive,
+                         plug);
     return NULL;
 }
 
-Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only)
+Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only, int address_family)
 {
 
     if (stack != NULL)
-       return stack->newlistener(srcaddr, port, plug, local_host_only);
+       return stack->newlistener(srcaddr, port, plug, local_host_only, address_family);
     return NULL;
 }
 
-char *sk_addr_error(SockAddr addr)
+const char *sk_addr_error(SockAddr addr)
 {
 
     if (stack != NULL)
@@ -162,6 +168,19 @@ void sk_cleanup(void)
        stack->cleanup();
 }
 
+/* We should use Internet Config here. */
+int net_service_lookup(char *service)
+{
+
+    return 0;
+}
+
+SockAddr platform_get_x11_unix_address(const char *display, int displaynum,
+                                      char **canonicalname)
+{
+    return NULL;
+}
+
 /*
  * Local Variables:
  * c-file-style: "simon"