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_clnt.c next >
Encoding:
C/C++ Source or Header  |  1991-05-12  |  4.7 KB  |  182 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_clnt.c    5.3 (Berkeley) 5/12/91
  39.  *
  40.  * $Id: amq_clnt.c,v 5.2.1.3 91/05/07 22:18:52 jsp Alpha $
  41.  *
  42.  */
  43.  
  44. #include "am.h"
  45. #include "amq.h"
  46.  
  47. static struct timeval TIMEOUT = { ALLOWED_MOUNT_TIME, 0 };
  48.  
  49. voidp
  50. amqproc_null_1(argp, clnt)
  51.     voidp argp;
  52.     CLIENT *clnt;
  53. {
  54.     static char res;
  55.  
  56.     bzero((char *)&res, sizeof(res));
  57.     if (clnt_call(clnt, AMQPROC_NULL, xdr_void, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) {
  58.         return (NULL);
  59.     }
  60.     return ((voidp)&res);
  61. }
  62.  
  63.  
  64. amq_mount_tree_p *
  65. amqproc_mnttree_1(argp, clnt)
  66.     amq_string *argp;
  67.     CLIENT *clnt;
  68. {
  69.     static amq_mount_tree_p res;
  70.  
  71.     bzero((char *)&res, sizeof(res));
  72.     if (clnt_call(clnt, AMQPROC_MNTTREE, xdr_amq_string, argp, xdr_amq_mount_tree_p, &res, TIMEOUT) != RPC_SUCCESS) {
  73.         return (NULL);
  74.     }
  75.     return (&res);
  76. }
  77.  
  78.  
  79. voidp
  80. amqproc_umnt_1(argp, clnt)
  81.     amq_string *argp;
  82.     CLIENT *clnt;
  83. {
  84.     static char res;
  85.  
  86.     bzero((char *)&res, sizeof(res));
  87.     if (clnt_call(clnt, AMQPROC_UMNT, xdr_amq_string, argp, xdr_void, &res, TIMEOUT) != RPC_SUCCESS) {
  88.         return (NULL);
  89.     }
  90.     return ((voidp)&res);
  91. }
  92.  
  93.  
  94. amq_mount_stats *
  95. amqproc_stats_1(argp, clnt)
  96.     voidp argp;
  97.     CLIENT *clnt;
  98. {
  99.     static amq_mount_stats res;
  100.  
  101.     bzero((char *)&res, sizeof(res));
  102.     if (clnt_call(clnt, AMQPROC_STATS, xdr_void, argp, xdr_amq_mount_stats, &res, TIMEOUT) != RPC_SUCCESS) {
  103.         return (NULL);
  104.     }
  105.     return (&res);
  106. }
  107.  
  108.  
  109. amq_mount_tree_list *
  110. amqproc_export_1(argp, clnt)
  111.     voidp argp;
  112.     CLIENT *clnt;
  113. {
  114.     static amq_mount_tree_list res;
  115.  
  116.     bzero((char *)&res, sizeof(res));
  117.     if (clnt_call(clnt, AMQPROC_EXPORT, xdr_void, argp, xdr_amq_mount_tree_list, &res, TIMEOUT) != RPC_SUCCESS) {
  118.         return (NULL);
  119.     }
  120.     return (&res);
  121. }
  122.  
  123. int *
  124. amqproc_setopt_1(argp, clnt)
  125.     amq_setopt *argp;
  126.     CLIENT *clnt;
  127. {
  128.     static int res;
  129.  
  130.     bzero((char *)&res, sizeof(res));
  131.     if (clnt_call(clnt, AMQPROC_SETOPT, xdr_amq_setopt, argp, xdr_int, &res, TIMEOUT) != RPC_SUCCESS) {
  132.         return (NULL);
  133.     }
  134.     return (&res);
  135. }
  136.  
  137.  
  138. amq_mount_info_list *
  139. amqproc_getmntfs_1(argp, clnt)
  140.     voidp argp;
  141.     CLIENT *clnt;
  142. {
  143.     static amq_mount_info_list res;
  144.  
  145.     bzero((char *)&res, sizeof(res));
  146.     if (clnt_call(clnt, AMQPROC_GETMNTFS, xdr_void, argp, xdr_amq_mount_info_list, &res, TIMEOUT) != RPC_SUCCESS) {
  147.         return (NULL);
  148.     }
  149.     return (&res);
  150. }
  151.  
  152.  
  153. int *
  154. amqproc_mount_1(argp, clnt)
  155.     voidp argp;
  156.     CLIENT *clnt;
  157. {
  158.     static int res;
  159.  
  160.     bzero((char *)&res, sizeof(res));
  161.     if (clnt_call(clnt, AMQPROC_MOUNT, xdr_amq_string, argp, xdr_int, &res, TIMEOUT) != RPC_SUCCESS) {
  162.         return (NULL);
  163.     }
  164.     return (&res);
  165. }
  166.  
  167.  
  168. amq_string *
  169. amqproc_getvers_1(argp, clnt)
  170.     voidp argp;
  171.     CLIENT *clnt;
  172. {
  173.     static amq_string res;
  174.  
  175.     bzero((char *)&res, sizeof(res));
  176.     if (clnt_call(clnt, AMQPROC_GETVERS, xdr_void, argp, xdr_amq_string, &res, TIMEOUT) != RPC_SUCCESS) {
  177.         return (NULL);
  178.     }
  179.     return (&res);
  180. }
  181.  
  182.