/crypto/external/bsd/heimdal/dist/lib/kadm5/private.h

http://www.minix3.org/ · C++ Header · 150 lines · 98 code · 14 blank · 38 comment · 0 complexity · a6b30bc0fe2a09b61628b371de7d2b8f MD5 · raw file

  1. /* $NetBSD: private.h,v 1.1.1.2 2011/04/14 14:09:17 elric Exp $ */
  2. /*
  3. * Copyright (c) 1997-2000 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 __kadm5_privatex_h__
  36. #define __kadm5_privatex_h__
  37. struct kadm_func {
  38. kadm5_ret_t (*chpass_principal) (void *, krb5_principal, const char*);
  39. kadm5_ret_t (*create_principal) (void*, kadm5_principal_ent_t,
  40. uint32_t, const char*);
  41. kadm5_ret_t (*delete_principal) (void*, krb5_principal);
  42. kadm5_ret_t (*destroy) (void*);
  43. kadm5_ret_t (*flush) (void*);
  44. kadm5_ret_t (*get_principal) (void*, krb5_principal,
  45. kadm5_principal_ent_t, uint32_t);
  46. kadm5_ret_t (*get_principals) (void*, const char*, char***, int*);
  47. kadm5_ret_t (*get_privs) (void*, uint32_t*);
  48. kadm5_ret_t (*modify_principal) (void*, kadm5_principal_ent_t, uint32_t);
  49. kadm5_ret_t (*randkey_principal) (void*, krb5_principal,
  50. krb5_keyblock**, int*);
  51. kadm5_ret_t (*rename_principal) (void*, krb5_principal, krb5_principal);
  52. kadm5_ret_t (*chpass_principal_with_key) (void *, krb5_principal,
  53. int, krb5_key_data *);
  54. };
  55. /* XXX should be integrated */
  56. typedef struct kadm5_common_context {
  57. krb5_context context;
  58. krb5_boolean my_context;
  59. struct kadm_func funcs;
  60. void *data;
  61. }kadm5_common_context;
  62. typedef struct kadm5_log_peer {
  63. int fd;
  64. char *name;
  65. krb5_auth_context ac;
  66. struct kadm5_log_peer *next;
  67. } kadm5_log_peer;
  68. typedef struct kadm5_log_context {
  69. char *log_file;
  70. int log_fd;
  71. uint32_t version;
  72. #ifndef NO_UNIX_SOCKETS
  73. struct sockaddr_un socket_name;
  74. #else
  75. struct addrinfo *socket_info;
  76. #endif
  77. krb5_socket_t socket_fd;
  78. } kadm5_log_context;
  79. typedef struct kadm5_server_context {
  80. krb5_context context;
  81. krb5_boolean my_context;
  82. struct kadm_func funcs;
  83. /* */
  84. kadm5_config_params config;
  85. HDB *db;
  86. krb5_principal caller;
  87. unsigned acl_flags;
  88. kadm5_log_context log_context;
  89. } kadm5_server_context;
  90. typedef struct kadm5_client_context {
  91. krb5_context context;
  92. krb5_boolean my_context;
  93. struct kadm_func funcs;
  94. /* */
  95. krb5_auth_context ac;
  96. char *realm;
  97. char *admin_server;
  98. int kadmind_port;
  99. int sock;
  100. char *client_name;
  101. char *service_name;
  102. krb5_prompter_fct prompter;
  103. const char *keytab;
  104. krb5_ccache ccache;
  105. kadm5_config_params *realm_params;
  106. }kadm5_client_context;
  107. typedef struct kadm5_ad_context {
  108. krb5_context context;
  109. krb5_boolean my_context;
  110. struct kadm_func funcs;
  111. /* */
  112. kadm5_config_params config;
  113. krb5_principal caller;
  114. krb5_ccache ccache;
  115. char *client_name;
  116. char *realm;
  117. void *ldap_conn;
  118. char *base_dn;
  119. } kadm5_ad_context;
  120. enum kadm_ops {
  121. kadm_get,
  122. kadm_delete,
  123. kadm_create,
  124. kadm_rename,
  125. kadm_chpass,
  126. kadm_modify,
  127. kadm_randkey,
  128. kadm_get_privs,
  129. kadm_get_princs,
  130. kadm_chpass_with_key,
  131. kadm_nop
  132. };
  133. #define KADMIN_APPL_VERSION "KADM0.1"
  134. #define KADMIN_OLD_APPL_VERSION "KADM0.0"
  135. #include "kadm5-private.h"
  136. #endif /* __kadm5_privatex_h__ */