9270916e4ffe62a53f4e4bc6ecc55afb5a339e97
[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                 [range(1, 1024)] uint32         num_channels;
48                 smbXsrv_channel_global0 channels[num_channels];
49         } smbXsrv_session_global0;
50
51         typedef union {
52                 [case(0)] smbXsrv_session_global0 *info0;
53                 [default] hyper *dummy;
54         } smbXsrv_session_globalU;
55
56         typedef [public] struct {
57                 uint32          version;
58                 uint32          seqnum;
59                 [switch_is(version)] smbXsrv_session_globalU info;
60         } smbXsrv_session_globalB;
61
62         void smbXsrv_session_global_decode(
63                 [in] smbXsrv_session_globalB blob
64                 );
65
66         typedef struct {
67                 [ignore] db_record                              *db_rec;
68                 [ignore] smbXsrv_connection                     *connection;
69                 uint32                                          local_id;
70                 [ref] smbXsrv_session_global0                   *global;
71                 NTSTATUS                                        status;
72                 //NTTIME                                                idle_time;
73                 //[ignore] gensec_security                      *gensec;
74                 //[ignore] smbXsrv_tcon_table                   *tcon_table;
75                 //[ignore] smbXsrv_open_table                   *open_table;
76                 [ignore] smbd_smb2_session                      *smb2sess;
77         } smbXsrv_session0;
78
79         typedef union {
80                 [case(0)] smbXsrv_session0                      *info0;
81                 [default] hyper                                 *dummy;
82         } smbXsrv_sessionU;
83
84         typedef [public] struct {
85                 uint32                                          version;
86                 [value(0)] uint32                               reserved;
87                 [switch_is(version)] smbXsrv_sessionU   info;
88         } smbXsrv_sessionB;
89
90         void smbXsrv_session_decode(
91                 [in] smbXsrv_sessionB blob
92                 );
93
94         /* open files */
95
96         typedef struct {
97                 [ignore] db_record              *db_rec;
98                 server_id                       server_id;
99                 uint32                          open_global_id;
100                 hyper                           open_persistent_id;
101                 hyper                           open_volatile_id;
102                 boolean8                        durable;
103                 NTTIME                          open_time;
104                 [charset(UTF8),string] char     *open_path;
105                 // TODO: DATA_BLOB                      backend_info;
106                 file_id                         backend_file_id;
107         } smbXsrv_open_global0;
108
109         typedef union {
110                 [case(0)] smbXsrv_open_global0 *info0;
111                 [default] hyper *dummy;
112         } smbXsrv_open_globalU;
113
114         typedef [public] struct {
115                 uint32          version;
116                 uint32          seqnum;
117                 [switch_is(version)] smbXsrv_open_globalU info;
118         } smbXsrv_open_globalB;
119
120         void smbXsrv_open_global_decode(
121                 [in] smbXsrv_open_globalB blob
122                 );
123
124         typedef struct {
125                 [ignore] db_record                              *db_rec;
126                 [ignore] smbXsrv_connection                     *connection;
127                 uint32                                          local_id;
128                 [ref] smbXsrv_open_global0                      *global;
129                 [ignore] files_struct                           *fsp;
130         } smbXsrv_open0;
131
132         typedef union {
133                 [case(0)] smbXsrv_open0                         *info0;
134                 [default] hyper                                 *dummy;
135         } smbXsrv_openU;
136
137         typedef [public] struct {
138                 uint32                                          version;
139                 [value(0)] uint32                               reserved;
140                 [switch_is(version)] smbXsrv_openU              info;
141         } smbXsrv_openB;
142
143         void smbXsrv_open_decode(
144                 [in] smbXsrv_openB blob
145                 );
146
147 }