]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Move process.c -> smb1_process.c
authorDavid Mulder <dmulder@suse.com>
Mon, 21 Mar 2022 14:30:48 +0000 (08:30 -0600)
committerJeremy Allison <jra@samba.org>
Thu, 7 Apr 2022 17:37:30 +0000 (17:37 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/proto.h
source3/smbd/smb1_process.c [moved from source3/smbd/process.c with 100% similarity]
source3/smbd/smb1_process.h [new file with mode: 0644]
source3/smbd/smbd.h
source3/wscript_build

index 41218e24d675b7195fb250868c600f04a95ace63..7fb1a46136880db16d948134eb2c775988b3f670 100644 (file)
@@ -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/smb1_process.h b/source3/smbd/smb1_process.h
new file mode 100644 (file)
index 0000000..234a195
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+*/
+
+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);
index 133032ccea55fec82d49671c3f8c4b78b3a370eb..cbf7a7d2618e1ec5a0f79b88e887ca3c5afe33b9 100644 (file)
@@ -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 {
index e3f1fe01fb77e25c6ec91dcb776a13a688ea69e3..a5448d871ff006460fad9c12f855dab428393394 100644 (file)
@@ -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