r17930: Merge noinclude branch:
[ira/wip.git] / source / winbind / wb_server.h
index 30737bccbfbfb7c17e7ee719665eba4bf3808129..42f11157d226a4dd7ff86b53c7dd6a2db8d51bbc 100644 (file)
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#define WINBINDD_DIR "/tmp/.winbindd/"
-#define WINBINDD_SOCKET WINBINDD_DIR"socket"
-/* the privileged socket is in smbd_tmp_dir() */
-#define WINBINDD_PRIVILEGED_SOCKET "winbind_socket"
+#include "nsswitch/winbindd_nss.h"
+
 
-#define WINBINDD_SAMBA3_SOCKET WINBINDD_DIR"pipe"
+
+#define WINBINDD_SAMBA3_SOCKET "pipe"
 /* the privileged socket is in smbd_tmp_dir() */
 #define WINBINDD_SAMBA3_PRIVILEGED_SOCKET "winbind_pipe"
 
@@ -45,14 +44,20 @@ struct wbsrv_samconn {
        NTSTATUS (*seqnum_recv)(struct composite_context *, uint64_t *);
 };
 
+struct wb_dom_info {
+       const char *name;
+       const char *dns_name;
+       const struct dom_sid *sid;
+
+       const char *dc_name;
+       const char *dc_dns_name;
+       const char *dc_address;
+};
+
 struct wbsrv_domain {
        struct wbsrv_domain *next, *prev;
 
-       BOOL initialized;
-
-       const char *name;
-       const struct dom_sid *sid;
-       const char *dcname;
+       struct wb_dom_info *info;
 
        struct dcerpc_pipe *lsa_pipe;
        struct policy_handle *lsa_policy;
@@ -62,26 +67,10 @@ struct wbsrv_domain {
        struct policy_handle *samr_handle;
        struct policy_handle *domain_handle;
 
-       struct dcerpc_pipe *netlogon_auth2_pipe;
+       struct ldap_connection *ldap_conn;
+
        struct dcerpc_pipe *netlogon_pipe;
        struct cli_credentials *schannel_creds;
-
-       BOOL busy;
-       struct domain_request_state *request_queue;
-};
-
-/* 
-  this is an abstraction for the actual protocol being used,
-  so that we can listen on different sockets with different protocols
-  e.g. the old samba3 protocol on one socket and a new protocol on another socket
-*/
-struct wbsrv_protocol_ops {
-       const char *name;
-       BOOL allow_pending_calls;
-       uint32_t (*packet_length)(DATA_BLOB blob);
-       NTSTATUS (*pull_request)(DATA_BLOB blob, TALLOC_CTX *mem_ctx, struct wbsrv_call **call);
-       NTSTATUS (*handle_call)(struct wbsrv_call *call);
-       NTSTATUS (*push_reply)(struct wbsrv_call *call, TALLOC_CTX *mem_ctx, DATA_BLOB *blob);
 };
 
 /*
@@ -91,7 +80,6 @@ struct wbsrv_listen_socket {
        const char *socket_path;
        struct wbsrv_service *service;
        BOOL privileged;
-       const struct wbsrv_protocol_ops *ops;
 };
 
 /*
@@ -107,21 +95,16 @@ struct wbsrv_connection {
        /* storage for protocol specific data */
        void *protocol_private_data;
 
-       /* the partial data we've receiced yet */
-       DATA_BLOB partial;
-
-       /* the amount that we used yet from the partial buffer */
-       uint32_t partial_read;
-
-       /* prevent loops when we use half async code, while processing a requuest */
-       BOOL processing;
-
        /* how many calls are pending */
        uint32_t pending_calls;
 
-       struct data_blob_list_item *send_queue;
+       struct packet_context *packet;
 };
 
+#define WBSRV_SAMBA3_SET_STRING(dest, src) do { \
+       strncpy(dest, src, sizeof(dest)-1);\
+} while(0)
+
 /*
   state of one request
 
@@ -140,16 +123,29 @@ struct wbsrv_connection {
      return;
 
 */
-struct wbsrv_call {
+struct wbsrv_samba3_call {
 #define WBSRV_CALL_FLAGS_REPLY_ASYNC 0x00000001
        uint32_t flags;
 
-       /* the backend should use this event context */
-       struct event_context *event_ctx;
-
        /* the connection the call belongs to */
        struct wbsrv_connection *wbconn;
 
-       /* storage for protocol specific data */
+       /* the backend should use this event context */
+       struct event_context *event_ctx;
+
+       /* here the backend can store stuff like composite_context's ... */
        void *private_data;
+
+       /* the request structure of the samba3 protocol */
+       struct winbindd_request request;
+       
+       /* the response structure of the samba3 protocol*/
+       struct winbindd_response response;
 };
+
+struct netr_LMSessionKey;
+struct netr_UserSessionKey;
+struct winbind_SamLogon;
+
+#include "winbind/wb_async_helpers.h"
+#include "winbind/wb_proto.h"