2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
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
20 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
25 #include <rpc/rpc.h> /* SUNWresync121 XXX */
26 #include <kadm5/kadm_rpc.h>
28 #include <kadm5/admin.h>
33 /* Default timeout can be changed using clnt_control() */
34 static struct timeval TIMEOUT
= { 25, 0 };
37 create_principal_2(cprinc_arg
*argp
, CLIENT
*clnt
)
39 static generic_ret clnt_res
;
41 /* Solaris Kerberos */
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
) {
55 create_principal3_2(cprinc3_arg
*argp
, CLIENT
*clnt
)
57 static generic_ret clnt_res
;
59 /* Solaris Kerberos */
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
) {
73 delete_principal_2(dprinc_arg
*argp
, CLIENT
*clnt
)
75 static generic_ret clnt_res
;
77 /* Solaris Kerberos */
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
) {
91 modify_principal_2(mprinc_arg
*argp
, CLIENT
*clnt
)
93 static generic_ret clnt_res
;
95 /* Solaris Kerberos */
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
) {
109 rename_principal_2(rprinc_arg
*argp
, CLIENT
*clnt
)
111 static generic_ret clnt_res
;
113 /* Solaris Kerberos */
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
) {
127 get_principal_2(gprinc_arg
*argp
, CLIENT
*clnt
)
129 static gprinc_ret clnt_res
;
131 /* Solaris Kerberos */
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
) {
145 get_princs_2(gprincs_arg
*argp
, CLIENT
*clnt
)
147 static gprincs_ret clnt_res
;
149 /* Solaris Kerberos */
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
) {
163 chpass_principal_2(chpass_arg
*argp
, CLIENT
*clnt
)
165 static generic_ret clnt_res
;
167 /* Solaris Kerberos */
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
) {
181 chpass_principal3_2(chpass3_arg
*argp
, CLIENT
*clnt
)
183 static generic_ret clnt_res
;
185 /* Solaris Kerberos */
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
) {
199 setv4key_principal_2(setv4key_arg
*argp
, CLIENT
*clnt
)
201 static generic_ret clnt_res
;
203 /* Solaris Kerberos */
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
) {
217 setkey_principal_2(setkey_arg
*argp
, CLIENT
*clnt
)
219 static generic_ret clnt_res
;
221 /* Solaris Kerberos */
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
) {
235 setkey_principal3_2(setkey3_arg
*argp
, CLIENT
*clnt
)
237 static generic_ret clnt_res
;
239 /* Solaris Kerberos */
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
) {
253 chrand_principal_2(chrand_arg
*argp
, CLIENT
*clnt
)
255 static chrand_ret clnt_res
;
257 /* Solaris Kerberos */
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
) {
271 chrand_principal3_2(chrand3_arg
*argp
, CLIENT
*clnt
)
273 static chrand_ret clnt_res
;
275 /* Solaris Kerberos */
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
) {
289 create_policy_2(cpol_arg
*argp
, CLIENT
*clnt
)
291 static generic_ret clnt_res
;
293 /* Solaris Kerberos */
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
) {
307 delete_policy_2(dpol_arg
*argp
, CLIENT
*clnt
)
309 static generic_ret clnt_res
;
311 /* Solaris Kerberos */
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
) {
325 modify_policy_2(mpol_arg
*argp
, CLIENT
*clnt
)
327 static generic_ret clnt_res
;
329 /* Solaris Kerberos */
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
) {
343 get_policy_2(gpol_arg
*argp
, CLIENT
*clnt
)
345 static gpol_ret clnt_res
;
347 /* Solaris Kerberos */
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
) {
361 get_pols_2(gpols_arg
*argp
, CLIENT
*clnt
)
363 static gpols_ret clnt_res
;
365 /* Solaris Kerberos */
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
) {
379 get_privs_2(void *argp
, CLIENT
*clnt
)
381 static getprivs_ret clnt_res
;
383 /* Solaris Kerberos */
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
) {
397 init_2(void *argp
, CLIENT
*clnt
)
399 static generic_ret clnt_res
;
401 /* Solaris Kerberos */
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
) {