00001
00002
00003
00004
00005
00006 #include <rpc/rpc.h>
00007 #include <sum_rpc.h>
00008
00009 bool_t
00010 xdr_nametype(xdrs, objp)
00011 XDR *xdrs;
00012 nametype *objp;
00013 {
00014 if (!xdr_string(xdrs, objp, MAXSTRING)) {
00015 return (FALSE);
00016 }
00017 return (TRUE);
00018 }
00019
00020 bool_t
00021 xdr_keyseg(xdrs, objp)
00022 XDR *xdrs;
00023 keyseg *objp;
00024 {
00025 if (!xdr_nametype(xdrs, &objp->name)) {
00026 return (FALSE);
00027 }
00028 if (!xdr_int(xdrs, &objp->key_type)) {
00029 return (FALSE);
00030 }
00031 switch (objp->key_type) {
00032 case 1:
00033 if (!xdr_nametype(xdrs, &objp->keyseg_u.val_str)) {
00034 return (FALSE);
00035 }
00036 break;
00037 case -1:
00038 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_byte, sizeof(char), (xdrproc_t) xdr_char)) {
00039 return (FALSE);
00040 }
00041 break;
00042 case -2:
00043 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_ubyte, sizeof(u_char), (xdrproc_t) xdr_u_char)) {
00044 return (FALSE);
00045 }
00046 break;
00047 case -3:
00048 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_short, sizeof(short) , (xdrproc_t) xdr_short)) {
00049 return (FALSE);
00050 }
00051 break;
00052 case -4:
00053 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_ushort, sizeof(u_short), (xdrproc_t) xdr_u_short)) {
00054 return (FALSE);
00055 }
00056 break;
00057 case -5:
00058 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_int, sizeof(int), (xdrproc_t) xdr_int)) {
00059 return (FALSE);
00060 }
00061 break;
00062 case -6:
00063 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_uint, sizeof(u_int), (xdrproc_t) xdr_u_int)) {
00064 return (FALSE);
00065 }
00066 break;
00067 case -7:
00068 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_long, sizeof(long), (xdrproc_t) xdr_long)) {
00069 return (FALSE);
00070 }
00071 break;
00072 case -8:
00073 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_ulong, sizeof(u_long), (xdrproc_t) xdr_u_long)) {
00074 return (FALSE);
00075 }
00076 break;
00077 case -9:
00078 if (!xdr_pointer (xdrs, (char **)&objp->keyseg_u.val_uint64, sizeof (uint64_t), (xdrproc_t) xdr_uint64_t))
00079 return FALSE;
00080 break;
00081 case -10:
00082 if (!xdr_pointer (xdrs, (char **)&objp->keyseg_u.val_uint32, sizeof (uint32_t), (xdrproc_t) xdr_uint32_t))
00083 return FALSE;
00084 break;
00085 case -16:
00086 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_float, sizeof(float) , (xdrproc_t) xdr_float)) {
00087 return (FALSE);
00088 }
00089 break;
00090 case -17:
00091 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_double, sizeof(double), (xdrproc_t) xdr_double)) {
00092 return (FALSE);
00093 }
00094 break;
00095 case -32:
00096 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_FILE, sizeof(double), (xdrproc_t) xdr_double)) {
00097 return (FALSE);
00098 }
00099 break;
00100 case -33:
00101 if (!xdr_pointer(xdrs, (char **)&objp->keyseg_u.val_time, sizeof(double), (xdrproc_t) xdr_double)) {
00102 return (FALSE);
00103 }
00104 break;
00105 }
00106 return (TRUE);
00107 }
00108
00109 bool_t
00110 xdr_Rkey(xdrs, objp)
00111 XDR *xdrs;
00112 Rkey *objp;
00113 {
00114 if(!xdr_pointer(xdrs, (char **)&objp->next, sizeof(struct Rkey),(xdrproc_t)xdr_Rkey)) {
00115 return(FALSE);
00116 }
00117 if(!xdr_keyseg(xdrs, &objp->key_segment)) {
00118 return(FALSE);
00119 }
00120 return(TRUE);
00121 }
00122
00123 bool_t
00124 xdr_Sunumarray(xdrs, objp)
00125 XDR *xdrs;
00126 Sunumarray *objp;
00127 {
00128 if(!xdr_int(xdrs, &objp->reqcnt))
00129 return(FALSE);
00130 if(!xdr_int(xdrs, &objp->mode))
00131 return(FALSE);
00132 if(!xdr_int(xdrs, &objp->tdays))
00133 return(FALSE);
00134 if(!xdr_int(xdrs, &objp->reqcode))
00135 return(FALSE);
00136 if(!xdr_uint64_t(xdrs, &objp->uid))
00137 return(FALSE);
00138 if (!xdr_string(xdrs, &objp->username, MAX_STR))
00139 return(FALSE);
00140 if (!xdr_string(xdrs, &objp->machinetype, MAX_STR))
00141 return(FALSE);
00142
00143 if(xdrs->x_op == XDR_DECODE && (objp->sunums != NULL)) {
00144
00145 objp->sunums = NULL;
00146 }
00147 if(!xdr_array(xdrs, &objp->sunums, &objp->reqcnt, MAXSUNUMARRAY, sizeof(uint64_t), (xdrproc_t) xdr_uint64_t))
00148 return(FALSE);
00149 return(TRUE);
00150 }
00151
00152 bool_t
00153 xdr_Sinfoarray(xdrs, objp)
00154 XDR *xdrs;
00155 Sinfoarray *objp;
00156 {
00157 if(!xdr_int(xdrs, &objp->reqcnt))
00158 return(FALSE);
00159 if(!xdr_int(xdrs, &objp->reqcode))
00160 return(FALSE);
00161 if(!xdr_uint64_t(xdrs, &objp->uid))
00162 return(FALSE);
00163
00164 if(xdrs->x_op == XDR_DECODE && (objp->sinfo != NULL)) {
00165
00166 objp->sinfo = NULL;
00167 }
00168 if(!xdr_array(xdrs, &objp->sinfo, &objp->reqcnt, MAXSUNUMARRAY, sizeof(SUM_info_t), (xdrproc_t) xdr_sum_info_t))
00169 return(FALSE);
00170 return(TRUE);
00171 }
00172
00173 bool_t
00174 xdr_sum_info_t(xdrs, objp)
00175 XDR *xdrs;
00176 SUM_info_t *objp;
00177 {
00178 if(!xdr_pointer(xdrs, &(objp->next), sizeof(SUM_info_t), xdr_sum_info_t))
00179 return (FALSE);
00180
00181 if(!xdr_uint64_t(xdrs, &objp->sunum))
00182 return(FALSE);
00183
00184 if (!xdr_opaque(xdrs, objp->online_loc, 81))
00185 return (FALSE);
00186
00187 if (!xdr_opaque(xdrs, objp->online_status, 5))
00188 return (FALSE);
00189
00190 if (!xdr_opaque(xdrs, objp->archive_status, 5))
00191 return (FALSE);
00192
00193 if (!xdr_opaque(xdrs, objp->offsite_ack, 5))
00194 return (FALSE);
00195
00196 if (!xdr_opaque(xdrs, objp->history_comment, 81))
00197 return (FALSE);
00198
00199 if (!xdr_opaque(xdrs, objp->owning_series, 81))
00200 return (FALSE);
00201 if(!xdr_int(xdrs, &objp->storage_group))
00202 return(FALSE);
00203 if(!xdr_double(xdrs, &objp->bytes))
00204 return(FALSE);
00205
00206 if (!xdr_opaque(xdrs, objp->creat_date, 32))
00207 return (FALSE);
00208
00209 if (!xdr_opaque(xdrs, objp->username, 11))
00210 return (FALSE);
00211
00212 if (!xdr_opaque(xdrs, objp->arch_tape, 21))
00213 return (FALSE);
00214 if(!xdr_int(xdrs, &objp->arch_tape_fn))
00215 return(FALSE);
00216
00217 if (!xdr_opaque(xdrs, objp->arch_tape_date, 32))
00218 return (FALSE);
00219
00220 if (!xdr_opaque(xdrs, objp->safe_tape, 21))
00221 return (FALSE);
00222 if(!xdr_int(xdrs, &objp->safe_tape_fn))
00223 return(FALSE);
00224
00225 if (!xdr_opaque(xdrs, objp->safe_tape_date, 32))
00226 return (FALSE);
00227 if(!xdr_int(xdrs, &objp->pa_status))
00228 return(FALSE);
00229 if(!xdr_int(xdrs, &objp->pa_substatus))
00230 return(FALSE);
00231
00232 if (!xdr_opaque(xdrs, objp->effective_date, 20))
00233 return (FALSE);
00234 }