s3:winbind: Convert the GETPWENT routines to the new API
[ira/wip.git] / source3 / winbindd / winbindd_proto.h
index 0df00f52ba7bc346e30e4d4157faaaf51a5705ac..1cce60c1cbc1e84005d654ad5dc270c361cb74f2 100644 (file)
@@ -114,10 +114,6 @@ void winbindd_getsidaliases_async(struct winbindd_domain *domain,
                                  void *private_data);
 enum winbindd_result winbindd_dual_getsidaliases(struct winbindd_domain *domain,
                                                 struct winbindd_cli_state *state);
-void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid,
-                            void (*cont)(void *private_data, bool success,
-                                         DOM_SID *sids, size_t num_sids),
-                            void *private_data);
 void query_user_async(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
                      const DOM_SID *sid,
                      void (*cont)(void *private_data, bool success,
@@ -210,6 +206,12 @@ NTSTATUS nss_get_info_cached( struct winbindd_domain *domain,
                              ADS_STRUCT *ads, LDAPMessage *msg,
                              const char **homedir, const char **shell,
                              const char **gecos, gid_t *p_gid);
+bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
+                        time_t last_seq_check);
+bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
+                     uint32_t opnum, const DATA_BLOB *req, DATA_BLOB *resp);
+void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
+                     const DATA_BLOB *req, const DATA_BLOB *resp);
 
 /* The following definitions come from winbindd/winbindd_ccache_access.c  */
 
@@ -324,7 +326,7 @@ void sendto_child(struct winbindd_cli_state *state,
                  struct winbindd_child *child);
 void sendto_domain(struct winbindd_cli_state *state,
                   struct winbindd_domain *domain);
-void setup_child(struct winbindd_child *child,
+void setup_child(struct winbindd_domain *domain, struct winbindd_child *child,
                 const struct winbindd_child_dispatch_table *table,
                 const char *logprefix,
                 const char *logname);
@@ -378,6 +380,11 @@ void winbindd_getsidaliases(struct winbindd_cli_state *state);
 enum winbindd_result winbindd_dual_getuserdomgroups(struct winbindd_domain *domain,
                                                    struct winbindd_cli_state *state);
 bool get_sam_group_entries(struct getent_state *ent);
+bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
+               const char *dom_name, const char *gr_name, gid_t unix_gid);
+NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
+                                    TALLOC_CTX *mem_ctx,
+                                    int *num_members, char **result);
 
 
 /* The following definitions come from winbindd/winbindd_idmap.c  */
@@ -627,6 +634,7 @@ void winbindd_wins_byip(struct winbindd_cli_state *state);
 void winbindd_wins_byname(struct winbindd_cli_state *state);
 
 struct tevent_req *wb_ping_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
+                               struct winbindd_cli_state *cli,
                                struct winbindd_request *request);
 NTSTATUS wb_ping_recv(struct tevent_req *req,
                      struct winbindd_response *resp);
@@ -635,6 +643,7 @@ enum winbindd_result winbindd_dual_ping(struct winbindd_domain *domain,
                                        struct winbindd_cli_state *state);
 
 struct rpc_pipe_client *wbint_rpccli_create(TALLOC_CTX *mem_ctx,
+                                           struct winbindd_domain *domain,
                                            struct winbindd_child *child);
 enum winbindd_result winbindd_dual_ndrcmd(struct winbindd_domain *domain,
                                          struct winbindd_cli_state *state);
@@ -647,7 +656,8 @@ NTSTATUS wb_lookupsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                           const char **name);
 
 struct tevent_req *winbindd_lookupsid_send(TALLOC_CTX *mem_ctx,
-                                         struct tevent_context *ev,
+                                          struct tevent_context *ev,
+                                          struct winbindd_cli_state *cli,
                                           struct winbindd_request *request);
 NTSTATUS winbindd_lookupsid_recv(struct tevent_req *req,
                                 struct winbindd_response *response);
@@ -661,6 +671,7 @@ NTSTATUS wb_lookupname_recv(struct tevent_req *req, struct dom_sid *sid,
 
 struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
+                                           struct winbindd_cli_state *cli,
                                            struct winbindd_request *request);
 NTSTATUS winbindd_lookupname_recv(struct tevent_req *req,
                                  struct winbindd_response *response);
@@ -672,6 +683,7 @@ NTSTATUS wb_sid2uid_recv(struct tevent_req *req, uid_t *uid);
 
 struct tevent_req *winbindd_sid_to_uid_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
+                                           struct winbindd_cli_state *cli,
                                            struct winbindd_request *request);
 NTSTATUS winbindd_sid_to_uid_recv(struct tevent_req *req,
                                  struct winbindd_response *response);
@@ -683,6 +695,7 @@ NTSTATUS wb_sid2gid_recv(struct tevent_req *req, gid_t *gid);
 
 struct tevent_req *winbindd_sid_to_gid_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
+                                           struct winbindd_cli_state *cli,
                                            struct winbindd_request *request);
 NTSTATUS winbindd_sid_to_gid_recv(struct tevent_req *req,
                                  struct winbindd_response *response);
@@ -694,6 +707,7 @@ NTSTATUS wb_uid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
 
 struct tevent_req *winbindd_uid_to_sid_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
+                                           struct winbindd_cli_state *cli,
                                            struct winbindd_request *request);
 NTSTATUS winbindd_uid_to_sid_recv(struct tevent_req *req,
                                  struct winbindd_response *response);
@@ -705,6 +719,7 @@ NTSTATUS wb_gid2sid_recv(struct tevent_req *req, struct dom_sid *sid);
 
 struct tevent_req *winbindd_gid_to_sid_send(TALLOC_CTX *mem_ctx,
                                            struct tevent_context *ev,
+                                           struct winbindd_cli_state *cli,
                                            struct winbindd_request *request);
 NTSTATUS winbindd_gid_to_sid_recv(struct tevent_req *req,
                                  struct winbindd_response *response);
