Lines Matching refs:hdr

14 static int check_smb2_hdr(struct smb2_hdr *hdr)  in check_smb2_hdr()  argument
19 if (hdr->Flags & SMB2_FLAGS_SERVER_TO_REDIR) in check_smb2_hdr()
86 struct smb2_hdr *hdr) in smb2_get_data_area_len() argument
98 switch (hdr->Command) { in smb2_get_data_area_len()
100 *off = le16_to_cpu(((struct smb2_sess_setup_req *)hdr)->SecurityBufferOffset); in smb2_get_data_area_len()
101 *len = le16_to_cpu(((struct smb2_sess_setup_req *)hdr)->SecurityBufferLength); in smb2_get_data_area_len()
105 le16_to_cpu(((struct smb2_tree_connect_req *)hdr)->PathOffset), in smb2_get_data_area_len()
107 *len = le16_to_cpu(((struct smb2_tree_connect_req *)hdr)->PathLength); in smb2_get_data_area_len()
113 le16_to_cpu(((struct smb2_create_req *)hdr)->NameOffset), in smb2_get_data_area_len()
116 le16_to_cpu(((struct smb2_create_req *)hdr)->NameLength); in smb2_get_data_area_len()
118 if (((struct smb2_create_req *)hdr)->CreateContextsLength) { in smb2_get_data_area_len()
120 hdr)->CreateContextsOffset); in smb2_get_data_area_len()
122 hdr)->CreateContextsLength); in smb2_get_data_area_len()
136 le16_to_cpu(((struct smb2_query_info_req *)hdr)->InputBufferOffset), in smb2_get_data_area_len()
138 *len = le32_to_cpu(((struct smb2_query_info_req *)hdr)->InputBufferLength); in smb2_get_data_area_len()
142 le16_to_cpu(((struct smb2_set_info_req *)hdr)->BufferOffset), in smb2_get_data_area_len()
144 *len = le32_to_cpu(((struct smb2_set_info_req *)hdr)->BufferLength); in smb2_get_data_area_len()
147 *off = le16_to_cpu(((struct smb2_read_req *)hdr)->ReadChannelInfoOffset); in smb2_get_data_area_len()
148 *len = le16_to_cpu(((struct smb2_read_req *)hdr)->ReadChannelInfoLength); in smb2_get_data_area_len()
151 if (((struct smb2_write_req *)hdr)->DataOffset || in smb2_get_data_area_len()
152 ((struct smb2_write_req *)hdr)->Length) { in smb2_get_data_area_len()
154 le16_to_cpu(((struct smb2_write_req *)hdr)->DataOffset), in smb2_get_data_area_len()
156 *len = le32_to_cpu(((struct smb2_write_req *)hdr)->Length); in smb2_get_data_area_len()
160 *off = le16_to_cpu(((struct smb2_write_req *)hdr)->WriteChannelInfoOffset); in smb2_get_data_area_len()
161 *len = le16_to_cpu(((struct smb2_write_req *)hdr)->WriteChannelInfoLength); in smb2_get_data_area_len()
165 le16_to_cpu(((struct smb2_query_directory_req *)hdr)->FileNameOffset), in smb2_get_data_area_len()
167 *len = le16_to_cpu(((struct smb2_query_directory_req *)hdr)->FileNameLength); in smb2_get_data_area_len()
173 lock_count = le16_to_cpu(((struct smb2_lock_req *)hdr)->LockCount); in smb2_get_data_area_len()
182 le32_to_cpu(((struct smb2_ioctl_req *)hdr)->InputOffset), in smb2_get_data_area_len()
184 *len = le32_to_cpu(((struct smb2_ioctl_req *)hdr)->InputCount); in smb2_get_data_area_len()
210 struct smb2_hdr *hdr = &pdu->hdr; in smb2_calc_size() local
216 *len = le16_to_cpu(hdr->StructureSize); in smb2_calc_size()
229 if (hdr->Command == SMB2_LOCK) in smb2_calc_size()
232 if (has_smb2_data_area[le16_to_cpu(hdr->Command)] == false) in smb2_calc_size()
235 ret = smb2_get_data_area_len(&offset, &data_length, hdr); in smb2_calc_size()
302 struct smb2_hdr *hdr) in smb2_validate_credit_charge() argument
305 unsigned short credit_charge = le16_to_cpu(hdr->CreditCharge); in smb2_validate_credit_charge()
306 void *__hdr = hdr; in smb2_validate_credit_charge()
309 switch (hdr->Command) { in smb2_validate_credit_charge()
371 struct smb2_hdr *hdr = &pdu->hdr; in ksmbd_smb2_check_message() local
375 __u32 req_struct_size, next_cmd = le32_to_cpu(hdr->NextCommand); in ksmbd_smb2_check_message()
388 if (check_smb2_hdr(hdr)) in ksmbd_smb2_check_message()
391 if (hdr->StructureSize != SMB2_HEADER_STRUCTURE_SIZE) { in ksmbd_smb2_check_message()
393 le16_to_cpu(hdr->StructureSize)); in ksmbd_smb2_check_message()
397 command = le16_to_cpu(hdr->Command); in ksmbd_smb2_check_message()
423 if (smb2_calc_size(hdr, &clc_len)) in ksmbd_smb2_check_message()
457 le64_to_cpu(hdr->MessageId)); in ksmbd_smb2_check_message()
464 smb2_validate_credit_charge(work->conn, hdr)) in ksmbd_smb2_check_message()