s4-smbtorture: move test_ReplyOpenPrinter from RPC-SPOOLSS to RPC-SPOOLSS-NOTIFY.
[Samba/eduardoll.git] / librpc / gen_ndr / ndr_named_pipe_auth.c
blob88ad4498785d187d573700a98550c27fdb2ba583
1 /* parser auto-generated by pidl */
3 #include "includes.h"
4 #include "../librpc/gen_ndr/ndr_named_pipe_auth.h"
6 #include "librpc/gen_ndr/ndr_netlogon.h"
7 static enum ndr_err_code ndr_push_named_pipe_auth_req_info(struct ndr_push *ndr, int ndr_flags, const union named_pipe_auth_req_info *r)
9 if (ndr_flags & NDR_SCALARS) {
10 int level = ndr_push_get_switch_value(ndr, r);
11 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
12 switch (level) {
13 case 0: {
14 break; }
16 case 1: {
17 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_SCALARS, &r->info1));
18 break; }
20 default:
21 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
24 if (ndr_flags & NDR_BUFFERS) {
25 int level = ndr_push_get_switch_value(ndr, r);
26 switch (level) {
27 case 0:
28 break;
30 case 1:
31 NDR_CHECK(ndr_push_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info1));
32 break;
34 default:
35 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
38 return NDR_ERR_SUCCESS;
41 static enum ndr_err_code ndr_pull_named_pipe_auth_req_info(struct ndr_pull *ndr, int ndr_flags, union named_pipe_auth_req_info *r)
43 int level;
44 uint32_t _level;
45 level = ndr_pull_get_switch_value(ndr, r);
46 if (ndr_flags & NDR_SCALARS) {
47 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
48 if (_level != level) {
49 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
51 switch (level) {
52 case 0: {
53 break; }
55 case 1: {
56 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_SCALARS, &r->info1));
57 break; }
59 default:
60 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
63 if (ndr_flags & NDR_BUFFERS) {
64 switch (level) {
65 case 0:
66 break;
68 case 1:
69 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr, NDR_BUFFERS, &r->info1));
70 break;
72 default:
73 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
76 return NDR_ERR_SUCCESS;
79 _PUBLIC_ void ndr_print_named_pipe_auth_req_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_req_info *r)
81 int level;
82 level = ndr_print_get_switch_value(ndr, r);
83 ndr_print_union(ndr, name, level, "named_pipe_auth_req_info");
84 switch (level) {
85 case 0:
86 break;
88 case 1:
89 ndr_print_netr_SamInfo3(ndr, "info1", &r->info1);
90 break;
92 default:
93 ndr_print_bad_level(ndr, name, level);
97 _PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_req(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_req *r)
99 if (ndr_flags & NDR_SCALARS) {
100 NDR_CHECK(ndr_push_align(ndr, 4));
102 uint32_t _flags_save_uint32 = ndr->flags;
103 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
104 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_req(r, ndr->iconv_convenience, ndr->flags) - 4));
105 ndr->flags = _flags_save_uint32;
107 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS));
108 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
109 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
110 NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info));
112 if (ndr_flags & NDR_BUFFERS) {
113 NDR_CHECK(ndr_push_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info));
115 return NDR_ERR_SUCCESS;
118 _PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_req(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_req *r)
120 if (ndr_flags & NDR_SCALARS) {
121 NDR_CHECK(ndr_pull_align(ndr, 4));
123 uint32_t _flags_save_uint32 = ndr->flags;
124 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
125 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
126 ndr->flags = _flags_save_uint32;
128 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, 4, sizeof(uint8_t), CH_DOS));
129 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
130 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
131 NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_SCALARS, &r->info));
133 if (ndr_flags & NDR_BUFFERS) {
134 NDR_CHECK(ndr_pull_named_pipe_auth_req_info(ndr, NDR_BUFFERS, &r->info));
136 return NDR_ERR_SUCCESS;
139 _PUBLIC_ void ndr_print_named_pipe_auth_req(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_req *r)
141 ndr_print_struct(ndr, name, "named_pipe_auth_req");
142 ndr->depth++;
143 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_req(r, ndr->iconv_convenience, ndr->flags) - 4:r->length);
144 ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic);
145 ndr_print_uint32(ndr, "level", r->level);
146 ndr_print_set_switch_value(ndr, &r->info, r->level);
147 ndr_print_named_pipe_auth_req_info(ndr, "info", &r->info);
148 ndr->depth--;
151 _PUBLIC_ size_t ndr_size_named_pipe_auth_req(const struct named_pipe_auth_req *r, struct smb_iconv_convenience *ic, int flags)
153 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_req, ic);
156 static enum ndr_err_code ndr_push_named_pipe_auth_rep_info(struct ndr_push *ndr, int ndr_flags, const union named_pipe_auth_rep_info *r)
158 if (ndr_flags & NDR_SCALARS) {
159 int level = ndr_push_get_switch_value(ndr, r);
160 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level));
161 switch (level) {
162 case 0: {
163 break; }
165 case 1: {
166 break; }
168 default:
169 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
172 if (ndr_flags & NDR_BUFFERS) {
173 int level = ndr_push_get_switch_value(ndr, r);
174 switch (level) {
175 case 0:
176 break;
178 case 1:
179 break;
181 default:
182 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
185 return NDR_ERR_SUCCESS;
188 static enum ndr_err_code ndr_pull_named_pipe_auth_rep_info(struct ndr_pull *ndr, int ndr_flags, union named_pipe_auth_rep_info *r)
190 int level;
191 uint32_t _level;
192 level = ndr_pull_get_switch_value(ndr, r);
193 if (ndr_flags & NDR_SCALARS) {
194 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
195 if (_level != level) {
196 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
198 switch (level) {
199 case 0: {
200 break; }
202 case 1: {
203 break; }
205 default:
206 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
209 if (ndr_flags & NDR_BUFFERS) {
210 switch (level) {
211 case 0:
212 break;
214 case 1:
215 break;
217 default:
218 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
221 return NDR_ERR_SUCCESS;
224 _PUBLIC_ void ndr_print_named_pipe_auth_rep_info(struct ndr_print *ndr, const char *name, const union named_pipe_auth_rep_info *r)
226 int level;
227 level = ndr_print_get_switch_value(ndr, r);
228 ndr_print_union(ndr, name, level, "named_pipe_auth_rep_info");
229 switch (level) {
230 case 0:
231 break;
233 case 1:
234 break;
236 default:
237 ndr_print_bad_level(ndr, name, level);
241 _PUBLIC_ enum ndr_err_code ndr_push_named_pipe_auth_rep(struct ndr_push *ndr, int ndr_flags, const struct named_pipe_auth_rep *r)
243 if (ndr_flags & NDR_SCALARS) {
244 NDR_CHECK(ndr_push_align(ndr, 4));
246 uint32_t _flags_save_uint32 = ndr->flags;
247 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
248 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_named_pipe_auth_rep(r, ndr->iconv_convenience, ndr->flags) - 4));
249 ndr->flags = _flags_save_uint32;
251 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, NAMED_PIPE_AUTH_MAGIC, 4, sizeof(uint8_t), CH_DOS));
252 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level));
253 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level));
254 NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info));
255 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
257 if (ndr_flags & NDR_BUFFERS) {
258 NDR_CHECK(ndr_push_named_pipe_auth_rep_info(ndr, NDR_BUFFERS, &r->info));
260 return NDR_ERR_SUCCESS;
263 _PUBLIC_ enum ndr_err_code ndr_pull_named_pipe_auth_rep(struct ndr_pull *ndr, int ndr_flags, struct named_pipe_auth_rep *r)
265 if (ndr_flags & NDR_SCALARS) {
266 NDR_CHECK(ndr_pull_align(ndr, 4));
268 uint32_t _flags_save_uint32 = ndr->flags;
269 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
270 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
271 ndr->flags = _flags_save_uint32;
273 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->magic, 4, sizeof(uint8_t), CH_DOS));
274 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level));
275 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level));
276 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_SCALARS, &r->info));
277 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
279 if (ndr_flags & NDR_BUFFERS) {
280 NDR_CHECK(ndr_pull_named_pipe_auth_rep_info(ndr, NDR_BUFFERS, &r->info));
282 return NDR_ERR_SUCCESS;
285 _PUBLIC_ void ndr_print_named_pipe_auth_rep(struct ndr_print *ndr, const char *name, const struct named_pipe_auth_rep *r)
287 ndr_print_struct(ndr, name, "named_pipe_auth_rep");
288 ndr->depth++;
289 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_named_pipe_auth_rep(r, ndr->iconv_convenience, ndr->flags) - 4:r->length);
290 ndr_print_string(ndr, "magic", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NAMED_PIPE_AUTH_MAGIC:r->magic);
291 ndr_print_uint32(ndr, "level", r->level);
292 ndr_print_set_switch_value(ndr, &r->info, r->level);
293 ndr_print_named_pipe_auth_rep_info(ndr, "info", &r->info);
294 ndr_print_NTSTATUS(ndr, "status", r->status);
295 ndr->depth--;
298 _PUBLIC_ size_t ndr_size_named_pipe_auth_rep(const struct named_pipe_auth_rep *r, struct smb_iconv_convenience *ic, int flags)
300 return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_named_pipe_auth_rep, ic);