/* Program unavailable error reply */ void svcerr_noprog (register SVCXPRT *xprt) { struct rpc_msg rply; rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.acpted_rply.ar_verf = xprt->xp_verf; rply.acpted_rply.ar_stat = PROG_UNAVAIL; SVC_REPLY (xprt, &rply); }
/* Some system error */ void svcerr_systemerr (register SVCXPRT *xprt) { struct rpc_msg rply; rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.acpted_rply.ar_verf = xprt->xp_verf; rply.acpted_rply.ar_stat = SYSTEM_ERR; SVC_REPLY (xprt, &rply); }
/* Authentication error reply */ void svcerr_auth (SVCXPRT *xprt, enum auth_stat why) { struct rpc_msg rply; rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_DENIED; rply.rjcted_rply.rj_stat = AUTH_ERROR; rply.rjcted_rply.rj_why = why; SVC_REPLY (xprt, &rply); }
/* Can't decode args error reply */ void svcerr_decode (register SVCXPRT *xprt) { struct rpc_msg rply; rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.acpted_rply.ar_verf = xprt->xp_verf; rply.acpted_rply.ar_stat = GARBAGE_ARGS; SVC_REPLY (xprt, &rply); }
/* * Program version mismatch error reply */ void svcerr_progvers(SVCXPRT *xprt, u_long low_vers, u_long high_vers) { struct rpc_msg rply; rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.acpted_rply.ar_verf = xprt->xp_verf; rply.acpted_rply.ar_stat = PROG_MISMATCH; rply.acpted_rply.ar_vers.low = low_vers; rply.acpted_rply.ar_vers.high = high_vers; SVC_REPLY(xprt, &rply); }
/* * Send a reply to an rpc request */ bool_t svc_sendreply(SVCXPRT *xprt, xdrproc_t xdr_results, caddr_t xdr_location) { struct rpc_msg rply; rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.acpted_rply.ar_verf = xprt->xp_verf; rply.acpted_rply.ar_stat = SUCCESS; rply.acpted_rply.ar_results.where = xdr_location; rply.acpted_rply.ar_results.proc = xdr_results; return (SVC_REPLY(xprt, &rply)); }
/* * Some system error (MT-SAFE) */ void svcerr_systemerr(SVCXPRT *xprt, struct svc_req *req) { struct rpc_msg rply; assert(xprt != NULL); rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.rm_xid = req->rq_xid; rply.acpted_rply.ar_verf = req->rq_verf; rply.acpted_rply.ar_stat = SYSTEM_ERR; SVC_REPLY(xprt, req, &rply); }
/* * Can't decode args error reply (MT-SAFE) */ void svcerr_decode(SVCXPRT *xprt, struct svc_req *req) { struct rpc_msg rply; assert(xprt != NULL); rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.rm_xid = req->rq_xid; rply.acpted_rply.ar_verf = req->rq_verf; rply.acpted_rply.ar_stat = GARBAGE_ARGS; SVC_REPLY(xprt, req, &rply); }
/* * No procedure error reply (MT-SAFE) */ void svcerr_noproc(SVCXPRT *xprt, struct svc_req *req) { struct rpc_msg rply; assert(xprt != NULL); rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.rm_xid = req->rq_xid; rply.acpted_rply.ar_verf = req->rq_verf; rply.acpted_rply.ar_stat = PROC_UNAVAIL; SVC_REPLY(xprt, req, &rply); }
/* * Send a reply to an rpc request (MT-SAFE). * * XXX Rather than marshal an rpc_msg on the stack, we may * want another variant which takes a message, perhaps one from * a reply cache (e.g., CITI Windows NFS client). * */ bool svc_sendreply(SVCXPRT *xprt, struct svc_req *req, xdrproc_t xdr_results, void *xdr_location) { struct rpc_msg rply; assert(xprt != NULL); rply.rm_direction = REPLY; rply.rm_reply.rp_stat = MSG_ACCEPTED; rply.rm_xid = req->rq_xid; rply.acpted_rply.ar_verf = req->rq_verf; rply.acpted_rply.ar_stat = SUCCESS; rply.acpted_rply.ar_results.where = xdr_location; rply.acpted_rply.ar_results.proc = xdr_results; return (SVC_REPLY(xprt, req, &rply)); }