TODO s3:smbXsrv.idl: add smbXsrv_open*
[metze/samba/wip.git] / source3 / librpc / idl / smbXsrv.idl
1 #include "idl_types.h"
2
3 import "server_id.idl";
4 import "security.idl";
5 import "auth.idl";
6 import "file_id.idl";
7
8 /*
9  * The main server code should just work with
10  * 'struct smbXsrv_session' and never use
11  * smbXsrv_session0, smbXsrv_sessionU
12  * and smbXsrv_sessionB directly.
13  *
14  * We need to change the smbXsrv_session,
15  * we can just point it to smbXsrv_session1
16  * and could implement transparent mapping.
17  */
18 cpp_quote("#define smbXsrv_session smbXsrv_session0")
19 cpp_quote("#define smbXsrv_open smbXsrv_open0")
20
21 [
22         pointer_default(unique)
23 ]
24 interface smbXsrv
25 {
26         /* sessions */
27
28         typedef struct {
29                 server_id                       server_id;
30                 [charset(UTF8),string] char     *local_address;
31                 [charset(UTF8),string] char     *remote_address;
32                 [charset(UTF8),string] char     *remote_name;
33                 DATA_BLOB signing_key;
34         } smbXsrv_channel_global0;
35
36         typedef struct {
37                 [ignore] db_record              *db_rec;
38                 uint32                          session_global_id;
39                 hyper                           session_wire_id;
40                 NTTIME                          creation_time;
41                 NTTIME                          expiration_time;
42                 /*
43                  * auth_session is NULL until the
44                  * session is valid for the first time.
45                  */
46                 auth_session_info               *auth_session_info;
47                 boolean8                        signing_required;
48                 boolean8                        encryption_required;
49                 DATA_BLOB                       signing_key;
50                 DATA_BLOB                       encryption_key;
51                 DATA_BLOB                       decryption_key;
52                 DATA_BLOB                       application_key;
53                 [range(1, 1024)] uint32         num_channels;
54                 smbXsrv_channel_global0 channels[num_channels];
55         } smbXsrv_session_global0;
56
57         typedef union {
58                 [case(0)] smbXsrv_session_global0 *info0;
59                 [default] hyper *dummy;
60         } smbXsrv_session_globalU;
61
62         typedef [public] struct {
63                 uint32          version;
64                 uint32          seqnum;
65                 [switch_is(version)] smbXsrv_session_globalU info;
66         } smbXsrv_session_globalB;
67
68         void smbXsrv_session_global_decode(
69                 [in] smbXsrv_session_globalB blob
70                 );
71
72         typedef struct {
73                 [ignore] db_record                              *db_rec;
74                 [ignore] smbXsrv_connection                     *connection;
75                 uint32                                          local_id;
76                 [ref] smbXsrv_session_global0                   *global;
77                 NTSTATUS                                        status;
78                 //NTTIME                                                idle_time;
79                 //[ignore] gensec_security                      *gensec;
80                 //[ignore] smbXsrv_tcon_table                   *tcon_table;
81                 //[ignore] smbXsrv_open_table                   *open_table;
82                 [ignore] smbd_smb2_session                      *smb2sess;
83         } smbXsrv_session0;
84
85         typedef union {
86                 [case(0)] smbXsrv_session0                      *info0;
87                 [default] hyper                                 *dummy;
88         } smbXsrv_sessionU;
89
90         typedef [public] struct {
91                 uint32                                          version;
92                 [value(0)] uint32                               reserved;
93                 [switch_is(version)] smbXsrv_sessionU   info;
94         } smbXsrv_sessionB;
95
96         void smbXsrv_session_decode(
97                 [in] smbXsrv_sessionB blob
98                 );
99
100         /* open files */
101
102         typedef struct {
103                 [ignore] db_record              *db_rec;
104                 server_id                       server_id;
105                 uint32                          open_global_id;
106                 hyper                           open_persistent_id;
107                 hyper                           open_volatile_id;
108                 boolean8                        durable;
109                 boolean8                        persistent;
110                 NTTIME                          open_time;
111                 [charset(UTF8),string] char     *open_path;
112                 // TODO: DATA_BLOB                      backend_info;
113                 file_id                         backend_file_id;
114         } smbXsrv_open_global0;
115
116         typedef union {
117                 [case(0)] smbXsrv_open_global0 *info0;
118                 [default] hyper *dummy;
119         } smbXsrv_open_globalU;
120
121         typedef [public] struct {
122                 uint32          version;
123                 uint32          seqnum;
124                 [switch_is(version)] smbXsrv_open_globalU info;
125         } smbXsrv_open_globalB;
126
127         void smbXsrv_open_global_decode(
128                 [in] smbXsrv_open_globalB blob
129                 );
130
131         typedef struct {
132                 [ignore] db_record                              *db_rec;
133                 [ignore] smbXsrv_connection                     *connection;
134                 uint32                                          local_id;
135                 [ref] smbXsrv_open_global0                      *global;
136                 [ignore] files_struct                           *fsp;
137         } smbXsrv_open0;
138
139         typedef union {
140                 [case(0)] smbXsrv_open0                         *info0;
141                 [default] hyper                                 *dummy;
142         } smbXsrv_openU;
143
144         typedef [public] struct {
145                 uint32                                          version;
146                 [value(0)] uint32                               reserved;
147                 [switch_is(version)] smbXsrv_openU              info;
148         } smbXsrv_openB;
149
150         void smbXsrv_open_decode(
151                 [in] smbXsrv_openB blob
152                 );
153
154 }