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