c07a903878e3c2ef7a7fd0961970581f9e6c33ce
[gd/samba-autobuild/.git] / source3 / librpc / idl / open_files.idl
1 #include "idl_types.h"
2
3 import "server_id.idl";
4 import "security.idl";
5 import "file_id.idl";
6 import "smb2_lease_struct.idl";
7 import "misc.idl";
8
9 [
10         pointer_default(unique)
11 ]
12
13 interface open_files
14 {
15         typedef [public,flag(NDR_PAHEX)] struct {
16                 GUID                    client_guid;
17                 smb2_lease_key          lease_key;
18                 smb2_lease_state        current_state;
19                 /*
20                  * 'breaking' indicates that we're waiting
21                  * for a lease break ack from the client
22                  * and breaking_to_requested and breaking_to_required
23                  * have a meaning.
24                  *
25                  * breaking_to_requested is the value already sent to
26                  * the client, the client needs to ack to this (or less).
27                  *
28                  * breaking_to_required is the internal value that needs to
29                  * be reached before we can reset breaking = false, this
30                  * may requires multiple roundtrips to the client, e.g.
31                  * when the lease broken to a more reduced value, while
32                  * the lease break is still in progress.
33                  *
34                  * The following can be assumed (if breaking == true):
35                  *
36                  * current_state > breaking_to_requested >= breaking_to_required
37                  */
38                 boolean8                breaking;
39                 smb2_lease_state        breaking_to_requested;
40                 smb2_lease_state        breaking_to_required;
41                 uint16                  lease_version;
42                 uint16                  epoch;
43         } share_mode_lease;
44
45         typedef [public] struct {
46                 server_id       pid;
47                 hyper           op_mid;
48                 uint16          op_type;
49                 uint32          lease_idx;
50                 uint32          access_mask;
51                 uint32          share_access;
52                 uint32          private_options;
53                 timeval         time;
54                 udlong          share_file_id;
55                 uint32          uid;
56                 uint16          flags;
57                 uint32          name_hash;
58
59                 /*
60                  * In-memory flag indicating a non-existing pid. We don't want
61                  * to store this share_mode_entry on disk.
62                  */
63                 [skip] boolean8 stale;
64         } share_mode_entry;
65
66         typedef [public] struct {
67                 uint32          name_hash;
68                 security_token *delete_nt_token;
69                 security_unix_token *delete_token;
70         } delete_token;
71
72         typedef [public] struct {
73                 hyper sequence_number;
74                 [string,charset(UTF8)] char *servicepath;
75                 [string,charset(UTF8)] char *base_name;
76                 [string,charset(UTF8)] char *stream_name;
77                 uint32 num_share_modes;
78                 [size_is(num_share_modes)] share_mode_entry share_modes[];
79                 uint32 num_leases;
80                 [size_is(num_leases)] share_mode_lease leases[];
81                 uint32 num_delete_tokens;
82                 [size_is(num_delete_tokens)] delete_token delete_tokens[];
83                 timespec old_write_time;
84                 timespec changed_write_time;
85                 [skip] boolean8 fresh;
86                 [skip] boolean8 modified;
87                 [ignore] db_record *record;
88                 [ignore] file_id id; /* In memory key used to lookup cache. */
89         } share_mode_data;
90
91         /* these are 0x30 (48) characters */
92         const string VFS_DEFAULT_DURABLE_COOKIE_MAGIC =
93                 "VFS_DEFAULT_DURABLE_COOKIE_MAGIC                ";
94         const uint32 VFS_DEFAULT_DURABLE_COOKIE_VERSION = 0;
95
96         /* this corresponds to struct stat_ex (SMB_STRUCT_STAT) */
97         typedef struct {
98                 hyper           st_ex_dev;
99                 hyper           st_ex_ino;
100                 hyper           st_ex_mode;
101                 hyper           st_ex_nlink;
102                 hyper           st_ex_uid;
103                 hyper           st_ex_gid;
104                 hyper           st_ex_rdev;
105                 hyper           st_ex_size;
106                 timespec        st_ex_atime;
107                 timespec        st_ex_mtime;
108                 timespec        st_ex_ctime;
109                 timespec        st_ex_btime;
110                 boolean8        st_ex_calculated_birthtime;
111                 hyper           st_ex_blksize;
112                 hyper           st_ex_blocks;
113                 uint32          st_ex_flags;
114                 uint32          st_ex_mask;
115         } vfs_default_durable_stat;
116
117         typedef [public] struct {
118                 [value(VFS_DEFAULT_DURABLE_COOKIE_MAGIC),charset(DOS)] uint8 magic[0x30];
119                 [value(VFS_DEFAULT_DURABLE_COOKIE_VERSION)] uint32 version;
120                 boolean8 allow_reconnect;
121                 file_id id;
122                 [string,charset(UTF8)] char *servicepath;
123                 [string,charset(UTF8)] char *base_name;
124                 hyper initial_allocation_size;
125                 hyper position_information;
126                 boolean8 update_write_time_triggered;
127                 boolean8 update_write_time_on_close;
128                 boolean8 write_time_forced;
129                 timespec close_write_time;
130                 vfs_default_durable_stat stat_info;
131         } vfs_default_durable_cookie;
132 }