}
smb_setlen(outbuf, outsize - 4);
show_msg(outbuf);
- if (!srv_send_smb(aio_ex->smbreq->sconn, outbuf,
+ if (!srv_send_smb(aio_ex->smbreq->xconn, outbuf,
true, aio_ex->smbreq->seqnum+1,
IS_CONN_ENCRYPTED(fsp->conn), NULL)) {
exit_server_cleanly("handle_aio_read_complete: srv_send_smb "
SSVAL(aio_ex->outbuf.data,smb_vwv2,numtowrite);
SSVAL(aio_ex->outbuf.data,smb_vwv4,(numtowrite>>16)&1);
show_msg((char *)aio_ex->outbuf.data);
- if (!srv_send_smb(aio_ex->smbreq->sconn,
+ if (!srv_send_smb(aio_ex->smbreq->xconn,
(char *)aio_ex->outbuf.data,
true, aio_ex->smbreq->seqnum+1,
IS_CONN_ENCRYPTED(fsp->conn),
}
show_msg(outbuf);
- if (!srv_send_smb(aio_ex->smbreq->sconn, outbuf,
+ if (!srv_send_smb(aio_ex->smbreq->xconn, outbuf,
true, aio_ex->smbreq->seqnum+1,
IS_CONN_ENCRYPTED(fsp->conn),
NULL)) {
* that here and must set up the chain info manually.
*/
- if (!srv_send_smb(req->sconn,
+ if (!srv_send_smb(req->xconn,
(char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(req->conn)||req->encrypted,
}
reply_nterror(blr->req, status);
- if (!srv_send_smb(blr->req->sconn, (char *)blr->req->outbuf,
+ if (!srv_send_smb(blr->req->xconn, (char *)blr->req->outbuf,
true, blr->req->seqnum+1,
blr->req->encrypted, NULL)) {
exit_server_cleanly("generic_blocking_lock_error: srv_send_smb failed.");
*/
SCVAL(blr->req->outbuf,smb_com,SMBtrans2);
- if (!srv_send_smb(blr->req->sconn,
+ if (!srv_send_smb(blr->req->xconn,
(char *)blr->req->outbuf,
true, blr->req->seqnum+1,
IS_CONN_ENCRYPTED(blr->fsp->conn),
int ldata = rdata ? rdata_len : 0;
int lparam = rparam ? rparam_len : 0;
struct smbXsrv_connection *xconn = req->xconn;
- struct smbd_server_connection *sconn = xconn->sconn;
int max_send = xconn->smb1.sessions.max_send;
/* HACK: make sure we send at least 128 byte in one go */
int hdr_overhead = SMB_BUFFER_SIZE_MIN - 128;
}
show_msg((char *)req->outbuf);
- if (!srv_send_smb(sconn, (char *)req->outbuf,
+ if (!srv_send_smb(xconn, (char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(conn), &req->pcd)) {
exit_server_cleanly("send_trans_reply: srv_send_smb failed.");
}
show_msg((char *)req->outbuf);
- if (!srv_send_smb(sconn, (char *)req->outbuf,
+ if (!srv_send_smb(xconn, (char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(conn), &req->pcd))
exit_server_cleanly("send_trans_reply: srv_send_smb "
send:
if (!srv_send_smb(
- req->sconn, (char *)req->outbuf,
+ req->xconn, (char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(req->conn) || req->encrypted,
&req->pcd)) {
NT_STATUS_EQUAL(old, status)?"":nt_errstr(status)));
reply_nterror(req, status);
- if (!srv_send_smb(req->sconn, (char *)req->outbuf,
+ if (!srv_send_smb(req->xconn, (char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(req->conn)
||req->encrypted, &req->pcd)) {
int alignment_offset = 1;
int data_alignment_offset = 0;
struct smbXsrv_connection *xconn = req->xconn;
- struct smbd_server_connection *sconn = xconn->sconn;
int max_send = xconn->smb1.sessions.max_send;
/*
__LINE__,__FILE__);
}
show_msg((char *)req->outbuf);
- if (!srv_send_smb(sconn,
+ if (!srv_send_smb(xconn,
(char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(conn),
/* Send the packet */
show_msg((char *)req->outbuf);
- if (!srv_send_smb(sconn,
+ if (!srv_send_smb(xconn,
(char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(conn),
static void send_break_message_smb1(files_struct *fsp, int level)
{
+ struct smbXsrv_connection *xconn = fsp->conn->sconn->conn;
char break_msg[SMB1_BREAK_MESSAGE_LENGTH];
new_break_message_smb1(fsp, level, break_msg);
show_msg(break_msg);
- if (!srv_send_smb(fsp->conn->sconn,
+ if (!srv_send_smb(xconn,
break_msg, false, 0,
IS_CONN_ENCRYPTED(fsp->conn),
NULL)) {
DEBUG(3,("write-IPC nwritten=%d\n", (int)nwritten));
send:
- if (!srv_send_smb(req->sconn, (char *)req->outbuf,
+ if (!srv_send_smb(req->xconn, (char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(req->conn)||req->encrypted,
&req->pcd)) {
Send an smb to a fd.
****************************************************************************/
-bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer,
+bool srv_send_smb(struct smbXsrv_connection *xconn, char *buffer,
bool do_signing, uint32_t seqnum,
bool do_encrypt,
struct smb_perfcount_data *pcd)
{
- struct smbXsrv_connection *xconn = sconn->conn;
size_t len = 0;
ssize_t ret;
char *buf_out = buffer;
bool encrypted,
struct smb_perfcount_data *deferred_pcd)
{
+ struct smbXsrv_connection *xconn = sconn->conn;
struct smb_request **reqs = NULL;
struct smb_request *req;
unsigned num_reqs;
char errbuf[smb_size];
error_packet(errbuf, 0, 0, NT_STATUS_INVALID_PARAMETER,
__LINE__, __FILE__);
- if (!srv_send_smb(sconn, errbuf, true, seqnum, encrypted,
+ if (!srv_send_smb(xconn, errbuf, true, seqnum, encrypted,
NULL)) {
exit_server_cleanly("construct_reply_chain: "
"srv_send_smb failed.");
first_req->outbuf, talloc_get_size(first_req->outbuf) - 4);
shipit:
- if (!srv_send_smb(first_req->sconn,
+ if (!srv_send_smb(first_req->xconn,
(char *)first_req->outbuf,
true, first_req->seqnum+1,
IS_CONN_ENCRYPTED(req->conn)||first_req->encrypted,
{
char errbuf[smb_size];
error_packet(errbuf, 0, 0, status, __LINE__, __FILE__);
- if (!srv_send_smb(req->sconn, errbuf, true,
+ if (!srv_send_smb(req->xconn, errbuf, true,
req->seqnum+1, req->encrypted,
NULL)) {
exit_server_cleanly("construct_reply_chain: "
memcpy(smb_buf(req.outbuf), req.buf, req.buflen);
}
- ok = srv_send_smb(req.sconn,
+ ok = srv_send_smb(req.xconn,
(char *)outbuf,
true, seqnum+1,
false, &req.pcd);
DEBUG( 1, ("Connection denied from %s to %s\n",
tsocket_address_string(remote_address, talloc_tos()),
tsocket_address_string(local_address, talloc_tos())));
- (void)srv_send_smb(sconn,(char *)buf, false,
+ (void)srv_send_smb(xconn,(char *)buf, false,
0, false, NULL);
exit_server_cleanly("connection denied");
}
void smbd_setup_sig_term_handler(struct smbd_server_connection *sconn);
void smbd_setup_sig_hup_handler(struct smbd_server_connection *sconn);
-bool srv_send_smb(struct smbd_server_connection *sconn, char *buffer,
+bool srv_send_smb(struct smbXsrv_connection *xconn, char *buffer,
bool no_signing, uint32_t seqnum,
bool do_encrypt,
struct smb_perfcount_data *pcd);
static bool netbios_session_retarget(struct smbXsrv_connection *xconn,
const char *name, int name_type)
{
- struct smbd_server_connection *sconn = xconn->sconn;
char *trim_name;
char *trim_name_type;
const char *retarget_parm;
*(uint32_t *)(outbuf+4) = in_addr->sin_addr.s_addr;
*(uint16_t *)(outbuf+8) = htons(retarget_port);
- if (!srv_send_smb(sconn, (char *)outbuf, false, 0, false,
+ if (!srv_send_smb(xconn, (char *)outbuf, false, 0, false,
NULL)) {
exit_server_cleanly("netbios_session_retarget: srv_send_smb "
"failed.");
DEBUG(5,("init msg_type=0x%x msg_flags=0x%x\n",
msg_type, msg_flags));
- srv_send_smb(sconn, outbuf, false, 0, false, NULL);
+ srv_send_smb(xconn, outbuf, false, 0, false, NULL);
if (CVAL(outbuf, 0) != 0x82) {
exit_server_cleanly("invalid netbios session");
SCVAL(buf,smb_com,SMBwritebraw);
SSVALS(buf,smb_vwv0,0xFFFF);
show_msg(buf);
- if (!srv_send_smb(req->sconn,
+ if (!srv_send_smb(req->xconn,
buf,
false, 0, /* no signing */
IS_CONN_ENCRYPTED(conn),
} else {
reply_nterror(smbreq, status);
}
- if (!srv_send_smb(smbreq->sconn,
+ if (!srv_send_smb(smbreq->xconn,
(char *)smbreq->outbuf,
true,
smbreq->seqnum+1,
SSVAL(req->outbuf,smb_vwv0,seq_num);
show_msg((char *)req->outbuf);
- if (!srv_send_smb(req->sconn,
+ if (!srv_send_smb(req->xconn,
(char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(conn)||req->encrypted,
int data_alignment_offset = 0;
bool overflow = False;
struct smbXsrv_connection *xconn = req->xconn;
- struct smbd_server_connection *sconn = xconn->sconn;
int max_send = xconn->smb1.sessions.max_send;
/* Modify the data_to_send and datasize and set the error if
__LINE__,__FILE__);
}
show_msg((char *)req->outbuf);
- if (!srv_send_smb(sconn,
+ if (!srv_send_smb(xconn,
(char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(conn),
/* Send the packet */
show_msg((char *)req->outbuf);
- if (!srv_send_smb(sconn,
+ if (!srv_send_smb(xconn,
(char *)req->outbuf,
true, req->seqnum+1,
IS_CONN_ENCRYPTED(conn),