smbd: Add conn_using_smb2()
authorVolker Lendecke <vl@samba.org>
Tue, 13 Feb 2024 11:28:06 +0000 (12:28 +0100)
committerMartin Schwenke <martins@samba.org>
Wed, 17 Apr 2024 07:57:36 +0000 (07:57 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
source3/smbd/conn.c
source3/smbd/proto.h

index e6c1fa72dcbfc728b92c13e51b1ebf69cd6f0908..b7a745a951e85f2731ba25373ae4b915714b5df8 100644 (file)
@@ -84,6 +84,12 @@ enum protocol_types conn_protocol(struct smbd_server_connection *sconn)
        return PROTOCOL_COREPLUS;
 }
 
+bool conn_using_smb2(struct smbd_server_connection *sconn)
+{
+       enum protocol_types proto = conn_protocol(sconn);
+       return (proto >= PROTOCOL_SMB2_02);
+}
+
 /****************************************************************************
  Find first available connection slot, starting from a random position.
  The randomisation stops problems with the server dying and clients
index 4f0b7ac35da4cb4b605892bfc0360083499176b5..7f8aee068bd6eb4aaefebdbd4e7aa784171f6eeb 100644 (file)
@@ -143,6 +143,7 @@ bool has_other_nonposix_opens(struct share_mode_lock *lck,
 int conn_num_open(struct smbd_server_connection *sconn);
 bool conn_snum_used(struct smbd_server_connection *sconn, int snum);
 enum protocol_types conn_protocol(struct smbd_server_connection *sconn);
+bool conn_using_smb2(struct smbd_server_connection *sconn);
 connection_struct *conn_new(struct smbd_server_connection *sconn);
 bool conn_idle_all(struct smbd_server_connection *sconn, time_t t);
 void conn_clear_vuid_caches(struct smbd_server_connection *sconn, uint64_t vuid);