pmap.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #ifndef __RPC_PMAP_PROT_H__
  10. #define __RPC_PMAP_PROT_H__
  11. #include <rpc/xdr.h>
  12. /* The following procedures are supported by the protocol:
  13. *
  14. * PMAPPROC_NULL() returns ()
  15. * takes nothing, returns nothing
  16. *
  17. * PMAPPROC_SET(struct pmap) returns (bool_t)
  18. * TRUE is success, FALSE is failure. Registers the tuple
  19. * [prog, vers, prot, port].
  20. *
  21. * PMAPPROC_UNSET(struct pmap) returns (bool_t)
  22. * TRUE is success, FALSE is failure. Un-registers pair
  23. * [prog, vers]. prot and port are ignored.
  24. *
  25. * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
  26. * 0 is failure. Otherwise returns the port number where the pair
  27. * [prog, vers] is registered. It may lie!
  28. *
  29. * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
  30. *
  31. * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
  32. * RETURNS (port, string<>);
  33. * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
  34. * Calls the procedure on the local machine. If it is not registered,
  35. * this procedure is quite; ie it does not return error information!!!
  36. * This procedure only is supported on rpc/udp and calls via
  37. * rpc/udp. This routine only passes null authentication parameters.
  38. * This file has no interface to xdr routines for PMAPPROC_CALLIT.
  39. *
  40. * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
  41. */
  42. #define PMAPPORT ((unsigned short)111)
  43. #define PMAPPROG ((unsigned long)100000)
  44. #define PMAPVERS ((unsigned long)2)
  45. #define PMAPVERS_PROTO ((unsigned long)2)
  46. #define PMAPVERS_ORIG ((unsigned long)1)
  47. #define PMAPPROC_NULL ((unsigned long)0)
  48. #define PMAPPROC_SET ((unsigned long)1)
  49. #define PMAPPROC_UNSET ((unsigned long)2)
  50. #define PMAPPROC_GETPORT ((unsigned long)3)
  51. #define PMAPPROC_DUMP ((unsigned long)4)
  52. #define PMAPPROC_CALLIT ((unsigned long)5)
  53. struct pmap {
  54. long unsigned pm_prog;
  55. long unsigned pm_vers;
  56. long unsigned pm_prot;
  57. long unsigned pm_port;
  58. };
  59. extern bool_t xdr_pmap (XDR *__xdrs, struct pmap *__regs);
  60. #endif