00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef __GI_XDR_RPC_H
00018
#define __GI_XDR_RPC_H
00019
00020
00021
00026
00027
00028
enum gi_rpcmsg_type
00029 {
00030 GI_RPCMSG_CALL = 0,
00031 GI_RPCMSG_REPLY = 1
00032 };
00033
00034
enum gi_rpcmsg_rstat
00035 {
00036 GI_RPCMSG_REPLY_ACCEPTED = 0,
00037 GI_RPCMSG_REPLY_DENIED = 1
00038 };
00039
00040
enum gi_rpcmsg_astat
00041 {
00042 GI_RPCMSG_ACCEPT_SUCCESS = 0,
00043 GI_RPCMSG_ACCEPT_PROG_UNAVAIL = 1,
00044 GI_RPCMSG_ACCEPT_PROG_MISMATCH = 2,
00045 GI_RPCMSG_ACCEPT_PROC_UNAVAIL = 3,
00046 GI_RPCMSG_ACCEPT_GARBAGE_ARGS = 4,
00047 GI_RPCMSG_ACCEPT_SYSTEM_ERR = 5
00048 };
00049
00050
enum gi_rpcmsg_estat
00051 {
00052 GI_RPCMSG_REJECT_RPC_MISMATCH = 0,
00053 GI_RPCMSG_REJECT_AUTH_ERROR = 1
00054 };
00055
00056
enum gi_rpcmsg_auth_flavor
00057 {
00058 GI_RPCMSG_AUTH_NONE = 0
00059 };
00060
00061
struct gi_rpcmsg_oauth
00062 {
00063
enum gi_rpcmsg_auth_flavor flavor;
00064
void *body;
00065 };
00066
00067
struct gi_rpcmsg_call
00068 {
00069
unsigned int rpcvers;
00070
unsigned int prog;
00071
unsigned int vers;
00072
unsigned int proc;
00073
00074
struct gi_rpcmsg_oauth cred;
00075
struct gi_rpcmsg_oauth verf;
00076 };
00077
00078
struct gi_rpcmsg_acpt_reply
00079 {
00080
struct gi_rpcmsg_oauth verf;
00081
enum gi_rpcmsg_astat stat;
00082
00083
union
00084
{
00085
void *results;
00086
struct
00087
{
00088
unsigned int low;
00089
unsigned int high;
00090 } mismatch;
00091 } data;
00092 };
00093
00094
struct gi_rpcmsg_rjct_reply
00095 {
00096
enum gi_rpcmsg_estat stat;
00097
00098
union
00099
{
00100
void *stat;
00101
struct
00102
{
00103
unsigned int low;
00104
unsigned int high;
00105 } mismatch;
00106 } data;
00107 };
00108
00109
struct gi_rpcmsg_reply
00110 {
00111
enum gi_rpcmsg_rstat stat;
00112
00113
union
00114
{
00115
struct gi_rpcmsg_acpt_reply accept;
00116
struct gi_rpcmsg_rjct_reply reject;
00117 } reply;
00118 };
00119
00120
struct gi_rpcmsg
00121 {
00122
unsigned int xid;
00123
enum gi_rpcmsg_type type;
00124
00125
union
00126
{
00127
struct gi_rpcmsg_call call;
00128
struct gi_rpcmsg_reply reply;
00129 } body;
00130 };
00131
00132
00133
00138 struct gi_rpcrm
00139 {
00144 bool lastfrag;
00145
00151 uint32_t
length;
00152 };
00153
00154
00155
00156 EXTERN_C_BEGIN
00157
00158
00159
00168 LIBGIFT_EXPORT
00169
bool gi_xdr_rpcmsg (
GiXdr *xdrs,
struct gi_rpcmsg *msg,
bool rm);
00170
00178 LIBGIFT_EXPORT
00179
bool gi_xdr_rpcrm (
GiXdr *xdrs,
struct gi_rpcrm *rm);
00180
00181
00182
00183 EXTERN_C_END
00184
00185
00186
00187
#endif