summaryrefslogtreecommitdiff
path: root/source4/lib/socket/socket.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-29 16:25:03 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-30 13:41:08 +0100
commit706e10820d490e0865b73f66a8665951aa6a71e3 (patch)
tree046a6f5dfc3595d9562d2f28210c1c513d8b39d0 /source4/lib/socket/socket.h
parent99f2177e8fbf7f288fa896a0c64bfb6ae03b9ada (diff)
downloadsamba-706e10820d490e0865b73f66a8665951aa6a71e3.tar.gz
samba-706e10820d490e0865b73f66a8665951aa6a71e3.tar.bz2
samba-706e10820d490e0865b73f66a8665951aa6a71e3.zip
s4:lib/socket: add socket_connect_multi_ex_*
This add an async establish hook, that gets called before a connection success is detected. This can be used to do a NBT session request and it makes sure that we don't cancel the connection on port 445, just because the tcp connect on port 139 worked. metze
Diffstat (limited to 'source4/lib/socket/socket.h')
-rw-r--r--source4/lib/socket/socket.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/lib/socket/socket.h b/source4/lib/socket/socket.h
index e00b61ba6c..403a723edb 100644
--- a/source4/lib/socket/socket.h
+++ b/source4/lib/socket/socket.h
@@ -202,6 +202,34 @@ NTSTATUS socket_connect_ev(struct socket_context *sock,
uint32_t flags,
struct tevent_context *ev);
+struct socket_connect_multi_ex {
+ void *private_data;
+ struct tevent_req *(*establish_send)(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct socket_context *sock,
+ struct socket_address *addr,
+ void *private_data);
+ NTSTATUS (*establish_recv)(struct tevent_req *req);
+};
+struct composite_context *socket_connect_multi_ex_send(TALLOC_CTX *mem_ctx,
+ const char *server_address,
+ int num_server_ports,
+ uint16_t *server_ports,
+ struct resolve_context *resolve_ctx,
+ struct tevent_context *event_ctx,
+ struct socket_connect_multi_ex *ex);
+NTSTATUS socket_connect_multi_ex_recv(struct composite_context *ctx,
+ TALLOC_CTX *mem_ctx,
+ struct socket_context **result,
+ uint16_t *port);
+NTSTATUS socket_connect_multi_ex(TALLOC_CTX *mem_ctx, const char *server_address,
+ int num_server_ports, uint16_t *server_ports,
+ struct resolve_context *resolve_ctx,
+ struct tevent_context *event_ctx,
+ struct socket_connect_multi_ex *ex,
+ struct socket_context **result,
+ uint16_t *port);
+
struct composite_context *socket_connect_multi_send(TALLOC_CTX *mem_ctx,
const char *server_address,
int num_server_ports,