f72f9d2507b97691bd0863ee7c50796ed44a4148
[samba.git] / librpc / idl / ioctl.idl
1 #include "idl_types.h"
2 [
3         pointer_default(unique)
4 ]
5 interface copychunk
6 {
7         typedef [public] struct {
8                 uint8 resume_key[24];
9                 uint32 context_len;
10                 /* <56> Windows sends 4 bytes of zero for the context field. */
11                 uint8 context[4];
12         } req_resume_key_rsp;
13
14         const uint32 COPYCHUNK_MAX_CHUNKS = 256; /* 2k8r2 & win8 = 256 */
15         const uint32 COPYCHUNK_MAX_CHUNK_LEN = 1048576; /* 2k8r2 & win8 = 1048576 */
16         const uint32 COPYCHUNK_MAX_TOTAL_LEN = 16777216; /* 2k8r2 & win8 = 16777216 */
17
18         typedef struct {
19                 hyper source_off;
20                 hyper target_off;
21                 uint32 length;
22                 uint32 reserved;
23         } srv_copychunk;
24
25         typedef [public] struct {
26                 uint8 source_key[24];
27                 uint32 chunk_count;
28                 uint32 reserved;
29                 srv_copychunk chunks[chunk_count];
30         } srv_copychunk_copy;
31
32         typedef [public] struct {
33                 uint32 chunks_written;
34                 uint32 chunk_bytes_written;
35                 uint32 total_bytes_written;
36         } srv_copychunk_rsp;
37
38         typedef [public] struct {
39                 uint32 version;
40                 uint32 size;
41                 uint32 maximum_token_lifetime;
42                 uint32 default_token_lifetime;
43                 hyper maximum_xfer_size;
44                 hyper optimal_xfer_count;
45                 uint32 maximum_data_descriptors;
46                 uint32 maximum_xfer_length_per_descriptor;
47                 uint32 optimal_xfer_length_per_descriptor;
48                 uint16 optimal_xfer_length_granularity;
49                 uint8 reserved[2];
50         } device_copy_offload_descriptor;
51
52         /* XXX: 0x00000001 is unconfirmed */
53         const uint32 STORAGE_OFFLOAD_TOKEN_TYPE_ZERO_DATA = 0x00000001;
54         typedef [public] struct {
55                 uint32 token_type;
56                 uint8 reserved[2];
57                 uint16 token_id_len;
58                 [size_is(token_id_len)] uint8 token[];
59         } storage_offload_token;
60
61         typedef [public] struct {
62                 uint32 size;
63                 uint32 flags;
64                 uint32 token_time_to_live;
65                 uint32 reserved;
66                 hyper file_offset;
67                 hyper length;
68         } fsctl_offload_read_input;
69
70         const uint32 OFFLOAD_READ_FLAG_FILE_TOO_SMALL = 0x00000001;
71         const uint32 OFFLOAD_READ_FLAG_ALL_ZERO_BEYOND_RANGE = 0x00000002;
72         const uint32 OFFLOAD_READ_FLAG_CANNOT_OFFLOAD_BEYOND_RANGE = 0x00000004;
73         typedef [public] struct {
74                 uint32 size;
75                 uint32 flags;
76                 hyper xfer_length;
77                 uint8 token[512];
78         } fsctl_offload_read_output;
79
80         typedef [public] struct {
81                 uint32 size;
82                 uint32 flags;
83                 hyper file_offset;
84                 hyper copy_length;
85                 hyper xfer_offset;
86                 uint8 token[512];
87         } fsctl_offload_write_input;
88
89         typedef [public] struct {
90                 uint32 size;
91                 uint32 flags;
92                 hyper length_written;
93         } fsctl_offload_write_output;
94
95         typedef [public] struct {
96                 uint8 source_fid[16];
97                 hyper source_off;
98                 hyper target_off;
99                 hyper byte_count;
100         } fsctl_dup_extents_to_file;
101 }
102
103 interface compression
104 {
105         const uint16 COMPRESSION_FORMAT_NONE = 0x0000;
106         const uint16 COMPRESSION_FORMAT_DEFAULT = 0x0001;
107         const uint16 COMPRESSION_FORMAT_LZNT1 = 0x0002;
108
109         typedef [public] struct {
110                 uint16 format;
111         } compression_state;
112 }
113
114 interface netinterface
115 {
116         typedef [bitmap32bit] bitmap {
117                 FSCTL_NET_IFACE_NONE_CAPABLE = 0x00000000,
118                 FSCTL_NET_IFACE_RSS_CAPABLE = 0x00000001,
119                 FSCTL_NET_IFACE_RDMA_CAPABLE = 0x00000002
120         } fsctl_net_iface_capability;
121
122         typedef [enum16bit] enum {
123                 FSCTL_NET_IFACE_AF_INET = 0x0002,
124                 FSCTL_NET_IFACE_AF_INET6 = 0x0017
125         } fsctl_sockaddr_af;
126
127         typedef [flag(NDR_NOALIGN)] struct {
128                 [value(0)] uint16 port;
129                 [flag(NDR_BIG_ENDIAN)] ipv4address ipv4;
130                 [value(0)] hyper reserved;
131         } fsctl_sockaddr_in;
132
133         typedef [flag(NDR_NOALIGN)] struct {
134                 [value(0)] uint16 port;
135                 [value(0)] uint32 flowinfo;
136                 [flag(NDR_BIG_ENDIAN)] ipv6address ipv6;
137                 [value(0)] uint32 scopeid;
138         } fsctl_sockaddr_in6;
139
140         typedef [nodiscriminant,flag(NDR_NOALIGN)] union {
141                 [case (FSCTL_NET_IFACE_AF_INET)] fsctl_sockaddr_in saddr_in;
142                 [case (FSCTL_NET_IFACE_AF_INET6)] fsctl_sockaddr_in6 saddr_in6;
143         } fsctl_sockaddr_union;
144
145         typedef [flag(NDR_NOALIGN)] struct {
146                 fsctl_sockaddr_af family;
147                 [subcontext(0),subcontext_size(126),switch_is(family)] fsctl_sockaddr_union saddr;
148         } fsctl_sockaddr_storage;
149
150         typedef [public,relative_base,noprint] struct {
151                 [relative] fsctl_net_iface_info *next;
152                 uint32 ifindex;
153                 fsctl_net_iface_capability capability;
154                 [value(0)] uint32 reserved;
155                 hyper linkspeed;
156                 fsctl_sockaddr_storage sockaddr;
157         } fsctl_net_iface_info;
158 }
159
160 interface sparse
161 {
162         /* MS-FSCC 2.3.33 FSCTL_QUERY_ALLOCATED_RANGES Request */
163         typedef [public] struct {
164                 hyper file_off;
165                 hyper len;
166         } file_alloced_range_buf;
167
168         typedef [public] struct {
169                 file_alloced_range_buf buf;
170         } fsctl_query_alloced_ranges_req;
171
172         /*
173          * 2.3.34 FSCTL_QUERY_ALLOCATED_RANGES Reply
174          * ...
175          * The number of FILE_ALLOCATED_RANGE_BUFFER elements returned is
176          * computed by dividing the size of the returned output buffer (from
177          * either SMB or SMB2, the lower-layer protocol that carries the FSCTL)
178          * by the size of the FILE_ALLOCATED_RANGE_BUFFER element.
179          *
180          * This logic can't (currently) be represented in pidl, so just use a
181          * blob. Perhaps in future we'll support:
182          *      [flag(NDR_REMAINING)] file_alloced_range_buf array[];
183          */
184         typedef [public] struct {
185                 [flag(NDR_REMAINING)] DATA_BLOB far_buf_array;
186         } fsctl_query_alloced_ranges_rsp;
187
188         /* 2.3.65 FSCTL_SET_ZERO_DATA Request */
189         typedef [public] struct {
190                 hyper file_off;
191                 hyper beyond_final_zero;
192         } file_zero_data_info;
193
194         typedef [public] struct {
195                 file_zero_data_info info;
196         } fsctl_set_zero_data_req;
197 }
198
199 interface resiliency
200 {
201         /* 2.2.31.3 NETWORK_RESILIENCY_REQUEST */
202         typedef [public] struct {
203                 uint32 timeout;
204                 uint32 reserved;
205         } network_resiliency_request;
206 }
207
208 interface trim
209 {
210         /* MS-FSCC 2.3.73.1 FILE_LEVEL_TRIM_RANGE */
211         typedef [public] struct {
212                 hyper off;
213                 hyper len;
214         } file_level_trim_range;
215
216         /* MS-FSCC 2.3.73 FSCTL_FILE_LEVEL_TRIM Request */
217         typedef [public] struct {
218                 uint32 key;
219                 uint32 num_ranges;
220                 file_level_trim_range ranges[num_ranges];
221         } fsctl_file_level_trim_req;
222
223         /* MS-FSCC 2.3.74 FSCTL_FILE_LEVEL_TRIM Reply */
224         typedef [public] struct {
225                 uint32 num_ranges_processed;
226         } fsctl_file_level_trim_rsp;
227 }