ypclnt.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* Copyright (C) 1996-2020 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifndef __RPCSVC_YPCLNT_H__
  16. #define __RPCSVC_YPCLNT_H__
  17. #include <features.h>
  18. /* Some defines */
  19. #define YPERR_SUCCESS 0 /* There is no error */
  20. #define YPERR_BADARGS 1 /* Args to function are bad */
  21. #define YPERR_RPC 2 /* RPC failure */
  22. #define YPERR_DOMAIN 3 /* Can't bind to a server with this domain */
  23. #define YPERR_MAP 4 /* No such map in server's domain */
  24. #define YPERR_KEY 5 /* No such key in map */
  25. #define YPERR_YPERR 6 /* Internal yp server or client error */
  26. #define YPERR_RESRC 7 /* Local resource allocation failure */
  27. #define YPERR_NOMORE 8 /* No more records in map database */
  28. #define YPERR_PMAP 9 /* Can't communicate with portmapper */
  29. #define YPERR_YPBIND 10 /* Can't communicate with ypbind */
  30. #define YPERR_YPSERV 11 /* Can't communicate with ypserv */
  31. #define YPERR_NODOM 12 /* Local domain name not set */
  32. #define YPERR_BADDB 13 /* yp data base is bad */
  33. #define YPERR_VERS 14 /* YP version mismatch */
  34. #define YPERR_ACCESS 15 /* Access violation */
  35. #define YPERR_BUSY 16 /* Database is busy */
  36. /* Types of update operations */
  37. #define YPOP_CHANGE 1 /* Change, do not add */
  38. #define YPOP_INSERT 2 /* Add, do not change */
  39. #define YPOP_DELETE 3 /* Delete this entry */
  40. #define YPOP_STORE 4 /* Add, or change */
  41. __BEGIN_DECLS
  42. /* struct ypall_callback * is the arg which must be passed to yp_all. */
  43. struct ypall_callback
  44. {
  45. int (*foreach) (int __status, char *__key, int __keylen,
  46. char *__val, int __vallen, char *__data);
  47. char *data;
  48. };
  49. /* External NIS client function references. */
  50. extern int yp_bind (const char *) __THROW;
  51. extern void yp_unbind (const char *) __THROW;
  52. extern int yp_get_default_domain (char **) __THROW;
  53. extern int yp_match (const char *, const char *, const char *,
  54. const int, char **, int *) __THROW;
  55. extern int yp_first (const char *, const char *, char **,
  56. int *, char **, int *) __THROW;
  57. extern int yp_next (const char *, const char *, const char *,
  58. const int, char **, int *, char **, int *) __THROW;
  59. extern int yp_master (const char *, const char *, char **) __THROW;
  60. extern int yp_order (const char *, const char *, unsigned int *) __THROW;
  61. extern int yp_all (const char *, const char *,
  62. const struct ypall_callback *) __THROW;
  63. extern const char *yperr_string (const int) __THROW;
  64. extern const char *ypbinderr_string (const int) __THROW;
  65. extern int ypprot_err (const int) __THROW;
  66. extern int yp_update (char *, char *, unsigned int, char *,
  67. int, char *, int) __THROW;
  68. /* This functions exists only under BSD and Linux systems. */
  69. extern int __yp_check (char **) __THROW;
  70. __END_DECLS
  71. #endif /* __RPCSVC_YPCLNT_H__ */