summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_atsvc.c
blob: d502add2b0423d084e7d102c304965b8318f957d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
/* parser auto-generated by pidl */

#include "includes.h"

NTSTATUS ndr_push_atsvc_JobInfo(struct ndr_push *ndr, int ndr_flags, struct atsvc_JobInfo *r)
{
	if (!(ndr_flags & NDR_SCALARS)) goto buffers;
	NDR_CHECK(ndr_push_struct_start(ndr));
	NDR_CHECK(ndr_push_align(ndr, 4));
	NDR_CHECK(ndr_push_uint32(ndr, r->job_time));
	NDR_CHECK(ndr_push_uint32(ndr, r->days_of_month));
	NDR_CHECK(ndr_push_uint8(ndr, r->days_of_week));
	NDR_CHECK(ndr_push_uint8(ndr, r->flags));
	NDR_CHECK(ndr_push_ptr(ndr, r->command));
	ndr_push_struct_end(ndr);
buffers:
	if (!(ndr_flags & NDR_BUFFERS)) goto done;
	if (r->command) {
		NDR_CHECK(ndr_push_unistr(ndr, r->command));
	}
done:
	return NT_STATUS_OK;
}

NTSTATUS ndr_push_atsvc_JobAdd(struct ndr_push *ndr, struct atsvc_JobAdd *r)
{
	NDR_CHECK(ndr_push_ptr(ndr, r->in.servername));
	if (r->in.servername) {
		NDR_CHECK(ndr_push_unistr(ndr, r->in.servername));
	}
	NDR_CHECK(ndr_push_atsvc_JobInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.job_info));

	return NT_STATUS_OK;
}

NTSTATUS ndr_push_atsvc_JobDel(struct ndr_push *ndr, struct atsvc_JobDel *r)
{
	NDR_CHECK(ndr_push_ptr(ndr, r->in.servername));
	if (r->in.servername) {
		NDR_CHECK(ndr_push_unistr(ndr, r->in.servername));
	}
	NDR_CHECK(ndr_push_uint32(ndr, r->in.min_job_id));
	NDR_CHECK(ndr_push_uint32(ndr, r->in.max_job_id));

	return NT_STATUS_OK;
}

NTSTATUS ndr_push_atsvc_JobEnumInfo(struct ndr_push *ndr, int ndr_flags, struct atsvc_JobEnumInfo *r)
{
	if (!(ndr_flags & NDR_SCALARS)) goto buffers;
	NDR_CHECK(ndr_push_struct_start(ndr));
	NDR_CHECK(ndr_push_align(ndr, 4));
	NDR_CHECK(ndr_push_uint32(ndr, r->job_id));
	NDR_CHECK(ndr_push_uint32(ndr, r->job_time));
	NDR_CHECK(ndr_push_uint32(ndr, r->days_of_month));
	NDR_CHECK(ndr_push_uint8(ndr, r->days_of_week));
	NDR_CHECK(ndr_push_uint8(ndr, r->flags));
	NDR_CHECK(ndr_push_ptr(ndr, r->command));
	ndr_push_struct_end(ndr);
buffers:
	if (!(ndr_flags & NDR_BUFFERS)) goto done;
	if (r->command) {
		NDR_CHECK(ndr_push_unistr(ndr, r->command));
	}
done:
	return NT_STATUS_OK;
}

NTSTATUS ndr_push_atsvc_enum_ctr(struct ndr_push *ndr, int ndr_flags, struct atsvc_enum_ctr *r)
{
	if (!(ndr_flags & NDR_SCALARS)) goto buffers;
	NDR_CHECK(ndr_push_struct_start(ndr));
	NDR_CHECK(ndr_push_align(ndr, 4));
	NDR_CHECK(ndr_push_uint32(ndr, r->entries_read));
	NDR_CHECK(ndr_push_ptr(ndr, r->first_entry));
	ndr_push_struct_end(ndr);
buffers:
	if (!(ndr_flags & NDR_BUFFERS)) goto done;
	if (r->first_entry) {
		NDR_CHECK(ndr_push_uint32(ndr, r->entries_read));
		NDR_CHECK(ndr_push_array(ndr, NDR_SCALARS|NDR_BUFFERS, r->first_entry, sizeof(r->first_entry[0]), r->entries_read, (ndr_push_flags_fn_t)ndr_push_atsvc_JobEnumInfo));
	}
done:
	return NT_STATUS_OK;
}

