]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - network.h
Log identifying information for the other end of connections.
[PuTTY.git] / network.h
index ec67ba942345f9b15d5f3813c856942bd6f80667..7dc497827a26b7e1dcd469cd14f23d3491a6d252 100644 (file)
--- a/network.h
+++ b/network.h
@@ -38,6 +38,7 @@ struct socket_function_table {
     void (*set_frozen) (Socket s, int is_frozen);
     /* ignored by tcp, but vital for ssl */
     const char *(*socket_error) (Socket s);
+    char *(*peer_info) (Socket s);
 };
 
 typedef union { void *p; int i; } accept_ctx_t;
@@ -182,6 +183,13 @@ const char *sk_addr_error(SockAddr addr);
  */
 #define sk_set_frozen(s, is_frozen) (((*s)->set_frozen) (s, is_frozen))
 
+/*
+ * Return a (dynamically allocated) string giving some information
+ * about the other end of the socket, suitable for putting in log
+ * files. May be NULL if nothing is available at all.
+ */
+#define sk_peer_info(s) (((*s)->peer_info) (s))
+
 /*
  * Simple wrapper on getservbyname(), needed by ssh.c. Returns the
  * port number, in host byte order (suitable for printf and so on).