Add convenience function for creating nbt sockets in torture.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 5 Jun 2008 20:02:41 +0000 (22:02 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 5 Jun 2008 20:02:41 +0000 (22:02 +0200)
(This used to be commit 1e6bfb1aa7eba1b92ee4bfb318ba843752a993a9)

source4/torture/nbt/nbt.c
source4/torture/nbt/query.c
source4/torture/nbt/register.c
source4/torture/nbt/wins.c

index 422261884f661329487333b2c78067995f41302a..7d35fc856a05089451f2ee0f33e9ec4192fd2d9c 100644 (file)
 #include "libcli/resolve/resolve.h"
 #include "param/param.h"
 
+struct nbt_name_socket *torture_init_nbt_socket(struct torture_context *tctx)
+{
+       return nbt_name_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
+}
+
 bool torture_nbt_get_name(struct torture_context *tctx, 
                          struct nbt_name *name, 
                          const char **address)
index 3f3a15cca542b53d8871b9f0f948c629e1be8e72..80027a1b68ff1ce01ad65931c343c1985311924a 100644 (file)
@@ -47,8 +47,7 @@ static void increment_handler(struct nbt_name_request *req)
 */
 static bool bench_namequery(struct torture_context *tctx)
 {
-       struct nbt_name_socket *nbtsock = nbt_name_socket_init(tctx, tctx->ev,
-                                                              lp_iconv_convenience(tctx->lp_ctx));
+       struct nbt_name_socket *nbtsock = torture_init_nbt_socket(tctx);
        int num_sent=0;
        struct result_struct *result;
        struct nbt_name_query io;
index a8681f828f7373e10b20fd5ffb642247f8164a7a..8ddea4096e1606a4a3ed4e83108c1176616edc16 100644 (file)
@@ -44,8 +44,7 @@ static bool nbt_register_own(struct torture_context *tctx)
 {
        struct nbt_name_register io;
        NTSTATUS status;
-       struct nbt_name_socket *nbtsock = nbt_name_socket_init(tctx, tctx->ev,
-                                                              lp_iconv_convenience(tctx->lp_ctx));
+       struct nbt_name_socket *nbtsock = torture_init_nbt_socket(tctx);
        struct socket_address *socket_address;
        struct nbt_name name;
        const char *address;
@@ -114,8 +113,7 @@ static bool nbt_refresh_own(struct torture_context *tctx)
 {
        struct nbt_name_refresh io;
        NTSTATUS status;
-       struct nbt_name_socket *nbtsock = nbt_name_socket_init(tctx, tctx->ev,
-                                                              lp_iconv_convenience(tctx->lp_ctx));
+       struct nbt_name_socket *nbtsock = torture_init_nbt_socket(tctx);
        const char *myaddress;
        struct socket_address *socket_address;
        struct nbt_name name;
index ae20de6e2f59244ea62f89e880f9627de834169d..ad9a97f1336ea8cc4ec76d486b7552a134839be2 100644 (file)
@@ -53,7 +53,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
        struct nbt_name_refresh_wins refresh;
        struct nbt_name_release release;
        NTSTATUS status;
-       struct nbt_name_socket *nbtsock = nbt_name_socket_init(tctx, tctx->ev, lp_iconv_convenience(tctx->lp_ctx));
+       struct nbt_name_socket *nbtsock = torture_init_nbt_socket(tctx);
        const char *myaddress;
        struct socket_address *socket_address;
        struct interface *ifaces;