From: David Mulder Date: Mon, 21 Mar 2022 14:30:48 +0000 (-0600) Subject: smbd: Move process.c -> smb1_process.c X-Git-Tag: tevent-0.12.0~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e1ff0ff35bb2645c37e7ee17634c024aaed99af;p=thirdparty%2Fsamba.git smbd: Move process.c -> smb1_process.c Signed-off-by: David Mulder Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 41218e24d67..7fb1a461368 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -846,57 +846,6 @@ NTSTATUS make_default_filesystem_acl( const SMB_STRUCT_STAT *psbuf, struct security_descriptor **ppdesc); -/* The following definitions come from smbd/process.c */ - -bool smb1_srv_send(struct smbXsrv_connection *xconn, char *buffer, - bool do_signing, uint32_t seqnum, - bool do_encrypt, - struct smb_perfcount_data *pcd); -NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid); -void smb_request_done(struct smb_request *req); -const char *smb_fn_name(int type); -void add_to_common_flags2(uint32_t v); -void remove_from_common_flags2(uint32_t v); -bool smb1_is_chain(const uint8_t *buf); -bool smb1_walk_chain(const uint8_t *buf, - bool (*fn)(uint8_t cmd, - uint8_t wct, const uint16_t *vwv, - uint16_t num_bytes, const uint8_t *bytes, - void *private_data), - void *private_data); -unsigned smb1_chain_length(const uint8_t *buf); -bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf, - struct smbXsrv_connection *xconn, - bool encrypted, uint32_t seqnum, - struct smb_request ***reqs, unsigned *num_reqs); -bool req_is_in_chain(const struct smb_request *req); -bool fork_echo_handler(struct smbXsrv_connection *xconn); -NTSTATUS smb1_receive_talloc(TALLOC_CTX *mem_ctx, - struct smbXsrv_connection *xconn, - int sock, - char **buffer, unsigned int timeout, - size_t *p_unread, bool *p_encrypted, - size_t *p_len, - uint32_t *seqnum, - bool trusted_channel); -bool push_deferred_open_message_smb1(struct smb_request *req, - struct timeval timeout, - struct file_id id, - struct deferred_open_record *open_rec); -void process_smb1(struct smbXsrv_connection *xconn, - uint8_t *inbuf, size_t nread, size_t unread_bytes, - uint32_t seqnum, bool encrypted, - struct smb_perfcount_data *deferred_pcd); -bool valid_smb_header(const uint8_t *inbuf); -void smbd_echo_init(struct smbXsrv_connection *xconn); -void construct_reply(struct smbXsrv_connection *xconn, - char *inbuf, int size, size_t unread_bytes, - uint32_t seqnum, bool encrypted, - struct smb_perfcount_data *deferred_pcd); -void smbd_smb1_server_connection_read_handler(struct smbXsrv_connection *xconn, - int fd); -bool keepalive_fn(const struct timeval *now, void *private_data); - /* The following definitions come from smbd/smb2_process.c */ bool srv_send_smb(struct smbXsrv_connection *xconn, char *buffer, diff --git a/source3/smbd/process.c b/source3/smbd/smb1_process.c similarity index 100% rename from source3/smbd/process.c rename to source3/smbd/smb1_process.c diff --git a/source3/smbd/smb1_process.h b/source3/smbd/smb1_process.h new file mode 100644 index 00000000000..234a19599ab --- /dev/null +++ b/source3/smbd/smb1_process.h @@ -0,0 +1,68 @@ +/* + Unix SMB/CIFS implementation. + process incoming packets - main loop + Copyright (C) Andrew Tridgell 1992-1998 + Copyright (C) Volker Lendecke 2005-2007 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +bool smb1_srv_send(struct smbXsrv_connection *xconn, char *buffer, + bool do_signing, uint32_t seqnum, + bool do_encrypt, + struct smb_perfcount_data *pcd); +NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid); +void smb_request_done(struct smb_request *req); +const char *smb_fn_name(int type); +void add_to_common_flags2(uint32_t v); +void remove_from_common_flags2(uint32_t v); +bool smb1_is_chain(const uint8_t *buf); +bool smb1_walk_chain(const uint8_t *buf, + bool (*fn)(uint8_t cmd, + uint8_t wct, const uint16_t *vwv, + uint16_t num_bytes, const uint8_t *bytes, + void *private_data), + void *private_data); +unsigned smb1_chain_length(const uint8_t *buf); +bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf, + struct smbXsrv_connection *xconn, + bool encrypted, uint32_t seqnum, + struct smb_request ***reqs, unsigned *num_reqs); +bool req_is_in_chain(const struct smb_request *req); +bool fork_echo_handler(struct smbXsrv_connection *xconn); +NTSTATUS smb1_receive_talloc(TALLOC_CTX *mem_ctx, + struct smbXsrv_connection *xconn, + int sock, + char **buffer, unsigned int timeout, + size_t *p_unread, bool *p_encrypted, + size_t *p_len, + uint32_t *seqnum, + bool trusted_channel); +bool push_deferred_open_message_smb1(struct smb_request *req, + struct timeval timeout, + struct file_id id, + struct deferred_open_record *open_rec); +void process_smb1(struct smbXsrv_connection *xconn, + uint8_t *inbuf, size_t nread, size_t unread_bytes, + uint32_t seqnum, bool encrypted, + struct smb_perfcount_data *deferred_pcd); +bool valid_smb_header(const uint8_t *inbuf); +void smbd_echo_init(struct smbXsrv_connection *xconn); +void construct_reply(struct smbXsrv_connection *xconn, + char *inbuf, int size, size_t unread_bytes, + uint32_t seqnum, bool encrypted, + struct smb_perfcount_data *deferred_pcd); +void smbd_smb1_server_connection_read_handler(struct smbXsrv_connection *xconn, + int fd); +bool keepalive_fn(const struct timeval *now, void *private_data); diff --git a/source3/smbd/smbd.h b/source3/smbd/smbd.h index 133032ccea5..cbf7a7d2618 100644 --- a/source3/smbd/smbd.h +++ b/source3/smbd/smbd.h @@ -39,6 +39,7 @@ struct dptr_struct; #include "smbd/smb1_reply.h" #include "smbd/smb1_service.h" #include "smbd/smb1_signing.h" +#include "smbd/smb1_process.h" #endif struct trans_state { diff --git a/source3/wscript_build b/source3/wscript_build index e3f1fe01fb7..a5448d871ff 100644 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -612,6 +612,7 @@ if bld.CONFIG_SET('WITH_SMB1SERVER'): smbd/smb1_reply.c smbd/smb1_service.c smbd/smb1_signing.c + smbd/smb1_process.c ''' else: SMB1_SOURCES = '' @@ -649,7 +650,6 @@ bld.SAMBA3_LIBRARY('smbd_base', smbd/seal.c smbd/posix_acls.c lib/sysacls.c - smbd/process.c smbd/smb2_process.c smbd/smb2_service.c smbd/error.c