dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libc / port / nsl / svid_funcs.c
blob9ea59ac630df587436c9b6c3e7567b6a7be9f927
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 #pragma ident "%Z%%M% %I% %E% SMI"
31 * These functions are documented in the SVID as being part of libnsl.
32 * They are also defined as macros in various RPC header files. To
33 * ensure that these interfaces exist as functions, we've created this
34 * (we hope unused) file.
37 #include "mt.h"
38 #include <rpc/rpc.h>
39 #include <sys/types.h>
40 #include <synch.h>
42 #undef auth_destroy
43 #undef clnt_call
44 #undef clnt_send
45 #undef clnt_control
46 #undef clnt_destroy
47 #undef clnt_freeres
48 #undef clnt_geterr
49 #undef svc_destroy
50 #undef svc_freeargs
51 #undef svc_getargs
52 #undef svc_getrpccaller
53 #undef xdr_destroy
54 #undef xdr_getpos
55 #undef xdr_inline
56 #undef xdr_setpos
58 extern int __svc_versquiet_get();
59 extern void __svc_versquiet_off();
60 extern void __svc_versquiet_on();
62 void
63 auth_destroy(AUTH *auth)
65 ((*((auth)->ah_ops->ah_destroy))(auth));
68 enum clnt_stat
69 clnt_call(CLIENT *cl, uint32_t proc, xdrproc_t xargs, caddr_t argsp,
70 xdrproc_t xres, caddr_t resp, struct timeval timeout)
72 return ((*(cl)->cl_ops->cl_call)(cl, proc, xargs, argsp, xres, resp,
73 timeout));
76 enum clnt_stat
77 clnt_send(CLIENT *cl, uint32_t proc, xdrproc_t xargs, caddr_t argsp)
79 return ((*(cl)->cl_ops->cl_send)(cl, proc, xargs, argsp));
82 bool_t
83 clnt_control(CLIENT *cl, uint_t rq, char *in)
85 return ((*(cl)->cl_ops->cl_control)(cl, rq, in));
88 void
89 clnt_destroy(CLIENT *cl)
91 ((*(cl)->cl_ops->cl_destroy)(cl));
94 bool_t
95 clnt_freeres(CLIENT *cl, xdrproc_t xres, caddr_t resp)
97 return ((*(cl)->cl_ops->cl_freeres)(cl, xres, resp));
100 void
101 clnt_geterr(CLIENT *cl, struct rpc_err *errp)
103 (*(cl)->cl_ops->cl_geterr)(cl, errp);
106 bool_t
107 svc_control(SVCXPRT *xprt, const uint_t rq, void *in)
109 switch (rq) {
110 case SVCGET_VERSQUIET:
111 *((int *)in) = __svc_versquiet_get(xprt);
112 return (TRUE);
113 case SVCSET_VERSQUIET:
114 if (*((int *)in) == 0)
115 __svc_versquiet_off(xprt);
116 else
117 __svc_versquiet_on(xprt);
118 return (TRUE);
119 default:
120 return ((*(xprt)->xp_ops->xp_control)(xprt, rq, in));
124 void
125 svc_destroy(SVCXPRT *xprt)
127 (*(xprt)->xp_ops->xp_destroy)(xprt);
130 bool_t
131 svc_freeargs(SVCXPRT *xprt, xdrproc_t xargs, char *argsp)
133 return ((*(xprt)->xp_ops->xp_freeargs)(xprt, xargs, argsp));
136 bool_t
137 svc_getargs(SVCXPRT *xprt, xdrproc_t xargs, char *argsp)
139 return ((*(xprt)->xp_ops->xp_getargs)(xprt, xargs, argsp));
142 struct netbuf *
143 svc_getrpccaller(SVCXPRT *xprt)
145 return (&(xprt)->xp_rtaddr);
148 void
149 xdr_destroy(XDR *xdrs)
151 (*(xdrs)->x_ops->x_destroy)(xdrs);
154 uint_t
155 xdr_getpos(XDR *xdrs)
157 return ((*(xdrs)->x_ops->x_getpostn)(xdrs));
160 rpc_inline_t *
161 xdr_inline(XDR *xdrs, int len)
163 return ((*(xdrs)->x_ops->x_inline)(xdrs, len));
166 bool_t
167 xdr_setpos(XDR *xdrs, uint_t pos)
169 return ((*(xdrs)->x_ops->x_setpostn)(xdrs, pos));