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