1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/source3/locking/leases_db.h
Jeremy Allison 5ebb190385 s3:locking: Change the data model for leases_db to cope with dynamic path renames.
interface leases_db
{
        typedef [public] struct {
                GUID client_guid;
                smb2_lease_key lease_key;
        } leases_db_key;

        typedef [public] struct {
                file_id id;
                [string,charset(UTF8)] char *servicepath;
                [string,charset(UTF8)] char *base_name;
                [string,charset(UTF8)] char *stream_name;
        } leases_db_file;

        typedef [public] struct {
                uint32 num_files;
                [size_is(num_files)] leases_db_file files[];
        } leases_db_value;
}

As designed by metze.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec  9 03:44:04 CET 2014 on sn-devel-104
2014-12-09 03:44:04 +01:00

56 lines
1.9 KiB
C

/*
* Unix SMB/CIFS implementation.
* leases.tdb functions
*
* Copyright (C) Volker Lendecke 2014
*
* 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/>.
*/
#ifndef _LEASES_DB_H_
#define _LEASES_DB_H_
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,
const char *servicepath,
const char *filename,
const char *stream_name);
NTSTATUS leases_db_del(const struct GUID *client_guid,
const struct smb2_lease_key *lease_key,
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_files,
const struct leases_db_file *files,
void *private_data),
void *private_data);
NTSTATUS leases_db_rename(const struct GUID *client_guid,
const struct smb2_lease_key *lease_key,
const struct file_id *id,
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_ */