struct cli_state *c = NULL;
NTSTATUS nt_status;
uint32_t flags = 0;
+ struct smb_transports ts = smbsock_transports_from_port(port);
nt_status = cli_full_connection_creds(talloc_tos(),
&c,
lp_netbios_name(),
server,
NULL,
- port,
+ &ts,
share,
"?????",
creds,
uint16_t fnum = 0xffff;
NTSTATUS status;
const DATA_BLOB *binary = NULL;
+ struct smb_transports ts = smbsock_transports_from_port(port);
status = cli_full_connection_creds(
talloc_tos(),
NULL,
hostname,
NULL,
- port,
+ &ts,
"ADMIN$",
"?????",
credentials,
#else
const DATA_BLOB *winexesvc64_exe = NULL;
#endif
+ struct smb_transports ts;
NTSTATUS status;
int ret = 1;
int return_code = 0;
goto done;
}
+ ts = smbsock_transports_from_port(options.port);
status = cli_full_connection_creds(
talloc_tos(),
&cli,
lp_netbios_name(),
options.hostname,
NULL,
- options.port,
+ &ts,
"IPC$",
"IPC",
options.credentials,
struct cli_state **cli)
{
int flags = CLI_FULL_CONNECTION_IPC;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
NTSTATUS status;
status = cli_full_connection_creds(mem_ctx,
cli,
NULL,
dc,
- NULL, 0,
+ NULL,
+ &ts,
"IPC$", "IPC",
creds,
flags);
NTSTATUS status;
int flags = CLI_FULL_CONNECTION_IPC;
const struct sockaddr_storage *remote_sockaddr = NULL;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
if (!dc_name) {
TALLOC_FREE(frame);
&cli,
NULL,
dc_name,
- NULL, 0,
+ NULL,
+ &ts,
"IPC$", "IPC",
cli_creds,
flags);
&cli,
NULL,
dc_name,
- NULL, 0,
+ NULL,
+ &ts,
"IPC$", "IPC",
anon_creds,
flags);
struct cli_state **output_cli,
const char *my_name,
const char *dest_host,
- const struct sockaddr_storage *dest_ss, int port,
+ const struct sockaddr_storage *dest_ss,
+ const struct smb_transports *transports,
const char *service, const char *service_type,
struct cli_credentials *creds,
int flags)
struct tevent_context *ev;
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- struct smb_transports ts = smbsock_transports_from_port(port);
ev = samba_tevent_context_init(mem_ctx);
if (ev == NULL) {
goto fail;
}
req = cli_full_connection_creds_send(
- ev, ev, my_name, dest_host, dest_ss, &ts, service,
+ ev, ev, my_name, dest_host, dest_ss, transports, service,
service_type, creds, flags,
NULL);
if (req == NULL) {
struct cli_state *cli;
NTSTATUS nt_status;
uint32_t flags = CLI_FULL_CONNECTION_ANONYMOUS_FALLBACK;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
flags |= CLI_FULL_CONNECTION_FORCE_SMB1;
flags |= CLI_FULL_CONNECTION_IPC;
NULL,
server,
server_ss,
- 0,
+ &ts,
"IPC$",
"IPC",
creds,
NTSTATUS nt_status;
SMBCSRV *srv=NULL;
SMBCSRV *ipc_srv=NULL;
+ struct smb_transports ts = smbsock_transports_from_port(port);
/*
* Use srv->cli->desthost and srv->cli->share instead of
lp_netbios_name(),
server,
NULL,
- 0,
+ &ts,
"IPC$",
"?????",
creds,
struct cli_state **output_cli,
const char *my_name,
const char *dest_host,
- const struct sockaddr_storage *dest_ss, int port,
+ const struct sockaddr_storage *dest_ss,
+ const struct smb_transports *transports,
const char *service, const char *service_type,
struct cli_credentials *creds,
- int flags);
+ int flags)
+ NONNULL(2) NONNULL(6);
NTSTATUS cli_raw_tcon(struct cli_state *cli,
const char *service, const char *pass, const char *dev,
uint16_t *max_xmit, uint16_t *tid);
struct sockaddr_storage rm_addr;
char addr[INET6_ADDRSTRLEN];
struct cli_credentials *anon_creds = NULL;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
if ( is_zero_addr(client_ss) ) {
DEBUG(2,("spoolss_connect_to_client: resolving %s\n",
lp_netbios_name(),
remote_machine,
&rm_addr,
- 0,
+ &ts,
"IPC$",
"IPC",
anon_creds,
NTSTATUS nt_status;
WERROR werror;
struct cli_credentials *creds = samba_cmdline_get_creds();
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
if ( argc != 3 ) {
printf("Usage: %s <printer> <server>\n", argv[0]);
lp_netbios_name(),
argv[2],
NULL,
- 0,
+ &ts,
"IPC$",
"IPC",
creds,
}
if (transport == NCACN_NP) {
+ struct smb_transports ts = smbsock_transports_from_port(opt_port);
+
nt_status = cli_full_connection_creds(frame,
&cli,
lp_netbios_name(),
host,
opt_ipaddr ? &server_ss
: NULL,
- opt_port,
+ &ts,
"IPC$",
"IPC",
creds,
static int count;
NTSTATUS nt_status;
struct cli_credentials *creds = NULL;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
fstrcpy(server,share+2);
share = strchr_m(server,'\\');
myname,
server_n,
NULL,
- 0,
+ &ts,
share,
"?????",
creds,
struct cli_credentials *torture_creds;
static const char *sockops="TCP_NODELAY";
int torture_nprocs=1;
-static int port_to_use=0;
int torture_numops=100;
int torture_blocksize=1024*1024;
static int procnum; /* records process count number when forking */
const char *sharename,
int flags)
{
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
NTSTATUS status;
status = cli_full_connection_creds(NULL,
myname,
hostname,
NULL, /* dest_ss */
- port_to_use,
+ &ts,
sharename,
"?????",
torture_creds,
flags);
if (!NT_STATUS_IS_OK(status)) {
- printf("failed to open share connection: //%s/%s port:%d - %s\n",
- hostname, sharename, port_to_use, nt_errstr(status));
+ printf("failed to open share connection: //%s/%s - %s\n",
+ hostname, sharename, nt_errstr(status));
return False;
}
{
static struct cli_state *cli1 = NULL;
int flags = CLI_FULL_CONNECTION_FORCE_SMB1;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
NTSTATUS status;
bool ret = True;
myname,
host,
NULL, /* dest_ss */
- port_to_use,
+ &ts,
NULL, /* service */
NULL, /* service_type */
torture_creds,
!= EOF) {
switch (opt) {
case 'p':
- port_to_use = atoi(optarg);
lpcfg_set_cmdline(lp_ctx, "client smb transports", optarg);
break;
case 's':
POPT_COMMON_VERSION
POPT_TABLEEND
};
+ struct smb_transports ts = { .num_transports = 0, };
smb_init_locale();
creds = samba_cmdline_get_creds();
+ ts = smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
+
status = cli_full_connection_creds(frame,
&cli,
lp_netbios_name(),
server,
NULL,
- 0,
+ &ts,
"IPC$",
"IPC",
creds,
LDAPMessage *res = NULL;
bool ok;
int ret = -1;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
if (argc < 1 || c->display_usage) {
d_printf("%s\n%s",
lp_netbios_name(),
servername,
&server_ss,
- 0,
+ &ts,
"IPC$",
"IPC",
c->creds,
const char *service_name,
const char *service_type)
{
+ struct smb_transports ts = smbsock_transports_from_port(c->opt_port);
NTSTATUS nt_status;
int flags = 0;
NULL,
server_name,
server_ss,
- c->opt_port,
+ &ts,
service_name,
service_type,
c->creds,
const struct sockaddr_storage *server_ss,
const char *server_name)
{
+ struct smb_transports ts = smbsock_transports_from_port(c->opt_port);
NTSTATUS nt_status;
struct cli_credentials *anon_creds = NULL;
c->opt_requester_name,
server_name,
server_ss,
- c->opt_port,
+ &ts,
"IPC$",
"IPC",
anon_creds,
NTSTATUS nt_status;
struct sockaddr_storage loopback_ss;
struct cli_credentials *anon_creds = NULL;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
*perr = NT_STATUS_OK;
lp_netbios_name(),
lp_netbios_name(),
&loopback_ss,
- 0,
+ &ts,
"IPC$",
"IPC",
anon_creds,
struct cli_state *c = NULL;
NTSTATUS nt_status;
uint32_t flags = 0;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
nt_status = cli_full_connection_creds(talloc_tos(),
&c,
lp_netbios_name(),
server,
NULL,
- 0,
+ &ts,
share,
"?????",
creds,
struct cli_state *c;
NTSTATUS nt_status;
uint32_t flags = 0;
+ struct smb_transports ts =
+ smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
nt_status = cli_full_connection_creds(talloc_tos(),
&c,
lp_netbios_name(),
server,
NULL,
- 0,
+ &ts,
share,
"?????",
samba_cmdline_get_creds(),
struct cli_state *c = NULL;
uint32_t flags = CLI_FULL_CONNECTION_IPC;
bool ok;
+ struct smb_transports ts = { .num_transports = 0, };
ok = samba_cmdline_init(frame,
SAMBA_CMDLINE_CONFIG_CLIENT,
talloc_strdup(select_stmt->cols, default_column);
}
+ ts = smb_transports_parse("client smb transports",
+ lp_client_smb_transports());
+
status = cli_full_connection_creds(talloc_tos(),
&c,
lp_netbios_name(),
server,
NULL,
- 0,
+ &ts,
"IPC$",
"IPC",
samba_cmdline_get_creds(),