Remove include/rpc_ds.h and all references to it completly.
[kai/samba-autobuild/.git] / source3 / winbindd / winbindd.h
index ebede0f0076987a6ea0dba4a12eb3f1a62a28abe..c4c1278d739868899b457189e44e2e6ada4ec558 100644 (file)
@@ -49,13 +49,13 @@ struct fd_event {
        void (*handler)(struct fd_event *fde, int flags);
        void *data;
        size_t length, done;
-       void (*finished)(void *private_data, BOOL success);
+       void (*finished)(void *private_data, bool success);
        void *private_data;
 };
 
 struct sid_ctr {
        DOM_SID *sid;
-       BOOL finished;
+       bool finished;
        const char *domain;
        const char *name;
        enum lsa_SidType type;
@@ -66,17 +66,17 @@ struct winbindd_cli_state {
        int sock;                                 /* Open socket from client */
        struct fd_event fd_event;
        pid_t pid;                                /* pid of client */
-       BOOL finished;                            /* Can delete from list */
-       BOOL write_extra_data;                    /* Write extra_data field */
+       bool finished;                            /* Can delete from list */
+       bool write_extra_data;                    /* Write extra_data field */
        time_t last_access;                       /* Time of last access (read or write) */
-       BOOL privileged;                           /* Is the client 'privileged' */
+       bool privileged;                           /* Is the client 'privileged' */
 
        TALLOC_CTX *mem_ctx;                      /* memory per request */
        struct winbindd_request request;          /* Request from client */
        struct winbindd_response response;        /* Respose to client */
-       BOOL getpwent_initialized;                /* Has getpwent_state been
+       bool getpwent_initialized;                /* Has getpwent_state been
                                                   * initialized? */
-       BOOL getgrent_initialized;                /* Has getgrent_state been
+       bool getgrent_initialized;                /* Has getgrent_state been
                                                   * initialized? */
        struct getent_state *getpwent_state;      /* State for getpwent() */
        struct getent_state *getgrent_state;      /* State for getgrent() */
@@ -88,7 +88,7 @@ struct getent_state {
        struct getent_state *prev, *next;
        void *sam_entries;
        uint32 sam_entry_index, num_sam_entries;
-       BOOL got_sam_entries;
+       bool got_sam_entries;
        fstring domain_name;
 };
 
@@ -134,16 +134,27 @@ struct winbindd_async_request;
 
 /* Async child */
 
+struct winbindd_domain;
+
+struct winbindd_child_dispatch_table {
+       const char *name;
+       enum winbindd_cmd struct_cmd;
+       enum winbindd_result (*struct_fn)(struct winbindd_domain *domain,
+                                         struct winbindd_cli_state *state);
+};
+
 struct winbindd_child {
        struct winbindd_child *next, *prev;
 
        pid_t pid;
        struct winbindd_domain *domain;
-       pstring logfilename;
+       char *logfilename;
 
        struct fd_event event;
        struct timed_event *lockout_policy_event;
        struct winbindd_async_request *requests;
+
+       const struct winbindd_child_dispatch_table *table;
 };
 
 /* Structures to hold per domain information */
@@ -153,17 +164,17 @@ struct winbindd_domain {
        fstring alt_name;                      /* alt Domain name, if any (FQDN for ADS) */
        fstring forest_name;                   /* Name of the AD forest we're in */
        DOM_SID sid;                           /* SID for this domain */
-       uint32 domain_flags;                   /* Domain flags from rpc_ds.h */ 
-       uint32 domain_type;                    /* Domain type from rpc_ds.h */  
-       uint32 domain_trust_attribs;           /* Trust attribs from rpc_ds.h */
-       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 ? */
-       BOOL primary;                          /* is this our primary domain ? */
-       BOOL internal;                         /* BUILTIN and member SAM */
-       BOOL online;                           /* is this domain available ? */
+       uint32 domain_flags;                   /* Domain flags from netlogon.h */
+       uint32 domain_type;                    /* Domain type from netlogon.h */
+       uint32 domain_trust_attribs;           /* Trust attribs from netlogon.h */
+       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 ? */
+       bool primary;                          /* is this our primary domain ? */
+       bool internal;                         /* BUILTIN and member SAM */
+       bool online;                           /* is this domain available ? */
        time_t startup_time;                   /* When we set "startup" true. */
-       BOOL startup;                          /* are we in the first 30 seconds after startup_time ? */
+       bool startup;                          /* are we in the first 30 seconds after startup_time ? */
 
        /* Lookup methods for this domain (LDAP or RPC) */
        struct winbindd_methods *methods;
@@ -174,11 +185,11 @@ struct winbindd_domain {
 
         /* Private data for the backends (used for connection cache) */
 
-       void *private_data; 
+       void *private_data;
 
        /* A working DC */
        fstring dcname;
-       struct sockaddr_in dcaddr;
+       struct sockaddr_storage dcaddr;
 
        /* Sequence number stuff */
 
@@ -209,7 +220,7 @@ struct winbindd_domain {
 struct winbindd_methods {
        /* does this backend provide a consistent view of the data? (ie. is the primary group
           always correct) */
-       BOOL consistent;
+       bool consistent;
 
        /* get a list of users, returning a WINBIND_USERINFO for each one */
        NTSTATUS (*query_user_list)(struct winbindd_domain *domain,
@@ -318,16 +329,16 @@ typedef struct {
 /* Filled out by IDMAP backends */
 struct winbindd_idmap_methods {
   /* Called when backend is first loaded */
-  BOOL (*init)(void);
+  bool (*init)(void);
 
-  BOOL (*get_sid_from_uid)(uid_t uid, DOM_SID *sid);
-  BOOL (*get_sid_from_gid)(gid_t gid, DOM_SID *sid);
+  bool (*get_sid_from_uid)(uid_t uid, DOM_SID *sid);
+  bool (*get_sid_from_gid)(gid_t gid, DOM_SID *sid);
 
-  BOOL (*get_uid_from_sid)(DOM_SID *sid, uid_t *uid);
-  BOOL (*get_gid_from_sid)(DOM_SID *sid, gid_t *gid);
+  bool (*get_uid_from_sid)(DOM_SID *sid, uid_t *uid);
+  bool (*get_gid_from_sid)(DOM_SID *sid, gid_t *gid);
 
   /* Called when backend is unloaded */
-  BOOL (*close)(void);
+  bool (*close)(void);
   /* Called to dump backend status */
   void (*status)(void);
 };