Finish removal of iconv_convenience in public API's.
[amitay/samba.git] / source4 / torture / ldap / cldapbench.c
index 16141202943d49ce588c207df499f59c4644ee97..27c0746e9ac46592505758c8be2f0fbe156c8636 100644 (file)
@@ -20,7 +20,6 @@
 */
 
 #include "includes.h"
-#include <tevent.h>
 #include "libcli/cldap/cldap.h"
 #include "libcli/resolve/resolve.h"
 #include "torture/torture.h"
@@ -41,9 +40,7 @@ static void request_netlogon_handler(struct tevent_req *req)
        NTSTATUS status;
        TALLOC_CTX *tmp_ctx = talloc_new(NULL);
        io.in.version = 6;
-       status = cldap_netlogon_recv(req,
-                                    lp_iconv_convenience(state->tctx->lp_ctx),
-                                    tmp_ctx, &io);
+       status = cldap_netlogon_recv(req, tmp_ctx, &io);
        talloc_free(req);
        if (NT_STATUS_IS_OK(status)) {
                state->pass_count++;
@@ -81,8 +78,8 @@ static bool bench_cldap_netlogon(struct torture_context *tctx, const char *addre
        state->tctx = tctx;
 
        ZERO_STRUCT(search);
-       search.in.dest_address = address;
-       search.in.dest_port     = lp_cldap_port(tctx->lp_ctx);
+       search.in.dest_address = NULL;
+       search.in.dest_port = 0;
        search.in.acct_control = -1;
        search.in.version = 6;
 
@@ -148,16 +145,24 @@ static bool bench_cldap_rootdse(struct torture_context *tctx, const char *addres
        struct cldap_search search;
        struct bench_state *state;
        NTSTATUS status;
+       struct tsocket_address *dest_addr;
+       int ret;
+
+       ret = tsocket_address_inet_from_strings(tctx, "ip",
+                                               address,
+                                               lp_cldap_port(tctx->lp_ctx),
+                                               &dest_addr);
+       CHECK_VAL(ret, 0);
 
        /* cldap_socket_init should now know about the dest. address */
-       status = cldap_socket_init(tctx, tctx->ev, NULL, NULL, &cldap);
+       status = cldap_socket_init(tctx, tctx->ev, NULL, dest_addr, &cldap);
        torture_assert_ntstatus_ok(tctx, status, "cldap_socket_init");
 
        state = talloc_zero(tctx, struct bench_state);
 
        ZERO_STRUCT(search);
-       search.in.dest_address  = address;
-       search.in.dest_port     = lp_cldap_port(tctx->lp_ctx);
+       search.in.dest_address  = NULL;
+       search.in.dest_port     = 0;
        search.in.filter        = "(objectClass=*)";
        search.in.timeout       = 2;
        search.in.retries       = 1;