winbind: Use one queue for all domain children
[samba.git] / source3 / winbindd / winbindd.h
index f676b1e317af375f4e9276fcaf8d8a59d6a6597a..081722f6a901bb9317f6a837af2b55e7ce710096 100644 (file)
@@ -28,8 +28,6 @@
 #include "librpc/gen_ndr/dcerpc.h"
 #include "librpc/gen_ndr/winbind.h"
 
-#include "talloc_dict.h"
-
 #include "../lib/util/tevent_ntstatus.h"
 
 #ifdef HAVE_LIBNSCD
@@ -67,6 +65,7 @@ struct winbindd_cli_state {
        struct winbindd_request *request;         /* Request from client */
        struct tevent_queue *out_queue;
        struct winbindd_response *response;        /* Respose to client */
+       struct tevent_req *io_req; /* wb_req_read_* or wb_resp_write_* */
 
        struct getpwent_state *pwent_state; /* State for getpwent() */
        struct getgrent_state *grent_state; /* State for getgrent() */
@@ -74,9 +73,8 @@ struct winbindd_cli_state {
 
 struct getpwent_state {
        struct winbindd_domain *domain;
-       int next_user;
-       int num_users;
-       struct wbint_userinfo *users;
+       uint32_t next_user;
+       struct wbint_RidArray rids;
 };
 
 struct getgrent_state {
@@ -86,17 +84,6 @@ struct getgrent_state {
        struct wbint_Principal *groups;
 };
 
-/* Storage for cached getpwent() user entries */
-
-struct getpwent_user {
-       fstring name;                        /* Account name */
-       fstring gecos;                       /* User information */
-       fstring homedir;                     /* User Home Directory */
-       fstring shell;                       /* User Login Shell */
-       struct dom_sid user_sid;                    /* NT user and primary group SIDs */
-       struct dom_sid group_sid;
-};
-
 /* Our connection to the DC */
 
 struct winbindd_cm_conn {
@@ -112,8 +99,7 @@ struct winbindd_cm_conn {
        struct policy_handle lsa_policy;
 
        struct rpc_pipe_client *netlogon_pipe;
-       struct netlogon_creds_cli_context *netlogon_creds;
-       uint32_t netlogon_flags;
+       struct netlogon_creds_cli_context *netlogon_creds_ctx;
        bool netlogon_force_reauth;
 };
 
@@ -152,9 +138,11 @@ struct winbindd_domain {
        char *alt_name;                        /* alt Domain name, if any (FQDN for ADS) */
        char *forest_name;                     /* Name of the AD forest we're in */
        struct dom_sid sid;                           /* SID for this domain */
+       enum netr_SchannelType secure_channel_type;
        uint32_t domain_flags;                   /* Domain flags from netlogon.h */
        uint32_t domain_type;                    /* Domain type from netlogon.h */
        uint32_t domain_trust_attribs;           /* Trust attribs from netlogon.h */
+       struct winbindd_domain *routing_domain;
        bool initialized;                      /* Did we already ask for the domain mode? */
        bool native_mode;                      /* is this a win2k domain in native mode ? */
        bool active_directory;                 /* is this a win2k active directory ? */
@@ -167,24 +155,16 @@ struct winbindd_domain {
 
        bool can_do_ncacn_ip_tcp;
 
-       /* Lookup methods for this domain (LDAP or RPC) */
-       struct winbindd_methods *methods;
-
-       /* the backend methods are used by the cache layer to find the right
-          backend */
+       /*
+        * Lookup methods for this domain (LDAP or RPC). The backend
+        * methods are used by the cache layer.
+        */
        struct winbindd_methods *backend;
 
         /* Private data for the backends (used for connection cache) */
 
        void *private_data;
 
-       /*
-        * idmap config settings, used to tell the idmap child which
-        * special domain config to use for a mapping
-        */
-       bool have_idmap_config;
-       uint32_t id_range_low, id_range_high;
-
        /* A working DC */
        pid_t dc_probe_pid; /* Child we're using to detect the DC. */
        char *dcname;
@@ -204,6 +184,9 @@ struct winbindd_domain {
 
        struct winbindd_child *children;
 
+       struct tevent_queue *queue;
+       struct dcerpc_binding_handle *binding_handle;
+
        /* Callback we use to try put us back online. */
 
        uint32_t check_online_timeout;
@@ -230,8 +213,7 @@ struct winbindd_methods {
        /* get a list of users, returning a wbint_userinfo for each one */
        NTSTATUS (*query_user_list)(struct winbindd_domain *domain,
                                   TALLOC_CTX *mem_ctx,
-                                  uint32_t *num_entries,
-                                  struct wbint_userinfo **info);
+                                  uint32_t **rids);
 
        /* get a list of domain groups */
        NTSTATUS (*enum_dom_groups)(struct winbindd_domain *domain,
@@ -271,12 +253,6 @@ struct winbindd_methods {
                                  char ***names,
                                  enum lsa_SidType **types);
 
-       /* lookup user info for a given SID */
-       NTSTATUS (*query_user)(struct winbindd_domain *domain, 
-                              TALLOC_CTX *mem_ctx, 
-                              const struct dom_sid *user_sid,
-                              struct wbint_userinfo *user_info);
-
        /* lookup all groups that a user is a member of. The backend
           can also choose to lookup by username or rid for this
           function */
@@ -350,12 +326,6 @@ struct winbindd_tdc_domain {
        uint32_t trust_type;
 };
 
-/* Switch for listing users or groups */
-enum ent_type {
-       LIST_USERS = 0,
-       LIST_GROUPS,
-};
-
 struct WINBINDD_MEMORY_CREDS {
        struct WINBINDD_MEMORY_CREDS *next, *prev;
        const char *username; /* lookup key. */