From 8b81e7c7c65f3923aaa7a366733000517b44756e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 09:44:53 +0100 Subject: Happy New Year! metze --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index a8a2d98154..3253773903 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -27,7 +27,7 @@ #define _SMB_H /* logged when starting the various Samba daemons */ -#define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2008" +#define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2009" #if defined(LARGE_SMB_OFF_T) -- cgit From aed8c7bfcfb3c860758d39d476ca87ef9eda2b6d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 20 Dec 2008 10:44:29 +0100 Subject: packet.h API: The callback is now responsible to talloc_free() "buf" --- source3/include/packet.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/packet.h b/source3/include/packet.h index 05974da8fc..03331da750 100644 --- a/source3/include/packet.h +++ b/source3/include/packet.h @@ -44,12 +44,14 @@ NTSTATUS packet_fd_read_sync(struct packet_context *ctx); * Handle an incoming packet: * Return False if none is available * Otherwise return True and store the callback result in *status + * Callback must either talloc_move or talloc_free buf */ bool packet_handler(struct packet_context *ctx, - bool (*full_req)(const DATA_BLOB *data, + bool (*full_req)(const uint8_t *buf, + size_t available, size_t *length, void *private_data), - NTSTATUS (*callback)(const DATA_BLOB *data, + NTSTATUS (*callback)(uint8_t *buf, size_t length, void *private_data), void *private_data, NTSTATUS *status); -- cgit From 27abf6731ed472580157a0447e858e11f6f63f3b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 3 Jan 2009 10:34:59 +0100 Subject: struct async_req doesn't really need to carry an event_context --- source3/include/async_req.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/async_req.h b/source3/include/async_req.h index 14a30696c4..2633027e37 100644 --- a/source3/include/async_req.h +++ b/source3/include/async_req.h @@ -96,13 +96,6 @@ struct async_req { **/ NTSTATUS status; - /** - * @brief The event context we are using - * - * The event context that this async request works on. - */ - struct event_context *event_ctx; - /** * @brief What to do on completion * @@ -122,7 +115,7 @@ struct async_req { } async; }; -struct async_req *async_req_new(TALLOC_CTX *mem_ctx, struct event_context *ev); +struct async_req *async_req_new(TALLOC_CTX *mem_ctx); char *async_req_print(TALLOC_CTX *mem_ctx, struct async_req *req); @@ -130,7 +123,8 @@ void async_req_done(struct async_req *req); void async_req_error(struct async_req *req, NTSTATUS status); -bool async_post_status(struct async_req *req, NTSTATUS status); +bool async_post_status(struct async_req *req, struct event_context *ev, + NTSTATUS status); bool async_req_nomem(const void *p, struct async_req *req); -- cgit From b6138bf4f22e7a093d35e2f23992595acae55068 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 27 Dec 2008 18:42:45 +0100 Subject: Fix retval of async_syscall_result_int --- source3/include/async_sock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/async_sock.h b/source3/include/async_sock.h index f0cd5fdaa4..892ffef087 100644 --- a/source3/include/async_sock.h +++ b/source3/include/async_sock.h @@ -24,7 +24,7 @@ ssize_t async_syscall_result_ssize_t(struct async_req *req, int *perrno); size_t async_syscall_result_size_t(struct async_req *req, int *perrno); -ssize_t async_syscall_result_int(struct async_req *req, int *perrno); +int async_syscall_result_int(struct async_req *req, int *perrno); struct async_req *async_send(TALLOC_CTX *mem_ctx, struct event_context *ev, int fd, const void *buffer, size_t length, -- cgit From fafb9ecc613914ee49bfdb4c1eb249fcbbcf25f7 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 3 Jan 2009 18:16:08 +0100 Subject: open_socket_out is always used with SOCK_STREAM, remove argument "type" --- source3/include/proto.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index be34bb0e65..42d1f52fe1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1457,8 +1457,7 @@ int open_socket_in(int type, int dlevel, const struct sockaddr_storage *psock, bool rebind); -int open_socket_out(int type, - const struct sockaddr_storage *pss, +int open_socket_out(const struct sockaddr_storage *pss, uint16_t port, int timeout); bool open_any_socket_out(struct sockaddr_storage *addrs, int num_addrs, -- cgit From ebacce2efe6dbb27a9e7962597da8ef783473f6a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 3 Jan 2009 19:10:57 +0100 Subject: Add async timeout helpers --- source3/include/async_req.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/include') diff --git a/source3/include/async_req.h b/source3/include/async_req.h index 2633027e37..bbe52da723 100644 --- a/source3/include/async_req.h +++ b/source3/include/async_req.h @@ -132,4 +132,14 @@ bool async_req_is_error(struct async_req *req, NTSTATUS *status); NTSTATUS async_req_simple_recv(struct async_req *req); +bool async_req_set_timeout(struct async_req *req, struct event_context *ev, + struct timeval to); + +struct async_req *async_wait_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct timeval to); + +NTSTATUS async_wait_recv(struct async_req *req); + + #endif -- cgit From 611f0d7ee607bad65b7a40ba2f0195ba987f1cab Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 4 Jan 2009 11:28:40 +0100 Subject: Add an async queueing mechanism --- source3/include/async_req.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/include') diff --git a/source3/include/async_req.h b/source3/include/async_req.h index bbe52da723..1b8dbf3346 100644 --- a/source3/include/async_req.h +++ b/source3/include/async_req.h @@ -141,5 +141,13 @@ struct async_req *async_wait_send(TALLOC_CTX *mem_ctx, NTSTATUS async_wait_recv(struct async_req *req); +struct async_req_queue; + +struct async_req_queue *async_req_queue_init(TALLOC_CTX *mem_ctx); + +bool async_req_enqueue(struct async_req_queue *queue, + struct event_context *ev, + struct async_req *req, + void (*trigger)(struct async_req *req)); #endif -- cgit From c6c33d840ba90686fcdc81b49b5e256270b97f29 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 4 Jan 2009 00:26:49 +0100 Subject: Convert async_connect to "normal" style --- source3/include/async_sock.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/async_sock.h b/source3/include/async_sock.h index 892ffef087..c6f95d64d5 100644 --- a/source3/include/async_sock.h +++ b/source3/include/async_sock.h @@ -32,9 +32,11 @@ struct async_req *async_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct event_context *ev, int fd, void *buffer, size_t length, int flags); -struct async_req *async_connect(TALLOC_CTX *mem_ctx, struct event_context *ev, - int fd, const struct sockaddr *address, - socklen_t address_len); +struct async_req *async_connect_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + int fd, const struct sockaddr *address, + socklen_t address_len); +NTSTATUS async_connect_recv(struct async_req *req, int *perrno); struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct event_context *ev, int fd, const void *buffer, size_t length, -- cgit From 4df681abf497c24e8abf3df1137023389bfed709 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 27 Dec 2008 18:43:03 +0100 Subject: async libwbclient infrastructure --- source3/include/proto.h | 10 ++++++++++ source3/include/smb.h | 1 + 2 files changed, 11 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 42d1f52fe1..dc63611514 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7982,4 +7982,14 @@ NTSTATUS idmap_sid_to_gid(const char *domname, DOM_SID *sid, gid_t *gid); NTSTATUS nss_info_template_init( void ); +/* Misc protos */ + +struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct event_context *ev, + struct wb_context *wb_ctx, bool need_priv, + const struct winbindd_request *wb_req); +NTSTATUS wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx, + struct winbindd_response **presponse); +struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx); + + #endif /* _PROTO_H_ */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 3253773903..7fd4fbb553 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -369,6 +369,7 @@ struct share_mode_entry; struct uuid; struct named_mutex; struct pcap_cache; +struct wb_context; struct vfs_fsp_data { struct vfs_fsp_data *next; -- cgit From 19b783cce9edf7b616cd1a9d9dcb78a02791d89e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 3 Jan 2009 19:50:05 +0100 Subject: Async wrapper for open_socket_out_send/recv --- source3/include/proto.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index dc63611514..957302c378 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1457,9 +1457,14 @@ int open_socket_in(int type, int dlevel, const struct sockaddr_storage *psock, bool rebind); -int open_socket_out(const struct sockaddr_storage *pss, - uint16_t port, - int timeout); +NTSTATUS open_socket_out(const struct sockaddr_storage *pss, uint16_t port, + int timeout, int *pfd); +struct async_req *open_socket_out_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + const struct sockaddr_storage *pss, + uint16_t port, + int timeout); +NTSTATUS open_socket_out_recv(struct async_req *req, int *pfd); bool open_any_socket_out(struct sockaddr_storage *addrs, int num_addrs, int timeout, int *fd_index, int *fd); int open_udp_socket(const char *host, int port); -- cgit From 0cc63c64166d2e26b7a7ffc0e78ea6041de35f53 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 4 Jan 2009 01:45:06 +0100 Subject: Add open_socket_out_defer_send/recv --- source3/include/proto.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 957302c378..6238ba3d00 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1465,6 +1465,13 @@ struct async_req *open_socket_out_send(TALLOC_CTX *mem_ctx, uint16_t port, int timeout); NTSTATUS open_socket_out_recv(struct async_req *req, int *pfd); +struct async_req *open_socket_out_defer_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct timeval wait_time, + const struct sockaddr_storage *pss, + uint16_t port, + int timeout); +NTSTATUS open_socket_out_defer_recv(struct async_req *req, int *pfd); bool open_any_socket_out(struct sockaddr_storage *addrs, int num_addrs, int timeout, int *fd_index, int *fd); int open_udp_socket(const char *host, int port); -- cgit