const char **calling_names,
int *calling_types,
size_t num_addrs,
- uint16_t port,
+ const struct smb_transports *transports,
int sec_timeout,
int *pfd, size_t *chosen_index,
- uint16_t *chosen_port);
+ uint16_t *chosen_port)
+ NONNULL(1) NONNULL(7) NONNULL(9);
/* The following definitions come from lib/util_wellknown.c */
const char **calling_names,
int *calling_types,
size_t num_addrs,
- uint16_t port,
+ const struct smb_transports *transports,
int sec_timeout,
int *pfd, size_t *chosen_index,
uint16_t *chosen_port)
TALLOC_CTX *frame = talloc_stackframe();
struct tevent_context *ev;
struct tevent_req *req;
- struct smb_transports ts = smbsock_transports_from_port(port);
NTSTATUS status = NT_STATUS_NO_MEMORY;
ev = samba_tevent_context_init(frame);
req = smbsock_any_connect_send(frame, ev, addrs,
called_names, called_types,
calling_names, calling_types,
- num_addrs, &ts);
+ num_addrs, transports);
if (req == NULL) {
goto fail;
}
int fd;
NTSTATUS status;
struct sockaddr_storage addrs[5];
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
size_t chosen_index;
uint16_t port;
interpret_string_addr(&addrs[4], "192.168.99.9", 0);
status = smbsock_any_connect(addrs, NULL, NULL, NULL, NULL,
- ARRAY_SIZE(addrs), 0, 0,
+ ARRAY_SIZE(addrs), &ts, 0,
&fd, &chosen_index, &port);
d_printf("smbsock_any_connect returned %s (fd %d)\n",
struct sockaddr_storage *addrs = NULL;
int num_addrs = 0;
-
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
int i;
size_t fd_index;
"(timeout of 10 sec for each DC).\n",
num_dcs);
status = smbsock_any_connect(addrs, dcnames, NULL, NULL, NULL,
- num_addrs, 0, 10, fd, &fd_index, NULL);
+ num_addrs, &ts, 10, fd, &fd_index, NULL);
if (!NT_STATUS_IS_OK(status)) {
for (i=0; i<num_dcs; i++) {
char ab[INET6_ADDRSTRLEN];