leases_db: Add share_mode_lease info to leases.tdb
[mimir/samba-autobuild/.git] / source3 / locking / leases_db.h
index f3988632b50c758065606624ab473aa5853112e3..db08c61c6098dad202130033c6b36e86a83e0524 100644 (file)
 struct GUID;
 struct smb2_lease_key;
 struct file_id;
+struct leases_db_file;
 
 bool leases_db_init(bool read_only);
 NTSTATUS leases_db_add(const struct GUID *client_guid,
                       const struct smb2_lease_key *lease_key,
                       const struct file_id *id,
+                      uint32_t current_state,
+                      uint16_t lease_version,
+                      uint16_t epoch,
+                      const char *servicepath,
                       const char *filename,
                       const char *stream_name);
 NTSTATUS leases_db_del(const struct GUID *client_guid,
@@ -36,10 +41,8 @@ NTSTATUS leases_db_del(const struct GUID *client_guid,
                       const struct file_id *id);
 NTSTATUS leases_db_parse(const struct GUID *client_guid,
                         const struct smb2_lease_key *lease_key,
-                        void (*parser)(uint32_t num_file_ids,
-                                       struct file_id *ids,
-                                       const char *filename,
-                                       const char *stream_name,
+                        void (*parser)(uint32_t num_files,
+                                       const struct leases_db_file *files,
                                        void *private_data),
                         void *private_data);
 NTSTATUS leases_db_rename(const struct GUID *client_guid,
@@ -48,4 +51,8 @@ NTSTATUS leases_db_rename(const struct GUID *client_guid,
                        const char *servicepath_new,
                        const char *filename_new,
                        const char *stream_name_new);
+NTSTATUS leases_db_copy_file_ids(TALLOC_CTX *mem_ctx,
+                       uint32_t num_files,
+                       const struct leases_db_file *files,
+                       struct file_id **pp_ids);
 #endif /* _LEASES_DB_H_ */