Back to index

glibc  2.9
pmap_clnt.h
Go to the documentation of this file.
00001 /* @(#)pmap_clnt.h   2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */
00002 /*
00003  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
00004  * unrestricted use provided that this legend is included on all tape
00005  * media and as a part of the software program in whole or part.  Users
00006  * may copy or modify Sun RPC without charge, but are not authorized
00007  * to license or distribute it to anyone else except as part of a product or
00008  * program developed by the user.
00009  *
00010  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
00011  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
00012  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
00013  *
00014  * Sun RPC is provided with no support and without any obligation on the
00015  * part of Sun Microsystems, Inc. to assist in its use, correction,
00016  * modification or enhancement.
00017  *
00018  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
00019  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
00020  * OR ANY PART THEREOF.
00021  *
00022  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
00023  * or profits or other special, indirect and consequential damages, even if
00024  * Sun has been advised of the possibility of such damages.
00025  *
00026  * Sun Microsystems, Inc.
00027  * 2550 Garcia Avenue
00028  * Mountain View, California  94043
00029  */
00030 
00031 /*
00032  * pmap_clnt.h
00033  * Supplies C routines to get to portmap services.
00034  *
00035  * Copyright (C) 1984, Sun Microsystems, Inc.
00036  */
00037 
00038 #ifndef _RPC_PMAP_CLNT_H
00039 #define _RPC_PMAP_CLNT_H    1
00040 
00041 #include <features.h>
00042 #include <rpc/types.h>
00043 #include <rpc/xdr.h>
00044 #include <rpc/clnt.h>
00045 
00046 __BEGIN_DECLS
00047 
00048 typedef bool_t (*resultproc_t) (caddr_t resp, struct sockaddr_in *raddr);
00049 
00050 /*
00051  * Usage:
00052  *     success = pmap_set(program, version, protocol, port);
00053  *     success = pmap_unset(program, version);
00054  *     port = pmap_getport(address, program, version, protocol);
00055  *     head = pmap_getmaps(address);
00056  *     clnt_stat = pmap_rmtcall(address, program, version, procedure,
00057  *            xdrargs, argsp, xdrres, resp, tout, port_ptr)
00058  *            (works for udp only.)
00059  *     clnt_stat = clnt_broadcast(program, version, procedure,
00060  *            xdrargs, argsp,      xdrres, resp, eachresult)
00061  *            (like pmap_rmtcall, except the call is broadcasted to all
00062  *            locally connected nets.  For each valid response received,
00063  *            the procedure eachresult is called.  Its form is:
00064  *     done = eachresult(resp, raddr)
00065  *            bool_t done;
00066  *            caddr_t resp;
00067  *            struct sockaddr_in raddr;
00068  *            where resp points to the results of the call and raddr is the
00069  *            address if the responder to the broadcast.
00070  */
00071 
00072 extern bool_t pmap_set (__const u_long __program, __const u_long __vers,
00073                      int __protocol, u_short __port) __THROW;
00074 extern bool_t pmap_unset (__const u_long __program, __const u_long __vers)
00075      __THROW;
00076 extern struct pmaplist *pmap_getmaps (struct sockaddr_in *__address) __THROW;
00077 extern enum clnt_stat pmap_rmtcall (struct sockaddr_in *__addr,
00078                                 __const u_long __prog,
00079                                 __const u_long __vers,
00080                                 __const u_long __proc,
00081                                 xdrproc_t __xdrargs,
00082                                 caddr_t __argsp, xdrproc_t __xdrres,
00083                                 caddr_t __resp, struct timeval __tout,
00084                                 u_long *__port_ptr) __THROW;
00085 extern enum clnt_stat clnt_broadcast (__const u_long __prog,
00086                                   __const u_long __vers,
00087                                   __const u_long __proc, xdrproc_t __xargs,
00088                                   caddr_t __argsp, xdrproc_t __xresults,
00089                                   caddr_t __resultsp,
00090                                   resultproc_t __eachresult) __THROW;
00091 extern u_short pmap_getport (struct sockaddr_in *__address,
00092                           __const u_long __program,
00093                           __const u_long __version, u_int __protocol)
00094      __THROW;
00095 
00096 __END_DECLS
00097 
00098 #endif /* rpc/pmap_clnt.h */