NTSTATUS ndr_push_atsvc_JobEnum(struct ndr_push *ndr, struct atsvc_JobEnum *r)
{
	NDR_CHECK(ndr_push_ptr(ndr, r->in.servername));
	if (r->in.servername) {
		NDR_CHECK(ndr_push_unistr(ndr, r->in.servername));
	}
	NDR_CHECK(ndr_push_atsvc_enum_ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.ctr));
	NDR_CHECK(ndr_push_uint32(ndr, r->in.preferred_max_len));
	NDR_CHECK(ndr_push_ptr(ndr, r->in.resume_handle));
	if (r->in.resume_handle) {
		NDR_CHECK(ndr_push_uint32(ndr, *r->in.resume_handle));
	}

	return NT_STATUS_OK;
}

NTSTATUS ndr_push_atsvc_JobGetInfo(struct ndr_push *ndr, struct atsvc_JobGetInfo *r)
{
	NDR_CHECK(ndr_push_ptr(ndr, r->in.servername));
	if (r->in.servername) {
		NDR_CHECK(ndr_push_unistr(ndr, r->in.servername));
	}
	NDR_CHECK(ndr_push_uint32(ndr, r->in.job_id));

	return NT_STATUS_OK;
}

NTSTATUS ndr_pull_atsvc_JobInfo(struct ndr_pull *ndr, int ndr_flags, struct atsvc_JobInfo *r)
{
	uint32 _ptr_command;
	NDR_CHECK(ndr_pull_struct_start(ndr));
	if (!(ndr_flags & NDR_SCALARS)) goto buffers;
	NDR_CHECK(ndr_pull_align(ndr, 4));
	NDR_CHECK(ndr_pull_uint32(ndr, &r->job_time));
	NDR_CHECK(ndr_pull_uint32(ndr, &r->days_of_month));
	NDR_CHECK(ndr_pull_uint8(ndr, &r->days_of_week));
	NDR_CHECK(ndr_pull_uint8(ndr, &r->flags));
	NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_command));
	if (_ptr_command) {
		NDR_ALLOC(ndr, r->command);
	} else {
		r->command = NULL;
	}
	ndr_pull_struct_end(ndr);
buffers:
	if (!(ndr_flags & NDR_BUFFERS)) goto done;
	if (r->command) {
		NDR_CHECK(ndr_pull_unistr(ndr, &r->command));
	}
done:
	return NT_STATUS_OK;
}

NTSTATUS ndr_pull_atsvc_JobAdd(struct ndr_pull *ndr, struct atsvc_JobAdd *r)
{
	NDR_CHECK(ndr_pull_uint32(ndr, &r->out.job_id));
	NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));

	return NT_STATUS_OK;
}

NTSTATUS ndr_pull_atsvc_JobDel(struct ndr_pull *ndr, struct atsvc_JobDel *r)
{
	NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));

	return NT_STATUS_OK;
}

