home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / nfs / amd / amd-5.2 / rpcx / amq_xdr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-23  |  4.7 KB  |  237 lines

  1. /*
  2.  * $Id: amq_xdr.c,v 5.2 90/06/23 22:20:14 jsp Rel $
  3.  *
  4.  * Copyright (c) 1990 Jan-Simon Pendry
  5.  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  6.  * Copyright (c) 1990 The Regents of the University of California.
  7.  * All rights reserved.
  8.  *
  9.  * This code is derived from software contributed to Berkeley by
  10.  * Jan-Simon Pendry at Imperial College, London.
  11.  *
  12.  * Redistribution and use in source and binary forms are permitted provided
  13.  * that: (1) source distributions retain this entire copyright notice and
  14.  * comment, and (2) distributions including binaries display the following
  15.  * acknowledgement:  ``This product includes software developed by the
  16.  * University of California, Berkeley and its contributors'' in the
  17.  * documentation or other materials provided with the distribution and in
  18.  * all advertising materials mentioning features or use of this software.
  19.  * Neither the name of the University nor the names of its contributors may
  20.  * be used to endorse or promote products derived from this software without
  21.  * specific prior written permission.
  22.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  23.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  24.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  25.  *
  26.  *    %W% (Berkeley) %G%
  27.  */
  28.  
  29. #include "am.h"
  30. #include "amq.h"
  31.  
  32.  
  33. bool_t
  34. xdr_amq_string(xdrs, objp)
  35.     XDR *xdrs;
  36.     amq_string *objp;
  37. {
  38.     if (!xdr_string(xdrs, objp, AMQ_STRLEN)) {
  39.         return (FALSE);
  40.     }
  41.     return (TRUE);
  42. }
  43.  
  44.  
  45.  
  46.  
  47. bool_t
  48. xdr_time_type(xdrs, objp)
  49.     XDR *xdrs;
  50.     time_type *objp;
  51. {
  52.     if (!xdr_long(xdrs, objp)) {
  53.         return (FALSE);
  54.     }
  55.     return (TRUE);
  56. }
  57.  
  58.  
  59.  
  60.  
  61. bool_t
  62. xdr_amq_mount_tree(xdrs, objp)
  63.     XDR *xdrs;
  64.     amq_mount_tree *objp;
  65. {
  66.     if (!xdr_amq_string(xdrs, &objp->mt_mountinfo)) {
  67.         return (FALSE);
  68.     }
  69.     if (!xdr_amq_string(xdrs, &objp->mt_directory)) {
  70.         return (FALSE);
  71.     }
  72.     if (!xdr_amq_string(xdrs, &objp->mt_mountpoint)) {
  73.         return (FALSE);
  74.     }
  75.     if (!xdr_amq_string(xdrs, &objp->mt_type)) {
  76.         return (FALSE);
  77.     }
  78.     if (!xdr_time_type(xdrs, &objp->mt_mounttime)) {
  79.         return (FALSE);
  80.     }
  81.     if (!xdr_u_short(xdrs, &objp->mt_mountuid)) {
  82.         return (FALSE);
  83.     }
  84.     if (!xdr_int(xdrs, &objp->mt_getattr)) {
  85.         return (FALSE);
  86.     }
  87.     if (!xdr_int(xdrs, &objp->mt_lookup)) {
  88.         return (FALSE);
  89.     }
  90.     if (!xdr_int(xdrs, &objp->mt_readdir)) {
  91.         return (FALSE);
  92.     }
  93.     if (!xdr_int(xdrs, &objp->mt_readlink)) {
  94.         return (FALSE);
  95.     }
  96.     if (!xdr_int(xdrs, &objp->mt_statfs)) {
  97.         return (FALSE);
  98.     }
  99.     if (!xdr_pointer(xdrs, (char **)&objp->mt_next, sizeof(amq_mount_tree), xdr_amq_mount_tree)) {
  100.         return (FALSE);
  101.     }
  102.     if (!xdr_pointer(xdrs, (char **)&objp->mt_child, sizeof(amq_mount_tree), xdr_amq_mount_tree)) {
  103.         return (FALSE);
  104.     }
  105.     return (TRUE);
  106. }
  107.  
  108.  
  109.  
  110.  
  111. bool_t
  112. xdr_amq_mount_tree_p(xdrs, objp)
  113.     XDR *xdrs;
  114.     amq_mount_tree_p *objp;
  115. {
  116.     if (!xdr_pointer(xdrs, (char **)objp, sizeof(amq_mount_tree), xdr_amq_mount_tree)) {
  117.         return (FALSE);
  118.     }
  119.     return (TRUE);
  120. }
  121.  
  122.  
  123.  
  124. bool_t
  125. xdr_amq_mount_info(xdrs, objp)
  126.     XDR *xdrs;
  127.     amq_mount_info *objp;
  128. {
  129.     if (!xdr_amq_string(xdrs, &objp->mi_type)) {
  130.         return (FALSE);
  131.     }
  132.     if (!xdr_amq_string(xdrs, &objp->mi_mountpt)) {
  133.         return (FALSE);
  134.     }
  135.     if (!xdr_amq_string(xdrs, &objp->mi_mountinfo)) {
  136.         return (FALSE);
  137.     }
  138.     if (!xdr_amq_string(xdrs, &objp->mi_fserver)) {
  139.         return (FALSE);
  140.     }
  141.     if (!xdr_int(xdrs, &objp->mi_error)) {
  142.         return (FALSE);
  143.     }
  144.     if (!xdr_int(xdrs, &objp->mi_refc)) {
  145.         return (FALSE);
  146.     }
  147.     if (!xdr_int(xdrs, &objp->mi_up)) {
  148.         return (FALSE);
  149.     }
  150.     return (TRUE);
  151. }
  152.  
  153.  
  154.  
  155. bool_t
  156. xdr_amq_mount_info_list(xdrs, objp)
  157.     XDR *xdrs;
  158.     amq_mount_info_list *objp;
  159. {
  160.     if (!xdr_array(xdrs, (char **)&objp->amq_mount_info_list_val, (u_int *)&objp->amq_mount_info_list_len, ~0, sizeof(amq_mount_info), xdr_amq_mount_info)) {
  161.         return (FALSE);
  162.     }
  163.     return (TRUE);
  164. }
  165.  
  166.  
  167.  
  168. bool_t
  169. xdr_amq_mount_tree_list(xdrs, objp)
  170.     XDR *xdrs;
  171.     amq_mount_tree_list *objp;
  172. {
  173.     if (!xdr_array(xdrs, (char **)&objp->amq_mount_tree_list_val, (u_int *)&objp->amq_mount_tree_list_len, ~0, sizeof(amq_mount_tree_p), xdr_amq_mount_tree_p)) {
  174.         return (FALSE);
  175.     }
  176.     return (TRUE);
  177. }
  178.  
  179.  
  180.  
  181.  
  182. bool_t
  183. xdr_amq_mount_stats(xdrs, objp)
  184.     XDR *xdrs;
  185.     amq_mount_stats *objp;
  186. {
  187.     if (!xdr_int(xdrs, &objp->as_drops)) {
  188.         return (FALSE);
  189.     }
  190.     if (!xdr_int(xdrs, &objp->as_stale)) {
  191.         return (FALSE);
  192.     }
  193.     if (!xdr_int(xdrs, &objp->as_mok)) {
  194.         return (FALSE);
  195.     }
  196.     if (!xdr_int(xdrs, &objp->as_merr)) {
  197.         return (FALSE);
  198.     }
  199.     if (!xdr_int(xdrs, &objp->as_uerr)) {
  200.         return (FALSE);
  201.     }
  202.     return (TRUE);
  203. }
  204.  
  205.  
  206.  
  207.  
  208. bool_t
  209. xdr_amq_opt(xdrs, objp)
  210.     XDR *xdrs;
  211.     amq_opt *objp;
  212. {
  213.     if (!xdr_enum(xdrs, (enum_t *)objp)) {
  214.         return (FALSE);
  215.     }
  216.     return (TRUE);
  217. }
  218.  
  219.  
  220.  
  221.  
  222. bool_t
  223. xdr_amq_setopt(xdrs, objp)
  224.     XDR *xdrs;
  225.     amq_setopt *objp;
  226. {
  227.     if (!xdr_amq_opt(xdrs, &objp->as_opt)) {
  228.         return (FALSE);
  229.     }
  230.     if (!xdr_amq_string(xdrs, &objp->as_str)) {
  231.         return (FALSE);
  232.     }
  233.     return (TRUE);
  234. }
  235.  
  236.  
  237.