dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / krb5 / kadm5 / clnt / client_rpc.c
blob407c85b4cd89df1d801250cb960df6610c31c56c
1 /*
2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
7 /*
8 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
10 * Openvision retains the copyright to derivative works of
11 * this source code. Do *NOT* create a derivative of this
12 * source code before consulting with your legal department.
13 * Do *NOT* integrate *ANY* of this source code into another
14 * product before consulting with your legal department.
16 * For further information, read the top-level Openvision
17 * copyright which is contained in the top-level MIT Kerberos
18 * copyright.
20 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
25 #include <rpc/rpc.h> /* SUNWresync121 XXX */
26 #include <kadm5/kadm_rpc.h>
27 #include <krb5.h>
28 #include <kadm5/admin.h>
29 #ifdef HAVE_MEMORY_H
30 #include <memory.h>
31 #endif
33 /* Default timeout can be changed using clnt_control() */
34 static struct timeval TIMEOUT = { 25, 0 };
36 generic_ret *
37 create_principal_2(cprinc_arg *argp, CLIENT *clnt)
39 static generic_ret clnt_res;
41 /* Solaris Kerberos */
42 if (clnt == NULL)
43 return (NULL);
44 memset((char *)&clnt_res, 0, sizeof(clnt_res));
45 if (clnt_call(clnt, CREATE_PRINCIPAL,
46 (xdrproc_t) xdr_cprinc_arg, (caddr_t) argp,
47 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
48 TIMEOUT) != RPC_SUCCESS) {
49 return (NULL);
51 return (&clnt_res);
54 generic_ret *
55 create_principal3_2(cprinc3_arg *argp, CLIENT *clnt)
57 static generic_ret clnt_res;
59 /* Solaris Kerberos */
60 if (clnt == NULL)
61 return (NULL);
62 memset((char *)&clnt_res, 0, sizeof(clnt_res));
63 if (clnt_call(clnt, CREATE_PRINCIPAL3,
64 (xdrproc_t) xdr_cprinc3_arg, (caddr_t) argp,
65 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
66 TIMEOUT) != RPC_SUCCESS) {
67 return (NULL);
69 return (&clnt_res);
72 generic_ret *
73 delete_principal_2(dprinc_arg *argp, CLIENT *clnt)
75 static generic_ret clnt_res;
77 /* Solaris Kerberos */
78 if (clnt == NULL)
79 return (NULL);
80 memset((char *)&clnt_res, 0, sizeof(clnt_res));
81 if (clnt_call(clnt, DELETE_PRINCIPAL,
82 (xdrproc_t) xdr_dprinc_arg, (caddr_t) argp,
83 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
84 TIMEOUT) != RPC_SUCCESS) {
85 return (NULL);
87 return (&clnt_res);
90 generic_ret *
91 modify_principal_2(mprinc_arg *argp, CLIENT *clnt)
93 static generic_ret clnt_res;
95 /* Solaris Kerberos */
96 if (clnt == NULL)
97 return (NULL);
98 memset((char *)&clnt_res, 0, sizeof(clnt_res));
99 if (clnt_call(clnt, MODIFY_PRINCIPAL,
100 (xdrproc_t) xdr_mprinc_arg, (caddr_t) argp,
101 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
102 TIMEOUT) != RPC_SUCCESS) {
103 return (NULL);
105 return (&clnt_res);
108 generic_ret *
109 rename_principal_2(rprinc_arg *argp, CLIENT *clnt)
111 static generic_ret clnt_res;
113 /* Solaris Kerberos */
114 if (clnt == NULL)
115 return (NULL);
116 memset((char *)&clnt_res, 0, sizeof(clnt_res));
117 if (clnt_call(clnt, RENAME_PRINCIPAL,
118 (xdrproc_t) xdr_rprinc_arg, (caddr_t) argp,
119 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
120 TIMEOUT) != RPC_SUCCESS) {
121 return (NULL);
123 return (&clnt_res);
126 gprinc_ret *
127 get_principal_2(gprinc_arg *argp, CLIENT *clnt)
129 static gprinc_ret clnt_res;
131 /* Solaris Kerberos */
132 if (clnt == NULL)
133 return (NULL);
134 memset((char *)&clnt_res, 0, sizeof(clnt_res));
135 if (clnt_call(clnt, GET_PRINCIPAL,
136 (xdrproc_t) xdr_gprinc_arg, (caddr_t) argp,
137 (xdrproc_t) xdr_gprinc_ret, (caddr_t) &clnt_res,
138 TIMEOUT) != RPC_SUCCESS) {
139 return (NULL);
141 return (&clnt_res);
144 gprincs_ret *
145 get_princs_2(gprincs_arg *argp, CLIENT *clnt)
147 static gprincs_ret clnt_res;
149 /* Solaris Kerberos */
150 if (clnt == NULL)
151 return (NULL);
152 memset((char *)&clnt_res, 0, sizeof(clnt_res));
153 if (clnt_call(clnt, GET_PRINCS,
154 (xdrproc_t) xdr_gprincs_arg, (caddr_t) argp,
155 (xdrproc_t) xdr_gprincs_ret, (caddr_t) &clnt_res,
156 TIMEOUT) != RPC_SUCCESS) {
157 return (NULL);
159 return (&clnt_res);
162 generic_ret *
163 chpass_principal_2(chpass_arg *argp, CLIENT *clnt)
165 static generic_ret clnt_res;
167 /* Solaris Kerberos */
168 if (clnt == NULL)
169 return (NULL);
170 memset((char *)&clnt_res, 0, sizeof(clnt_res));
171 if (clnt_call(clnt, CHPASS_PRINCIPAL,
172 (xdrproc_t) xdr_chpass_arg, (caddr_t) argp,
173 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
174 TIMEOUT) != RPC_SUCCESS) {
175 return (NULL);
177 return (&clnt_res);
180 generic_ret *
181 chpass_principal3_2(chpass3_arg *argp, CLIENT *clnt)
183 static generic_ret clnt_res;
185 /* Solaris Kerberos */
186 if (clnt == NULL)
187 return (NULL);
188 memset((char *)&clnt_res, 0, sizeof(clnt_res));
189 if (clnt_call(clnt, CHPASS_PRINCIPAL3,
190 (xdrproc_t) xdr_chpass3_arg, (caddr_t) argp,
191 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
192 TIMEOUT) != RPC_SUCCESS) {
193 return (NULL);
195 return (&clnt_res);
198 generic_ret *
199 setv4key_principal_2(setv4key_arg *argp, CLIENT *clnt)
201 static generic_ret clnt_res;
203 /* Solaris Kerberos */
204 if (clnt == NULL)
205 return (NULL);
206 memset((char *)&clnt_res, 0, sizeof(clnt_res));
207 if (clnt_call(clnt, SETV4KEY_PRINCIPAL,
208 (xdrproc_t) xdr_setv4key_arg, (caddr_t) argp,
209 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
210 TIMEOUT) != RPC_SUCCESS) {
211 return (NULL);
213 return (&clnt_res);
216 generic_ret *
217 setkey_principal_2(setkey_arg *argp, CLIENT *clnt)
219 static generic_ret clnt_res;
221 /* Solaris Kerberos */
222 if (clnt == NULL)
223 return (NULL);
224 memset((char *)&clnt_res, 0, sizeof(clnt_res));
225 if (clnt_call(clnt, SETKEY_PRINCIPAL,
226 (xdrproc_t) xdr_setkey_arg, (caddr_t) argp,
227 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
228 TIMEOUT) != RPC_SUCCESS) {
229 return (NULL);
231 return (&clnt_res);
234 generic_ret *
235 setkey_principal3_2(setkey3_arg *argp, CLIENT *clnt)
237 static generic_ret clnt_res;
239 /* Solaris Kerberos */
240 if (clnt == NULL)
241 return (NULL);
242 memset((char *)&clnt_res, 0, sizeof(clnt_res));
243 if (clnt_call(clnt, SETKEY_PRINCIPAL3,
244 (xdrproc_t) xdr_setkey3_arg, (caddr_t) argp,
245 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
246 TIMEOUT) != RPC_SUCCESS) {
247 return (NULL);
249 return (&clnt_res);
252 chrand_ret *
253 chrand_principal_2(chrand_arg *argp, CLIENT *clnt)
255 static chrand_ret clnt_res;
257 /* Solaris Kerberos */
258 if (clnt == NULL)
259 return (NULL);
260 memset((char *)&clnt_res, 0, sizeof(clnt_res));
261 if (clnt_call(clnt, CHRAND_PRINCIPAL,
262 (xdrproc_t) xdr_chrand_arg, (caddr_t) argp,
263 (xdrproc_t) xdr_chrand_ret, (caddr_t) &clnt_res,
264 TIMEOUT) != RPC_SUCCESS) {
265 return (NULL);
267 return (&clnt_res);
270 chrand_ret *
271 chrand_principal3_2(chrand3_arg *argp, CLIENT *clnt)
273 static chrand_ret clnt_res;
275 /* Solaris Kerberos */
276 if (clnt == NULL)
277 return (NULL);
278 memset((char *)&clnt_res, 0, sizeof(clnt_res));
279 if (clnt_call(clnt, CHRAND_PRINCIPAL3,
280 (xdrproc_t) xdr_chrand3_arg, (caddr_t) argp,
281 (xdrproc_t) xdr_chrand_ret, (caddr_t) &clnt_res,
282 TIMEOUT) != RPC_SUCCESS) {
283 return (NULL);
285 return (&clnt_res);
288 generic_ret *
289 create_policy_2(cpol_arg *argp, CLIENT *clnt)
291 static generic_ret clnt_res;
293 /* Solaris Kerberos */
294 if (clnt == NULL)
295 return (NULL);
296 memset((char *)&clnt_res, 0, sizeof(clnt_res));
297 if (clnt_call(clnt, CREATE_POLICY,
298 (xdrproc_t) xdr_cpol_arg, (caddr_t) argp,
299 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
300 TIMEOUT) != RPC_SUCCESS) {
301 return (NULL);
303 return (&clnt_res);
306 generic_ret *
307 delete_policy_2(dpol_arg *argp, CLIENT *clnt)
309 static generic_ret clnt_res;
311 /* Solaris Kerberos */
312 if (clnt == NULL)
313 return (NULL);
314 memset((char *)&clnt_res, 0, sizeof(clnt_res));
315 if (clnt_call(clnt, DELETE_POLICY,
316 (xdrproc_t) xdr_dpol_arg, (caddr_t) argp,
317 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
318 TIMEOUT) != RPC_SUCCESS) {
319 return (NULL);
321 return (&clnt_res);
324 generic_ret *
325 modify_policy_2(mpol_arg *argp, CLIENT *clnt)
327 static generic_ret clnt_res;
329 /* Solaris Kerberos */
330 if (clnt == NULL)
331 return (NULL);
332 memset((char *)&clnt_res, 0, sizeof(clnt_res));
333 if (clnt_call(clnt, MODIFY_POLICY,
334 (xdrproc_t) xdr_mpol_arg, (caddr_t) argp,
335 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
336 TIMEOUT) != RPC_SUCCESS) {
337 return (NULL);
339 return (&clnt_res);
342 gpol_ret *
343 get_policy_2(gpol_arg *argp, CLIENT *clnt)
345 static gpol_ret clnt_res;
347 /* Solaris Kerberos */
348 if (clnt == NULL)
349 return (NULL);
350 memset((char *)&clnt_res, 0, sizeof(clnt_res));
351 if (clnt_call(clnt, GET_POLICY,
352 (xdrproc_t) xdr_gpol_arg, (caddr_t) argp,
353 (xdrproc_t) xdr_gpol_ret, (caddr_t) &clnt_res,
354 TIMEOUT) != RPC_SUCCESS) {
355 return (NULL);
357 return (&clnt_res);
360 gpols_ret *
361 get_pols_2(gpols_arg *argp, CLIENT *clnt)
363 static gpols_ret clnt_res;
365 /* Solaris Kerberos */
366 if (clnt == NULL)
367 return (NULL);
368 memset((char *)&clnt_res, 0, sizeof(clnt_res));
369 if (clnt_call(clnt, GET_POLS,
370 (xdrproc_t) xdr_gpols_arg, (caddr_t) argp,
371 (xdrproc_t) xdr_gpols_ret, (caddr_t) &clnt_res,
372 TIMEOUT) != RPC_SUCCESS) {
373 return (NULL);
375 return (&clnt_res);
378 getprivs_ret *
379 get_privs_2(void *argp, CLIENT *clnt)
381 static getprivs_ret clnt_res;
383 /* Solaris Kerberos */
384 if (clnt == NULL)
385 return (NULL);
386 memset((char *)&clnt_res, 0, sizeof(clnt_res));
387 if (clnt_call(clnt, GET_PRIVS,
388 (xdrproc_t) xdr_u_int, (caddr_t) argp,
389 (xdrproc_t) xdr_getprivs_ret, (caddr_t) &clnt_res,
390 TIMEOUT) != RPC_SUCCESS) {
391 return (NULL);
393 return (&clnt_res);
396 generic_ret *
397 init_2(void *argp, CLIENT *clnt)
399 static generic_ret clnt_res;
401 /* Solaris Kerberos */
402 if (clnt == NULL)
403 return (NULL);
405 memset((char *)&clnt_res, 0, sizeof(clnt_res));
406 if (clnt_call(clnt, INIT,
407 (xdrproc_t) xdr_u_int, (caddr_t) argp,
408 (xdrproc_t) xdr_generic_ret, (caddr_t) &clnt_res,
409 TIMEOUT) != RPC_SUCCESS) {
410 return (NULL);
412 return (&clnt_res);