NTSTATUS ndr_pull_atsvc_JobEnumInfo(struct ndr_pull *ndr, int ndr_flags, struct atsvc_JobEnumInfo *r)
{
	uint32 _ptr_command;
	NDR_CHECK(ndr_pull_struct_start(ndr));
	if (!(ndr_flags & NDR_SCALARS)) goto buffers;
	NDR_CHECK(ndr_pull_align(ndr, 4));
	NDR_CHECK(ndr_pull_uint32(ndr, &r->job_id));
	NDR_CHECK(ndr_pull_uint32(ndr, &r->job_time));
	NDR_CHECK(ndr_pull_uint32(ndr, &r->days_of_month));
	NDR_CHECK(ndr_pull_uint8(ndr, &r->days_of_week));
	NDR_CHECK(ndr_pull_uint8(ndr, &r->flags));
	NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_command));
	if (_ptr_command) {
		NDR_ALLOC(ndr, r->command);
	} else {
		r->command = NULL;
	}
	ndr_pull_struct_end(ndr);
buffers:
	if (!(ndr_flags & NDR_BUFFERS)) goto done;
	if (r->command) {
		NDR_CHECK(ndr_pull_unistr(ndr, &r->command));
	}
done:
	return NT_STATUS_OK;
}

NTSTATUS ndr_pull_atsvc_enum_ctr(struct ndr_pull *ndr, int ndr_flags, struct atsvc_enum_ctr *r)
{
	uint32 _ptr_first_entry;
	NDR_CHECK(ndr_pull_struct_start(ndr));
	if (!(ndr_flags & NDR_SCALARS)) goto buffers;
	NDR_CHECK(ndr_pull_align(ndr, 4));
	NDR_CHECK(ndr_pull_uint32(ndr, &r->entries_read));
	NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_first_entry));
	if (_ptr_first_entry) {
		NDR_ALLOC(ndr, r->first_entry);
	} else {
		r->first_entry = NULL;
	}
	ndr_pull_struct_end(ndr);
buffers:
	if (!(ndr_flags & NDR_BUFFERS)) goto done;
	if (r->first_entry) {
	{
		uint32 _array_size;
		NDR_CHECK(ndr_pull_uint32(ndr, &_array_size));
		if (r->entries_read > _array_size) {
			return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should be %u", _array_size, r->entries_read);
		}
	}
		NDR_ALLOC_N_SIZE(ndr, r->first_entry, r->entries_read, sizeof(r->first_entry[0]));
	{
		NDR_CHECK(ndr_pull_array(ndr, NDR_SCALARS|NDR_BUFFERS, (void **)r->first_entry, sizeof(r->first_entry[0]), r->entries_read, (ndr_pull_flags_fn_t)ndr_pull_atsvc_JobEnumInfo));
	}
	}
done:
	return NT_STATUS_OK;
}

NTSTATUS ndr_pull_atsvc_JobEnum(struct ndr_pull *ndr, struct atsvc_JobEnum *r)
{
	uint32 _ptr_resume_handle;
	NDR_CHECK(ndr_pull_atsvc_enum_ctr(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.ctr));
	NDR_CHECK(ndr_pull_uint32(ndr, &r->out.total_entries));
	NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_resume_handle));
	if (_ptr_resume_handle) {
		NDR_ALLOC(ndr, r->out.resume_handle);
	} else {
		r->out.resume_handle = NULL;
	}
	if (r->out.resume_handle) {
		NDR_CHECK(ndr_pull_uint32(ndr, r->out.resume_handle));
	}
	NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));

	return NT_STATUS_OK;
}

NTSTATUS ndr_pull_atsvc_JobGetInfo(struct ndr_pull *ndr, struct atsvc_JobGetInfo *r)
{
	uint32 _ptr_job_info;
	NDR_CHECK(ndr_pull_uint32(ndr, &_ptr_job_info));
	if (_ptr_job_info) {
		NDR_ALLOC(ndr, r->out.job_info);
	} else {
		r->out.job_info = NULL;
	}
	if (r->out.job_info) {
		NDR_CHECK(ndr_pull_atsvc_JobInfo(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.job_info));
	}
	NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result));

	return NT_STATUS_OK;
}

