split persistene and volatile ids
[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                          creation_time;
101         } smbXsrv_open_global0;
102
103         typedef union {
104                 [case(0)] smbXsrv_open_global0 *info0;
105                 [default] hyper *dummy;
106         } smbXsrv_open_globalU;
107
108         typedef [public] struct {
109                 uint32          version;
110                 uint32          seqnum;
111                 [switch_is(version)] smbXsrv_open_globalU info;
112         } smbXsrv_open_globalB;
113
114         void smbXsrv_open_global_decode(
115                 [in] smbXsrv_open_globalB blob
116                 );
117
118         typedef struct {
119                 [ignore] db_record                              *db_rec;
120                 [ignore] smbXsrv_connection                     *connection;
121                 uint32                                          local_id;
122                 [ref] smbXsrv_open_global0                      *global;
123                 [ignore] files_struct                           *fsp;
124         } smbXsrv_open0;
125
126         typedef union {
127                 [case(0)] smbXsrv_open0                         *info0;
128                 [default] hyper                                 *dummy;
129         } smbXsrv_openU;
130
131         typedef [public] struct {
132                 uint32                                          version;
133                 [value(0)] uint32                               reserved;
134                 [switch_is(version)] smbXsrv_openU              info;
135         } smbXsrv_openB;
136
137         void smbXsrv_open_decode(
138                 [in] smbXsrv_openB blob
139                 );
140
141 }