summaryrefslogtreecommitdiff
path: root/source3/librpc/idl/open_files.idl
blob: 1f85f245fca0a045fde51848b3b315fa534fcc1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#include "idl_types.h"

import "server_id.idl";
import "security.idl";
import "file_id.idl";
import "smb2_lease_struct.idl";
import "misc.idl";

[
	pointer_default(unique)
]

interface open_files
{
	typedef [public,flag(NDR_PAHEX)] struct {
		GUID			client_guid;
		smb2_lease_key		lease_key;
		smb2_lease_state	current_state;
		/*
		 * 'breaking' indicates that we're waiting
		 * for a lease break ack from the client
		 * and breaking_to_requested and breaking_to_required
		 * have a meaning.
		 *
		 * breaking_to_requested is the value already sent to
		 * the client, the client needs to ack to this (or less).
		 *
		 * breaking_to_required is the internal value that needs to
		 * be reached before we can reset breaking = false, this
		 * may requires multiple roundtrips to the client, e.g.
		 * when the lease broken to a more reduced value, while
		 * the lease break is still in progress.
		 *
		 * The following can be assumed (if breaking == true):
		 *
		 * current_state > breaking_to_requested >= breaking_to_required
		 */
		boolean8		breaking;
		smb2_lease_state	breaking_to_requested;
		smb2_lease_state	breaking_to_required;
		uint16			lease_version;
		uint16			epoch;
	} share_mode_lease;

	typedef [public] struct {
		server_id	pid;
		hyper		op_mid;
		uint16		op_type;
		uint32		lease_idx;
		uint32		access_mask;
		uint32		share_access;
		uint32		private_options;
		timeval		time;
		file_id		id;
		udlong		share_file_id;
		uint32		uid;
		uint16		flags;
		uint32		name_hash;

		/*
		 * In-memory flag indicating a non-existing pid. We don't want
		 * to store this share_mode_entry on disk.
		 */
		[skip] boolean8	stale;
		[ignore] share_mode_lease *lease;
	} share_mode_entry;

	typedef [public] struct {
		uint32		name_hash;
		security_token *delete_nt_token;
		security_unix_token *delete_token;
	} delete_token;

	typedef [public] struct {
		hyper sequence_number;
		[string,charset(UTF8)] char *servicepath;
		[string,charset(UTF8)] char *base_name;
		[string,charset(UTF8)] char *stream_name;
		uint32 num_share_modes;
		[size_is(num_share_modes)] share_mode_entry share_modes[];
		uint32 num_leases;
		[size_is(num_leases)] share_mode_lease leases[];
		uint32 num_delete_tokens;
		[size_is(num_delete_tokens)] delete_token delete_tokens[];
		timespec old_write_time;
		timespec changed_write_time;
		[skip] boolean8 fresh;
		[skip] boolean8 modified;
		[ignore] db_record *record;
		[ignore] file_id id; /* In memory key used to lookup cache. */
	} share_mode_data;

	/* these are 0x30 (48) characters */
	const string VFS_DEFAULT_DURABLE_COOKIE_MAGIC =
		"VFS_DEFAULT_DURABLE_COOKIE_MAGIC                ";
	const uint32 VFS_DEFAULT_DURABLE_COOKIE_VERSION = 0;

	/* this corresponds to struct stat_ex (SMB_STRUCT_STAT) */
	typedef struct {
		hyper		st_ex_dev;
		hyper		st_ex_ino;
		hyper		st_ex_mode;
		hyper		st_ex_nlink;
		hyper		st_ex_uid;
		hyper		st_ex_gid;
		hyper		st_ex_rdev;
		hyper		st_ex_size;
		timespec	st_ex_atime;
		timespec	st_ex_mtime;
		timespec	st_ex_ctime;
		timespec	st_ex_btime;
		boolean8	st_ex_calculated_birthtime;
		hyper		st_ex_blksize;
		hyper		st_ex_blocks;
		uint32		st_ex_flags;
		uint32		st_ex_mask;
	} vfs_default_durable_stat;

	typedef [public] struct {
		[value(VFS_DEFAULT_DURABLE_COOKIE_MAGIC),charset(DOS)] uint8 magic[0x30];
		[value(VFS_DEFAULT_DURABLE_COOKIE_VERSION)] uint32 version;
		boolean8 allow_reconnect;
		file_id id;
		[string,charset(UTF8)] char *servicepath;
		[string,charset(UTF8)] char *base_name;
		hyper initial_allocation_size;
		hyper position_information;
		boolean8 update_write_time_triggered;
		boolean8 update_write_time_on_close;
		boolean8 write_time_forced;
		timespec close_write_time;
		vfs_default_durable_stat stat_info;
	} vfs_default_durable_cookie;
}