1 /* parser auto-generated by pidl */
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
));
17 NDR_CHECK(ndr_push_netr_SamInfo3(ndr
, NDR_SCALARS
, &r
->info1
));
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
);
31 NDR_CHECK(ndr_push_netr_SamInfo3(ndr
, NDR_BUFFERS
, &r
->info1
));
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
)
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
);
56 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr
, NDR_SCALARS
, &r
->info1
));
60 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
63 if (ndr_flags
& NDR_BUFFERS
) {
69 NDR_CHECK(ndr_pull_netr_SamInfo3(ndr
, NDR_BUFFERS
, &r
->info1
));
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
)
82 level
= ndr_print_get_switch_value(ndr
, r
);
83 ndr_print_union(ndr
, name
, level
, "named_pipe_auth_req_info");
89 ndr_print_netr_SamInfo3(ndr
, "info1", &r
->info1
);
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");
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
);
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
));
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
);
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
)
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
);
206 return ndr_pull_error(ndr
, NDR_ERR_BAD_SWITCH
, "Bad switch value %u", level
);
209 if (ndr_flags
& NDR_BUFFERS
) {
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
)
227 level
= ndr_print_get_switch_value(ndr
, r
);
228 ndr_print_union(ndr
, name
, level
, "named_pipe_auth_rep_info");
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");
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
);
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
);