void ndr_print_atsvc_JobInfo(struct ndr_print *ndr, const char *name, struct atsvc_JobInfo *r)
{
	ndr_print_struct(ndr, name, "atsvc_JobInfo");
	ndr->depth++;
	ndr_print_uint32(ndr, "job_time", r->job_time);
	ndr_print_uint32(ndr, "days_of_month", r->days_of_month);
	ndr_print_uint8(ndr, "days_of_week", r->days_of_week);
	ndr_print_uint8(ndr, "flags", r->flags);
	ndr_print_ptr(ndr, "command", r->command);
	ndr->depth++;
	if (r->command) {
		ndr_print_unistr(ndr, "command", r->command);
	}
	ndr->depth--;
	ndr->depth--;
}

void ndr_print_atsvc_JobAdd(struct ndr_print *ndr, const char *name, int flags, struct atsvc_JobAdd *r)
{
	ndr_print_struct(ndr, name, "atsvc_JobAdd");
	ndr->depth++;
	if (flags & NDR_IN) {
		ndr_print_struct(ndr, "in", "atsvc_JobAdd");
	ndr->depth++;
	ndr_print_ptr(ndr, "servername", r->in.servername);
	ndr->depth++;
	if (r->in.servername) {
		ndr_print_unistr(ndr, "servername", r->in.servername);
	}
	ndr->depth--;
	ndr_print_ptr(ndr, "job_info", r->in.job_info);
	ndr->depth++;
		ndr_print_atsvc_JobInfo(ndr, "job_info", r->in.job_info);
	ndr->depth--;
	ndr->depth--;
	}
	if (flags & NDR_OUT) {
		ndr_print_struct(ndr, "out", "atsvc_JobAdd");
	ndr->depth++;
	ndr_print_uint32(ndr, "job_id", r->out.job_id);
	ndr_print_NTSTATUS(ndr, "result", &r->out.result);
	ndr->depth--;
	}
	ndr->depth--;
}

void ndr_print_atsvc_JobDel(struct ndr_print *ndr, const char *name, int flags, struct atsvc_JobDel *r)
{
	ndr_print_struct(ndr, name, "atsvc_JobDel");
	ndr->depth++;
	if (flags & NDR_IN) {
		ndr_print_struct(ndr, "in", "atsvc_JobDel");
	ndr->depth++;
	ndr_print_ptr(ndr, "servername", r->in.servername);
	ndr->depth++;
	if (r->in.servername) {
		ndr_print_unistr(ndr, "servername", r->in.servername);
	}
	ndr->depth--;
	ndr_print_uint32(ndr, "min_job_id", r->in.min_job_id);
	ndr_print_uint32(ndr, "max_job_id", r->in.max_job_id);
	ndr->depth--;
	}
	if (flags & NDR_OUT) {
		ndr_print_struct(ndr, "out", "atsvc_JobDel");
	ndr->depth++;
	ndr_print_NTSTATUS(ndr, "result", &r->out.result);
	ndr->depth--;
	}
	ndr->depth--;
}

void ndr_print_atsvc_JobEnumInfo(struct ndr_print *ndr, const char *name, struct atsvc_JobEnumInfo *r)
{
	ndr_print_struct(ndr, name, "atsvc_JobEnumInfo");
	ndr->depth++;
	ndr_print_uint32(ndr, "job_id", r->job_id);
	ndr_print_uint32(ndr, "job_time", r->job_time);
	ndr_print_uint32(ndr, "days_of_month", r->days_of_month);
	ndr_print_uint8(ndr, "days_of_week", r->days_of_week);
	ndr_print_uint8(ndr, "flags", r->flags);
	ndr_print_ptr(ndr, "command", r->command);
	ndr->depth++;
	if (r->command) {
		ndr_print_unistr(ndr, "command", r->command);
	}
	ndr->depth--;
	ndr->depth--;
}

