From 63fd883e54ea6fe808b72368e95aeebf265f2451 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Mar 2007 18:12:21 +0000 Subject: r21826: reorder functions metze (This used to be commit 3d0a810ccd5d7490d46f91ca6aef6052ca0c56c3) --- source4/libnet/libnet_unbecome_dc.c | 48 +++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'source4/libnet') diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c index ffec396e21..c0dbfcc68d 100644 --- a/source4/libnet/libnet_unbecome_dc.c +++ b/source4/libnet/libnet_unbecome_dc.c @@ -94,6 +94,31 @@ struct libnet_UnbecomeDC_state { } dest_dsa; }; +static void unbecomeDC_recv_cldap(struct cldap_request *req); + +static void unbecomeDC_send_cldap(struct libnet_UnbecomeDC_state *s) +{ + struct composite_context *c = s->creq; + struct cldap_request *req; + + s->cldap.io.in.dest_address = s->source_dsa.address; + s->cldap.io.in.realm = s->domain.dns_name; + s->cldap.io.in.host = s->dest_dsa.netbios_name; + s->cldap.io.in.user = NULL; + s->cldap.io.in.domain_guid = NULL; + s->cldap.io.in.domain_sid = NULL; + s->cldap.io.in.acct_control = -1; + s->cldap.io.in.version = 6; + + s->cldap.sock = cldap_socket_init(s, s->libnet->event_ctx); + if (composite_nomem(s->cldap.sock, c)) return; + + req = cldap_netlogon_send(s->cldap.sock, &s->cldap.io); + if (composite_nomem(req, c)) return; + req->async.fn = unbecomeDC_recv_cldap; + req->async.private = s; +} + static void unbecomeDC_connect_ldap(struct libnet_UnbecomeDC_state *s); static void unbecomeDC_recv_cldap(struct cldap_request *req) @@ -120,29 +145,6 @@ static void unbecomeDC_recv_cldap(struct cldap_request *req) unbecomeDC_connect_ldap(s); } -static void unbecomeDC_send_cldap(struct libnet_UnbecomeDC_state *s) -{ - struct composite_context *c = s->creq; - struct cldap_request *req; - - s->cldap.io.in.dest_address = s->source_dsa.address; - s->cldap.io.in.realm = s->domain.dns_name; - s->cldap.io.in.host = s->dest_dsa.netbios_name; - s->cldap.io.in.user = NULL; - s->cldap.io.in.domain_guid = NULL; - s->cldap.io.in.domain_sid = NULL; - s->cldap.io.in.acct_control = -1; - s->cldap.io.in.version = 6; - - s->cldap.sock = cldap_socket_init(s, s->libnet->event_ctx); - if (composite_nomem(s->cldap.sock, c)) return; - - req = cldap_netlogon_send(s->cldap.sock, &s->cldap.io); - if (composite_nomem(req, c)) return; - req->async.fn = unbecomeDC_recv_cldap; - req->async.private = s; -} - static NTSTATUS unbecomeDC_ldap_connect(struct libnet_UnbecomeDC_state *s) { char *url; -- cgit