@@ -723,18 +738,21 @@ NTSTATUS wb_getpwsid_recv(struct tevent_req *req);
 
 struct tevent_req *winbindd_getpwsid_send(TALLOC_CTX *mem_ctx,
                                          struct tevent_context *ev,
+                                         struct winbindd_cli_state *cli,
                                          struct winbindd_request *request);
 NTSTATUS winbindd_getpwsid_recv(struct tevent_req *req,
                                struct winbindd_response *response);
 
 struct tevent_req *winbindd_getpwnam_send(TALLOC_CTX *mem_ctx,
                                          struct tevent_context *ev,
+                                         struct winbindd_cli_state *cli,
                                          struct winbindd_request *request);
 NTSTATUS winbindd_getpwnam_recv(struct tevent_req *req,
                                struct winbindd_response *response);
 
 struct tevent_req *winbindd_getpwuid_send(TALLOC_CTX *mem_ctx,
                                          struct tevent_context *ev,
+                                         struct winbindd_cli_state *cli,
                                          struct winbindd_request *request);
 NTSTATUS winbindd_getpwuid_recv(struct tevent_req *req,
                                struct winbindd_response *response);
@@ -747,6 +765,7 @@ NTSTATUS wb_lookupuseraliases_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                                   uint32_t *num_aliases, uint32_t **aliases);
 struct tevent_req *winbindd_getsidaliases_send(TALLOC_CTX *mem_ctx,
                                               struct tevent_context *ev,
+                                              struct winbindd_cli_state *cli,
                                               struct winbindd_request *request);
 NTSTATUS winbindd_getsidaliases_recv(struct tevent_req *req,
                                     struct winbindd_response *response);
@@ -759,6 +778,7 @@ NTSTATUS wb_lookupusergroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
 
 struct tevent_req *winbindd_getuserdomgroups_send(TALLOC_CTX *mem_ctx,
                                                  struct tevent_context *ev,
+                                                 struct winbindd_cli_state *cli,
                                                  struct winbindd_request *request);
 NTSTATUS winbindd_getuserdomgroups_recv(struct tevent_req *req,
                                        struct winbindd_response *response);
@@ -769,6 +789,7 @@ NTSTATUS wb_gettoken_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                          int *num_sids, struct dom_sid **sids);
 struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
                                           struct tevent_context *ev,
+                                          struct winbindd_cli_state *cli,
                                           struct winbindd_request *request);
 NTSTATUS winbindd_getgroups_recv(struct tevent_req *req,
                                 struct winbindd_response *response);
@@ -786,6 +807,7 @@ NTSTATUS wb_seqnums_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
 
 struct tevent_req *winbindd_show_sequence_send(TALLOC_CTX *mem_ctx,
                                               struct tevent_context *ev,
+                                              struct winbindd_cli_state *cli,
                                               struct winbindd_request *request);
 NTSTATUS winbindd_show_sequence_recv(struct tevent_req *req,
                                     struct winbindd_response *response);
@@ -806,4 +828,65 @@ NTSTATUS wb_getgrsid_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
                          const char **domname, const char **name, gid_t *gid,
                          struct talloc_dict **members);
 
+struct tevent_req *winbindd_getgrgid_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct winbindd_cli_state *cli,
+                                         struct winbindd_request *request);
+NTSTATUS winbindd_getgrgid_recv(struct tevent_req *req,
+                               struct winbindd_response *response);
+
+struct tevent_req *winbindd_getgrnam_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct winbindd_cli_state *cli,
+                                         struct winbindd_request *request);
+NTSTATUS winbindd_getgrnam_recv(struct tevent_req *req,
+                               struct winbindd_response *response);
+
+struct tevent_req *winbindd_getusersids_send(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            struct winbindd_cli_state *cli,
+                                            struct winbindd_request *request);
+NTSTATUS winbindd_getusersids_recv(struct tevent_req *req,
+                                  struct winbindd_response *response);
+
+struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct winbindd_domain *domain);
+NTSTATUS wb_query_user_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+                                int *num_users,
+                                struct wbint_userinfo **users);
+
+struct tevent_req *wb_fill_pwent_send(TALLOC_CTX *mem_ctx,
+                                     struct tevent_context *ev,
+                                     struct wbint_userinfo *info,
+                                     struct winbindd_pw *pw);
+NTSTATUS wb_fill_pwent_recv(struct tevent_req *req);
+
+struct tevent_req *wb_next_pwent_send(TALLOC_CTX *mem_ctx,
+                                     struct tevent_context *ev,
+                                     struct getpwent_state *gstate,
+                                     struct winbindd_pw *pw);
+NTSTATUS wb_next_pwent_recv(struct tevent_req *req);
+
+struct tevent_req *winbindd_setpwent_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct winbindd_cli_state *cli,
+                                         struct winbindd_request *request);
+NTSTATUS winbindd_setpwent_recv(struct tevent_req *req,
+                               struct winbindd_response *presp);
+
+struct tevent_req *winbindd_getpwent_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct winbindd_cli_state *cli,
+                                         struct winbindd_request *request);
+NTSTATUS winbindd_getpwent_recv(struct tevent_req *req,
+                               struct winbindd_response *response);
+
+struct tevent_req *winbindd_endpwent_send(TALLOC_CTX *mem_ctx,
+                                         struct tevent_context *ev,
+                                         struct winbindd_cli_state *cli,
+                                         struct winbindd_request *request);
+NTSTATUS winbindd_endpwent_recv(struct tevent_req *req,
+                               struct winbindd_response *response);
+
 #endif /*  _WINBINDD_PROTO_H_  */