void ndr_print_atsvc_enum_ctr(struct ndr_print *ndr, const char *name, struct atsvc_enum_ctr *r)
{
	ndr_print_struct(ndr, name, "atsvc_enum_ctr");
	ndr->depth++;
	ndr_print_uint32(ndr, "entries_read", r->entries_read);
	ndr_print_ptr(ndr, "first_entry", r->first_entry);
	ndr->depth++;
	if (r->first_entry) {
		ndr_print_array(ndr, "first_entry", r->first_entry, sizeof(r->first_entry[0]), r->entries_read, (ndr_print_fn_t)ndr_print_atsvc_JobEnumInfo);
	}
	ndr->depth--;
	ndr->depth--;
}

void ndr_print_atsvc_JobEnum(struct ndr_print *ndr, const char *name, int flags, struct atsvc_JobEnum *r)
{
	ndr_print_struct(ndr, name, "atsvc_JobEnum");
	ndr->depth++;
	if (flags & NDR_IN) {
		ndr_print_struct(ndr, "in", "atsvc_JobEnum");
	ndr->depth++;
	ndr_print_ptr(ndr, "servername", r->in.servername);
	ndr->depth++;
	if (r->in.servername) {
		ndr_print_unistr(ndr, "servername", r->in.servername);
	}
	ndr->depth--;
	ndr_print_ptr(ndr, "ctr", r->in.ctr);
	ndr->depth++;
		ndr_print_atsvc_enum_ctr(ndr, "ctr", r->in.ctr);
	ndr->depth--;
	ndr_print_uint32(ndr, "preferred_max_len", r->in.preferred_max_len);
	ndr_print_ptr(ndr, "resume_handle", r->in.resume_handle);
	ndr->depth++;
	if (r->in.resume_handle) {
		ndr_print_uint32(ndr, "resume_handle", *r->in.resume_handle);
	}
	ndr->depth--;
	ndr->depth--;
	}
	if (flags & NDR_OUT) {
		ndr_print_struct(ndr, "out", "atsvc_JobEnum");
	ndr->depth++;
	ndr_print_ptr(ndr, "ctr", r->out.ctr);
	ndr->depth++;
		ndr_print_atsvc_enum_ctr(ndr, "ctr", r->out.ctr);
	ndr->depth--;
	ndr_print_uint32(ndr, "total_entries", r->out.total_entries);
	ndr_print_ptr(ndr, "resume_handle", r->out.resume_handle);
	ndr->depth++;
	if (r->out.resume_handle) {
		ndr_print_uint32(ndr, "resume_handle", *r->out.resume_handle);
	}
	ndr->depth--;
	ndr_print_NTSTATUS(ndr, "result", &r->out.result);
	ndr->depth--;
	}
	ndr->depth--;
}

void ndr_print_atsvc_JobGetInfo(struct ndr_print *ndr, const char *name, int flags, struct atsvc_JobGetInfo *r)
{
	ndr_print_struct(ndr, name, "atsvc_JobGetInfo");
	ndr->depth++;
	if (flags & NDR_IN) {
		ndr_print_struct(ndr, "in", "atsvc_JobGetInfo");
	ndr->depth++;
	ndr_print_ptr(ndr, "servername", r->in.servername);
	ndr->depth++;
	if (r->in.servername) {
		ndr_print_unistr(ndr, "servername", r->in.servername);
	}
	ndr->depth--;
	ndr_print_uint32(ndr, "job_id", r->in.job_id);
	ndr->depth--;
	}
	if (flags & NDR_OUT) {
		ndr_print_struct(ndr, "out", "atsvc_JobGetInfo");
	ndr->depth++;
	ndr_print_ptr(ndr, "job_info", r->out.job_info);
	ndr->depth++;
	if (r->out.job_info) {
		ndr_print_atsvc_JobInfo(ndr, "job_info", r->out.job_info);
	}
	ndr->depth--;
	ndr_print_NTSTATUS(ndr, "result", &r->out.result);
	ndr->depth--;
	}
	ndr->depth--;
}