add winbindd_get_domain_info_async()...
authorStefan Metzmacher <metze@sernet.de>
Fri, 14 Dec 2007 13:12:07 +0000 (14:12 +0100)
committerStefan Metzmacher <metze@sernet.de>
Fri, 2 May 2008 14:13:11 +0000 (16:13 +0200)
source/winbindd/winbindd_misc.c

index e511c34ca013fac199c44f3edf1a5ad1eadd2ccb..665b616dc7162fcce65d61b1580e7cd1c89cf062 100644 (file)
@@ -505,6 +505,47 @@ void winbindd_ndr_domain_child_get_dc_info(struct winbindd_domain *domain,
        return;
 }
 
+static void winbindd_get_domain_info_recv(TALLOC_CTX *mem_ctx, bool success,
+                                         struct winbindd_ndr_call *c,
+                                         void *_r,
+                                         void *_cont,
+                                         void *private_data)
+{
+       void (*cont)(void *priv, bool succ, struct winbind_get_domain_info *r) =
+               (void (*)(void *, bool, struct winbind_get_domain_info*))_cont;
+       struct winbind_get_domain_info *r =
+               talloc_get_type_abort(_r, struct winbind_get_domain_info);
+
+       if (!success) {
+               DEBUG(5, ("Could not get domain_info\n"));
+               cont(private_data, False, r);
+               return;
+       }
+
+       if (r->out.result != WINBIND_STATUS_OK) {
+               DEBUG(5, ("get_domain_info returned an error:0x%08X\n",
+                       r->out.result));
+               cont(private_data, False, r);
+               return;
+       }
+
+       cont(private_data, True, r);
+}
+
+void winbindd_get_domain_info_async(TALLOC_CTX *mem_ctx,
+                                   struct winbindd_domain *domain,
+                                   struct winbind_get_domain_info *r,
+                                   void (*cont)(void *private_data,
+                                                bool success,
+                                                struct winbind_get_domain_info *r),
+                                   void *private_data)
+{
+       do_async_ndr_domain(mem_ctx, domain,
+                           NDR_WINBIND_GET_DOMAIN_INFO, r,
+                           winbindd_get_domain_info_recv, r,
+                           (void *)cont, private_data);
+}
+
 struct sequence_state {
        TALLOC_CTX *mem_ctx;
        struct winbindd_cli_state *cli_state;