6
6
static enum ndr_err_code ndr_push_pcap_printer(struct ndr_push *ndr, int ndr_flags, const struct pcap_printer *r)
8
8
if (ndr_flags & NDR_SCALARS) {
9
NDR_CHECK(ndr_push_align(ndr, 4));
9
NDR_CHECK(ndr_push_align(ndr, 5));
10
10
NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
11
11
NDR_CHECK(ndr_push_unique_ptr(ndr, r->info));
12
NDR_CHECK(ndr_push_unique_ptr(ndr, r->location));
13
NDR_CHECK(ndr_push_trailer_align(ndr, 5));
13
15
if (ndr_flags & NDR_BUFFERS) {
15
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
16
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
17
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
17
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
18
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
19
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
18
20
NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
21
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->info, CH_UTF8)));
22
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
23
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->info, CH_UTF8)));
23
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->info, CH_UTF8)));
24
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
25
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->info, CH_UTF8)));
24
26
NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->info, ndr_charset_length(r->info, CH_UTF8), sizeof(uint8_t), CH_UTF8));
29
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->location, CH_UTF8)));
30
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
31
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->location, CH_UTF8)));
32
NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->location, ndr_charset_length(r->location, CH_UTF8), sizeof(uint8_t), CH_UTF8));
27
35
return NDR_ERR_SUCCESS;
33
41
TALLOC_CTX *_mem_save_name_0;
34
42
uint32_t _ptr_info;
35
43
TALLOC_CTX *_mem_save_info_0;
44
uint32_t _ptr_location;
45
TALLOC_CTX *_mem_save_location_0;
36
46
if (ndr_flags & NDR_SCALARS) {
37
NDR_CHECK(ndr_pull_align(ndr, 4));
47
NDR_CHECK(ndr_pull_align(ndr, 5));
38
48
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
40
50
NDR_PULL_ALLOC(ndr, r->name);
73
90
NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->info, ndr_get_array_length(ndr, &r->info), sizeof(uint8_t), CH_UTF8));
74
91
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
94
_mem_save_location_0 = NDR_PULL_GET_MEM_CTX(ndr);
95
NDR_PULL_SET_MEM_CTX(ndr, r->location, 0);
96
NDR_CHECK(ndr_pull_array_size(ndr, &r->location));
97
NDR_CHECK(ndr_pull_array_length(ndr, &r->location));
98
if (ndr_get_array_length(ndr, &r->location) > ndr_get_array_size(ndr, &r->location)) {
99
return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->location), ndr_get_array_length(ndr, &r->location));
101
NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->location), sizeof(uint8_t)));
102
NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->location, ndr_get_array_length(ndr, &r->location), sizeof(uint8_t), CH_UTF8));
103
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_location_0, 0);
77
106
return NDR_ERR_SUCCESS;
101
137
uint32_t cntr_printers_0;
102
138
if (ndr_flags & NDR_SCALARS) {
103
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
104
NDR_CHECK(ndr_push_align(ndr, 4));
139
NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
140
NDR_CHECK(ndr_push_align(ndr, 5));
105
141
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->status));
106
142
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count));
107
143
for (cntr_printers_0 = 0; cntr_printers_0 < r->count; cntr_printers_0++) {
108
144
NDR_CHECK(ndr_push_pcap_printer(ndr, NDR_SCALARS, &r->printers[cntr_printers_0]));
146
NDR_CHECK(ndr_push_trailer_align(ndr, 5));
111
148
if (ndr_flags & NDR_BUFFERS) {
112
149
for (cntr_printers_0 = 0; cntr_printers_0 < r->count; cntr_printers_0++) {
122
159
TALLOC_CTX *_mem_save_printers_0;
123
160
if (ndr_flags & NDR_SCALARS) {
124
161
NDR_CHECK(ndr_pull_array_size(ndr, &r->printers));
125
NDR_CHECK(ndr_pull_align(ndr, 4));
162
NDR_CHECK(ndr_pull_align(ndr, 5));
126
163
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->status));
127
164
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count));
128
165
NDR_PULL_ALLOC_N(ndr, r->printers, ndr_get_array_size(ndr, &r->printers));
152
190
uint32_t cntr_printers_0;
153
191
ndr_print_struct(ndr, name, "pcap_data");
192
if (r == NULL) { ndr_print_null(ndr); return; }
155
194
ndr_print_NTSTATUS(ndr, "status", r->status);
156
195
ndr_print_uint32(ndr, "count", r->count);
157
196
ndr->print(ndr, "%s: ARRAY(%d)", "printers", (int)r->count);
159
198
for (cntr_printers_0=0;cntr_printers_0<r->count;cntr_printers_0++) {
161
if (asprintf(&idx_0, "[%d]", cntr_printers_0) != -1) {
162
ndr_print_pcap_printer(ndr, "printers", &r->printers[cntr_printers_0]);
199
ndr_print_pcap_printer(ndr, "printers", &r->printers[cntr_printers_0]);