Deleted Added
full compact
rpc_prot.c (16283) rpc_prot.c (21086)
1/*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
8 *

--- 16 unchanged lines hidden (view full) ---

25 * Sun Microsystems, Inc.
26 * 2550 Garcia Avenue
27 * Mountain View, California 94043
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31/*static char *sccsid = "from: @(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";*/
32/*static char *sccsid = "from: @(#)rpc_prot.c 2.3 88/08/07 4.0 RPCSRC";*/
1/*
2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
8 *

--- 16 unchanged lines hidden (view full) ---

25 * Sun Microsystems, Inc.
26 * 2550 Garcia Avenue
27 * Mountain View, California 94043
28 */
29
30#if defined(LIBC_SCCS) && !defined(lint)
31/*static char *sccsid = "from: @(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";*/
32/*static char *sccsid = "from: @(#)rpc_prot.c 2.3 88/08/07 4.0 RPCSRC";*/
33static char *rcsid = "$Id: rpc_prot.c,v 1.2 1995/05/30 05:41:31 rgrimes Exp $";
33static char *rcsid = "$Id: rpc_prot.c,v 1.3 1996/06/10 20:13:06 jraynard Exp $";
34#endif
35
36/*
37 * rpc_prot.c
38 *
39 * Copyright (C) 1984, Sun Microsystems, Inc.
40 *
41 * This set of routines implements the rpc message definition,

--- 56 unchanged lines hidden (view full) ---

98 if (! xdr_enum(xdrs, (enum_t *)&(ar->ar_stat)))
99 return (FALSE);
100 switch (ar->ar_stat) {
101
102 case SUCCESS:
103 return ((*(ar->ar_results.proc))(xdrs, ar->ar_results.where));
104
105 case PROG_MISMATCH:
34#endif
35
36/*
37 * rpc_prot.c
38 *
39 * Copyright (C) 1984, Sun Microsystems, Inc.
40 *
41 * This set of routines implements the rpc message definition,

--- 56 unchanged lines hidden (view full) ---

98 if (! xdr_enum(xdrs, (enum_t *)&(ar->ar_stat)))
99 return (FALSE);
100 switch (ar->ar_stat) {
101
102 case SUCCESS:
103 return ((*(ar->ar_results.proc))(xdrs, ar->ar_results.where));
104
105 case PROG_MISMATCH:
106 if (! xdr_u_long(xdrs, &(ar->ar_vers.low)))
106 if (! xdr_u_int32_t(xdrs, &(ar->ar_vers.low)))
107 return (FALSE);
107 return (FALSE);
108 return (xdr_u_long(xdrs, &(ar->ar_vers.high)));
108 return (xdr_u_int32_t(xdrs, &(ar->ar_vers.high)));
109 default:
110 break;
111 }
112 return (TRUE); /* TRUE => open ended set of problems */
113}
114
115/*
116 * XDR the MSG_DENIED part of a reply message union

--- 5 unchanged lines hidden (view full) ---

122{
123
124 /* personalized union, rather than calling xdr_union */
125 if (! xdr_enum(xdrs, (enum_t *)&(rr->rj_stat)))
126 return (FALSE);
127 switch (rr->rj_stat) {
128
129 case RPC_MISMATCH:
109 default:
110 break;
111 }
112 return (TRUE); /* TRUE => open ended set of problems */
113}
114
115/*
116 * XDR the MSG_DENIED part of a reply message union

--- 5 unchanged lines hidden (view full) ---

122{
123
124 /* personalized union, rather than calling xdr_union */
125 if (! xdr_enum(xdrs, (enum_t *)&(rr->rj_stat)))
126 return (FALSE);
127 switch (rr->rj_stat) {
128
129 case RPC_MISMATCH:
130 if (! xdr_u_long(xdrs, &(rr->rj_vers.low)))
130 if (! xdr_u_int32_t(xdrs, &(rr->rj_vers.low)))
131 return (FALSE);
131 return (FALSE);
132 return (xdr_u_long(xdrs, &(rr->rj_vers.high)));
132 return (xdr_u_int32_t(xdrs, &(rr->rj_vers.high)));
133
134 case AUTH_ERROR:
135 return (xdr_enum(xdrs, (enum_t *)&(rr->rj_why)));
136 }
137 return (FALSE);
138}
139
140static struct xdr_discrim reply_dscrm[3] = {

--- 5 unchanged lines hidden (view full) ---

146 * XDR a reply message
147 */
148bool_t
149xdr_replymsg(xdrs, rmsg)
150 register XDR *xdrs;
151 register struct rpc_msg *rmsg;
152{
153 if (
133
134 case AUTH_ERROR:
135 return (xdr_enum(xdrs, (enum_t *)&(rr->rj_why)));
136 }
137 return (FALSE);
138}
139
140static struct xdr_discrim reply_dscrm[3] = {

--- 5 unchanged lines hidden (view full) ---

146 * XDR a reply message
147 */
148bool_t
149xdr_replymsg(xdrs, rmsg)
150 register XDR *xdrs;
151 register struct rpc_msg *rmsg;
152{
153 if (
154 xdr_u_long(xdrs, &(rmsg->rm_xid)) &&
154 xdr_u_int32_t(xdrs, &(rmsg->rm_xid)) &&
155 xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction)) &&
156 (rmsg->rm_direction == REPLY) )
157 return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat),
158 (caddr_t)&(rmsg->rm_reply.ru), reply_dscrm, NULL_xdrproc_t));
159 return (FALSE);
160}
161
162

--- 7 unchanged lines hidden (view full) ---

170 register XDR *xdrs;
171 register struct rpc_msg *cmsg;
172{
173
174 cmsg->rm_direction = CALL;
175 cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION;
176 if (
177 (xdrs->x_op == XDR_ENCODE) &&
155 xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction)) &&
156 (rmsg->rm_direction == REPLY) )
157 return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat),
158 (caddr_t)&(rmsg->rm_reply.ru), reply_dscrm, NULL_xdrproc_t));
159 return (FALSE);
160}
161
162

--- 7 unchanged lines hidden (view full) ---

170 register XDR *xdrs;
171 register struct rpc_msg *cmsg;
172{
173
174 cmsg->rm_direction = CALL;
175 cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION;
176 if (
177 (xdrs->x_op == XDR_ENCODE) &&
178 xdr_u_long(xdrs, &(cmsg->rm_xid)) &&
178 xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) &&
179 xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) &&
179 xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) &&
180 xdr_u_long(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
181 xdr_u_long(xdrs, &(cmsg->rm_call.cb_prog)) )
182 return (xdr_u_long(xdrs, &(cmsg->rm_call.cb_vers)));
180 xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) &&
181 xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) )
182 return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers)));
183 return (FALSE);
184}
185
186/* ************************** Client utility routine ************* */
187
188static void
189accepted(acpt_stat, error)
190 register enum accept_stat acpt_stat;

--- 107 unchanged lines hidden ---
183 return (FALSE);
184}
185
186/* ************************** Client utility routine ************* */
187
188static void
189accepted(acpt_stat, error)
190 register enum accept_stat acpt_stat;

--- 107 unchanged lines hidden ---