[evolution-data-server/camel-socks-proxy: 1/2] Add camel_tcp_stream_set/get_socks_proxy()



commit 15795951a9bb3682ec6851ae3246fe37dfe4319f
Author: Federico Mena Quintero <federico novell com>
Date:   Wed May 12 15:00:09 2010 -0500

    Add camel_tcp_stream_set/get_socks_proxy()
    
    This will be the low-level function to set a SOCKS proxy for TCP streams.
    In subsequent commits we'll add the machinery to CamelSession et al
    to pass down the client's specified proxy into TCP streams.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 camel/camel-tcp-stream.c |   17 +++++++++++++++++
 camel/camel-tcp-stream.h |    2 ++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-tcp-stream.c b/camel/camel-tcp-stream.c
index 9584806..686a0f0 100644
--- a/camel/camel-tcp-stream.c
+++ b/camel/camel-tcp-stream.c
@@ -154,6 +154,23 @@ camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *dat
 	return CTS_CLASS (stream)->setsockopt (stream, data);
 }
 
+/**
+ * camel_tcp_stream_set_socks_proxy:
+ * @stream: a #CamelTcpStream object
+ * @socks_host: hostname to use for the SOCKS proxy
+ * @socks_port: port number to use for the SOCKS proxy
+ *
+ * Configures a SOCKS proxy for the specified @stream.  Instead of direct connections,
+ * this @stream will instead go through the proxy.
+ */
+void
+camel_tcp_stream_set_socks_proxy (CamelTcpStream *stream, const char *socks_host, int socks_port)
+{
+	g_return_if_fail (CAMEL_IS_TCP_STREAM (stream));
+
+	/* FIXME */
+}
+
 static struct sockaddr *
 tcp_get_local_address (CamelTcpStream *stream, socklen_t *len)
 {
diff --git a/camel/camel-tcp-stream.h b/camel/camel-tcp-stream.h
index 238c0fa..d48ba81 100644
--- a/camel/camel-tcp-stream.h
+++ b/camel/camel-tcp-stream.h
@@ -115,6 +115,8 @@ gint         camel_tcp_stream_connect    (CamelTcpStream *stream, struct addrinf
 gint         camel_tcp_stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
 gint         camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
 
+void camel_tcp_stream_set_socks_proxy (CamelTcpStream *stream, const char *socks_host, int socks_port);
+
 struct sockaddr *camel_tcp_stream_get_local_address  (CamelTcpStream *stream, socklen_t *len);
 struct sockaddr *camel_tcp_stream_get_remote_address (CamelTcpStream *stream, socklen_t *len);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]