summaryrefslogtreecommitdiff
path: root/source4/lib/tls/tls.h
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-05-02 20:15:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:05:32 -0500
commit742c110cd67f4995639822981e8bfcb1f652f2c4 (patch)
treecd6774c861b0a968c3d22b24b5a02a0be9c54043 /source4/lib/tls/tls.h
parent49994442bbb035b2c438a33f411d6b5a8b2313df (diff)
downloadsamba-742c110cd67f4995639822981e8bfcb1f652f2c4.tar.gz
samba-742c110cd67f4995639822981e8bfcb1f652f2c4.tar.bz2
samba-742c110cd67f4995639822981e8bfcb1f652f2c4.zip
r15400: Move the TLS code behind the socket interface.
This reduces caller complexity, because the TLS code is now called just like any other socket. (A new socket context is returned by the tls_init_server and tls_init_client routines). When TLS is not available, the original socket is returned. Andrew Bartlett (This used to be commit 09b2f30dfa7a640f5187b4933204e9680be61497)
Diffstat (limited to 'source4/lib/tls/tls.h')
-rw-r--r--source4/lib/tls/tls.h26
1 files changed, 6 insertions, 20 deletions
diff --git a/source4/lib/tls/tls.h b/source4/lib/tls/tls.h
index df67bad0e4..00186408e0 100644
--- a/source4/lib/tls/tls.h
+++ b/source4/lib/tls/tls.h
@@ -37,31 +37,21 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx);
tls and non-tls servers on the same port. If this is NULL then only
tls connections will be allowed
*/
-struct tls_context *tls_init_server(struct tls_params *parms,
+struct socket_context *tls_init_server(struct tls_params *parms,
struct socket_context *sock,
struct fd_event *fde,
- const char *plain_chars,
- BOOL tls_enable);
+ const char *plain_chars);
/*
call tls_init_client() on each new client connection
*/
-struct tls_context *tls_init_client(struct socket_context *sock,
- struct fd_event *fde,
- BOOL tls_enable);
-
-/*
- call these to send and receive data. They behave like socket_send() and socket_recv()
- */
-NTSTATUS tls_socket_recv(struct tls_context *tls, void *buf, size_t wantlen,
- size_t *nread);
-NTSTATUS tls_socket_send(struct tls_context *tls, const DATA_BLOB *blob,
- size_t *sendlen);
+struct socket_context *tls_init_client(struct socket_context *sock,
+ struct fd_event *fde);
/*
return True if a connection used tls
*/
-BOOL tls_enabled(struct tls_context *tls);
+BOOL tls_enabled(struct socket_context *tls);
/*
@@ -69,10 +59,6 @@ BOOL tls_enabled(struct tls_context *tls);
*/
BOOL tls_support(struct tls_params *parms);
-
-/*
- ask for the number of bytes in a pending incoming packet
-*/
-NTSTATUS tls_socket_pending(struct tls_context *tls, size_t *npending);
+const struct socket_ops *socket_tls_ops(enum socket_type type);
#endif