Lines Matching refs:shdr
221 struct smb2_hdr *shdr = (struct smb2_hdr *)iov[0].iov_base; in smb2_calc_signature() local
226 ses = smb2_find_smb_ses(server, le64_to_cpu(shdr->SessionId)); in smb2_calc_signature()
233 memset(shdr->Signature, 0x0, SMB2_SIGNATURE_SIZE); in smb2_calc_signature()
284 memcpy(shdr->Signature, sigptr, SMB2_SIGNATURE_SIZE); in smb2_calc_signature()
542 struct smb2_hdr *shdr = (struct smb2_hdr *)iov[0].iov_base; in smb3_calc_signature() local
547 rc = smb2_get_sign_key(le64_to_cpu(shdr->SessionId), server, key); in smb3_calc_signature()
562 memset(shdr->Signature, 0x0, SMB2_SIGNATURE_SIZE); in smb3_calc_signature()
603 memcpy(shdr->Signature, sigptr, SMB2_SIGNATURE_SIZE); in smb3_calc_signature()
616 struct smb2_hdr *shdr; in smb2_sign_rqst() local
621 shdr = (struct smb2_hdr *)rqst->rq_iov[0].iov_base; in smb2_sign_rqst()
622 ssr = (struct smb2_sess_setup_req *)shdr; in smb2_sign_rqst()
624 is_binding = shdr->Command == SMB2_SESSION_SETUP && in smb2_sign_rqst()
626 is_signed = shdr->Flags & SMB2_FLAGS_SIGNED; in smb2_sign_rqst()
638 strncpy(shdr->Signature, "BSRSPYL", 8); in smb2_sign_rqst()
652 struct smb2_hdr *shdr = in smb2_verify_signature() local
655 if ((shdr->Command == SMB2_NEGOTIATE) || in smb2_verify_signature()
656 (shdr->Command == SMB2_SESSION_SETUP) || in smb2_verify_signature()
657 (shdr->Command == SMB2_OPLOCK_BREAK) || in smb2_verify_signature()
668 if (memcmp(shdr->Signature, "BSRSPYL ", 8) == 0) in smb2_verify_signature()
670 shdr->Command); in smb2_verify_signature()
676 memcpy(server_response_sig, shdr->Signature, SMB2_SIGNATURE_SIZE); in smb2_verify_signature()
678 memset(shdr->Signature, 0, SMB2_SIGNATURE_SIZE); in smb2_verify_signature()
685 if (memcmp(server_response_sig, shdr->Signature, SMB2_SIGNATURE_SIZE)) { in smb2_verify_signature()
687 shdr->Command, shdr->MessageId); in smb2_verify_signature()
699 struct smb2_hdr *shdr) in smb2_seq_num_into_buf() argument
701 unsigned int i, num = le16_to_cpu(shdr->CreditCharge); in smb2_seq_num_into_buf()
703 shdr->MessageId = get_next_mid64(server); in smb2_seq_num_into_buf()
710 smb2_mid_entry_alloc(const struct smb2_hdr *shdr, in smb2_mid_entry_alloc() argument
714 unsigned int credits = le16_to_cpu(shdr->CreditCharge); in smb2_mid_entry_alloc()
724 temp->mid = le64_to_cpu(shdr->MessageId); in smb2_mid_entry_alloc()
727 temp->command = shdr->Command; /* Always LE */ in smb2_mid_entry_alloc()
742 trace_smb3_cmd_enter(le32_to_cpu(shdr->Id.SyncId.TreeId), in smb2_mid_entry_alloc()
743 le64_to_cpu(shdr->SessionId), in smb2_mid_entry_alloc()
744 le16_to_cpu(shdr->Command), temp->mid); in smb2_mid_entry_alloc()
750 struct smb2_hdr *shdr, struct mid_q_entry **mid) in smb2_get_mid_entry() argument
765 shdr->Command != SMB2_NEGOTIATE) { in smb2_get_mid_entry()
773 if ((shdr->Command != SMB2_SESSION_SETUP) && in smb2_get_mid_entry()
774 (shdr->Command != SMB2_NEGOTIATE)) { in smb2_get_mid_entry()
782 if (shdr->Command != SMB2_LOGOFF) { in smb2_get_mid_entry()
790 *mid = smb2_mid_entry_alloc(shdr, server); in smb2_get_mid_entry()
831 struct smb2_hdr *shdr = in smb2_setup_request() local
835 smb2_seq_num_into_buf(server, shdr); in smb2_setup_request()
837 rc = smb2_get_mid_entry(ses, server, shdr, &mid); in smb2_setup_request()
839 revert_current_mid_from_hdr(server, shdr); in smb2_setup_request()
845 revert_current_mid_from_hdr(server, shdr); in smb2_setup_request()
857 struct smb2_hdr *shdr = in smb2_setup_async_request() local
863 shdr->Command != SMB2_NEGOTIATE) { in smb2_setup_async_request()
869 smb2_seq_num_into_buf(server, shdr); in smb2_setup_async_request()
871 mid = smb2_mid_entry_alloc(shdr, server); in smb2_setup_async_request()
873 revert_current_mid_from_hdr(server, shdr); in smb2_setup_async_request()
879 revert_current_mid_from_hdr(server, shdr); in smb2_setup_async_request()