git add -f bin/default/librpc/gen_ndr/*.[ch] bin/default/source*/librpc/gen_ndr/...
[metze/samba/wip.git] / bin.gen_ndr / default / librpc / gen_ndr / ndr_preg.c
1 /* parser auto-generated by pidl */
2
3 #include "includes.h"
4 #include "bin/default/librpc/gen_ndr/ndr_preg.h"
5
6 #include "librpc/gen_ndr/ndr_misc.h"
7 _PUBLIC_ enum ndr_err_code ndr_push_preg_entry(struct ndr_push *ndr, int ndr_flags, const struct preg_entry *r)
8 {
9         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
10         if (ndr_flags & NDR_SCALARS) {
11                 NDR_CHECK(ndr_push_align(ndr, 4));
12                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "[", 2, sizeof(uint8_t), CH_DOS));
13                 {
14                         uint32_t _flags_save_string = ndr->flags;
15                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
16                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->keyname));
17                         ndr->flags = _flags_save_string;
18                 }
19                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
20                 {
21                         uint32_t _flags_save_string = ndr->flags;
22                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
23                         NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->valuename));
24                         ndr->flags = _flags_save_string;
25                 }
26                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
27                 NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->type));
28                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
29                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size));
30                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
31                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->data, r->size));
32                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "]", 2, sizeof(uint8_t), CH_DOS));
33                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
34         }
35         if (ndr_flags & NDR_BUFFERS) {
36         }
37         return NDR_ERR_SUCCESS;
38 }
39
40 _PUBLIC_ enum ndr_err_code ndr_pull_preg_entry(struct ndr_pull *ndr, int ndr_flags, struct preg_entry *r)
41 {
42         uint32_t size__opening_bracket_0 = 0;
43         uint32_t size__sep1_0 = 0;
44         uint32_t size__sep2_0 = 0;
45         uint32_t size__sep3_0 = 0;
46         uint32_t size__sep4_0 = 0;
47         uint32_t size_data_0 = 0;
48         uint32_t size__closing_bracket_0 = 0;
49         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
50         if (ndr_flags & NDR_SCALARS) {
51                 NDR_CHECK(ndr_pull_align(ndr, 4));
52                 size__opening_bracket_0 = 2;
53                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_opening_bracket, size__opening_bracket_0, sizeof(uint8_t), CH_DOS));
54                 {
55                         uint32_t _flags_save_string = ndr->flags;
56                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
57                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->keyname));
58                         ndr->flags = _flags_save_string;
59                 }
60                 size__sep1_0 = 2;
61                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep1, size__sep1_0, sizeof(uint8_t), CH_DOS));
62                 {
63                         uint32_t _flags_save_string = ndr->flags;
64                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
65                         NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->valuename));
66                         ndr->flags = _flags_save_string;
67                 }
68                 size__sep2_0 = 2;
69                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep2, size__sep2_0, sizeof(uint8_t), CH_DOS));
70                 NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->type));
71                 size__sep3_0 = 2;
72                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep3, size__sep3_0, sizeof(uint8_t), CH_DOS));
73                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
74                 size__sep4_0 = 2;
75                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep4, size__sep4_0, sizeof(uint8_t), CH_DOS));
76                 size_data_0 = r->size;
77                 NDR_PULL_ALLOC_N(ndr, r->data, size_data_0);
78                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->data, size_data_0));
79                 size__closing_bracket_0 = 2;
80                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_closing_bracket, size__closing_bracket_0, sizeof(uint8_t), CH_DOS));
81                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
82         }
83         if (ndr_flags & NDR_BUFFERS) {
84         }
85         return NDR_ERR_SUCCESS;
86 }
87
88 _PUBLIC_ void ndr_print_preg_entry(struct ndr_print *ndr, const char *name, const struct preg_entry *r)
89 {
90         ndr_print_struct(ndr, name, "preg_entry");
91         if (r == NULL) { ndr_print_null(ndr); return; }
92         ndr->depth++;
93         ndr_print_string(ndr, "keyname", r->keyname);
94         ndr_print_string(ndr, "valuename", r->valuename);
95         ndr_print_winreg_Type(ndr, "type", r->type);
96         ndr_print_uint32(ndr, "size", r->size);
97         ndr_print_array_uint8(ndr, "data", r->data, r->size);
98         ndr->depth--;
99 }
100
101 _PUBLIC_ enum ndr_err_code ndr_push_preg_header(struct ndr_push *ndr, int ndr_flags, const struct preg_header *r)
102 {
103         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
104         if (ndr_flags & NDR_SCALARS) {
105                 NDR_CHECK(ndr_push_align(ndr, 4));
106                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "PReg", 4, sizeof(uint8_t), CH_DOS));
107                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
108                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
109         }
110         if (ndr_flags & NDR_BUFFERS) {
111         }
112         return NDR_ERR_SUCCESS;
113 }
114
115 _PUBLIC_ enum ndr_err_code ndr_pull_preg_header(struct ndr_pull *ndr, int ndr_flags, struct preg_header *r)
116 {
117         uint32_t size_signature_0 = 0;
118         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
119         if (ndr_flags & NDR_SCALARS) {
120                 NDR_CHECK(ndr_pull_align(ndr, 4));
121                 size_signature_0 = 4;
122                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->signature, size_signature_0, sizeof(uint8_t), CH_DOS));
123                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
124                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
125         }
126         if (ndr_flags & NDR_BUFFERS) {
127         }
128         return NDR_ERR_SUCCESS;
129 }
130
131 _PUBLIC_ void ndr_print_preg_header(struct ndr_print *ndr, const char *name, const struct preg_header *r)
132 {
133         ndr_print_struct(ndr, name, "preg_header");
134         if (r == NULL) { ndr_print_null(ndr); return; }
135         ndr->depth++;
136         ndr_print_string(ndr, "signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"PReg":r->signature);
137         ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
138         ndr->depth--;
139 }
140
141 _PUBLIC_ void ndr_print_preg_file(struct ndr_print *ndr, const char *name, const struct preg_file *r)
142 {
143         uint32_t cntr_entries_0;
144         ndr_print_struct(ndr, name, "preg_file");
145         if (r == NULL) { ndr_print_null(ndr); return; }
146         {
147                 uint32_t _flags_save_STRUCT = ndr->flags;
148                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
149                 ndr->depth++;
150                 ndr_print_preg_header(ndr, "header", &r->header);
151                 ndr_print_uint32(ndr, "num_entries", r->num_entries);
152                 ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->num_entries);
153                 ndr->depth++;
154                 for (cntr_entries_0=0;cntr_entries_0<r->num_entries;cntr_entries_0++) {
155                         ndr_print_preg_entry(ndr, "entries", &r->entries[cntr_entries_0]);
156                 }
157                 ndr->depth--;
158                 ndr->depth--;
159                 ndr->flags = _flags_save_STRUCT;
160         }
161 }
162
163 static enum ndr_err_code ndr_push_decode_preg_file(struct ndr_push *ndr, int flags, const struct decode_preg_file *r)
164 {
165         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
166         if (flags & NDR_IN) {
167                 NDR_CHECK(ndr_push_preg_file(ndr, NDR_SCALARS, &r->in.file));
168         }
169         if (flags & NDR_OUT) {
170         }
171         return NDR_ERR_SUCCESS;
172 }
173
174 static enum ndr_err_code ndr_pull_decode_preg_file(struct ndr_pull *ndr, int flags, struct decode_preg_file *r)
175 {
176         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
177         if (flags & NDR_IN) {
178                 NDR_CHECK(ndr_pull_preg_file(ndr, NDR_SCALARS, &r->in.file));
179         }
180         if (flags & NDR_OUT) {
181         }
182         return NDR_ERR_SUCCESS;
183 }
184
185 _PUBLIC_ void ndr_print_decode_preg_file(struct ndr_print *ndr, const char *name, int flags, const struct decode_preg_file *r)
186 {
187         ndr_print_struct(ndr, name, "decode_preg_file");
188         if (r == NULL) { ndr_print_null(ndr); return; }
189         ndr->depth++;
190         if (flags & NDR_SET_VALUES) {
191                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
192         }
193         if (flags & NDR_IN) {
194                 ndr_print_struct(ndr, "in", "decode_preg_file");
195                 ndr->depth++;
196                 ndr_print_preg_file(ndr, "file", &r->in.file);
197                 ndr->depth--;
198         }
199         if (flags & NDR_OUT) {
200                 ndr_print_struct(ndr, "out", "decode_preg_file");
201                 ndr->depth++;
202                 ndr->depth--;
203         }
204         ndr->depth--;
205 }
206
207 static const struct ndr_interface_call preg_calls[] = {
208         {
209                 "decode_preg_file",
210                 sizeof(struct decode_preg_file),
211                 (ndr_push_flags_fn_t) ndr_push_decode_preg_file,
212                 (ndr_pull_flags_fn_t) ndr_pull_decode_preg_file,
213                 (ndr_print_function_t) ndr_print_decode_preg_file,
214                 { 0, NULL },
215                 { 0, NULL },
216         },
217         { NULL, 0, NULL, NULL, NULL }
218 };
219
220 static const char * const preg_endpoint_strings[] = {
221         "ncacn_np:[\\pipe\\preg]", 
222 };
223
224 static const struct ndr_interface_string_array preg_endpoints = {
225         .count  = 1,
226         .names  = preg_endpoint_strings
227 };
228
229 static const char * const preg_authservice_strings[] = {
230         "host", 
231 };
232
233 static const struct ndr_interface_string_array preg_authservices = {
234         .count  = 1,
235         .names  = preg_authservice_strings
236 };
237
238
239 const struct ndr_interface_table ndr_table_preg = {
240         .name           = "preg",
241         .syntax_id      = {
242                 {0x67655250,0x0000,0x0000,{0x00,0x00},{0x00,0x00,0x00,0x00}},
243                 NDR_PREG_VERSION
244         },
245         .helpstring     = NDR_PREG_HELPSTRING,
246         .num_calls      = 1,
247         .calls          = preg_calls,
248         .endpoints      = &preg_endpoints,
249         .authservices   = &preg_authservices
250 };
251