ff79baa3825cddf2ad5356dbeca8ca10bc56f884
[ira/wip.git] / librpc / gen_ndr / ndr_misc.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_misc.h"
5
6 _PUBLIC_ enum ndr_err_code ndr_push_GUID(struct ndr_push *ndr, int ndr_flags, const struct GUID *r)
7 {
8         if (ndr_flags & NDR_SCALARS) {
9                 NDR_CHECK(ndr_push_align(ndr, 4));
10                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time_low));
11                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_mid));
12                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->time_hi_and_version));
13                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2));
14                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->node, 6));
15                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
16         }
17         if (ndr_flags & NDR_BUFFERS) {
18         }
19         return NDR_ERR_SUCCESS;
20 }
21
22 _PUBLIC_ enum ndr_err_code ndr_pull_GUID(struct ndr_pull *ndr, int ndr_flags, struct GUID *r)
23 {
24         if (ndr_flags & NDR_SCALARS) {
25                 NDR_CHECK(ndr_pull_align(ndr, 4));
26                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time_low));
27                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_mid));
28                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->time_hi_and_version));
29                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->clock_seq, 2));
30                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->node, 6));
31                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
32         }
33         if (ndr_flags & NDR_BUFFERS) {
34         }
35         return NDR_ERR_SUCCESS;
36 }
37
38 _PUBLIC_ size_t ndr_size_GUID(const struct GUID *r, struct smb_iconv_convenience *ic, int flags)
39 {
40         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_GUID, ic);
41 }
42
43 _PUBLIC_ enum ndr_err_code ndr_push_ndr_syntax_id(struct ndr_push *ndr, int ndr_flags, const struct ndr_syntax_id *r)
44 {
45         if (ndr_flags & NDR_SCALARS) {
46                 NDR_CHECK(ndr_push_align(ndr, 4));
47                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid));
48                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->if_version));
49                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
50         }
51         if (ndr_flags & NDR_BUFFERS) {
52         }
53         return NDR_ERR_SUCCESS;
54 }
55
56 _PUBLIC_ enum ndr_err_code ndr_pull_ndr_syntax_id(struct ndr_pull *ndr, int ndr_flags, struct ndr_syntax_id *r)
57 {
58         if (ndr_flags & NDR_SCALARS) {
59                 NDR_CHECK(ndr_pull_align(ndr, 4));
60                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid));
61                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->if_version));
62                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
63         }
64         if (ndr_flags & NDR_BUFFERS) {
65         }
66         return NDR_ERR_SUCCESS;
67 }
68
69 _PUBLIC_ void ndr_print_ndr_syntax_id(struct ndr_print *ndr, const char *name, const struct ndr_syntax_id *r)
70 {
71         ndr_print_struct(ndr, name, "ndr_syntax_id");
72         ndr->depth++;
73         ndr_print_GUID(ndr, "uuid", &r->uuid);
74         ndr_print_uint32(ndr, "if_version", r->if_version);
75         ndr->depth--;
76 }
77
78 _PUBLIC_ enum ndr_err_code ndr_push_policy_handle(struct ndr_push *ndr, int ndr_flags, const struct policy_handle *r)
79 {
80         if (ndr_flags & NDR_SCALARS) {
81                 NDR_CHECK(ndr_push_align(ndr, 4));
82                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->handle_type));
83                 NDR_CHECK(ndr_push_GUID(ndr, NDR_SCALARS, &r->uuid));
84                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
85         }
86         if (ndr_flags & NDR_BUFFERS) {
87         }
88         return NDR_ERR_SUCCESS;
89 }
90
91 _PUBLIC_ enum ndr_err_code ndr_pull_policy_handle(struct ndr_pull *ndr, int ndr_flags, struct policy_handle *r)
92 {
93         if (ndr_flags & NDR_SCALARS) {
94                 NDR_CHECK(ndr_pull_align(ndr, 4));
95                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->handle_type));
96                 NDR_CHECK(ndr_pull_GUID(ndr, NDR_SCALARS, &r->uuid));
97                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
98         }
99         if (ndr_flags & NDR_BUFFERS) {
100         }
101         return NDR_ERR_SUCCESS;
102 }
103
104 _PUBLIC_ void ndr_print_policy_handle(struct ndr_print *ndr, const char *name, const struct policy_handle *r)
105 {
106         ndr_print_struct(ndr, name, "policy_handle");
107         ndr->depth++;
108         ndr_print_uint32(ndr, "handle_type", r->handle_type);
109         ndr_print_GUID(ndr, "uuid", &r->uuid);
110         ndr->depth--;
111 }
112
113 _PUBLIC_ enum ndr_err_code ndr_push_netr_SchannelType(struct ndr_push *ndr, int ndr_flags, enum netr_SchannelType r)
114 {
115         NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
116         return NDR_ERR_SUCCESS;
117 }
118
119 _PUBLIC_ enum ndr_err_code ndr_pull_netr_SchannelType(struct ndr_pull *ndr, int ndr_flags, enum netr_SchannelType *r)
120 {
121         uint16_t v;
122         NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
123         *r = v;
124         return NDR_ERR_SUCCESS;
125 }
126
127 _PUBLIC_ void ndr_print_netr_SchannelType(struct ndr_print *ndr, const char *name, enum netr_SchannelType r)
128 {
129         const char *val = NULL;
130
131         switch (r) {
132                 case SEC_CHAN_NULL: val = "SEC_CHAN_NULL"; break;
133                 case SEC_CHAN_WKSTA: val = "SEC_CHAN_WKSTA"; break;
134                 case SEC_CHAN_DNS_DOMAIN: val = "SEC_CHAN_DNS_DOMAIN"; break;
135                 case SEC_CHAN_DOMAIN: val = "SEC_CHAN_DOMAIN"; break;
136                 case SEC_CHAN_BDC: val = "SEC_CHAN_BDC"; break;
137         }
138         ndr_print_enum(ndr, name, "ENUM", val, r);
139 }
140
141 _PUBLIC_ enum ndr_err_code ndr_push_KRB5_EDATA_NTSTATUS(struct ndr_push *ndr, int ndr_flags, const struct KRB5_EDATA_NTSTATUS *r)
142 {
143         if (ndr_flags & NDR_SCALARS) {
144                 NDR_CHECK(ndr_push_align(ndr, 4));
145                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->ntstatus));
146                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown1));
147                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->unknown2));
148                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
149         }
150         if (ndr_flags & NDR_BUFFERS) {
151         }
152         return NDR_ERR_SUCCESS;
153 }
154
155 _PUBLIC_ enum ndr_err_code ndr_pull_KRB5_EDATA_NTSTATUS(struct ndr_pull *ndr, int ndr_flags, struct KRB5_EDATA_NTSTATUS *r)
156 {
157         if (ndr_flags & NDR_SCALARS) {
158                 NDR_CHECK(ndr_pull_align(ndr, 4));
159                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->ntstatus));
160                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown1));
161                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->unknown2));
162                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
163         }
164         if (ndr_flags & NDR_BUFFERS) {
165         }
166         return NDR_ERR_SUCCESS;
167 }
168
169 _PUBLIC_ void ndr_print_KRB5_EDATA_NTSTATUS(struct ndr_print *ndr, const char *name, const struct KRB5_EDATA_NTSTATUS *r)
170 {
171         ndr_print_struct(ndr, name, "KRB5_EDATA_NTSTATUS");
172         ndr->depth++;
173         ndr_print_NTSTATUS(ndr, "ntstatus", r->ntstatus);
174         ndr_print_uint32(ndr, "unknown1", r->unknown1);
175         ndr_print_uint32(ndr, "unknown2", r->unknown2);
176         ndr->depth--;
177 }
178
179 _PUBLIC_ enum ndr_err_code ndr_push_winreg_Type(struct ndr_push *ndr, int ndr_flags, enum winreg_Type r)
180 {
181         NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
182         return NDR_ERR_SUCCESS;
183 }
184
185 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_Type(struct ndr_pull *ndr, int ndr_flags, enum winreg_Type *r)
186 {
187         uint32_t v;
188         NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
189         *r = v;
190         return NDR_ERR_SUCCESS;
191 }
192
193 _PUBLIC_ void ndr_print_winreg_Type(struct ndr_print *ndr, const char *name, enum winreg_Type r)
194 {
195         const char *val = NULL;
196
197         switch (r) {
198                 case REG_NONE: val = "REG_NONE"; break;
199                 case REG_SZ: val = "REG_SZ"; break;
200                 case REG_EXPAND_SZ: val = "REG_EXPAND_SZ"; break;
201                 case REG_BINARY: val = "REG_BINARY"; break;
202                 case REG_DWORD: val = "REG_DWORD"; break;
203                 case REG_DWORD_BIG_ENDIAN: val = "REG_DWORD_BIG_ENDIAN"; break;
204                 case REG_LINK: val = "REG_LINK"; break;
205                 case REG_MULTI_SZ: val = "REG_MULTI_SZ"; break;
206                 case REG_RESOURCE_LIST: val = "REG_RESOURCE_LIST"; break;
207                 case REG_FULL_RESOURCE_DESCRIPTOR: val = "REG_FULL_RESOURCE_DESCRIPTOR"; break;
208                 case REG_RESOURCE_REQUIREMENTS_LIST: val = "REG_RESOURCE_REQUIREMENTS_LIST"; break;
209                 case REG_QWORD: val = "REG_QWORD"; break;
210         }
211         ndr_print_enum(ndr, name, "ENUM", val, r);
212 }
213
214 _PUBLIC_ enum ndr_err_code ndr_push_winreg_Data(struct ndr_push *ndr, int ndr_flags, const union winreg_Data *r)
215 {
216         if (ndr_flags & NDR_SCALARS) {
217                 int level = ndr_push_get_switch_value(ndr, r);
218                 NDR_CHECK(ndr_push_union_align(ndr, 4));
219                 switch (level) {
220                         case REG_NONE: {
221                         break; }
222
223                         case REG_SZ: {
224                                 {
225                                         uint32_t _flags_save_string = ndr->flags;
226                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
227                                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string));
228                                         ndr->flags = _flags_save_string;
229                                 }
230                         break; }
231
232                         case REG_BINARY: {
233                                 {
234                                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
235                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
236                                         NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->binary));
237                                         ndr->flags = _flags_save_DATA_BLOB;
238                                 }
239                         break; }
240
241                         case REG_DWORD: {
242                                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->value));
243                         break; }
244
245                         case REG_MULTI_SZ: {
246                                 {
247                                         uint32_t _flags_save_string_array = ndr->flags;
248                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
249                                         NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->string_array));
250                                         ndr->flags = _flags_save_string_array;
251                                 }
252                         break; }
253
254                         default: {
255                                 {
256                                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
257                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
258                                         NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data));
259                                         ndr->flags = _flags_save_DATA_BLOB;
260                                 }
261                         break; }
262
263                 }
264         }
265         if (ndr_flags & NDR_BUFFERS) {
266                 int level = ndr_push_get_switch_value(ndr, r);
267                 switch (level) {
268                         case REG_NONE:
269                         break;
270
271                         case REG_SZ:
272                         break;
273
274                         case REG_BINARY:
275                         break;
276
277                         case REG_DWORD:
278                         break;
279
280                         case REG_MULTI_SZ:
281                         break;
282
283                         default:
284                         break;
285
286                 }
287         }
288         return NDR_ERR_SUCCESS;
289 }
290
291 _PUBLIC_ enum ndr_err_code ndr_pull_winreg_Data(struct ndr_pull *ndr, int ndr_flags, union winreg_Data *r)
292 {
293         int level;
294         level = ndr_pull_get_switch_value(ndr, r);
295         if (ndr_flags & NDR_SCALARS) {
296                 NDR_CHECK(ndr_pull_union_align(ndr, 4));
297                 switch (level) {
298                         case REG_NONE: {
299                         break; }
300
301                         case REG_SZ: {
302                                 {
303                                         uint32_t _flags_save_string = ndr->flags;
304                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
305                                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string));
306                                         ndr->flags = _flags_save_string;
307                                 }
308                         break; }
309
310                         case REG_BINARY: {
311                                 {
312                                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
313                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
314                                         NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->binary));
315                                         ndr->flags = _flags_save_DATA_BLOB;
316                                 }
317                         break; }
318
319                         case REG_DWORD: {
320                                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value));
321                         break; }
322
323                         case REG_MULTI_SZ: {
324                                 {
325                                         uint32_t _flags_save_string_array = ndr->flags;
326                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
327                                         NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->string_array));
328                                         ndr->flags = _flags_save_string_array;
329                                 }
330                         break; }
331
332                         default: {
333                                 {
334                                         uint32_t _flags_save_DATA_BLOB = ndr->flags;
335                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
336                                         NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data));
337                                         ndr->flags = _flags_save_DATA_BLOB;
338                                 }
339                         break; }
340
341                 }
342         }
343         if (ndr_flags & NDR_BUFFERS) {
344                 switch (level) {
345                         case REG_NONE:
346                         break;
347
348                         case REG_SZ:
349                         break;
350
351                         case REG_BINARY:
352                         break;
353
354                         case REG_DWORD:
355                         break;
356
357                         case REG_MULTI_SZ:
358                         break;
359
360                         default:
361                         break;
362
363                 }
364         }
365         return NDR_ERR_SUCCESS;
366 }
367
368 _PUBLIC_ void ndr_print_winreg_Data(struct ndr_print *ndr, const char *name, const union winreg_Data *r)
369 {
370         int level;
371         level = ndr_print_get_switch_value(ndr, r);
372         ndr_print_union(ndr, name, level, "winreg_Data");
373         switch (level) {
374                 case REG_NONE:
375                 break;
376
377                 case REG_SZ:
378                         ndr_print_string(ndr, "string", r->string);
379                 break;
380
381                 case REG_BINARY:
382                         ndr_print_DATA_BLOB(ndr, "binary", r->binary);
383                 break;
384
385                 case REG_DWORD:
386                         ndr_print_uint32(ndr, "value", r->value);
387                 break;
388
389                 case REG_MULTI_SZ:
390                         ndr_print_string_array(ndr, "string_array", r->string_array);
391                 break;
392
393                 default:
394                         ndr_print_DATA_BLOB(ndr, "data", r->data);
395                 break;
396
397         }
398 }
399