pmap_clnt.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:4k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* portmap_clnt.h - Supplies C routines to get to portmap services. */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4.  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  5.  * unrestricted use provided that this legend is included on all tape
  6.  * media and as a part of the software program in whole or part.  Users
  7.  * may copy or modify Sun RPC without charge, but are not authorized
  8.  * to license or distribute it to anyone else except as part of a product or
  9.  * program developed by the user.
  10.  *
  11.  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  12.  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  13.  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  14.  *
  15.  * Sun RPC is provided with no support and without any obligation on the
  16.  * part of Sun Microsystems, Inc. to assist in its use, correction,
  17.  * modification or enhancement.
  18.  *
  19.  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  20.  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  21.  * OR ANY PART THEREOF.
  22.  *
  23.  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  24.  * or profits or other special, indirect and consequential damages, even if
  25.  * Sun has been advised of the possibility of such damages.
  26.  *
  27.  * Sun Microsystems, Inc.
  28.  * 2550 Garcia Avenue
  29.  * Mountain View, California  94043
  30.  */
  31. /* @(#)pmap_clnt.h 1.1 86/02/03 SMI */
  32. /*
  33.  * portmap_clnt.h
  34.  * Supplies C routines to get to portmap services.
  35.  *
  36.  * Copyright (C) 1984, Sun Microsystems, Inc.
  37.  */
  38. /*
  39. modification history
  40. --------------------
  41. 01h,22sep92,rrr  added support for c++
  42. 01g,26may92,rrr  the tree shuffle
  43. 01f,04oct91,rrr  passed through the ansification filter
  44.   -fixed broken prototype
  45.   -fixed #else and #endif
  46.   -changed copyright notice
  47. 01e,21jan91,shl  fxied typo in prototypes.
  48. 01d,24oct90,shl  deleted redundant function declarations.
  49. 01c,05oct90,shl  added ANSI function prototypes.
  50.                  added copyright notice.
  51. 01b,27oct89,hjb  added modification history and #ifndef's to avoid multiple
  52.  inclusion.
  53. */
  54. #ifndef __INCpmap_clnth
  55. #define __INCpmap_clnth
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. /*
  60.  * Usage:
  61.  * success = pmap_set(program, version, protocol, port);
  62.  * success = pmap_unset(program, version);
  63.  * port = pmap_getport(address, program, version, protocol);
  64.  * head = pmap_getmaps(address);
  65.  * clnt_stat = pmap_rmtcall(address, program, version, procedure,
  66.  * xdrargs, argsp, xdrres, resp, tout, port_ptr)
  67.  * (works for udp only.)
  68.  *  clnt_stat = clnt_broadcast(program, version, procedure,
  69.  * xdrargs, argsp, xdrres, resp, eachresult)
  70.  * (like pmap_rmtcall, except the call is broadcasted to all
  71.  * locally connected nets.  For each valid response received,
  72.  * the procedure eachresult is called.  Its form is:
  73.  * done = eachresult(resp, raddr)
  74.  * bool_t done;
  75.  * caddr_t resp;
  76.  * struct sockaddr_in raddr;
  77.  * where resp points to the results of the call and raddr is the
  78.  * address if the responder to the broadcast.
  79.  */
  80. /* function declarations */
  81. #if defined(__STDC__) || defined(__cplusplus)
  82. extern   bool_t       pmap_set (u_long program, u_long version,
  83.  u_long protocol, int port);
  84. extern   bool_t       pmap_unset (u_long program, u_long version);
  85. extern   struct       pmaplist *pmap_getmaps (struct sockaddr_in *address);
  86. extern   u_short      pmap_getport (struct sockaddr_in *address, u_long
  87.      program, u_long version, u_long protocol);
  88. extern   enum clnt_stat pmap_rmtcall (struct sockaddr_in *addr, u_long prog,
  89.         u_long vers, u_long proc, xdrproc_t xdrargs,
  90. caddr_t argsp, xdrproc_t xdrres, caddr_t resp,
  91. struct timeval tout, u_long *port_ptr);
  92. extern    enum clnt_stat clnt_broadcast (u_long prog, u_long vers, u_long proc,
  93. xdrproc_t xargs, caddr_t argsp,
  94. xdrproc_t xresults, caddr_t resultsp,
  95. bool_t (*eachresult)());
  96. #else
  97. extern   bool_t       pmap_set ();
  98. extern   bool_t       pmap_unset ();
  99. extern   struct       pmaplist *pmap_getmaps ();
  100. extern   u_short      pmap_getport ();
  101. extern    enum clnt_stat pmap_rmtcall();
  102. extern    enum clnt_stat clnt_broadcast();
  103. #endif /* __STDC__ */
  104. #ifdef __cplusplus
  105. }
  106. #endif
  107. #endif /* __INCpmap_clnth */