Lines Matching defs:ctx

165 conn_tcp6(struct smb_ctx *ctx, const struct sockaddr *sa, int port)
213 ctx->ct_tran_fd = fd;
226 conn_tcp4(struct smb_ctx *ctx, const struct sockaddr *sa, int port)
274 ctx->ct_tran_fd = fd;
293 conn_nbt(struct smb_ctx *ctx, const struct sockaddr *saarg, char *name)
337 nberr = nbns_getnodestatus(ctx->ct_nb,
342 strlcpy(ctx->ct_srvname, server,
343 sizeof (ctx->ct_srvname));
354 if ((err = conn_tcp4(ctx, sa, port)) != 0) {
360 err = nb_ssn_request(ctx, server);
366 if (ctx->ct_tran_fd != -1) {
367 close(ctx->ct_tran_fd);
368 ctx->ct_tran_fd = -1;
378 smb_iod_connect(smb_ctx_t *ctx)
386 if (ctx->ct_srvname[0] == '\0') {
390 DPRINT("server: %s", ctx->ct_srvname);
393 dump_ctx("smb_iod_connect", ctx);
399 if (ctx->ct_tran_fd != -1) {
400 close(ctx->ct_tran_fd);
401 ctx->ct_tran_fd = -1;
408 if (ctx->ct_locname == NULL) {
409 err = smb_getlocalname(&ctx->ct_locname);
421 ctx->ct_flags |= SMBCF_RESOLVED;
423 sa = &ctx->ct_srvaddr.sa;
427 err = conn_tcp6(ctx, sa, IPPORT_SMB);
431 err = conn_tcp4(ctx, sa, IPPORT_SMB);
440 err2 = conn_nbt(ctx, sa, NULL);
448 err = conn_nbt(ctx, sa, ctx->ct_srvname);
466 err = smb_negprot(ctx, &blob);
477 if (ctx->ct_user[0] == '\0') {
479 ctx->ct_domain[0] = '\0';
480 ctx->ct_authflags = SMB_AT_ANON;
481 ctx->ct_clnt_caps &= ~SMB_CAP_EXT_SECURITY;
482 ctx->ct_vcflags &= ~SMBV_WILL_SIGN;
492 if (ctx->ct_clnt_caps & SMB_CAP_EXT_SECURITY) {
493 err = smb_ssnsetup_spnego(ctx, &blob);
499 if (ctx->ct_authflags & SMB_AT_NTLM2) {
500 err = smb_ssnsetup_ntlm2(ctx);
501 } else if (ctx->ct_authflags & SMB_AT_NTLM1) {
502 err = smb_ssnsetup_ntlm1(ctx);
503 } else if (ctx->ct_authflags & SMB_AT_ANON) {
504 err = smb_ssnsetup_null(ctx);
519 close(ctx->ct_tran_fd);
520 ctx->ct_tran_fd = -1;
523 ctx->ct_flags |= SMBCF_SSNACTIVE;
524 DPRINT("tran_fd = %d", ctx->ct_tran_fd);