int *called_types,
const char **calling_names,
int *calling_types,
- size_t num_addrs, uint16_t port);
+ size_t num_addrs,
+ const struct smb_transports *transports)
+ NONNULL(2) NONNULL(3) NONNULL(9);
NTSTATUS smbsock_any_connect_recv(struct tevent_req *req, int *pfd,
size_t *chosen_index, uint16_t *chosen_port);
NTSTATUS smbsock_any_connect(const struct sockaddr_storage *addrs,
}
struct cli_connect_sock_state {
+ struct smb_transports transports;
const char **called_names;
const char **calling_names;
int *called_types;
if (req == NULL) {
return NULL;
}
+ state->transports = smbsock_transports_from_port(port);
if ((pss == NULL) || is_zero_addr(pss)) {
subreq = smbsock_any_connect_send(
state, ev, addrs, state->called_names, state->called_types,
- state->calling_names, NULL, num_addrs, port);
+ state->calling_names, NULL, num_addrs, &state->transports);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
int *called_types,
const char **calling_names,
int *calling_types,
- size_t num_addrs, uint16_t port)
+ size_t num_addrs,
+ const struct smb_transports *transports)
{
struct tevent_req *req, *subreq;
struct smbsock_any_connect_state *state;
state->called_types = called_types;
state->calling_names = calling_names;
state->calling_types = calling_types;
- state->transports = smbsock_transports_from_port(port);
+ state->transports = *transports;
state->fd = -1;
tevent_req_set_cleanup_fn(req, smbsock_any_connect_cleanup);
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, port);
+ num_addrs, &ts);
if (req == NULL) {
goto fail;
}