Lines Matching full:smb

7  *   Contains the routines for constructing the SMB PDUs themselves
11 /* SMB/CIFS PDU handling routines here - except for leftovers in connect.c */
69 /* reconnect the socket, tcon, and smb session if needed */
79 * tcp and smb session status done differently for those three - in the
139 * reconnect the same SMB session
222 /* Allocate and return pointer to an SMB request buffer, and set basic
223 SMB information in the SMB header. If the return code is zero, this
287 /* potential retries of smb operations it turns out we can determine */
339 /* check for parm and data offset going beyond end of smb */
349 * less than negotiated smb buffer
358 cifs_dump_mem("Invalid transact2 SMB: ", (char *)pSMB,
592 ECHO_REQ *smb;
600 rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb);
605 smb->hdr.Flags2 |= SMBFLG2_UNICODE;
608 smb->hdr.Tid = 0xffff;
609 smb->hdr.WordCount = 1;
610 put_unaligned_le16(1, &smb->EchoCount);
611 put_bcc(1, &smb->hdr);
612 smb->Data[0] = 'a';
613 inc_rfc1001_len(smb, 3);
616 iov[0].iov_base = smb;
617 iov[1].iov_len = get_rfc1002_length(smb);
618 iov[1].iov_base = (char *)smb + 4;
625 cifs_small_buf_release(smb);
675 since server closed smb session, no sense reporting
725 * Note that SMB offsets are from the beginning of SMB which is 4 bytes
935 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */
967 rc = -EIO; /* bad smb */
1331 cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
1399 READ_REQ *smb = NULL;
1418 rc = small_smb_init(SMB_COM_READ_ANDX, wct, tcon, (void **)&smb);
1422 smb->hdr.Pid = cpu_to_le16((__u16)rdata->req->pid);
1423 smb->hdr.PidHigh = cpu_to_le16((__u16)(rdata->req->pid >> 16));
1425 smb->AndXCommand = 0xFF; /* none */
1426 smb->Fid = rdata->req->cfile->fid.netfid;
1427 smb->OffsetLow = cpu_to_le32(rdata->subreq.start & 0xFFFFFFFF);
1429 smb->OffsetHigh = cpu_to_le32(rdata->subreq.start >> 32);
1430 smb->Remaining = 0;
1431 smb->MaxCount = cpu_to_le16(rdata->subreq.len & 0xFFFF);
1432 smb->MaxCountHigh = cpu_to_le32(rdata->subreq.len >> 16);
1434 smb->ByteCount = 0;
1438 (struct smb_com_readx_req *)smb;
1443 rdata->iov[0].iov_base = smb;
1445 rdata->iov[1].iov_base = (char *)smb + 4;
1446 rdata->iov[1].iov_len = get_rfc1002_length(smb);
1453 cifs_small_buf_release(smb);
1531 /*check that DataLength would not go beyond end of SMB */
1646 byte_count = bytes_sent + 5; /* bigger pad, smaller smb hdr */
1698 WRITE_RSP *smb = (WRITE_RSP *)mid->resp_buf;
1714 written = le16_to_cpu(smb->CountHigh);
1716 written += le16_to_cpu(smb->Count);
1772 WRITE_REQ *smb = NULL;
1789 rc = small_smb_init(SMB_COM_WRITE_ANDX, wct, tcon, (void **)&smb);
1793 smb->hdr.Pid = cpu_to_le16((__u16)wdata->req->pid);
1794 smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->req->pid >> 16));
1796 smb->AndXCommand = 0xFF; /* none */
1797 smb->Fid = wdata->req->cfile->fid.netfid;
1798 smb->OffsetLow = cpu_to_le32(wdata->subreq.start & 0xFFFFFFFF);
1800 smb->OffsetHigh = cpu_to_le32(wdata->subreq.start >> 32);
1801 smb->Reserved = 0xFFFFFFFF;
1802 smb->WriteMode = 0;
1803 smb->Remaining = 0;
1805 smb->DataOffset =
1810 iov[0].iov_base = smb;
1811 iov[1].iov_len = get_rfc1002_length(smb) + 1;
1812 iov[1].iov_base = (char *)smb + 4;
1821 smb->DataLengthLow = cpu_to_le16(wdata->subreq.len & 0xFFFF);
1822 smb->DataLengthHigh = cpu_to_le16(wdata->subreq.len >> 16);
1825 inc_rfc1001_len(&smb->hdr, wdata->subreq.len + 1);
1826 put_bcc(wdata->subreq.len + 1, &smb->hdr);
1830 (struct smb_com_writex_req *)smb;
1843 cifs_small_buf_release(smb);
1910 inc_rfc1001_len(pSMB, count + 5); /* smb data starts later */
1913 else /* wct == 12 */ /* bigger pad, smaller smb hdr, keep offset ok */ {
2107 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */
2120 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */
2163 rc = -EIO; /* bad smb */
2352 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */
2356 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */
2448 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */
2533 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */
3082 * @size_of_data_area: size of SMB we got
3106 /* check if we would go beyond end of SMB */
3120 /* check if we would go beyond end of SMB */
3214 /* BB add check to make sure ACL does not overflow SMB */
3290 rc = -EIO; /* bad smb */
3340 /* BB find max SMB size from sess */
3459 rc = -EIO; /* bad smb */
3486 * Initialize NT TRANSACT SMB into small smb request buffer. This assumes that
3553 cifs_dbg(FYI, "parms start after end of smb\n");
3556 cifs_dbg(FYI, "parm end after end of smb\n");
3559 cifs_dbg(FYI, "data starts after end of smb\n");
3562 cifs_dbg(FYI, "data %p + count %d (%p) past smb end %p start %p\n",
3567 cifs_dbg(FYI, "parm count and data count larger than SMB\n");
3626 cifs_dbg(FYI, "smb %p parm %p data %p\n",
3630 rc = -EIO; /* bad smb */
3848 rc = -EIO; /* bad smb */
3898 /* BB find exact max SMB PDU from sess structure BB */
3933 rc = -EIO; /* bad smb */
4014 rc = -EIO; /* bad smb */
4065 /* BB find exact max SMB PDU from sess structure BB */
4096 rc = -EIO; /* bad smb */
4494 rc = -EIO; /* bad smb */
4580 /* BB find exact max SMB PDU from sess structure BB */
4609 rc = -EIO; /* bad smb */
4683 rc = -EIO; /* bad smb */
4770 rc = -EIO; /* bad smb */
4828 /* BB find exact max SMB PDU from sess structure BB */
4858 rc = -EIO; /* bad smb */
4898 /* BB find exact max SMB PDU from sess structure BB */
4929 rc = -EIO; /* bad smb */
4971 /* BB find exact max SMB PDU from sess structure BB */
4998 rc = -EIO; /* bad smb */
5047 /* BB find exact max SMB PDU from sess structure BB */
5080 rc = -EIO; /* bad smb */
5116 /* BB find exact max SMB PDU from sess structure BB */
5143 rc = -EIO; /* bad smb */
5311 /* BB find exact max SMB PDU from sess structure BB */
5322 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */
5454 /* BB find max SMB PDU from sess */
5514 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */
5519 /* BB find max SMB PDU from sess */
5613 /* BB find max SMB PDU from sess structure BB */
5741 /* BB find max SMB PDU from sess */
5807 /* BB find max SMB PDU from sess structure BB */
5817 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */
5899 /* BB find exact max SMB PDU from sess structure BB */
5935 rc = -EIO; /* bad smb */
5945 /* BB check if start of smb + data_offset > &bcc+ bcc */
5961 /* make sure list_len doesn't go past end of SMB */
5964 cifs_dbg(FYI, "EA list appears to go beyond SMB\n");
6088 /* BB find max SMB PDU from sess */
6117 we need to ensure that it fits within the smb */
6120 negotiated SMB buffer size BB */