diff options
author | Simo Sorce <simo@redhat.com> | 2012-01-18 14:05:14 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-01-19 15:18:39 -0500 |
commit | d5651d2e98cd80e450b88693b08591567b74f0c1 (patch) | |
tree | aec74d851d34d75ef56de0097477cc9ade5e582f /x-files | |
parent | 3b1168e92bacdad1d9b3d181516db92145edf905 (diff) | |
download | gss-proxy-d5651d2e98cd80e450b88693b08591567b74f0c1.tar.gz gss-proxy-d5651d2e98cd80e450b88693b08591567b74f0c1.tar.xz gss-proxy-d5651d2e98cd80e450b88693b08591567b74f0c1.zip |
Add gp_rpc.x file
Created by Nico and prefixed by me to avoid conflicts with system headers.
Diffstat (limited to 'x-files')
-rw-r--r-- | x-files/gp_rpc.x | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/x-files/gp_rpc.x b/x-files/gp_rpc.x new file mode 100644 index 0000000..bed5cfe --- /dev/null +++ b/x-files/gp_rpc.x @@ -0,0 +1,129 @@ +enum gp_rpc_auth_flavor { + GP_RPC_AUTH_NONE = 0, + GP_RPC_AUTH_SYS = 1, + GP_RPC_AUTH_SHORT = 2, + GP_RPC_AUTH_DH = 3, + GP_RPC_RPCSEC_GSS = 6 + /* and more to be defined */ +}; + +struct gp_rpc_opaque_auth { + gp_rpc_auth_flavor flavor; + opaque body<400>; +}; + +enum gp_rpc_msg_type { + GP_RPC_CALL = 0, + GP_RPC_REPLY = 1 +}; + +enum gp_rpc_reply_status { + GP_RPC_MSG_ACCEPTED = 0, + GP_RPC_MSG_DENIED = 1 +}; + +enum gp_rpc_accept_status { + GP_RPC_SUCCESS = 0, /* RPC executed successfully */ + GP_RPC_PROG_UNAVAIL = 1, /* remote hasn't exported program */ + GP_RPC_PROG_MISMATCH = 2, /* remote can't support version # */ + GP_RPC_PROC_UNAVAIL = 3, /* program can't support procedure */ + GP_RPC_GARBAGE_ARGS = 4, /* procedure can't decode params */ + GP_RPC_SYSTEM_ERR = 5 /* e.g. memory allocation failure */ +}; + +enum gp_rpc_reject_status { + GP_RPC_RPC_MISMATCH = 0, /* RPC version number != 2 */ + GP_RPC_AUTH_ERROR = 1 /* remote can't authenticate caller */ +}; + +enum gp_rpc_auth_status { + GP_RPC_AUTH_OK = 0, /* success */ + /* + * failed at remote end + */ + GP_RPC_AUTH_BADCRED = 1, /* bad credential (seal broken) */ + GP_RPC_AUTH_REJECTEDCRED = 2, /* client must begin new session */ + GP_RPC_AUTH_BADVERF = 3, /* bad verifier (seal broken) */ + GP_RPC_AUTH_REJECTEDVERF = 4, /* verifier expired or replayed */ + GP_RPC_AUTH_TOOWEAK = 5, /* rejected for security reasons */ + /* + * failed locally + */ + GP_RPC_AUTH_INVALIDRESP = 6, /* bogus response verifier */ + GP_RPC_AUTH_FAILED = 7, /* reason unknown */ + /* + * AUTH_KERB errors; deprecated. See [RFC2695] + */ + GP_RPC_AUTH_KERB_GENERIC = 8, /* kerberos generic error */ + GP_RPC_AUTH_TIMEEXPIRE = 9, /* time of credential expired */ + GP_RPC_AUTH_TKT_FILE = 10, /* problem with ticket file */ + GP_RPC_AUTH_DECODE = 11, /* can't decode authenticator */ + GP_RPC_AUTH_NET_ADDR = 12, /* wrong net address in ticket */ + /* + * RPCSEC_GSS GSS related errors + */ + GP_RPC_RPCSEC_GSS_CREDPROBLEM = 13, /* no credentials for user */ + GP_RPC_RPCSEC_GSS_CTXPROBLEM = 14 /* problem with context */ +}; + +struct gp_rpc_mismatch_info { + unsigned int low; + unsigned int high; +}; + +union gp_rpc_reply_union switch (gp_rpc_accept_status status) { + case GP_RPC_SUCCESS: + opaque results[0]; + /* + * procedure-specific results start here + */ + case GP_RPC_PROG_MISMATCH: + gp_rpc_mismatch_info mismatch_info; + default: + /* + * Void. Cases include PROG_UNAVAIL, PROC_UNAVAIL, + * GARBAGE_ARGS, and SYSTEM_ERR. + */ + void; +}; + +struct gp_rpc_accepted_reply { + gp_rpc_opaque_auth verf; + gp_rpc_reply_union reply_data; +}; + +union gp_rpc_rejected_reply switch (gp_rpc_reject_status status) { + case GP_RPC_RPC_MISMATCH: + gp_rpc_mismatch_info mismatch_info; + case GP_RPC_AUTH_ERROR: + gp_rpc_auth_status status; +}; +struct gp_rpc_call_header { + unsigned int rpcvers; /* must be equal to two (2) */ + unsigned int prog; + unsigned int vers; + unsigned int proc; + gp_rpc_opaque_auth cred; + gp_rpc_opaque_auth verf; + /* procedure-specific parameters start here */ +}; + +union gp_rpc_reply_header switch (gp_rpc_reply_status status) { + case GP_RPC_MSG_ACCEPTED: + gp_rpc_accepted_reply accepted; + case GP_RPC_MSG_DENIED: + gp_rpc_rejected_reply rejected; +}; + +union gp_rpc_msg_union switch (gp_rpc_msg_type type) { + case GP_RPC_CALL: + gp_rpc_call_header chdr; + case GP_RPC_REPLY: + gp_rpc_reply_header rhdr; +}; + +struct gp_rpc_msg { + unsigned int xid; + gp_rpc_msg_union header; +}; + |