const char **calling_names,
int *calling_types,
size_t num_addrs,
+ struct loadparm_context *lp_ctx,
const struct smb_transports *transports,
int sec_timeout,
int *pfd, size_t *chosen_index,
const char **calling_names,
int *calling_types,
size_t num_addrs,
+ struct loadparm_context *lp_ctx,
const struct smb_transports *transports,
int sec_timeout,
int *pfd, size_t *chosen_index,
uint16_t *chosen_port)
- NONNULL(1) NONNULL(7) NONNULL(9);
+ NONNULL(1) NONNULL(7) NONNULL(8) NONNULL(10);
#endif /* _LIBSMB_SMBSOCK_CONNECT_H_ */
*/
#include "includes.h"
+#include "lib/param/param.h"
+#include "source3/param/loadparm.h"
#include "libsmb/smbsock_connect.h"
#include "torture/proto.h"
smb_transports_parse("client smb transports",
lp_client_smb_transports());
size_t chosen_index;
+ struct loadparm_context *lp_ctx = NULL;
uint16_t port;
+ lp_ctx = loadparm_init_s3(NULL, loadparm_s3_helpers());
+ if (lp_ctx == NULL) {
+ return false;
+ }
+
interpret_string_addr(&addrs[0], "192.168.99.5", 0);
interpret_string_addr(&addrs[1], "192.168.99.6", 0);
interpret_string_addr(&addrs[2], "192.168.99.7", 0);
interpret_string_addr(&addrs[4], "192.168.99.9", 0);
status = smbsock_any_connect(addrs, NULL, NULL, NULL, NULL,
- ARRAY_SIZE(addrs), &ts, 0,
+ ARRAY_SIZE(addrs), lp_ctx, &ts, 0,
&fd, &chosen_index, &port);
+ TALLOC_FREE(lp_ctx);
d_printf("smbsock_any_connect returned %s (fd %d)\n",
nt_errstr(status), NT_STATUS_IS_OK(status) ? fd : -1);
uint32_t request_flags,
int *fd)
{
+ struct loadparm_context *lp_ctx = NULL;
struct dc_name_ip *dcs = NULL;
int num_dcs = 0;
return false;
}
+ lp_ctx = loadparm_init_s3(talloc_tos(), loadparm_s3_helpers());
+ if (lp_ctx == NULL) {
+ DBG_ERR("loadparm_init_s3 failed\n");
+ return false;
+ }
+
again:
D_DEBUG("Retrieving a list of IP addresses for DCs.\n");
if (!get_dcs(mem_ctx, domain, &dcs, &num_dcs, request_flags) || (num_dcs == 0))
"(timeout of 10 sec for each DC).\n",
num_dcs);
status = smbsock_any_connect(addrs, dcnames, NULL, NULL, NULL,
- num_addrs, &ts, 10, fd, &fd_index, NULL);
+ num_addrs, lp_ctx, &ts,
+ 10, fd, &fd_index, NULL);
if (!NT_STATUS_IS_OK(status)) {
for (i=0; i<num_dcs; i++) {
char ab[INET6_ADDRSTRLEN];