123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- #ifndef _RPC_MSG_H
- #define _RPC_MSG_H 1
- #include <sys/cdefs.h>
- #include <rpc/xdr.h>
- #include <rpc/clnt.h>
- #define RPC_MSG_VERSION ((u_long) 2)
- #define RPC_SERVICE_PORT ((u_short) 2048)
- __BEGIN_DECLS
- enum msg_type {
- CALL=0,
- REPLY=1
- };
- enum reply_stat {
- MSG_ACCEPTED=0,
- MSG_DENIED=1
- };
- enum accept_stat {
- SUCCESS=0,
- PROG_UNAVAIL=1,
- PROG_MISMATCH=2,
- PROC_UNAVAIL=3,
- GARBAGE_ARGS=4,
- SYSTEM_ERR=5
- };
- enum reject_stat {
- RPC_MISMATCH=0,
- AUTH_ERROR=1
- };
- struct accepted_reply {
- struct opaque_auth ar_verf;
- enum accept_stat ar_stat;
- union {
- struct {
- u_long low;
- u_long high;
- } AR_versions;
- struct {
- caddr_t where;
- xdrproc_t proc;
- } AR_results;
-
- } ru;
- #define ar_results ru.AR_results
- #define ar_vers ru.AR_versions
- };
- struct rejected_reply {
- enum reject_stat rj_stat;
- union {
- struct {
- u_long low;
- u_long high;
- } RJ_versions;
- enum auth_stat RJ_why;
- } ru;
- #define rj_vers ru.RJ_versions
- #define rj_why ru.RJ_why
- };
- struct reply_body {
- enum reply_stat rp_stat;
- union {
- struct accepted_reply RP_ar;
- struct rejected_reply RP_dr;
- } ru;
- #define rp_acpt ru.RP_ar
- #define rp_rjct ru.RP_dr
- };
- struct call_body {
- u_long cb_rpcvers;
- u_long cb_prog;
- u_long cb_vers;
- u_long cb_proc;
- struct opaque_auth cb_cred;
- struct opaque_auth cb_verf;
- };
- struct rpc_msg {
- u_long rm_xid;
- enum msg_type rm_direction;
- union {
- struct call_body RM_cmb;
- struct reply_body RM_rmb;
- } ru;
- #define rm_call ru.RM_cmb
- #define rm_reply ru.RM_rmb
- };
- #define acpted_rply ru.RM_rmb.ru.RP_ar
- #define rjcted_rply ru.RM_rmb.ru.RP_dr
- extern bool_t xdr_callmsg (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
- extern bool_t xdr_callhdr (XDR *__xdrs, struct rpc_msg *__cmsg) __THROW;
- extern bool_t xdr_replymsg (XDR *__xdrs, struct rpc_msg *__rmsg) __THROW;
- extern void _seterr_reply (struct rpc_msg *__msg, struct rpc_err *__error)
- __THROW;
- __END_DECLS
- #endif
|