]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Move send_keepalive() to smbd/smb1_utils.c
authorVolker Lendecke <vl@samba.org>
Fri, 17 Jul 2020 10:36:22 +0000 (12:36 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 17 Aug 2020 19:35:37 +0000 (19:35 +0000)
This is a SMB1-only packet sent from smbd only

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/proto.h
source3/lib/util_sock.c
source3/smbd/process.c
source3/smbd/smb1_utils.c
source3/smbd/smb1_utils.h

index 51bac188919b2bcede588f41e6efed2b2cfbabee..fe3acde078ebc192ffaf6985969a50d2d7d58bd2 100644 (file)
@@ -535,7 +535,6 @@ NTSTATUS read_fd_with_timeout(int fd, char *buf,
                                  size_t *size_ret);
 NTSTATUS read_data_ntstatus(int fd, char *buffer, size_t N);
 
-bool send_keepalive(int client);
 NTSTATUS read_smb_length_return_keepalive(int fd, char *inbuf,
                                          unsigned int timeout,
                                          size_t *len);
index 0b7029706a6a6928f75cbe745f12652881d1c2e7..fb64c0e61cd782280aae2e8351cf549b49205c16 100644 (file)
@@ -203,20 +203,6 @@ NTSTATUS read_data_ntstatus(int fd, char *buffer, size_t N)
        return read_fd_with_timeout(fd, buffer, N, N, 0, NULL);
 }
 
-/****************************************************************************
- Send a keepalive packet (rfc1002).
-****************************************************************************/
-
-bool send_keepalive(int client)
-{
-       unsigned char buf[4];
-
-       buf[0] = NBSSkeepalive;
-       buf[1] = buf[2] = buf[3] = 0;
-
-       return(write_data(client,(char *)buf,4) == 4);
-}
-
 /****************************************************************************
  Read 4 bytes of a smb packet and return the smb length of the packet.
  Store the result in the buffer.
index 2bff5bf5a8f9c2148d2bdc7cb0fcdfad49ba4cfe..5205674a00697a01b850ce9326f6a9eb204b4150 100644 (file)
@@ -46,6 +46,7 @@
 #include "util_event.h"
 #include "libcli/smb/smbXcli_base.h"
 #include "lib/util/time_basic.h"
+#include "smb1_utils.h"
 
 /* Internal message queue for deferred opens. */
 struct pending_message_list {
index 75bc16e1cc7371206389483f38f071a778eeb713..95aabddb99788c09b27e0510aad4ee79511346aa 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "smb1_utils.h"
 #include "libcli/security/security.h"
+#include "lib/util/sys_rw_data.h"
 
 /****************************************************************************
  Special FCB or DOS processing in the case of a sharing violation.
@@ -109,3 +110,17 @@ struct files_struct *fcb_or_dos_open(
 
        return new_fsp;
 }
+
+/****************************************************************************
+ Send a keepalive packet (rfc1002).
+****************************************************************************/
+
+bool send_keepalive(int client)
+{
+       unsigned char buf[4];
+
+       buf[0] = NBSSkeepalive;
+       buf[1] = buf[2] = buf[3] = 0;
+
+       return(write_data(client,(char *)buf,4) == 4);
+}
index 71f0c6d3ee69fe5fc42021d5b236b1c949c68b0b..2416a91148a7539b0d534b5c79612a07126a10bb 100644 (file)
@@ -32,5 +32,6 @@ struct files_struct *fcb_or_dos_open(
        uint32_t access_mask,
        uint32_t create_options,
        uint32_t private_flags);
+bool send_keepalive(int client);
 
 #endif