Path: blob/main/crypto/heimdal/kadmin/kadmin_locl.h
34873 views
/*1* Copyright (c) 1997-2004 Kungliga Tekniska Högskolan2* (Royal Institute of Technology, Stockholm, Sweden).3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* 3. Neither the name of the Institute nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*/3233/*34* $Id$35*/3637#ifndef __ADMIN_LOCL_H__38#define __ADMIN_LOCL_H__3940#include <config.h>4142#include <stdio.h>43#include <stdlib.h>44#include <string.h>45#include <ctype.h>46#include <errno.h>47#include <limits.h>48#ifdef HAVE_SYS_TYPES_H49#include <sys/types.h>50#endif51#ifdef HAVE_SYS_SELECT_H52#include <sys/select.h>53#endif54#ifdef HAVE_FCNTL_H55#include <fcntl.h>56#endif57#ifdef HAVE_SYS_SOCKET_H58#include <sys/socket.h>59#endif60#ifdef HAVE_SYS_SELECT_H61#include <sys/select.h>62#endif63#ifdef HAVE_NETINET_IN_H64#include <netinet/in.h>65#endif66#ifdef HAVE_NETINET_IN6_H67#include <netinet/in6.h>68#endif69#ifdef HAVE_NETINET6_IN6_H70#include <netinet6/in6.h>71#endif7273#ifdef HAVE_UTIL_H74#include <util.h>75#endif76#ifdef HAVE_LIBUTIL_H77#include <libutil.h>78#endif79#ifdef HAVE_NETDB_H80#include <netdb.h>81#endif82#ifdef HAVE_SYS_UN_H83#include <sys/un.h>84#endif85#include <err.h>86#include <roken.h>87#include <krb5.h>88#include <krb5_locl.h>89#include <hdb.h>90#include <hdb_err.h>91#include <hex.h>92#include <kadm5/admin.h>93#include <kadm5/private.h>94#include <kadm5/kadm5_err.h>95#include <parse_time.h>96#include <getarg.h>9798extern krb5_context context;99extern void * kadm_handle;100101#undef ALLOC102#define ALLOC(X) ((X) = malloc(sizeof(*(X))))103104/* util.c */105106void attributes2str(krb5_flags, char *, size_t);107int str2attributes(const char *, krb5_flags *);108int parse_attributes (const char *, krb5_flags *, int *, int);109int edit_attributes (const char *, krb5_flags *, int *, int);110111void time_t2str(time_t, char *, size_t, int);112int str2time_t (const char *, time_t *);113int parse_timet (const char *, krb5_timestamp *, int *, int);114int edit_timet (const char *, krb5_timestamp *, int *,115int);116117void deltat2str(unsigned, char *, size_t);118int str2deltat(const char *, krb5_deltat *);119int parse_deltat (const char *, krb5_deltat *, int *, int);120int edit_deltat (const char *, krb5_deltat *, int *, int);121122int edit_entry(kadm5_principal_ent_t, int *, kadm5_principal_ent_t, int);123void set_defaults(kadm5_principal_ent_t, int *, kadm5_principal_ent_t, int);124int set_entry(krb5_context, kadm5_principal_ent_t, int *,125const char *, const char *, const char *,126const char *, const char *);127int128foreach_principal(const char *, int (*)(krb5_principal, void*),129const char *, void *);130131int parse_des_key (const char *, krb5_key_data *, const char **);132133/* random_password.c */134135void136random_password(char *, size_t);137138/* kadm_conn.c */139140extern sig_atomic_t term_flag, doing_useful_work;141142void parse_ports(krb5_context, const char*);143void start_server(krb5_context, const char*);144145/* server.c */146147krb5_error_code148kadmind_loop (krb5_context, krb5_keytab, int);149150/* rpc.c */151152int153handle_mit(krb5_context, void *, size_t, int);154155156#endif /* __ADMIN_LOCL_H__ */157158159