mirror of
https://github.com/samba-team/samba.git
synced 2025-08-26 01:49:31 +03:00
lib: Move send_keepalive() to smbd/smb1_utils.c
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>
This commit is contained in:
committed by
Jeremy Allison
parent
3514e4100c
commit
2e7f3e5e65
@ -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);
|
||||
|
@ -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.
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user