Line data Source code
1 : /* parser auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include "bin/default/source3/librpc/gen_ndr/ndr_leases_db.h"
5 :
6 : #include "librpc/gen_ndr/ndr_misc.h"
7 : #include "librpc/gen_ndr/ndr_smb2_lease_struct.h"
8 : #include "librpc/gen_ndr/ndr_file_id.h"
9 6288 : _PUBLIC_ enum ndr_err_code ndr_push_leases_db_key(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct leases_db_key *r)
10 : {
11 6288 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
12 6288 : if (ndr_flags & NDR_SCALARS) {
13 6288 : NDR_CHECK(ndr_push_align(ndr, 8));
14 6288 : NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->client_guid));
15 6288 : NDR_CHECK(ndr_push_smb2_lease_key(ndr, NDR_SCALARS, &r->lease_key));
16 6288 : NDR_CHECK(ndr_push_trailer_align(ndr, 8));
17 : }
18 6288 : if (ndr_flags & NDR_BUFFERS) {
19 0 : }
20 6288 : return NDR_ERR_SUCCESS;
21 : }
22 :
23 0 : _PUBLIC_ enum ndr_err_code ndr_pull_leases_db_key(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct leases_db_key *r)
24 : {
25 0 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
26 0 : if (ndr_flags & NDR_SCALARS) {
27 0 : NDR_CHECK(ndr_pull_align(ndr, 8));
28 0 : NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->client_guid));
29 0 : NDR_CHECK(ndr_pull_smb2_lease_key(ndr, NDR_SCALARS, &r->lease_key));
30 0 : NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
31 : }
32 0 : if (ndr_flags & NDR_BUFFERS) {
33 0 : }
34 0 : return NDR_ERR_SUCCESS;
35 : }
36 :
37 0 : static void ndr_print_flags_leases_db_key(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct leases_db_key *r)
38 : {
39 0 : ndr_print_leases_db_key(ndr, name, r);
40 0 : }
41 :
42 0 : _PUBLIC_ void ndr_print_leases_db_key(struct ndr_print *ndr, const char *name, const struct leases_db_key *r)
43 : {
44 0 : ndr_print_struct(ndr, name, "leases_db_key");
45 0 : if (r == NULL) { ndr_print_null(ndr); return; }
46 0 : ndr->depth++;
47 0 : ndr_print_GUID(ndr, "client_guid", &r->client_guid);
48 0 : ndr_print_smb2_lease_key(ndr, "lease_key", &r->lease_key);
49 0 : ndr->depth--;
50 : }
51 :
52 2352 : _PUBLIC_ enum ndr_err_code ndr_push_leases_db_file(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct leases_db_file *r)
53 : {
54 2352 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
55 2352 : if (ndr_flags & NDR_SCALARS) {
56 1176 : NDR_CHECK(ndr_push_align(ndr, 5));
57 1176 : NDR_CHECK(ndr_push_file_id(ndr, NDR_SCALARS, &r->id));
58 1176 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->servicepath));
59 1176 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->base_name));
60 1176 : NDR_CHECK(ndr_push_unique_ptr(ndr, r->stream_name));
61 1176 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
62 : }
63 2352 : if (ndr_flags & NDR_BUFFERS) {
64 1176 : if (r->servicepath) {
65 1176 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->servicepath, CH_UTF8)));
66 1176 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
67 1176 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->servicepath, CH_UTF8)));
68 1176 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->servicepath, ndr_charset_length(r->servicepath, CH_UTF8), sizeof(uint8_t), CH_UTF8));
69 : }
70 1176 : if (r->base_name) {
71 1176 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->base_name, CH_UTF8)));
72 1176 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
73 1176 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->base_name, CH_UTF8)));
74 1176 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->base_name, ndr_charset_length(r->base_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
75 : }
76 1176 : if (r->stream_name) {
77 2 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->stream_name, CH_UTF8)));
78 2 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
79 2 : NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->stream_name, CH_UTF8)));
80 2 : NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->stream_name, ndr_charset_length(r->stream_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
81 : }
82 : }
83 2352 : return NDR_ERR_SUCCESS;
84 : }
85 :
86 6700 : _PUBLIC_ enum ndr_err_code ndr_pull_leases_db_file(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct leases_db_file *r)
87 : {
88 0 : uint32_t _ptr_servicepath;
89 6700 : uint32_t size_servicepath_1 = 0;
90 6700 : uint32_t length_servicepath_1 = 0;
91 6700 : TALLOC_CTX *_mem_save_servicepath_0 = NULL;
92 0 : uint32_t _ptr_base_name;
93 6700 : uint32_t size_base_name_1 = 0;
94 6700 : uint32_t length_base_name_1 = 0;
95 6700 : TALLOC_CTX *_mem_save_base_name_0 = NULL;
96 0 : uint32_t _ptr_stream_name;
97 6700 : uint32_t size_stream_name_1 = 0;
98 6700 : uint32_t length_stream_name_1 = 0;
99 6700 : TALLOC_CTX *_mem_save_stream_name_0 = NULL;
100 6700 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
101 6700 : if (ndr_flags & NDR_SCALARS) {
102 3350 : NDR_CHECK(ndr_pull_align(ndr, 5));
103 3350 : NDR_CHECK(ndr_pull_file_id(ndr, NDR_SCALARS, &r->id));
104 3350 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servicepath));
105 3350 : if (_ptr_servicepath) {
106 3350 : NDR_PULL_ALLOC(ndr, r->servicepath);
107 : } else {
108 0 : r->servicepath = NULL;
109 : }
110 3350 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_base_name));
111 3350 : if (_ptr_base_name) {
112 3350 : NDR_PULL_ALLOC(ndr, r->base_name);
113 : } else {
114 0 : r->base_name = NULL;
115 : }
116 3350 : NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_stream_name));
117 3350 : if (_ptr_stream_name) {
118 2 : NDR_PULL_ALLOC(ndr, r->stream_name);
119 : } else {
120 3348 : r->stream_name = NULL;
121 : }
122 3350 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
123 : }
124 6700 : if (ndr_flags & NDR_BUFFERS) {
125 3350 : if (r->servicepath) {
126 3350 : _mem_save_servicepath_0 = NDR_PULL_GET_MEM_CTX(ndr);
127 3350 : NDR_PULL_SET_MEM_CTX(ndr, r->servicepath, 0);
128 3350 : NDR_CHECK(ndr_pull_array_size(ndr, &r->servicepath));
129 3350 : NDR_CHECK(ndr_pull_array_length(ndr, &r->servicepath));
130 3350 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->servicepath, &size_servicepath_1));
131 3350 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->servicepath, &length_servicepath_1));
132 3350 : if (length_servicepath_1 > size_servicepath_1) {
133 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_servicepath_1, length_servicepath_1);
134 : }
135 3350 : NDR_CHECK(ndr_check_string_terminator(ndr, length_servicepath_1, sizeof(uint8_t)));
136 3350 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->servicepath, length_servicepath_1, sizeof(uint8_t), CH_UTF8));
137 3350 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servicepath_0, 0);
138 : }
139 3350 : if (r->base_name) {
140 3350 : _mem_save_base_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
141 3350 : NDR_PULL_SET_MEM_CTX(ndr, r->base_name, 0);
142 3350 : NDR_CHECK(ndr_pull_array_size(ndr, &r->base_name));
143 3350 : NDR_CHECK(ndr_pull_array_length(ndr, &r->base_name));
144 3350 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->base_name, &size_base_name_1));
145 3350 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->base_name, &length_base_name_1));
146 3350 : if (length_base_name_1 > size_base_name_1) {
147 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_base_name_1, length_base_name_1);
148 : }
149 3350 : NDR_CHECK(ndr_check_string_terminator(ndr, length_base_name_1, sizeof(uint8_t)));
150 3350 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->base_name, length_base_name_1, sizeof(uint8_t), CH_UTF8));
151 3350 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_base_name_0, 0);
152 : }
153 3350 : if (r->stream_name) {
154 2 : _mem_save_stream_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
155 2 : NDR_PULL_SET_MEM_CTX(ndr, r->stream_name, 0);
156 2 : NDR_CHECK(ndr_pull_array_size(ndr, &r->stream_name));
157 2 : NDR_CHECK(ndr_pull_array_length(ndr, &r->stream_name));
158 2 : NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->stream_name, &size_stream_name_1));
159 2 : NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->stream_name, &length_stream_name_1));
160 2 : if (length_stream_name_1 > size_stream_name_1) {
161 0 : return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_stream_name_1, length_stream_name_1);
162 : }
163 2 : NDR_CHECK(ndr_check_string_terminator(ndr, length_stream_name_1, sizeof(uint8_t)));
164 2 : NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->stream_name, length_stream_name_1, sizeof(uint8_t), CH_UTF8));
165 2 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_stream_name_0, 0);
166 : }
167 : }
168 6700 : return NDR_ERR_SUCCESS;
169 : }
170 :
171 0 : static void ndr_print_flags_leases_db_file(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct leases_db_file *r)
172 : {
173 0 : ndr_print_leases_db_file(ndr, name, r);
174 0 : }
175 :
176 0 : _PUBLIC_ void ndr_print_leases_db_file(struct ndr_print *ndr, const char *name, const struct leases_db_file *r)
177 : {
178 0 : ndr_print_struct(ndr, name, "leases_db_file");
179 0 : if (r == NULL) { ndr_print_null(ndr); return; }
180 0 : ndr->depth++;
181 0 : ndr_print_file_id(ndr, "id", &r->id);
182 0 : ndr_print_ptr(ndr, "servicepath", r->servicepath);
183 0 : ndr->depth++;
184 0 : if (r->servicepath) {
185 0 : ndr_print_string(ndr, "servicepath", r->servicepath);
186 : }
187 0 : ndr->depth--;
188 0 : ndr_print_ptr(ndr, "base_name", r->base_name);
189 0 : ndr->depth++;
190 0 : if (r->base_name) {
191 0 : ndr_print_string(ndr, "base_name", r->base_name);
192 : }
193 0 : ndr->depth--;
194 0 : ndr_print_ptr(ndr, "stream_name", r->stream_name);
195 0 : ndr->depth++;
196 0 : if (r->stream_name) {
197 0 : ndr_print_string(ndr, "stream_name", r->stream_name);
198 : }
199 0 : ndr->depth--;
200 0 : ndr->depth--;
201 : }
202 :
203 1170 : _PUBLIC_ enum ndr_err_code ndr_push_leases_db_value(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct leases_db_value *r)
204 : {
205 0 : uint32_t cntr_files_0;
206 1170 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
207 1170 : if (ndr_flags & NDR_SCALARS) {
208 1170 : NDR_CHECK(ndr_push_align(ndr, 5));
209 1170 : NDR_CHECK(ndr_push_smb2_lease_state(ndr, NDR_SCALARS, r->current_state));
210 1170 : NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->breaking));
211 1170 : NDR_CHECK(ndr_push_smb2_lease_state(ndr, NDR_SCALARS, r->breaking_to_requested));
212 1170 : NDR_CHECK(ndr_push_smb2_lease_state(ndr, NDR_SCALARS, r->breaking_to_required));
213 1170 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lease_version));
214 1170 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->epoch));
215 1170 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_files));
216 2346 : for (cntr_files_0 = 0; cntr_files_0 < (r->num_files); cntr_files_0++) {
217 1176 : NDR_CHECK(ndr_push_leases_db_file(ndr, NDR_SCALARS, &r->files[cntr_files_0]));
218 : }
219 1170 : NDR_CHECK(ndr_push_trailer_align(ndr, 5));
220 : }
221 1170 : if (ndr_flags & NDR_BUFFERS) {
222 2346 : for (cntr_files_0 = 0; cntr_files_0 < (r->num_files); cntr_files_0++) {
223 1176 : NDR_CHECK(ndr_push_leases_db_file(ndr, NDR_BUFFERS, &r->files[cntr_files_0]));
224 : }
225 : }
226 1170 : return NDR_ERR_SUCCESS;
227 : }
228 :
229 3316 : _PUBLIC_ enum ndr_err_code ndr_pull_leases_db_value(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct leases_db_value *r)
230 : {
231 3316 : uint32_t size_files_0 = 0;
232 0 : uint32_t cntr_files_0;
233 3316 : TALLOC_CTX *_mem_save_files_0 = NULL;
234 3316 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
235 3316 : if (ndr_flags & NDR_SCALARS) {
236 3316 : NDR_CHECK(ndr_pull_align(ndr, 5));
237 3316 : NDR_CHECK(ndr_pull_smb2_lease_state(ndr, NDR_SCALARS, &r->current_state));
238 3316 : NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->breaking));
239 3316 : NDR_CHECK(ndr_pull_smb2_lease_state(ndr, NDR_SCALARS, &r->breaking_to_requested));
240 3316 : NDR_CHECK(ndr_pull_smb2_lease_state(ndr, NDR_SCALARS, &r->breaking_to_required));
241 3316 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lease_version));
242 3316 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->epoch));
243 3316 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_files));
244 3316 : size_files_0 = r->num_files;
245 3316 : NDR_PULL_ALLOC_N(ndr, r->files, size_files_0);
246 3316 : _mem_save_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
247 3316 : NDR_PULL_SET_MEM_CTX(ndr, r->files, 0);
248 6666 : for (cntr_files_0 = 0; cntr_files_0 < (size_files_0); cntr_files_0++) {
249 3350 : NDR_CHECK(ndr_pull_leases_db_file(ndr, NDR_SCALARS, &r->files[cntr_files_0]));
250 : }
251 3316 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_files_0, 0);
252 3316 : NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
253 : }
254 3316 : if (ndr_flags & NDR_BUFFERS) {
255 3316 : size_files_0 = r->num_files;
256 3316 : _mem_save_files_0 = NDR_PULL_GET_MEM_CTX(ndr);
257 3316 : NDR_PULL_SET_MEM_CTX(ndr, r->files, 0);
258 6666 : for (cntr_files_0 = 0; cntr_files_0 < (size_files_0); cntr_files_0++) {
259 3350 : NDR_CHECK(ndr_pull_leases_db_file(ndr, NDR_BUFFERS, &r->files[cntr_files_0]));
260 : }
261 3316 : NDR_PULL_SET_MEM_CTX(ndr, _mem_save_files_0, 0);
262 6666 : for (cntr_files_0 = 0; cntr_files_0 < (size_files_0); cntr_files_0++) {
263 : }
264 : }
265 3316 : return NDR_ERR_SUCCESS;
266 : }
267 :
268 0 : static void ndr_print_flags_leases_db_value(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct leases_db_value *r)
269 : {
270 0 : ndr_print_leases_db_value(ndr, name, r);
271 0 : }
272 :
273 0 : _PUBLIC_ void ndr_print_leases_db_value(struct ndr_print *ndr, const char *name, const struct leases_db_value *r)
274 : {
275 0 : uint32_t cntr_files_0;
276 0 : ndr_print_struct(ndr, name, "leases_db_value");
277 0 : if (r == NULL) { ndr_print_null(ndr); return; }
278 0 : ndr->depth++;
279 0 : ndr_print_smb2_lease_state(ndr, "current_state", r->current_state);
280 0 : ndr_print_uint8(ndr, "breaking", r->breaking);
281 0 : ndr_print_smb2_lease_state(ndr, "breaking_to_requested", r->breaking_to_requested);
282 0 : ndr_print_smb2_lease_state(ndr, "breaking_to_required", r->breaking_to_required);
283 0 : ndr_print_uint16(ndr, "lease_version", r->lease_version);
284 0 : ndr_print_uint16(ndr, "epoch", r->epoch);
285 0 : ndr_print_uint32(ndr, "num_files", r->num_files);
286 0 : ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "files", (uint32_t)(r->num_files));
287 0 : ndr->depth++;
288 0 : for (cntr_files_0 = 0; cntr_files_0 < (r->num_files); cntr_files_0++) {
289 0 : ndr_print_leases_db_file(ndr, "files", &r->files[cntr_files_0]);
290 : }
291 0 : ndr->depth--;
292 0 : ndr->depth--;
293 : }
294 :
295 : #ifndef SKIP_NDR_TABLE_leases_db
296 : static const struct ndr_interface_public_struct leases_db_public_structs[] = {
297 : {
298 : .name = "leases_db_key",
299 : .struct_size = sizeof(struct leases_db_key ),
300 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_leases_db_key,
301 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_leases_db_key,
302 : .ndr_print = (ndr_print_function_t) ndr_print_flags_leases_db_key,
303 : },
304 : {
305 : .name = "leases_db_file",
306 : .struct_size = sizeof(struct leases_db_file ),
307 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_leases_db_file,
308 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_leases_db_file,
309 : .ndr_print = (ndr_print_function_t) ndr_print_flags_leases_db_file,
310 : },
311 : {
312 : .name = "leases_db_value",
313 : .struct_size = sizeof(struct leases_db_value ),
314 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_leases_db_value,
315 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_leases_db_value,
316 : .ndr_print = (ndr_print_function_t) ndr_print_flags_leases_db_value,
317 : },
318 : { .name = NULL }
319 : };
320 :
321 : static const struct ndr_interface_call leases_db_calls[] = {
322 : { .name = NULL }
323 : };
324 :
325 : static const char * const leases_db_endpoint_strings[] = {
326 : "ncacn_np:[\\pipe\\leases_db]",
327 : };
328 :
329 : static const struct ndr_interface_string_array leases_db_endpoints = {
330 : .count = 1,
331 : .names = leases_db_endpoint_strings
332 : };
333 :
334 : static const char * const leases_db_authservice_strings[] = {
335 : "host",
336 : };
337 :
338 : static const struct ndr_interface_string_array leases_db_authservices = {
339 : .count = 1,
340 : .names = leases_db_authservice_strings
341 : };
342 :
343 :
344 : const struct ndr_interface_table ndr_table_leases_db = {
345 : .name = "leases_db",
346 : .num_calls = 0,
347 : .calls = leases_db_calls,
348 : .num_public_structs = 3,
349 : .public_structs = leases_db_public_structs,
350 : .endpoints = &leases_db_endpoints,
351 : .authservices = &leases_db_authservices
352 : };
353 :
354 : #endif /* SKIP_NDR_TABLE_leases_db */
|