NTTIME xconn_connect_time;
server_id dst_server_id;
NTTIME client_connect_time;
+ uint8 transport_type;
DATA_BLOB negotiate_request;
} smbXsrv_connection_pass0;
[ignore] smbXsrv_connection *connection;
uint16 signing_algo;
uint16 encryption_cipher;
+ uint8 transport_type;
} smbXsrv_channel_global0;
typedef struct {
bool smbd_smb2_is_last_in_compound(const struct smbd_smb2_request *req);
NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd,
+ enum smb_transport_type transport_type,
NTTIME now, struct smbXsrv_connection **_xconn);
NTSTATUS reply_smb2002(struct smb_request *req, uint16_t choice);
struct tevent_queue *shutdown_wait_queue;
int sock;
struct tevent_fd *fde;
+ enum smb_transport_type type;
struct {
bool got_session;
void smbd_process(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
int sock_fd,
- bool interactive);
+ bool interactive,
+ enum smb_transport_type transport_type);
bool valid_smb1_header(const uint8_t *inbuf);
bool init_smb1_request(struct smb_request *req,
struct smbd_server_connection *sconn,
smb_set_close_on_exec(fd);
if (s->parent->interactive) {
+ enum smb_transport_type transport_type = s->transport.type;
NTSTATUS status;
status = reinit_after_fork(msg_ctx, ev, true);
exit_server("reinit_after_fork() failed");
return;
}
- smbd_process(ev, msg_ctx, fd, true);
+ smbd_process(ev, msg_ctx, fd, true, transport_type);
exit_server_cleanly("end of interactive mode");
return;
}
pid = fork();
if (pid == 0) {
+ enum smb_transport_type transport_type = s->transport.type;
char addrstr[INET6_ADDRSTRLEN];
NTSTATUS status = NT_STATUS_OK;
print_sockaddr(addrstr, sizeof(addrstr), &caddr.u.ss);
process_set_title("smbd[%s]", "client [%s]", addrstr);
- smbd_process(ev, msg_ctx, fd, false);
+ smbd_process(ev, msg_ctx, fd, false, transport_type);
exit:
exit_server_cleanly("end of child");
return;
/* Stop zombies */
smbd_setup_sig_chld_handler(parent);
- smbd_process(ev_ctx, msg_ctx, sock, true);
+ smbd_process(ev_ctx, msg_ctx, sock, true, SMB_TRANSPORT_TYPE_TCP);
exit_server_cleanly(NULL);
return(0);
}
NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd,
+ enum smb_transport_type transport_type,
NTTIME now, struct smbXsrv_connection **_xconn)
{
TALLOC_CTX *frame = talloc_stackframe();
}
xconn->transport.sock = sock_fd;
+ xconn->transport.type = transport_type;
#if defined(WITH_SMB1SERVER)
smbd_echo_init(xconn);
#endif
void smbd_process(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
int sock_fd,
- bool interactive)
+ bool interactive,
+ enum smb_transport_type transport_type)
{
const struct loadparm_substitution *lp_sub =
loadparm_s3_global_substitution();
smbd_setup_sig_hup_handler(sconn);
}
- status = smbd_add_connection(client, sock_fd, now, &xconn);
+ status = smbd_add_connection(client,
+ sock_fd,
+ transport_type,
+ now,
+ &xconn);
if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) {
/*
* send a negative session response "not listening on calling
.xconn_connect_time = smb2req->xconn->client->global->initial_connect_time,
.dst_server_id = global->server_id,
.client_connect_time = global->initial_connect_time,
+ .transport_type = smb2req->xconn->transport.type,
};
reqlen = iov_buflen(smb2req->in.vector, smb2req->in.vector_count);
status = smbd_add_connection(client,
sock_fd,
+ pass_info0->transport_type,
pass_info0->xconn_connect_time,
&xconn);
if (NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) {
.channel_id = conn->channel_id,
.creation_time = now,
.connection = conn,
+ .transport_type = conn->transport.type,
};
c->local_address = tsocket_address_string(conn->local_address,