Path: blob/main/crypto/heimdal/lib/kafs/kafs_locl.h
34878 views
/*1* Copyright (c) 1995, 1996, 1997, 1998, 1999 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/* $Id$ */3435#ifndef __KAFS_LOCL_H__36#define __KAFS_LOCL_H__3738#ifdef HAVE_CONFIG_H39#include <config.h>40#endif4142#include <stdio.h>43#include <stdlib.h>44#include <string.h>45#include <signal.h>46#include <setjmp.h>47#include <errno.h>4849#ifdef HAVE_SYS_TYPES_H50#include <sys/types.h>51#endif52#ifdef HAVE_UNISTD_H53#include <unistd.h>54#endif55#if defined(HAVE_SYS_IOCTL_H) && SunOS != 4056#include <sys/ioctl.h>57#endif58#ifdef HAVE_SYS_FILIO_H59#include <sys/filio.h>60#endif61#ifdef HAVE_SYS_SYSCTL_H62#include <sys/sysctl.h>63#endif6465#ifdef HAVE_SYS_SYSCALL_H66#include <sys/syscall.h>67#endif68#ifdef HAVE_SYS_SOCKET_H69#include <sys/socket.h>70#endif71#ifdef HAVE_NETINET_IN_H72#include <netinet/in.h>73#endif74#ifdef HAVE_NETINET_IN6_H75#include <netinet/in6.h>76#endif77#ifdef HAVE_NETINET6_IN6_H78#include <netinet6/in6.h>79#endif8081#ifdef HAVE_NETDB_H82#include <netdb.h>83#endif8485#ifdef HAVE_ARPA_NAMESER_H86#include <arpa/nameser.h>87#endif88#ifdef HAVE_RESOLV_H89#include <resolv.h>90#endif91#include <roken.h>9293#ifdef KRB594#include <krb5.h>95#endif96#ifdef KRB597#include "crypto-headers.h"98#include <krb5-v4compat.h>99typedef struct credentials CREDENTIALS;100#endif /* KRB5 */101#include <kafs.h>102103#include <resolve.h>104105#include "afssysdefs.h"106107struct kafs_data;108struct kafs_token;109typedef int (*afslog_uid_func_t)(struct kafs_data *,110const char *,111const char *,112uid_t,113const char *);114115typedef int (*get_cred_func_t)(struct kafs_data*, const char*, const char*,116const char*, uid_t, struct kafs_token *);117118typedef char* (*get_realm_func_t)(struct kafs_data*, const char*);119120struct kafs_data {121const char *name;122afslog_uid_func_t afslog_uid;123get_cred_func_t get_cred;124get_realm_func_t get_realm;125const char *(*get_error)(struct kafs_data *, int);126void (*free_error)(struct kafs_data *, const char *);127void *data;128};129130struct kafs_token {131struct ClearToken ct;132void *ticket;133size_t ticket_len;134};135136void _kafs_foldup(char *, const char *);137138int _kafs_afslog_all_local_cells(struct kafs_data*, uid_t, const char*);139140int _kafs_get_cred(struct kafs_data*, const char*, const char*, const char *,141uid_t, struct kafs_token *);142143int144_kafs_realm_of_cell(struct kafs_data *, const char *, char **);145146int147_kafs_v4_to_kt(CREDENTIALS *, uid_t, struct kafs_token *);148149void150_kafs_fixup_viceid(struct ClearToken *, uid_t);151152#ifdef _AIX153int aix_pioctl(char*, int, struct ViceIoctl*, int);154int aix_setpag(void);155#endif156157#endif /* __KAFS_LOCL_H__ */158159160