/crypto/external/bsd/heimdal/dist/lib/kafs/kafs_locl.h

http://www.minix3.org/ · C++ Header · 160 lines · 101 code · 25 blank · 34 comment · 2 complexity · 8f79219282b1509683686bb4b44d6597 MD5 · raw file

  1. /* $NetBSD: kafs_locl.h,v 1.1.1.2 2011/04/14 14:09:18 elric Exp $ */
  2. /*
  3. * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hรถgskolan
  4. * (Royal Institute of Technology, Stockholm, Sweden).
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. *
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. *
  18. * 3. Neither the name of the Institute nor the names of its contributors
  19. * may be used to endorse or promote products derived from this software
  20. * without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
  23. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
  26. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  27. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  28. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  29. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  31. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. */
  34. /* Id */
  35. #ifndef __KAFS_LOCL_H__
  36. #define __KAFS_LOCL_H__
  37. #ifdef HAVE_CONFIG_H
  38. #include <config.h>
  39. #endif
  40. #include <stdio.h>
  41. #include <stdlib.h>
  42. #include <string.h>
  43. #include <signal.h>
  44. #include <setjmp.h>
  45. #include <errno.h>
  46. #ifdef HAVE_SYS_TYPES_H
  47. #include <sys/types.h>
  48. #endif
  49. #ifdef HAVE_UNISTD_H
  50. #include <unistd.h>
  51. #endif
  52. #if defined(HAVE_SYS_IOCTL_H) && SunOS != 40
  53. #include <sys/ioctl.h>
  54. #endif
  55. #ifdef HAVE_SYS_FILIO_H
  56. #include <sys/filio.h>
  57. #endif
  58. #ifdef HAVE_SYS_SYSCTL_H
  59. #include <sys/sysctl.h>
  60. #endif
  61. #ifdef HAVE_SYS_SYSCALL_H
  62. #include <sys/syscall.h>
  63. #endif
  64. #ifdef HAVE_SYS_SOCKET_H
  65. #include <sys/socket.h>
  66. #endif
  67. #ifdef HAVE_NETINET_IN_H
  68. #include <netinet/in.h>
  69. #endif
  70. #ifdef HAVE_NETINET_IN6_H
  71. #include <netinet/in6.h>
  72. #endif
  73. #ifdef HAVE_NETINET6_IN6_H
  74. #include <netinet6/in6.h>
  75. #endif
  76. #ifdef HAVE_NETDB_H
  77. #include <netdb.h>
  78. #endif
  79. #ifdef HAVE_ARPA_NAMESER_H
  80. #include <arpa/nameser.h>
  81. #endif
  82. #ifdef HAVE_RESOLV_H
  83. #include <resolv.h>
  84. #endif
  85. #include <krb5/roken.h>
  86. #ifdef KRB5
  87. #include <krb5/krb5.h>
  88. #endif
  89. #ifdef KRB5
  90. #include "crypto-headers.h"
  91. #include <krb5/krb5-v4compat.h>
  92. typedef struct credentials CREDENTIALS;
  93. #endif /* KRB5 */
  94. #include <krb5/kafs.h>
  95. #include <krb5/resolve.h>
  96. #include "afssysdefs.h"
  97. struct kafs_data;
  98. struct kafs_token;
  99. typedef int (*afslog_uid_func_t)(struct kafs_data *,
  100. const char *,
  101. const char *,
  102. uid_t,
  103. const char *);
  104. typedef int (*get_cred_func_t)(struct kafs_data*, const char*, const char*,
  105. const char*, uid_t, struct kafs_token *);
  106. typedef char* (*get_realm_func_t)(struct kafs_data*, const char*);
  107. struct kafs_data {
  108. const char *name;
  109. afslog_uid_func_t afslog_uid;
  110. get_cred_func_t get_cred;
  111. get_realm_func_t get_realm;
  112. const char *(*get_error)(struct kafs_data *, int);
  113. void (*free_error)(struct kafs_data *, const char *);
  114. void *data;
  115. };
  116. struct kafs_token {
  117. struct ClearToken ct;
  118. void *ticket;
  119. size_t ticket_len;
  120. };
  121. void _kafs_foldup(char *, const char *);
  122. int _kafs_afslog_all_local_cells(struct kafs_data*, uid_t, const char*);
  123. int _kafs_get_cred(struct kafs_data*, const char*, const char*, const char *,
  124. uid_t, struct kafs_token *);
  125. int
  126. _kafs_realm_of_cell(struct kafs_data *, const char *, char **);
  127. int
  128. _kafs_v4_to_kt(CREDENTIALS *, uid_t, struct kafs_token *);
  129. void
  130. _kafs_fixup_viceid(struct ClearToken *, uid_t);
  131. #ifdef _AIX
  132. int aix_pioctl(char*, int, struct ViceIoctl*, int);
  133. int aix_setpag(void);
  134. #endif
  135. #endif /* __KAFS_LOCL_H__ */