+/*
+ handle NBT name lookup reply
+ */
+static void finddcs_cldap_name_resolved(struct composite_context *ctx)
+{
+ struct finddcs_cldap_state *state =
+ talloc_get_type(ctx->async.private_data, struct finddcs_cldap_state);
+ const char *address;
+ NTSTATUS status;
+
+ status = resolve_name_recv(ctx, state, &address);
+ if (tevent_req_nterror(state->req, status)) {
+ return;
+ }
+
+ state->srv_addresses = talloc_array(state, const char *, 2);
+ if (tevent_req_nomem(state->srv_addresses, state->req)) {
+ return;
+ }
+ state->srv_addresses[0] = address;
+ state->srv_addresses[1] = NULL;
+
+ state->srv_address_index = 0;
+
+ status = cldap_socket_init(state, state->ev, NULL, NULL, &state->cldap);
+ if (tevent_req_nterror(state->req, status)) {
+ return;
+ }
+
+ finddcs_cldap_next_server(state);
+}
+