1 1.1 elric /* $NetBSD: kadmin_locl.h,v 1.2 2017/01/28 21:31:44 christos Exp $ */ 2 1.1 elric 3 1.1 elric /* 4 1.1 elric * Copyright (c) 1997-2004 Kungliga Tekniska Hgskolan 5 1.1 elric * (Royal Institute of Technology, Stockholm, Sweden). 6 1.1 elric * All rights reserved. 7 1.1 elric * 8 1.1 elric * Redistribution and use in source and binary forms, with or without 9 1.1 elric * modification, are permitted provided that the following conditions 10 1.1 elric * are met: 11 1.1 elric * 12 1.1 elric * 1. Redistributions of source code must retain the above copyright 13 1.1 elric * notice, this list of conditions and the following disclaimer. 14 1.1 elric * 15 1.1 elric * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 elric * notice, this list of conditions and the following disclaimer in the 17 1.1 elric * documentation and/or other materials provided with the distribution. 18 1.1 elric * 19 1.1 elric * 3. Neither the name of the Institute nor the names of its contributors 20 1.1 elric * may be used to endorse or promote products derived from this software 21 1.1 elric * without specific prior written permission. 22 1.1 elric * 23 1.1 elric * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 24 1.1 elric * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 1.1 elric * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 1.1 elric * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 27 1.1 elric * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 1.1 elric * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 1.1 elric * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 1.1 elric * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 1.1 elric * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 1.1 elric * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 1.1 elric * SUCH DAMAGE. 34 1.1 elric */ 35 1.1 elric 36 1.1 elric /* 37 1.2 christos * Id 38 1.1 elric */ 39 1.1 elric 40 1.1 elric #ifndef __ADMIN_LOCL_H__ 41 1.1 elric #define __ADMIN_LOCL_H__ 42 1.1 elric 43 1.1 elric #include <config.h> 44 1.1 elric 45 1.1 elric #include <stdio.h> 46 1.1 elric #include <stdlib.h> 47 1.1 elric #include <string.h> 48 1.1 elric #include <ctype.h> 49 1.1 elric #include <errno.h> 50 1.1 elric #include <limits.h> 51 1.1 elric #ifdef HAVE_SYS_TYPES_H 52 1.1 elric #include <sys/types.h> 53 1.1 elric #endif 54 1.1 elric #ifdef HAVE_SYS_SELECT_H 55 1.1 elric #include <sys/select.h> 56 1.1 elric #endif 57 1.1 elric #ifdef HAVE_FCNTL_H 58 1.1 elric #include <fcntl.h> 59 1.1 elric #endif 60 1.1 elric #ifdef HAVE_SYS_SOCKET_H 61 1.1 elric #include <sys/socket.h> 62 1.1 elric #endif 63 1.1 elric #ifdef HAVE_SYS_SELECT_H 64 1.1 elric #include <sys/select.h> 65 1.1 elric #endif 66 1.1 elric #ifdef HAVE_NETINET_IN_H 67 1.1 elric #include <netinet/in.h> 68 1.1 elric #endif 69 1.1 elric #ifdef HAVE_NETINET_IN6_H 70 1.1 elric #include <netinet/in6.h> 71 1.1 elric #endif 72 1.1 elric #ifdef HAVE_NETINET6_IN6_H 73 1.1 elric #include <netinet6/in6.h> 74 1.1 elric #endif 75 1.1 elric 76 1.1 elric #ifdef HAVE_UTIL_H 77 1.1 elric #include <util.h> 78 1.1 elric #endif 79 1.1 elric #ifdef HAVE_LIBUTIL_H 80 1.1 elric #include <libutil.h> 81 1.1 elric #endif 82 1.1 elric #ifdef HAVE_NETDB_H 83 1.1 elric #include <netdb.h> 84 1.1 elric #endif 85 1.1 elric #ifdef HAVE_SYS_UN_H 86 1.1 elric #include <sys/un.h> 87 1.1 elric #endif 88 1.1 elric #include <err.h> 89 1.1 elric #include <krb5/roken.h> 90 1.1 elric #include <krb5/krb5.h> 91 1.1 elric #include <krb5_locl.h> 92 1.1 elric #include <krb5/hdb.h> 93 1.1 elric #include <krb5/hdb_err.h> 94 1.1 elric #include <krb5/hex.h> 95 1.1 elric #include <kadm5/admin.h> 96 1.1 elric #include <kadm5/private.h> 97 1.1 elric #include <kadm5/kadm5_err.h> 98 1.1 elric #include <krb5/parse_time.h> 99 1.1 elric #include <krb5/getarg.h> 100 1.1 elric 101 1.1 elric extern krb5_context context; 102 1.1 elric extern void * kadm_handle; 103 1.1 elric 104 1.1 elric #undef ALLOC 105 1.1 elric #define ALLOC(X) ((X) = malloc(sizeof(*(X)))) 106 1.1 elric 107 1.1 elric /* util.c */ 108 1.1 elric 109 1.1 elric void attributes2str(krb5_flags, char *, size_t); 110 1.1 elric int str2attributes(const char *, krb5_flags *); 111 1.1 elric int parse_attributes (const char *, krb5_flags *, int *, int); 112 1.1 elric int edit_attributes (const char *, krb5_flags *, int *, int); 113 1.1 elric 114 1.2 christos int parse_policy (const char *, char **, int *, int); 115 1.2 christos int edit_policy (const char *, char **, int *, int); 116 1.2 christos 117 1.1 elric void time_t2str(time_t, char *, size_t, int); 118 1.1 elric int str2time_t (const char *, time_t *); 119 1.1 elric int parse_timet (const char *, krb5_timestamp *, int *, int); 120 1.1 elric int edit_timet (const char *, krb5_timestamp *, int *, 121 1.1 elric int); 122 1.1 elric 123 1.1 elric void deltat2str(unsigned, char *, size_t); 124 1.1 elric int str2deltat(const char *, krb5_deltat *); 125 1.1 elric int parse_deltat (const char *, krb5_deltat *, int *, int); 126 1.1 elric int edit_deltat (const char *, krb5_deltat *, int *, int); 127 1.1 elric 128 1.1 elric int edit_entry(kadm5_principal_ent_t, int *, kadm5_principal_ent_t, int); 129 1.1 elric void set_defaults(kadm5_principal_ent_t, int *, kadm5_principal_ent_t, int); 130 1.1 elric int set_entry(krb5_context, kadm5_principal_ent_t, int *, 131 1.1 elric const char *, const char *, const char *, 132 1.2 christos const char *, const char *, const char *); 133 1.1 elric int 134 1.1 elric foreach_principal(const char *, int (*)(krb5_principal, void*), 135 1.1 elric const char *, void *); 136 1.1 elric 137 1.1 elric int parse_des_key (const char *, krb5_key_data *, const char **); 138 1.1 elric 139 1.1 elric /* random_password.c */ 140 1.1 elric 141 1.1 elric void 142 1.1 elric random_password(char *, size_t); 143 1.1 elric 144 1.1 elric /* kadm_conn.c */ 145 1.1 elric 146 1.1 elric extern sig_atomic_t term_flag, doing_useful_work; 147 1.1 elric 148 1.1 elric void parse_ports(krb5_context, const char*); 149 1.1 elric void start_server(krb5_context, const char*); 150 1.1 elric 151 1.1 elric /* server.c */ 152 1.1 elric 153 1.1 elric krb5_error_code 154 1.1 elric kadmind_loop (krb5_context, krb5_keytab, int); 155 1.1 elric 156 1.1 elric /* rpc.c */ 157 1.1 elric 158 1.1 elric int 159 1.1 elric handle_mit(krb5_context, void *, size_t, int); 160 1.1 elric 161 1.1 elric 162 1.1 elric #endif /* __ADMIN_LOCL_H__ */ 163