/* ** File name: GETSYI_XDR.C ** ** Copyright (c) 1991, by ** Process Software Corporation ** Framingham, Massachusetts */ /* ** Except for the comments, this file is the output of RPCGEN. ** It is created by either of these commands: ** rpcgen -c -o getsyi_xdr.c getsyi.x ** rpcgen getsyi */ #include "TCPWARE_INCLUDE:RPC.H" #include "GETSYI.H" /* ** The functions xdr_item, xdr_result and xdr_message are identical. Each ** calls xdr_string with the maximum size allowed by the getsyi protocol ** (MAX_STRING_LEN). */ /******************** xdr_item() ********************/ bool_t xdr_item( xdrs, objp) XDR *xdrs; item *objp; { if( !xdr_string( xdrs, objp, MAX_STRING_LEN)) return( FALSE); return( TRUE); } /******************** xdr_result() ********************/ bool_t xdr_result( xdrs, objp) XDR *xdrs; result *objp; { if( !xdr_string( xdrs, objp, MAX_STRING_LEN)) return( FALSE); return( TRUE); } /******************** xdr_message() ********************/ bool_t xdr_message( xdrs, objp) XDR *xdrs; message *objp; { if( !xdr_string( xdrs, objp, MAX_STRING_LEN)) return( FALSE); return( TRUE); } /******************** xdr_getsyi_args() ********************/ /* ** The node name in the arguments is a string as above. The item codes are ** converted using xdr_array. ** ** The first argument to xdr_array is the standard xdr handle. The second ** argument is the address of the address of the array. This is done to allow ** memory to be allocated when the structure is converted into VAX format ** (decoded) on the server side. The address of the array size is the third ** argument. This allows the length to be written when decoding. The final ** three arguments are: the maximum size of the array, the number of bytes ** each array element will use, and the XDR function for an array element. */ bool_t xdr_getsyi_args( xdrs, objp) XDR *xdrs; getsyi_args *objp; { if( !xdr_string( xdrs, &objp->gsa_node_name, MAX_STRING_LEN)) return( FALSE); if( !xdr_array( xdrs, (char **)&objp->gsa_item_codes.gsa_item_codes_val, (u_int *)&objp->gsa_item_codes.gsa_item_codes_len, MAX_ITEM_CODES, sizeof( item), xdr_item)) { return( FALSE); } return( TRUE); } /******************** xdr_getsyi_info() ********************/ /* ** This XDR function is a call to xdr_array with the same arguments as above. */ bool_t xdr_getsyi_info( xdrs, objp) XDR *xdrs; getsyi_info *objp; { if( !xdr_array( xdrs, (char **)&objp->gsi_results.gsi_results_val, (u_int *)&objp->gsi_results.gsi_results_len, MAX_ITEM_CODES, sizeof( result), xdr_result)) { return( FALSE); } return( TRUE); } /******************** xdr_getsyi_res() ********************/ /* ** The XDR function for the server's reply. If gsr_status is 1, then the reply ** consists of a list of result strings. Otherwise, the reply is an error ** message. */ bool_t xdr_getsyi_res( xdrs, objp) XDR *xdrs; getsyi_res *objp; { if( !xdr_u_long( xdrs, &objp->gsr_status)) return( FALSE); switch( objp->gsr_status) { case 1: /* SS$_NORMAL, or success */ if( !xdr_getsyi_info( xdrs, &objp->getsyi_res_u.gsr_info)) return( FALSE); break; default: if( !xdr_message( xdrs, &objp->getsyi_res_u.gsr_msg)) return( FALSE); break; } return( TRUE); } /* end file GETSYI_XDR.C */