xref: /onnv-gate/usr/src/cmd/krb5/slave/kpropd_rpc.c (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
3*0Sstevel@tonic-gate  * Use is subject to license terms.
4*0Sstevel@tonic-gate  */
5*0Sstevel@tonic-gate 
6*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
7*0Sstevel@tonic-gate 
8*0Sstevel@tonic-gate #include <iprop_hdr.h>
9*0Sstevel@tonic-gate #include "iprop.h"
10*0Sstevel@tonic-gate #include <stdio.h>
11*0Sstevel@tonic-gate #include <stdlib.h>
12*0Sstevel@tonic-gate 
13*0Sstevel@tonic-gate /*
14*0Sstevel@tonic-gate  * Default timeout can be changed using clnt_control()
15*0Sstevel@tonic-gate  */
16*0Sstevel@tonic-gate static struct timeval TIMEOUT = { 25, 0 };
17*0Sstevel@tonic-gate 
18*0Sstevel@tonic-gate kdb_incr_result_t *
iprop_get_updates_1(argp,clnt)19*0Sstevel@tonic-gate iprop_get_updates_1(argp, clnt)
20*0Sstevel@tonic-gate 	kdb_last_t *argp;
21*0Sstevel@tonic-gate 	CLIENT *clnt;
22*0Sstevel@tonic-gate {
23*0Sstevel@tonic-gate 	static kdb_incr_result_t clnt_res;
24*0Sstevel@tonic-gate 
25*0Sstevel@tonic-gate 	memset((char *)&clnt_res, 0, sizeof (clnt_res));
26*0Sstevel@tonic-gate 	if (clnt_call(clnt, IPROP_GET_UPDATES,
27*0Sstevel@tonic-gate 		(xdrproc_t)xdr_kdb_last_t, (caddr_t)argp,
28*0Sstevel@tonic-gate 		(xdrproc_t)xdr_kdb_incr_result_t, (caddr_t)&clnt_res,
29*0Sstevel@tonic-gate 		TIMEOUT) != RPC_SUCCESS) {
30*0Sstevel@tonic-gate 		return (NULL);
31*0Sstevel@tonic-gate 	}
32*0Sstevel@tonic-gate 	return (&clnt_res);
33*0Sstevel@tonic-gate }
34*0Sstevel@tonic-gate 
35*0Sstevel@tonic-gate kdb_fullresync_result_t *
iprop_full_resync_1(argp,clnt)36*0Sstevel@tonic-gate iprop_full_resync_1(argp, clnt)
37*0Sstevel@tonic-gate 	void *argp;
38*0Sstevel@tonic-gate 	CLIENT *clnt;
39*0Sstevel@tonic-gate {
40*0Sstevel@tonic-gate 	static kdb_fullresync_result_t clnt_res;
41*0Sstevel@tonic-gate 
42*0Sstevel@tonic-gate 	memset((char *)&clnt_res, 0, sizeof (clnt_res));
43*0Sstevel@tonic-gate 	if (clnt_call(clnt, IPROP_FULL_RESYNC,
44*0Sstevel@tonic-gate 		(xdrproc_t)xdr_void, (caddr_t)argp,
45*0Sstevel@tonic-gate 		(xdrproc_t)xdr_kdb_fullresync_result_t, (caddr_t)&clnt_res,
46*0Sstevel@tonic-gate 		TIMEOUT) != RPC_SUCCESS) {
47*0Sstevel@tonic-gate 		return (NULL);
48*0Sstevel@tonic-gate 	}
49*0Sstevel@tonic-gate 	return (&clnt_res);
50*0Sstevel@tonic-gate }
51