home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.sbin / amd / rpcx / amq_xdr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-12  |  5.5 KB  |  252 lines

  1. /*
  2.  * Copyright (c) 1990 Jan-Simon Pendry
  3.  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  4.  * Copyright (c) 1990 The Regents of the University of California.
  5.  * All rights reserved.
  6.  *
  7.  * This code is derived from software contributed to Berkeley by
  8.  * Jan-Simon Pendry at Imperial College, London.
  9.  *
  10.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions
  12.  * are met:
  13.  * 1. Redistributions of source code must retain the above copyright
  14.  *    notice, this list of conditions and the following disclaimer.
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in the
  17.  *    documentation and/or other materials provided with the distribution.
  18.  * 3. All advertising materials mentioning features or use of this software
  19.  *    must display the following acknowledgement:
  20.  *    This product includes software developed by the University of
  21.  *    California, Berkeley and its contributors.
  22.  * 4. Neither the name of the University nor the names of its contributors
  23.  *    may be used to endorse or promote products derived from this software
  24.  *    without specific prior written permission.
  25.  *
  26.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  27.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  30.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  31.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  32.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  33.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  34.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  35.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  36.  * SUCH DAMAGE.
  37.  *
  38.  *    @(#)amq_xdr.c    5.3 (Berkeley) 5/12/91
  39.  *
  40.  * $Id: amq_xdr.c,v 5.2.1.2 91/05/07 22:18:51 jsp Alpha $
  41.  *
  42.  */
  43.  
  44. #include "am.h"
  45. #include "amq.h"
  46.  
  47.  
  48. bool_t
  49. xdr_amq_string(xdrs, objp)
  50.     XDR *xdrs;
  51.     amq_string *objp;
  52. {
  53.     if (!xdr_string(xdrs, objp, AMQ_STRLEN)) {
  54.         return (FALSE);
  55.     }
  56.     return (TRUE);
  57. }
  58.  
  59.  
  60.  
  61.  
  62. bool_t
  63. xdr_time_type(xdrs, objp)
  64.     XDR *xdrs;
  65.     time_type *objp;
  66. {
  67.     if (!xdr_long(xdrs, objp)) {
  68.         return (FALSE);
  69.     }
  70.     return (TRUE);
  71. }
  72.  
  73.  
  74.  
  75.  
  76. bool_t
  77. xdr_amq_mount_tree(xdrs, objp)
  78.     XDR *xdrs;
  79.     amq_mount_tree *objp;
  80. {
  81.     if (!xdr_amq_string(xdrs, &objp->mt_mountinfo)) {
  82.         return (FALSE);
  83.     }
  84.     if (!xdr_amq_string(xdrs, &objp->mt_directory)) {
  85.         return (FALSE);
  86.     }
  87.     if (!xdr_amq_string(xdrs, &objp->mt_mountpoint)) {
  88.         return (FALSE);
  89.     }
  90.     if (!xdr_amq_string(xdrs, &objp->mt_type)) {
  91.         return (FALSE);
  92.     }
  93.     if (!xdr_time_type(xdrs, &objp->mt_mounttime)) {
  94.         return (FALSE);
  95.     }
  96.     if (!xdr_u_short(xdrs, &objp->mt_mountuid)) {
  97.         return (FALSE);
  98.     }
  99.     if (!xdr_int(xdrs, &objp->mt_getattr)) {
  100.         return (FALSE);
  101.     }
  102.     if (!xdr_int(xdrs, &objp->mt_lookup)) {
  103.         return (FALSE);
  104.     }
  105.     if (!xdr_int(xdrs, &objp->mt_readdir)) {
  106.         return (FALSE);
  107.     }
  108.     if (!xdr_int(xdrs, &objp->mt_readlink)) {
  109.         return (FALSE);
  110.     }
  111.     if (!xdr_int(xdrs, &objp->mt_statfs)) {
  112.         return (FALSE);
  113.     }
  114.     if (!xdr_pointer(xdrs, (char **)&objp->mt_next, sizeof(amq_mount_tree), xdr_amq_mount_tree)) {
  115.         return (FALSE);
  116.     }
  117.     if (!xdr_pointer(xdrs, (char **)&objp->mt_child, sizeof(amq_mount_tree), xdr_amq_mount_tree)) {
  118.         return (FALSE);
  119.     }
  120.     return (TRUE);
  121. }
  122.  
  123.  
  124.  
  125.  
  126. bool_t
  127. xdr_amq_mount_tree_p(xdrs, objp)
  128.     XDR *xdrs;
  129.     amq_mount_tree_p *objp;
  130. {
  131.     if (!xdr_pointer(xdrs, (char **)objp, sizeof(amq_mount_tree), xdr_amq_mount_tree)) {
  132.         return (FALSE);
  133.     }
  134.     return (TRUE);
  135. }
  136.  
  137.  
  138.  
  139. bool_t
  140. xdr_amq_mount_info(xdrs, objp)
  141.     XDR *xdrs;
  142.     amq_mount_info *objp;
  143. {
  144.     if (!xdr_amq_string(xdrs, &objp->mi_type)) {
  145.         return (FALSE);
  146.     }
  147.     if (!xdr_amq_string(xdrs, &objp->mi_mountpt)) {
  148.         return (FALSE);
  149.     }
  150.     if (!xdr_amq_string(xdrs, &objp->mi_mountinfo)) {
  151.         return (FALSE);
  152.     }
  153.     if (!xdr_amq_string(xdrs, &objp->mi_fserver)) {
  154.         return (FALSE);
  155.     }
  156.     if (!xdr_int(xdrs, &objp->mi_error)) {
  157.         return (FALSE);
  158.     }
  159.     if (!xdr_int(xdrs, &objp->mi_refc)) {
  160.         return (FALSE);
  161.     }
  162.     if (!xdr_int(xdrs, &objp->mi_up)) {
  163.         return (FALSE);
  164.     }
  165.     return (TRUE);
  166. }
  167.  
  168.  
  169.  
  170. bool_t
  171. xdr_amq_mount_info_list(xdrs, objp)
  172.     XDR *xdrs;
  173.     amq_mount_info_list *objp;
  174. {
  175.     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)) {
  176.         return (FALSE);
  177.     }
  178.     return (TRUE);
  179. }
  180.  
  181.  
  182.  
  183. bool_t
  184. xdr_amq_mount_tree_list(xdrs, objp)
  185.     XDR *xdrs;
  186.     amq_mount_tree_list *objp;
  187. {
  188.     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)) {
  189.         return (FALSE);
  190.     }
  191.     return (TRUE);
  192. }
  193.  
  194.  
  195.  
  196.  
  197. bool_t
  198. xdr_amq_mount_stats(xdrs, objp)
  199.     XDR *xdrs;
  200.     amq_mount_stats *objp;
  201. {
  202.     if (!xdr_int(xdrs, &objp->as_drops)) {
  203.         return (FALSE);
  204.     }
  205.     if (!xdr_int(xdrs, &objp->as_stale)) {
  206.         return (FALSE);
  207.     }
  208.     if (!xdr_int(xdrs, &objp->as_mok)) {
  209.         return (FALSE);
  210.     }
  211.     if (!xdr_int(xdrs, &objp->as_merr)) {
  212.         return (FALSE);
  213.     }
  214.     if (!xdr_int(xdrs, &objp->as_uerr)) {
  215.         return (FALSE);
  216.     }
  217.     return (TRUE);
  218. }
  219.  
  220.  
  221.  
  222.  
  223. bool_t
  224. xdr_amq_opt(xdrs, objp)
  225.     XDR *xdrs;
  226.     amq_opt *objp;
  227. {
  228.     if (!xdr_enum(xdrs, (enum_t *)objp)) {
  229.         return (FALSE);
  230.     }
  231.     return (TRUE);
  232. }
  233.  
  234.  
  235.  
  236.  
  237. bool_t
  238. xdr_amq_setopt(xdrs, objp)
  239.     XDR *xdrs;
  240.     amq_setopt *objp;
  241. {
  242.     if (!xdr_amq_opt(xdrs, &objp->as_opt)) {
  243.         return (FALSE);
  244.     }
  245.     if (!xdr_amq_string(xdrs, &objp->as_str)) {
  246.         return (FALSE);
  247.     }
  248.     return (TRUE);
  249. }
  250.  
  251.  
  252.