Line data Source code
1 : /* parser auto-generated by pidl */
2 :
3 : #include "includes.h"
4 : #include "bin/default/source4/librpc/gen_ndr/ndr_ntp_signd.h"
5 :
6 2 : static enum ndr_err_code ndr_push_ntp_signd_op(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum ntp_signd_op r)
7 : {
8 2 : NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
9 2 : return NDR_ERR_SUCCESS;
10 : }
11 :
12 2 : static enum ndr_err_code ndr_pull_ntp_signd_op(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum ntp_signd_op *r)
13 : {
14 0 : uint32_t v;
15 2 : NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
16 2 : *r = v;
17 2 : return NDR_ERR_SUCCESS;
18 : }
19 :
20 0 : _PUBLIC_ void ndr_print_ntp_signd_op(struct ndr_print *ndr, const char *name, enum ntp_signd_op r)
21 : {
22 0 : const char *val = NULL;
23 :
24 0 : switch (r) {
25 0 : case SIGN_TO_CLIENT: val = "SIGN_TO_CLIENT"; break;
26 0 : case ASK_SERVER_TO_SIGN: val = "ASK_SERVER_TO_SIGN"; break;
27 0 : case CHECK_SERVER_SIGNATURE: val = "CHECK_SERVER_SIGNATURE"; break;
28 0 : case SIGNING_SUCCESS: val = "SIGNING_SUCCESS"; break;
29 0 : case SIGNING_FAILURE: val = "SIGNING_FAILURE"; break;
30 : }
31 0 : ndr_print_enum(ndr, name, "ENUM", val, r);
32 0 : }
33 :
34 1 : _PUBLIC_ enum ndr_err_code ndr_push_sign_request(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct sign_request *r)
35 : {
36 : {
37 1 : libndr_flags _flags_save_STRUCT = ndr->flags;
38 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
39 1 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
40 1 : if (ndr_flags & NDR_SCALARS) {
41 1 : NDR_CHECK(ndr_push_align(ndr, 4));
42 1 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NTP_SIGND_PROTOCOL_VERSION_0));
43 1 : NDR_CHECK(ndr_push_ntp_signd_op(ndr, NDR_SCALARS, r->op));
44 1 : NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->packet_id));
45 : {
46 1 : libndr_flags _flags_save_uint32 = ndr->flags;
47 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN);
48 1 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->key_id));
49 1 : ndr->flags = _flags_save_uint32;
50 : }
51 : {
52 1 : libndr_flags _flags_save_DATA_BLOB = ndr->flags;
53 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
54 1 : NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->packet_to_sign));
55 1 : ndr->flags = _flags_save_DATA_BLOB;
56 : }
57 1 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
58 : }
59 1 : if (ndr_flags & NDR_BUFFERS) {
60 0 : }
61 1 : ndr->flags = _flags_save_STRUCT;
62 : }
63 1 : return NDR_ERR_SUCCESS;
64 : }
65 :
66 1 : _PUBLIC_ enum ndr_err_code ndr_pull_sign_request(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct sign_request *r)
67 : {
68 : {
69 1 : libndr_flags _flags_save_STRUCT = ndr->flags;
70 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
71 1 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
72 1 : if (ndr_flags & NDR_SCALARS) {
73 1 : NDR_CHECK(ndr_pull_align(ndr, 4));
74 1 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
75 1 : NDR_CHECK(ndr_pull_ntp_signd_op(ndr, NDR_SCALARS, &r->op));
76 1 : NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->packet_id));
77 : {
78 1 : libndr_flags _flags_save_uint32 = ndr->flags;
79 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN);
80 1 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->key_id));
81 1 : ndr->flags = _flags_save_uint32;
82 : }
83 : {
84 1 : libndr_flags _flags_save_DATA_BLOB = ndr->flags;
85 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
86 1 : NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->packet_to_sign));
87 1 : ndr->flags = _flags_save_DATA_BLOB;
88 : }
89 1 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
90 : }
91 1 : if (ndr_flags & NDR_BUFFERS) {
92 0 : }
93 1 : ndr->flags = _flags_save_STRUCT;
94 : }
95 1 : return NDR_ERR_SUCCESS;
96 : }
97 :
98 0 : static void ndr_print_flags_sign_request(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct sign_request *r)
99 : {
100 0 : ndr_print_sign_request(ndr, name, r);
101 0 : }
102 :
103 0 : _PUBLIC_ void ndr_print_sign_request(struct ndr_print *ndr, const char *name, const struct sign_request *r)
104 : {
105 0 : ndr_print_struct(ndr, name, "sign_request");
106 0 : if (r == NULL) { ndr_print_null(ndr); return; }
107 : {
108 0 : libndr_flags _flags_save_STRUCT = ndr->flags;
109 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
110 0 : ndr->depth++;
111 0 : ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NTP_SIGND_PROTOCOL_VERSION_0:r->version);
112 0 : ndr_print_ntp_signd_op(ndr, "op", r->op);
113 0 : ndr_print_uint16(ndr, "packet_id", r->packet_id);
114 : {
115 0 : libndr_flags _flags_save_uint32 = ndr->flags;
116 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_LITTLE_ENDIAN);
117 0 : ndr_print_uint32(ndr, "key_id", r->key_id);
118 0 : ndr->flags = _flags_save_uint32;
119 : }
120 : {
121 0 : libndr_flags _flags_save_DATA_BLOB = ndr->flags;
122 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
123 0 : ndr_print_DATA_BLOB(ndr, "packet_to_sign", r->packet_to_sign);
124 0 : ndr->flags = _flags_save_DATA_BLOB;
125 : }
126 0 : ndr->depth--;
127 0 : ndr->flags = _flags_save_STRUCT;
128 : }
129 : }
130 :
131 1 : _PUBLIC_ enum ndr_err_code ndr_push_signed_reply(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct signed_reply *r)
132 : {
133 : {
134 1 : libndr_flags _flags_save_STRUCT = ndr->flags;
135 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
136 1 : NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
137 1 : if (ndr_flags & NDR_SCALARS) {
138 1 : NDR_CHECK(ndr_push_align(ndr, 4));
139 1 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, NTP_SIGND_PROTOCOL_VERSION_0));
140 1 : NDR_CHECK(ndr_push_ntp_signd_op(ndr, NDR_SCALARS, r->op));
141 1 : NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->packet_id));
142 : {
143 1 : libndr_flags _flags_save_DATA_BLOB = ndr->flags;
144 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
145 1 : NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->signed_packet));
146 1 : ndr->flags = _flags_save_DATA_BLOB;
147 : }
148 1 : NDR_CHECK(ndr_push_trailer_align(ndr, 4));
149 : }
150 1 : if (ndr_flags & NDR_BUFFERS) {
151 0 : }
152 1 : ndr->flags = _flags_save_STRUCT;
153 : }
154 1 : return NDR_ERR_SUCCESS;
155 : }
156 :
157 1 : _PUBLIC_ enum ndr_err_code ndr_pull_signed_reply(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct signed_reply *r)
158 : {
159 : {
160 1 : libndr_flags _flags_save_STRUCT = ndr->flags;
161 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
162 1 : NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
163 1 : if (ndr_flags & NDR_SCALARS) {
164 1 : NDR_CHECK(ndr_pull_align(ndr, 4));
165 1 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
166 1 : NDR_CHECK(ndr_pull_ntp_signd_op(ndr, NDR_SCALARS, &r->op));
167 1 : NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->packet_id));
168 : {
169 1 : libndr_flags _flags_save_DATA_BLOB = ndr->flags;
170 1 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
171 1 : NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->signed_packet));
172 1 : ndr->flags = _flags_save_DATA_BLOB;
173 : }
174 1 : NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
175 : }
176 1 : if (ndr_flags & NDR_BUFFERS) {
177 0 : }
178 1 : ndr->flags = _flags_save_STRUCT;
179 : }
180 1 : return NDR_ERR_SUCCESS;
181 : }
182 :
183 0 : static void ndr_print_flags_signed_reply(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct signed_reply *r)
184 : {
185 0 : ndr_print_signed_reply(ndr, name, r);
186 0 : }
187 :
188 0 : _PUBLIC_ void ndr_print_signed_reply(struct ndr_print *ndr, const char *name, const struct signed_reply *r)
189 : {
190 0 : ndr_print_struct(ndr, name, "signed_reply");
191 0 : if (r == NULL) { ndr_print_null(ndr); return; }
192 : {
193 0 : libndr_flags _flags_save_STRUCT = ndr->flags;
194 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
195 0 : ndr->depth++;
196 0 : ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?NTP_SIGND_PROTOCOL_VERSION_0:r->version);
197 0 : ndr_print_ntp_signd_op(ndr, "op", r->op);
198 0 : ndr_print_uint32(ndr, "packet_id", r->packet_id);
199 : {
200 0 : libndr_flags _flags_save_DATA_BLOB = ndr->flags;
201 0 : ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
202 0 : ndr_print_DATA_BLOB(ndr, "signed_packet", r->signed_packet);
203 0 : ndr->flags = _flags_save_DATA_BLOB;
204 : }
205 0 : ndr->depth--;
206 0 : ndr->flags = _flags_save_STRUCT;
207 : }
208 : }
209 :
210 : #ifndef SKIP_NDR_TABLE_ntp_signd
211 : static const struct ndr_interface_public_struct ntp_signd_public_structs[] = {
212 : {
213 : .name = "sign_request",
214 : .struct_size = sizeof(struct sign_request ),
215 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_sign_request,
216 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_sign_request,
217 : .ndr_print = (ndr_print_function_t) ndr_print_flags_sign_request,
218 : },
219 : {
220 : .name = "signed_reply",
221 : .struct_size = sizeof(struct signed_reply ),
222 : .ndr_push = (ndr_push_flags_fn_t) ndr_push_signed_reply,
223 : .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_signed_reply,
224 : .ndr_print = (ndr_print_function_t) ndr_print_flags_signed_reply,
225 : },
226 : { .name = NULL }
227 : };
228 :
229 : static const struct ndr_interface_call ntp_signd_calls[] = {
230 : { .name = NULL }
231 : };
232 :
233 : static const char * const ntp_signd_endpoint_strings[] = {
234 : "ncacn_np:[\\pipe\\ntp_signd]",
235 : };
236 :
237 : static const struct ndr_interface_string_array ntp_signd_endpoints = {
238 : .count = 1,
239 : .names = ntp_signd_endpoint_strings
240 : };
241 :
242 : static const char * const ntp_signd_authservice_strings[] = {
243 : "host",
244 : };
245 :
246 : static const struct ndr_interface_string_array ntp_signd_authservices = {
247 : .count = 1,
248 : .names = ntp_signd_authservice_strings
249 : };
250 :
251 :
252 : const struct ndr_interface_table ndr_table_ntp_signd = {
253 : .name = "ntp_signd",
254 : .syntax_id = {
255 : {0x0da00951,0x5b6c,0x4488,{0x9a,0x89},{0x75,0x0c,0xac,0x70,0x92,0x0c}},
256 : NDR_NTP_SIGND_VERSION
257 : },
258 : .helpstring = NDR_NTP_SIGND_HELPSTRING,
259 : .num_calls = 0,
260 : .calls = ntp_signd_calls,
261 : .num_public_structs = 2,
262 : .public_structs = ntp_signd_public_structs,
263 : .endpoints = &ntp_signd_endpoints,
264 : .authservices = &ntp_signd_authservices
265 : };
266 :
267 : #endif /* SKIP_NDR_TABLE_ntp_signd */
|