From 9531cc02b329eee5cd3c6b2aca09744b70223a9a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 10 May 2019 13:19:18 -0400 Subject: [PATCH 30/67] NOT_FOR_UPSTREAM-CVE-2005-1689-krb5-recvauth.c --- .../NOT_FOR_UPSTREAM-CVE-2005-1689-krb5-recvauth.c | 10749 +++++++++++++++++++ 1 file changed, 10749 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/analyzer/NOT_FOR_UPSTREAM-CVE-2005-1689-krb5-recvauth.c diff --git a/gcc/testsuite/gcc.dg/analyzer/NOT_FOR_UPSTREAM-CVE-2005-1689-krb5-recvauth.c b/gcc/testsuite/gcc.dg/analyzer/NOT_FOR_UPSTREAM-CVE-2005-1689-krb5-recvauth.c new file mode 100644 index 0000000..ba521ef --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/NOT_FOR_UPSTREAM-CVE-2005-1689-krb5-recvauth.c @@ -0,0 +1,10749 @@ + + + + + + +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; + + +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; + +typedef signed long int __int64_t; +typedef unsigned long int __uint64_t; + + + + + + + +typedef long int __quad_t; +typedef unsigned long int __u_quad_t; + + +typedef unsigned long int __dev_t; +typedef unsigned int __uid_t; +typedef unsigned int __gid_t; +typedef unsigned long int __ino_t; +typedef unsigned long int __ino64_t; +typedef unsigned int __mode_t; +typedef unsigned long int __nlink_t; +typedef long int __off_t; +typedef long int __off64_t; +typedef int __pid_t; +typedef struct { int __val[2]; } __fsid_t; +typedef long int __clock_t; +typedef unsigned long int __rlim_t; +typedef unsigned long int __rlim64_t; +typedef unsigned int __id_t; +typedef long int __time_t; +typedef unsigned int __useconds_t; +typedef long int __suseconds_t; + +typedef int __daddr_t; +typedef int __key_t; + + +typedef int __clockid_t; + + +typedef void * __timer_t; + + +typedef long int __blksize_t; + + + + +typedef long int __blkcnt_t; +typedef long int __blkcnt64_t; + + +typedef unsigned long int __fsblkcnt_t; +typedef unsigned long int __fsblkcnt64_t; + + +typedef unsigned long int __fsfilcnt_t; +typedef unsigned long int __fsfilcnt64_t; + + +typedef long int __fsword_t; + +typedef long int __ssize_t; + + +typedef long int __syscall_slong_t; + +typedef unsigned long int __syscall_ulong_t; + + + +typedef __off64_t __loff_t; +typedef __quad_t *__qaddr_t; +typedef char *__caddr_t; + + +typedef long int __intptr_t; + + +typedef unsigned int __socklen_t; + + + +typedef __u_char u_char; +typedef __u_short u_short; +typedef __u_int u_int; +typedef __u_long u_long; +typedef __quad_t quad_t; +typedef __u_quad_t u_quad_t; +typedef __fsid_t fsid_t; + + + + +typedef __loff_t loff_t; + + + +typedef __ino_t ino_t; +typedef __dev_t dev_t; + + + + +typedef __gid_t gid_t; + + + + +typedef __mode_t mode_t; + + + + +typedef __nlink_t nlink_t; + + + + +typedef __uid_t uid_t; + + + + + +typedef __off_t off_t; +typedef __pid_t pid_t; + + + + + +typedef __id_t id_t; + + + + +typedef __ssize_t ssize_t; + + + + + +typedef __daddr_t daddr_t; +typedef __caddr_t caddr_t; + + + + + +typedef __key_t key_t; + + +typedef __clock_t clock_t; + + + + + +typedef __time_t time_t; + + + +typedef __clockid_t clockid_t; +typedef __timer_t timer_t; +typedef long unsigned int size_t; + + + +typedef unsigned long int ulong; +typedef unsigned short int ushort; +typedef unsigned int uint; +typedef int int8_t __attribute__ ((__mode__ (__QI__))); +typedef int int16_t __attribute__ ((__mode__ (__HI__))); +typedef int int32_t __attribute__ ((__mode__ (__SI__))); +typedef int int64_t __attribute__ ((__mode__ (__DI__))); + + +typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); +typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); +typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); +typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); + +typedef int register_t __attribute__ ((__mode__ (__word__))); + + + + + + +static __inline unsigned int +__bswap_32 (unsigned int __bsx) +{ + return __builtin_bswap32 (__bsx); +} +static __inline __uint64_t +__bswap_64 (__uint64_t __bsx) +{ + return __builtin_bswap64 (__bsx); +} + + + + +typedef int __sig_atomic_t; + + + + +typedef struct + { + unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; + } __sigset_t; + + + +typedef __sigset_t sigset_t; + + + + + +struct timespec + { + __time_t tv_sec; + __syscall_slong_t tv_nsec; + }; + +struct timeval + { + __time_t tv_sec; + __suseconds_t tv_usec; + }; + + +typedef __suseconds_t suseconds_t; + + + + + +typedef long int __fd_mask; +typedef struct + { + + + + + + + __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))]; + + + } fd_set; + + + + + + +typedef __fd_mask fd_mask; + +extern int select (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + struct timeval *__restrict __timeout); +extern int pselect (int __nfds, fd_set *__restrict __readfds, + fd_set *__restrict __writefds, + fd_set *__restrict __exceptfds, + const struct timespec *__restrict __timeout, + const __sigset_t *__restrict __sigmask); + + + + + +__extension__ +extern unsigned int gnu_dev_major (unsigned long long int __dev) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +__extension__ +extern unsigned int gnu_dev_minor (unsigned long long int __dev) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +__extension__ +extern unsigned long long int gnu_dev_makedev (unsigned int __major, + unsigned int __minor) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); + + +__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int +__attribute__ ((__nothrow__ , __leaf__)) gnu_dev_major (unsigned long long int __dev) +{ + return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); +} + +__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int +__attribute__ ((__nothrow__ , __leaf__)) gnu_dev_minor (unsigned long long int __dev) +{ + return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); +} + +__extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned long long int +__attribute__ ((__nothrow__ , __leaf__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) +{ + return ((__minor & 0xff) | ((__major & 0xfff) << 8) + | (((unsigned long long int) (__minor & ~0xff)) << 12) + | (((unsigned long long int) (__major & ~0xfff)) << 32)); +} + + + + + + + +typedef __blksize_t blksize_t; + + + + + + +typedef __blkcnt_t blkcnt_t; + + + +typedef __fsblkcnt_t fsblkcnt_t; + + + +typedef __fsfilcnt_t fsfilcnt_t; +typedef unsigned long int pthread_t; + + +union pthread_attr_t +{ + char __size[56]; + long int __align; +}; + +typedef union pthread_attr_t pthread_attr_t; + + + + + +typedef struct __pthread_internal_list +{ + struct __pthread_internal_list *__prev; + struct __pthread_internal_list *__next; +} __pthread_list_t; +typedef union +{ + struct __pthread_mutex_s + { + int __lock; + unsigned int __count; + int __owner; + + unsigned int __nusers; + + + + int __kind; + + short __spins; + short __elision; + __pthread_list_t __list; + } __data; + char __size[40]; + long int __align; +} pthread_mutex_t; + +typedef union +{ + char __size[4]; + int __align; +} pthread_mutexattr_t; + + + + +typedef union +{ + struct + { + int __lock; + unsigned int __futex; + __extension__ unsigned long long int __total_seq; + __extension__ unsigned long long int __wakeup_seq; + __extension__ unsigned long long int __woken_seq; + void *__mutex; + unsigned int __nwaiters; + unsigned int __broadcast_seq; + } __data; + char __size[48]; + __extension__ long long int __align; +} pthread_cond_t; + +typedef union +{ + char __size[4]; + int __align; +} pthread_condattr_t; + + + +typedef unsigned int pthread_key_t; + + + +typedef int pthread_once_t; + + + + + +typedef union +{ + + struct + { + int __lock; + unsigned int __nr_readers; + unsigned int __readers_wakeup; + unsigned int __writer_wakeup; + unsigned int __nr_readers_queued; + unsigned int __nr_writers_queued; + int __writer; + int __shared; + unsigned long int __pad1; + unsigned long int __pad2; + + + unsigned int __flags; + + } __data; + char __size[56]; + long int __align; +} pthread_rwlock_t; + +typedef union +{ + char __size[8]; + long int __align; +} pthread_rwlockattr_t; + + + + + +typedef volatile int pthread_spinlock_t; + + + + +typedef union +{ + char __size[32]; + long int __align; +} pthread_barrier_t; + +typedef union +{ + char __size[4]; + int __align; +} pthread_barrierattr_t; + + + + + + +extern void __assert_fail (const char *__assertion, const char *__file, + unsigned int __line, const char *__function) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + +extern void __assert_perror_fail (int __errnum, const char *__file, + unsigned int __line, const char *__function) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + + +extern void __assert (const char *__assertion, const char *__file, int __line) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + + + + + +typedef struct { + const char *filename; + short lineno; +} k5_debug_loc; +typedef char k5_debug_mutex_stats; +enum k5_mutex_init_states { + K5_MUTEX_DEBUG_PARTLY_INITIALIZED = 0x12, + K5_MUTEX_DEBUG_INITIALIZED, + K5_MUTEX_DEBUG_DESTROYED +}; +enum k5_mutex_flag_states { + K5_MUTEX_DEBUG_UNLOCKED = 0x23, + K5_MUTEX_DEBUG_LOCKED +}; + +typedef struct { + enum k5_mutex_init_states initialized; + enum k5_mutex_flag_states locked; +} k5_os_nothread_mutex; +typedef unsigned char k5_os_nothread_once_t; + + + + +struct sched_param + { + int __sched_priority; + }; + + + + + + + + + + +struct __sched_param + { + int __sched_priority; + }; +typedef unsigned long int __cpu_mask; + + + + + + +typedef struct +{ + __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))]; +} cpu_set_t; + + +extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) + __attribute__ ((__nothrow__ , __leaf__)); +extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__ , __leaf__)) ; +extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + + + +extern int sched_setparam (__pid_t __pid, const struct sched_param *__param) + __attribute__ ((__nothrow__ , __leaf__)); + + +extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int sched_setscheduler (__pid_t __pid, int __policy, + const struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int sched_yield (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + + + + + + + + +struct tm +{ + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + + + long int tm_gmtoff; + const char *tm_zone; + + + + +}; + + + + + + + + +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; + + +struct sigevent; + + + +extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); + + +extern double difftime (time_t __time1, time_t __time0) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); + + +extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern size_t strftime (char *__restrict __s, size_t __maxsize, + const char *__restrict __format, + const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__)); + +typedef struct __locale_struct +{ + + struct __locale_data *__locales[13]; + + + const unsigned short int *__ctype_b; + const int *__ctype_tolower; + const int *__ctype_toupper; + + + const char *__names[13]; +} *__locale_t; + + +typedef __locale_t locale_t; + +extern size_t strftime_l (char *__restrict __s, size_t __maxsize, + const char *__restrict __format, + const struct tm *__restrict __tp, + __locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern struct tm *gmtime_r (const time_t *__restrict __timer, + struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern struct tm *localtime_r (const time_t *__restrict __timer, + struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); + + +extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + +extern char *asctime_r (const struct tm *__restrict __tp, + char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); + + +extern char *ctime_r (const time_t *__restrict __timer, + char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern char *__tzname[2]; +extern int __daylight; +extern long int __timezone; + + + + +extern char *tzname[2]; + + + +extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern int daylight; +extern long int timezone; + + + + + +extern int stime (const time_t *__when) __attribute__ ((__nothrow__ , __leaf__)); +extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); + + +extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern int nanosleep (const struct timespec *__requested_time, + struct timespec *__remaining); + + + +extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) + __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +extern int clock_nanosleep (clockid_t __clock_id, int __flags, + const struct timespec *__req, + struct timespec *__rem); + + +extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int timer_create (clockid_t __clock_id, + struct sigevent *__restrict __evp, + timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int timer_settime (timer_t __timerid, int __flags, + const struct itimerspec *__restrict __value, + struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) + __attribute__ ((__nothrow__ , __leaf__)); + + +extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern int timespec_get (struct timespec *__ts, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + + +typedef long int __jmp_buf[8]; + + + +enum +{ + PTHREAD_CREATE_JOINABLE, + + PTHREAD_CREATE_DETACHED + +}; + + + +enum +{ + PTHREAD_MUTEX_TIMED_NP, + PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_ADAPTIVE_NP + + , + PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, + PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL + + + + + +}; + + + + +enum +{ + PTHREAD_MUTEX_STALLED, + PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, + PTHREAD_MUTEX_ROBUST, + PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST +}; + + + + + +enum +{ + PTHREAD_PRIO_NONE, + PTHREAD_PRIO_INHERIT, + PTHREAD_PRIO_PROTECT +}; +enum +{ + PTHREAD_RWLOCK_PREFER_READER_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, + PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP +}; +enum +{ + PTHREAD_INHERIT_SCHED, + + PTHREAD_EXPLICIT_SCHED + +}; + + + +enum +{ + PTHREAD_SCOPE_SYSTEM, + + PTHREAD_SCOPE_PROCESS + +}; + + + +enum +{ + PTHREAD_PROCESS_PRIVATE, + + PTHREAD_PROCESS_SHARED + +}; +struct _pthread_cleanup_buffer +{ + void (*__routine) (void *); + void *__arg; + int __canceltype; + struct _pthread_cleanup_buffer *__prev; +}; + + +enum +{ + PTHREAD_CANCEL_ENABLE, + + PTHREAD_CANCEL_DISABLE + +}; +enum +{ + PTHREAD_CANCEL_DEFERRED, + + PTHREAD_CANCEL_ASYNCHRONOUS + +}; + + + + + +extern int pthread_create (pthread_t *__restrict __newthread, + const pthread_attr_t *__restrict __attr, + void *(*__start_routine) (void *), + void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); + + + + + +extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); + + + + + + + +extern int pthread_join (pthread_t __th, void **__thread_return); +extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern pthread_t pthread_self (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); + + +extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); + + + + + + + +extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_attr_destroy (pthread_attr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, + int *__detachstate) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, + int __detachstate) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_attr_getguardsize (const pthread_attr_t *__attr, + size_t *__guardsize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_attr_setguardsize (pthread_attr_t *__attr, + size_t __guardsize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, + struct sched_param *__restrict __param) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, + const struct sched_param *__restrict + __param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict + __attr, int *__restrict __policy) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict + __attr, int *__restrict __inherit) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, + int __inherit) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, + int *__restrict __scope) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict + __attr, void **__restrict __stackaddr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__)); + + + + + +extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, + void *__stackaddr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)); + + +extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict + __attr, size_t *__restrict __stacksize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + +extern int pthread_attr_setstacksize (pthread_attr_t *__attr, + size_t __stacksize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, + void **__restrict __stackaddr, + size_t *__restrict __stacksize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))); + + + + +extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, + size_t __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_setschedparam (pthread_t __target_thread, int __policy, + const struct sched_param *__param) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))); + + +extern int pthread_getschedparam (pthread_t __target_thread, + int *__restrict __policy, + struct sched_param *__restrict __param) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); + + +extern int pthread_setschedprio (pthread_t __target_thread, int __prio) + __attribute__ ((__nothrow__ , __leaf__)); +extern int pthread_once (pthread_once_t *__once_control, + void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_setcancelstate (int __state, int *__oldstate); + + + +extern int pthread_setcanceltype (int __type, int *__oldtype); + + +extern int pthread_cancel (pthread_t __th); + + + + +extern void pthread_testcancel (void); + + + + +typedef struct +{ + struct + { + __jmp_buf __cancel_jmp_buf; + int __mask_was_saved; + } __cancel_jmp_buf[1]; + void *__pad[4]; +} __pthread_unwind_buf_t __attribute__ ((__aligned__)); +struct __pthread_cleanup_frame +{ + void (*__cancel_routine) (void *); + void *__cancel_arg; + int __do_it; + int __cancel_type; +}; +extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) + ; +extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) + ; +extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) + __attribute__ ((__noreturn__)) + + + + ; + + + +struct __jmp_buf_tag; +extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__)); + + + + + +extern int pthread_mutex_init (pthread_mutex_t *__mutex, + const pthread_mutexattr_t *__mutexattr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_mutex_lock (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict + __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_mutex_getprioceiling (const pthread_mutex_t * + __restrict __mutex, + int *__restrict __prioceiling) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, + int __prioceiling, + int *__restrict __old_ceiling) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))); + + + + +extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, + int __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict + __attr, int *__restrict __kind) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + +extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __protocol) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, + int __protocol) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __prioceiling) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, + int __prioceiling) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, + int *__robustness) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + + + + +extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, + int __robustness) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, + const pthread_rwlockattr_t *__restrict + __attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict + __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict + __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * + __restrict __attr, + int *__restrict __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, + int __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * + __restrict __attr, + int *__restrict __pref) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, + int __pref) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + + +extern int pthread_cond_init (pthread_cond_t *__restrict __cond, + const pthread_condattr_t *__restrict __cond_attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_cond_destroy (pthread_cond_t *__cond) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_cond_signal (pthread_cond_t *__cond) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_cond_broadcast (pthread_cond_t *__cond) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + + + + + +extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex) + __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict __abstime) + __attribute__ ((__nonnull__ (1, 2, 3))); + + + + +extern int pthread_condattr_init (pthread_condattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_condattr_destroy (pthread_condattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_condattr_getpshared (const pthread_condattr_t * + __restrict __attr, + int *__restrict __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, + int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_condattr_getclock (const pthread_condattr_t * + __restrict __attr, + __clockid_t *__restrict __clock_id) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_condattr_setclock (pthread_condattr_t *__attr, + __clockid_t __clock_id) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_spin_destroy (pthread_spinlock_t *__lock) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_spin_lock (pthread_spinlock_t *__lock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_spin_trylock (pthread_spinlock_t *__lock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_spin_unlock (pthread_spinlock_t *__lock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + + + + + +extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, + const pthread_barrierattr_t *__restrict + __attr, unsigned int __count) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_barrier_wait (pthread_barrier_t *__barrier) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); + + + +extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t * + __restrict __attr, + int *__restrict __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, + int __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_key_create (pthread_key_t *__key, + void (*__destr_function) (void *)) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__)); + + +extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int pthread_setspecific (pthread_key_t __key, + const void *__pointer) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern int pthread_getcpuclockid (pthread_t __thread_id, + __clockid_t *__clock_id) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); +extern int pthread_atfork (void (*__prepare) (void), + void (*__parent) (void), + void (*__child) (void)) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) pthread_equal (pthread_t __thread1, pthread_t __thread2) +{ + return __thread1 == __thread2; +} + + + + + +typedef struct { + pthread_once_t o; + k5_os_nothread_once_t n; +} k5_once_t; +typedef struct { + pthread_mutex_t p; + + pthread_t owner; + + + + +} k5_os_mutex; +static __inline__ void k5_pthread_assert_unlocked(pthread_mutex_t *m) { } +static __inline__ int k5_os_mutex_finish_init(k5_os_mutex *m) { return 0; } +typedef struct { + k5_debug_loc loc_last, loc_created; + k5_os_mutex os; + k5_debug_mutex_stats stats; +} k5_mutex_t; + + + +static __inline__ int k5_mutex_init_1(k5_mutex_t *m, k5_debug_loc l) +{ + int err = pthread_mutex_init(&(&m->os)->p, 0); + if (err) return err; + m->loc_created = m->loc_last = l; + err = (*(&m->stats) = 's', 0); + + (( + err == 0 + ) ? (void) (0) : __assert_fail ( + "err == 0" + , "../../../include/k5-thread.h", 659, __PRETTY_FUNCTION__)) + ; + return 0; +} + +static __inline__ int k5_mutex_finish_init_1(k5_mutex_t *m, k5_debug_loc l) +{ + int err = k5_os_mutex_finish_init(&m->os); + if (err) return err; + m->loc_created = m->loc_last = l; + err = (0); + + (( + err == 0 + ) ? (void) (0) : __assert_fail ( + "err == 0" + , "../../../include/k5-thread.h", 669, __PRETTY_FUNCTION__)) + ; + return 0; +} +typedef enum { + K5_KEY_COM_ERR, + K5_KEY_GSS_KRB5_SET_CCACHE_OLD_NAME, + K5_KEY_GSS_KRB5_CCACHE_NAME, + K5_KEY_MAX +} k5_key_t; + + + + + +extern int krb5int_key_register(k5_key_t, void (*)(void *)); +extern void *krb5int_getspecific(k5_key_t); +extern int krb5int_setspecific(k5_key_t, void *); +extern int krb5int_key_delete(k5_key_t); +typedef struct { k5_once_t once; int error, did_run; void (*fn)(void); } k5_init_t; + +typedef unsigned char uint8_t; +typedef unsigned short int uint16_t; + +typedef unsigned int uint32_t; + + + +typedef unsigned long int uint64_t; +typedef signed char int_least8_t; +typedef short int int_least16_t; +typedef int int_least32_t; + +typedef long int int_least64_t; + + + + + + +typedef unsigned char uint_least8_t; +typedef unsigned short int uint_least16_t; +typedef unsigned int uint_least32_t; + +typedef unsigned long int uint_least64_t; +typedef signed char int_fast8_t; + +typedef long int int_fast16_t; +typedef long int int_fast32_t; +typedef long int int_fast64_t; +typedef unsigned char uint_fast8_t; + +typedef unsigned long int uint_fast16_t; +typedef unsigned long int uint_fast32_t; +typedef unsigned long int uint_fast64_t; +typedef long int intptr_t; + + +typedef unsigned long int uintptr_t; +typedef long int intmax_t; +typedef unsigned long int uintmax_t; + + +typedef int __gwchar_t; + + + + + +typedef struct + { + long int quot; + long int rem; + } imaxdiv_t; +extern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); + + +extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); + + +extern intmax_t strtoimax (const char *__restrict __nptr, + char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)); + + +extern uintmax_t strtoumax (const char *__restrict __nptr, + char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)); + + +extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr, + __gwchar_t **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)); + + +extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr, + __gwchar_t ** __restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern long int __strtol_internal (const char *__restrict __nptr, + char **__restrict __endptr, + int __base, int __group) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + +extern __inline __attribute__ ((__gnu_inline__)) intmax_t +__attribute__ ((__nothrow__ , __leaf__)) strtoimax (const char *__restrict nptr, char **__restrict endptr, int base) + +{ + return __strtol_internal (nptr, endptr, base, 0); +} + +extern unsigned long int __strtoul_internal (const char *__restrict __nptr, + char ** __restrict __endptr, + int __base, int __group) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + +extern __inline __attribute__ ((__gnu_inline__)) uintmax_t +__attribute__ ((__nothrow__ , __leaf__)) strtoumax (const char *__restrict nptr, char **__restrict endptr, int base) + +{ + return __strtoul_internal (nptr, endptr, base, 0); +} + +extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, + __gwchar_t **__restrict __endptr, + int __base, int __group) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + +extern __inline __attribute__ ((__gnu_inline__)) intmax_t +__attribute__ ((__nothrow__ , __leaf__)) wcstoimax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base) + +{ + return __wcstol_internal (nptr, endptr, base, 0); +} + +extern unsigned long int __wcstoul_internal (const __gwchar_t * + __restrict __nptr, + __gwchar_t ** + __restrict __endptr, + int __base, int __group) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + +extern __inline __attribute__ ((__gnu_inline__)) uintmax_t +__attribute__ ((__nothrow__ , __leaf__)) wcstoumax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base) + +{ + return __wcstoul_internal (nptr, endptr, base, 0); +} + + + + + + + + + + + +static __inline__ void +store_16_be (unsigned int val, unsigned char *p) +{ + p[0] = (val >> 8) & 0xff; + p[1] = (val ) & 0xff; +} +static __inline__ void +store_16_le (unsigned int val, unsigned char *p) +{ + p[1] = (val >> 8) & 0xff; + p[0] = (val ) & 0xff; +} +static __inline__ void +store_32_be (unsigned int val, unsigned char *p) +{ + p[0] = (val >> 24) & 0xff; + p[1] = (val >> 16) & 0xff; + p[2] = (val >> 8) & 0xff; + p[3] = (val ) & 0xff; +} +static __inline__ void +store_32_le (unsigned int val, unsigned char *p) +{ + p[3] = (val >> 24) & 0xff; + p[2] = (val >> 16) & 0xff; + p[1] = (val >> 8) & 0xff; + p[0] = (val ) & 0xff; +} +static __inline__ void +store_64_be (uint64_t val, unsigned char *p) +{ + p[0] = (unsigned char)((val >> 56) & 0xff); + p[1] = (unsigned char)((val >> 48) & 0xff); + p[2] = (unsigned char)((val >> 40) & 0xff); + p[3] = (unsigned char)((val >> 32) & 0xff); + p[4] = (unsigned char)((val >> 24) & 0xff); + p[5] = (unsigned char)((val >> 16) & 0xff); + p[6] = (unsigned char)((val >> 8) & 0xff); + p[7] = (unsigned char)((val ) & 0xff); +} +static __inline__ void +store_64_le (uint64_t val, unsigned char *p) +{ + p[7] = (unsigned char)((val >> 56) & 0xff); + p[6] = (unsigned char)((val >> 48) & 0xff); + p[5] = (unsigned char)((val >> 40) & 0xff); + p[4] = (unsigned char)((val >> 32) & 0xff); + p[3] = (unsigned char)((val >> 24) & 0xff); + p[2] = (unsigned char)((val >> 16) & 0xff); + p[1] = (unsigned char)((val >> 8) & 0xff); + p[0] = (unsigned char)((val ) & 0xff); +} +static __inline__ unsigned short +load_16_be (unsigned char *p) +{ + return (p[1] | (p[0] << 8)); +} +static __inline__ unsigned short +load_16_le (unsigned char *p) +{ + return (p[0] | (p[1] << 8)); +} +static __inline__ unsigned int +load_32_be (unsigned char *p) +{ + return (p[3] | (p[2] << 8) | (p[1] << 16) | (p[0] << 24)); +} +static __inline__ unsigned int +load_32_le (unsigned char *p) +{ + return (p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24)); +} +static __inline__ uint64_t +load_64_be (unsigned char *p) +{ + return ((uint64_t)load_32_be(p) << 32) | load_32_be(p+4); +} +static __inline__ uint64_t +load_64_le (unsigned char *p) +{ + return ((uint64_t)load_32_le(p+4) << 32) | load_32_le(p); +} + +typedef uint64_t krb5_ui_8; +typedef int64_t krb5_int64; + + + + + + + + +extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); + +typedef int wchar_t; + + + + + + + + +union wait + { + int w_status; + struct + { + + unsigned int __w_termsig:7; + unsigned int __w_coredump:1; + unsigned int __w_retcode:8; + unsigned int:16; + + + + + + + + } __wait_terminated; + struct + { + + unsigned int __w_stopval:8; + unsigned int __w_stopsig:8; + unsigned int:16; + + + + + + + } __wait_stopped; + }; +typedef union + { + union wait *__uptr; + int *__iptr; + } __WAIT_STATUS __attribute__ ((__transparent_union__)); + + +typedef struct + { + int quot; + int rem; + } div_t; + + + +typedef struct + { + long int quot; + long int rem; + } ldiv_t; + + + + + + + +__extension__ typedef struct + { + long long int quot; + long long int rem; + } lldiv_t; + + +extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern double atof (const char *__nptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; + +extern int atoi (const char *__nptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; + +extern long int atol (const char *__nptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; + + + + + +__extension__ extern long long int atoll (const char *__nptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; + + + + + +extern double strtod (const char *__restrict __nptr, + char **__restrict __endptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern float strtof (const char *__restrict __nptr, + char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +extern long double strtold (const char *__restrict __nptr, + char **__restrict __endptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern long int strtol (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +extern unsigned long int strtoul (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + +__extension__ +extern long long int strtoq (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +__extension__ +extern unsigned long long int strtouq (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +__extension__ +extern long long int strtoll (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +__extension__ +extern unsigned long long int strtoull (const char *__restrict __nptr, + char **__restrict __endptr, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) atoi (const char *__nptr) +{ + return (int) strtol (__nptr, (char **) ((void *)0), 10); +} +extern __inline __attribute__ ((__gnu_inline__)) long int +__attribute__ ((__nothrow__ , __leaf__)) atol (const char *__nptr) +{ + return strtol (__nptr, (char **) ((void *)0), 10); +} + + + + +__extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int +__attribute__ ((__nothrow__ , __leaf__)) atoll (const char *__nptr) +{ + return strtoll (__nptr, (char **) ((void *)0), 10); +} + +extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ; + + +extern long int a64l (const char *__s) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; +extern long int random (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern char *initstate (unsigned int __seed, char *__statebuf, + size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + + +extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + + +struct random_data + { + int32_t *fptr; + int32_t *rptr; + int32_t *state; + int rand_type; + int rand_deg; + int rand_sep; + int32_t *end_ptr; + }; + +extern int random_r (struct random_data *__restrict __buf, + int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + +extern int srandom_r (unsigned int __seed, struct random_data *__buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + +extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, + size_t __statelen, + struct random_data *__restrict __buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))); + +extern int setstate_r (char *__restrict __statebuf, + struct random_data *__restrict __buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + + + +extern int rand (void) __attribute__ ((__nothrow__ , __leaf__)); + +extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + +extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__)); +extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__)); +extern long int nrand48 (unsigned short int __xsubi[3]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__)); +extern long int jrand48 (unsigned short int __xsubi[3]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__)); +extern unsigned short int *seed48 (unsigned short int __seed16v[3]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +struct drand48_data + { + unsigned short int __x[3]; + unsigned short int __old_x[3]; + unsigned short int __c; + unsigned short int __init; + __extension__ unsigned long long int __a; + + }; + + +extern int drand48_r (struct drand48_data *__restrict __buffer, + double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int erand48_r (unsigned short int __xsubi[3], + struct drand48_data *__restrict __buffer, + double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int lrand48_r (struct drand48_data *__restrict __buffer, + long int *__restrict __result) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int nrand48_r (unsigned short int __xsubi[3], + struct drand48_data *__restrict __buffer, + long int *__restrict __result) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int mrand48_r (struct drand48_data *__restrict __buffer, + long int *__restrict __result) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int jrand48_r (unsigned short int __xsubi[3], + struct drand48_data *__restrict __buffer, + long int *__restrict __result) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int srand48_r (long int __seedval, struct drand48_data *__buffer) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + +extern int seed48_r (unsigned short int __seed16v[3], + struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + +extern int lcong48_r (unsigned short int __param[7], + struct drand48_data *__buffer) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + + + + + + +extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ; + +extern void *calloc (size_t __nmemb, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ; + + + + + + + + + + +extern void *realloc (void *__ptr, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); + +extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern void cfree (void *__ptr) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + + + + +extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + + + + + +extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ; + + + + +extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + + +extern void *aligned_alloc (size_t __alignment, size_t __size) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ; + + + + +extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + +extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + + +extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + + +extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + +extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + + + +extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + + + + + +extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + + + + + + +extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + +extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern int setenv (const char *__name, const char *__value, int __replace) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + +extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + +extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__)); +extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ; +extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ; +extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + + + +extern int system (const char *__command) ; + +extern char *realpath (const char *__restrict __name, + char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + + +typedef int (*__compar_fn_t) (const void *, const void *); + + + +extern void *bsearch (const void *__key, const void *__base, + size_t __nmemb, size_t __size, __compar_fn_t __compar) + __attribute__ ((__nonnull__ (1, 2, 5))) ; + + +extern __inline __attribute__ ((__gnu_inline__)) void * +bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, + __compar_fn_t __compar) +{ + size_t __l, __u, __idx; + const void *__p; + int __comparison; + + __l = 0; + __u = __nmemb; + while (__l < __u) + { + __idx = (__l + __u) / 2; + __p = (void *) (((const char *) __base) + (__idx * __size)); + __comparison = (*__compar) (__key, __p); + if (__comparison < 0) + __u = __idx; + else if (__comparison > 0) + __l = __idx + 1; + else + return (void *) __p; + } + + return ((void *)0); +} + + + + +extern void qsort (void *__base, size_t __nmemb, size_t __size, + __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); +extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; +extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; + + + +__extension__ extern long long int llabs (long long int __x) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; + + + + + + + +extern div_t div (int __numer, int __denom) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; +extern ldiv_t ldiv (long int __numer, long int __denom) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; + + + + +__extension__ extern lldiv_t lldiv (long long int __numer, + long long int __denom) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ; + +extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; + + + + +extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; + + + + +extern char *gcvt (double __value, int __ndigit, char *__buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ; + + + + +extern char *qecvt (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; +extern char *qfcvt (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ; +extern char *qgcvt (long double __value, int __ndigit, char *__buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ; + + + + +extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign, char *__restrict __buf, + size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); +extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, + int *__restrict __sign, char *__restrict __buf, + size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); + +extern int qecvt_r (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign, + char *__restrict __buf, size_t __len) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); +extern int qfcvt_r (long double __value, int __ndigit, + int *__restrict __decpt, int *__restrict __sign, + char *__restrict __buf, size_t __len) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); + + + + + + +extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int mbtowc (wchar_t *__restrict __pwc, + const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern size_t mbstowcs (wchar_t *__restrict __pwcs, + const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); + +extern size_t wcstombs (char *__restrict __s, + const wchar_t *__restrict __pwcs, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + + +extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; +extern int getsubopt (char **__restrict __optionp, + char *const *__restrict __tokens, + char **__restrict __valuep) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ; +extern int getloadavg (double __loadavg[], int __nelem) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern __inline __attribute__ ((__gnu_inline__)) double +__attribute__ ((__nothrow__ , __leaf__)) atof (const char *__nptr) +{ + return strtod (__nptr, (char **) ((void *)0)); +} + + + + + + + + + + +struct _profile_t; +typedef unsigned char krb5_octet; + + + + + +typedef short krb5_int16; +typedef unsigned short krb5_ui_2; + + + + + +typedef int krb5_int32; +typedef unsigned int krb5_ui_4; +typedef unsigned int krb5_boolean; +typedef unsigned int krb5_msgtype; +typedef unsigned int krb5_kvno; + +typedef krb5_int32 krb5_addrtype; +typedef krb5_int32 krb5_enctype; +typedef krb5_int32 krb5_cksumtype; +typedef krb5_int32 krb5_authdatatype; +typedef krb5_int32 krb5_keyusage; + +typedef krb5_int32 krb5_preauthtype; +typedef krb5_int32 krb5_flags; +typedef krb5_int32 krb5_timestamp; +typedef krb5_int32 krb5_error_code; +typedef krb5_int32 krb5_deltat; + +typedef krb5_error_code krb5_magic; + +typedef struct _krb5_data { + krb5_magic magic; + unsigned int length; + char *data; +} krb5_data; +typedef void * krb5_pointer; +typedef void const * krb5_const_pointer; + +typedef struct krb5_principal_data { + krb5_magic magic; + krb5_data realm; + krb5_data *data; + krb5_int32 length; + krb5_int32 type; +} krb5_principal_data; + +typedef krb5_principal_data * krb5_principal; +typedef const krb5_principal_data *krb5_const_principal; +typedef struct _krb5_address { + krb5_magic magic; + krb5_addrtype addrtype; + unsigned int length; + krb5_octet *contents; +} krb5_address; +struct _krb5_context; +typedef struct _krb5_context * krb5_context; + +struct _krb5_auth_context; +typedef struct _krb5_auth_context * krb5_auth_context; + +struct _krb5_cryptosystem_entry; + + + + + +typedef struct _krb5_keyblock { + krb5_magic magic; + krb5_enctype enctype; + unsigned int length; + krb5_octet *contents; +} krb5_keyblock; + + +typedef struct _krb5_encrypt_block { + krb5_magic magic; + krb5_enctype crypto_entry; + + + krb5_keyblock *key; +} krb5_encrypt_block; + + +typedef struct _krb5_checksum { + krb5_magic magic; + krb5_cksumtype checksum_type; + unsigned int length; + krb5_octet *contents; +} krb5_checksum; + +typedef struct _krb5_enc_data { + krb5_magic magic; + krb5_enctype enctype; + krb5_kvno kvno; + krb5_data ciphertext; +} krb5_enc_data; +enum { + KRB5_C_RANDSOURCE_OLDAPI = 0, + KRB5_C_RANDSOURCE_OSRAND = 1, + KRB5_C_RANDSOURCE_TRUSTEDPARTY = 2, + + + + + KRB5_C_RANDSOURCE_TIMING = 3, + KRB5_C_RANDSOURCE_EXTERNAL_PROTOCOL = 4, + KRB5_C_RANDSOURCE_MAX = 5 +}; +krb5_error_code + krb5_c_encrypt + (krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *cipher_state, + const krb5_data *input, krb5_enc_data *output); + +krb5_error_code + krb5_c_decrypt + (krb5_context context, const krb5_keyblock *key, + krb5_keyusage usage, const krb5_data *cipher_state, + const krb5_enc_data *input, krb5_data *output); + +krb5_error_code + krb5_c_encrypt_length + (krb5_context context, krb5_enctype enctype, + size_t inputlen, size_t *length); + +krb5_error_code + krb5_c_block_size + (krb5_context context, krb5_enctype enctype, + size_t *blocksize); + +krb5_error_code + krb5_c_init_state +(krb5_context context, +const krb5_keyblock *key, krb5_keyusage usage, +krb5_data *new_state); + +krb5_error_code + krb5_c_free_state +(krb5_context context, const krb5_keyblock *key, krb5_data *state); + +krb5_error_code + krb5_c_make_random_key + (krb5_context context, krb5_enctype enctype, + krb5_keyblock *k5_random_key); + + + + + +krb5_error_code + krb5_c_random_add_entropy +(krb5_context context, unsigned int randsource_id, const krb5_data *data); + + +krb5_error_code + krb5_c_random_make_octets + (krb5_context context, krb5_data *data); +krb5_error_code +krb5_c_random_os_entropy +(krb5_context context, int strong, int *success); + + krb5_error_code + krb5_c_random_seed + (krb5_context context, krb5_data *data); + +krb5_error_code + krb5_c_string_to_key + (krb5_context context, krb5_enctype enctype, + const krb5_data *string, const krb5_data *salt, + krb5_keyblock *key); +krb5_error_code +krb5_c_string_to_key_with_params(krb5_context context, + krb5_enctype enctype, + const krb5_data *string, + const krb5_data *salt, + const krb5_data *params, + krb5_keyblock *key); + +krb5_error_code + krb5_c_enctype_compare + (krb5_context context, krb5_enctype e1, krb5_enctype e2, + krb5_boolean *similar); + +krb5_error_code + krb5_c_make_checksum + (krb5_context context, krb5_cksumtype cksumtype, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *input, krb5_checksum *cksum); + +krb5_error_code + krb5_c_verify_checksum + (krb5_context context, + const krb5_keyblock *key, krb5_keyusage usage, + const krb5_data *data, + const krb5_checksum *cksum, + krb5_boolean *valid); + +krb5_error_code + krb5_c_checksum_length + (krb5_context context, krb5_cksumtype cksumtype, + size_t *length); + +krb5_error_code + krb5_c_keyed_checksum_types + (krb5_context context, krb5_enctype enctype, + unsigned int *count, krb5_cksumtype **cksumtypes); +krb5_boolean krb5_c_valid_enctype + (krb5_enctype ktype); +krb5_boolean krb5_c_valid_cksumtype + (krb5_cksumtype ctype); +krb5_boolean krb5_c_is_coll_proof_cksum + (krb5_cksumtype ctype); +krb5_boolean krb5_c_is_keyed_cksum + (krb5_cksumtype ctype); + + + +krb5_boolean valid_enctype + (krb5_enctype ktype); +krb5_boolean valid_cksumtype + (krb5_cksumtype ctype); +krb5_boolean is_coll_proof_cksum + (krb5_cksumtype ctype); +krb5_boolean is_keyed_cksum + (krb5_cksumtype ctype); + + + + + + + +krb5_error_code krb5_encrypt + (krb5_context context, + krb5_const_pointer inptr, + krb5_pointer outptr, + size_t size, + krb5_encrypt_block * eblock, + krb5_pointer ivec); +krb5_error_code krb5_decrypt + (krb5_context context, + krb5_const_pointer inptr, + krb5_pointer outptr, + size_t size, + krb5_encrypt_block * eblock, + krb5_pointer ivec); +krb5_error_code krb5_process_key + (krb5_context context, + krb5_encrypt_block * eblock, + const krb5_keyblock * key); +krb5_error_code krb5_finish_key + (krb5_context context, + krb5_encrypt_block * eblock); +krb5_error_code krb5_string_to_key + (krb5_context context, + const krb5_encrypt_block * eblock, + krb5_keyblock * keyblock, + const krb5_data * data, + const krb5_data * salt); +krb5_error_code krb5_init_random_key + (krb5_context context, + const krb5_encrypt_block * eblock, + const krb5_keyblock * keyblock, + krb5_pointer * ptr); +krb5_error_code krb5_finish_random_key + (krb5_context context, + const krb5_encrypt_block * eblock, + krb5_pointer * ptr); +krb5_error_code krb5_random_key + (krb5_context context, + const krb5_encrypt_block * eblock, + krb5_pointer ptr, + krb5_keyblock ** keyblock); +krb5_enctype krb5_eblock_enctype + (krb5_context context, + const krb5_encrypt_block * eblock); +krb5_error_code krb5_use_enctype + (krb5_context context, + krb5_encrypt_block * eblock, + krb5_enctype enctype); +size_t krb5_encrypt_size + (size_t length, + krb5_enctype crypto); +size_t krb5_checksum_size + (krb5_context context, + krb5_cksumtype ctype); +krb5_error_code krb5_calculate_checksum + (krb5_context context, + krb5_cksumtype ctype, + krb5_const_pointer in, size_t in_length, + krb5_const_pointer seed, size_t seed_length, + krb5_checksum * outcksum); +krb5_error_code krb5_verify_checksum + (krb5_context context, + krb5_cksumtype ctype, + const krb5_checksum * cksum, + krb5_const_pointer in, size_t in_length, + krb5_const_pointer seed, size_t seed_length); + + +krb5_error_code krb5_random_confounder + (size_t, krb5_pointer); + +krb5_error_code krb5_encrypt_data + (krb5_context context, krb5_keyblock *key, + krb5_pointer ivec, krb5_data *data, + krb5_enc_data *enc_data); + +krb5_error_code krb5_decrypt_data + (krb5_context context, krb5_keyblock *key, + krb5_pointer ivec, krb5_enc_data *data, + krb5_data *enc_data); +typedef struct _krb5_ticket_times { + krb5_timestamp authtime; + + krb5_timestamp starttime; + + krb5_timestamp endtime; + krb5_timestamp renew_till; +} krb5_ticket_times; + + +typedef struct _krb5_authdata { + krb5_magic magic; + krb5_authdatatype ad_type; + unsigned int length; + krb5_octet *contents; +} krb5_authdata; + + +typedef struct _krb5_transited { + krb5_magic magic; + krb5_octet tr_type; + krb5_data tr_contents; +} krb5_transited; + +typedef struct _krb5_enc_tkt_part { + krb5_magic magic; + + krb5_flags flags; + krb5_keyblock *session; + krb5_principal client; + krb5_transited transited; + krb5_ticket_times times; + krb5_address **caddrs; + krb5_authdata **authorization_data; +} krb5_enc_tkt_part; + +typedef struct _krb5_ticket { + krb5_magic magic; + + krb5_principal server; + krb5_enc_data enc_part; + + krb5_enc_tkt_part *enc_part2; + +} krb5_ticket; + + +typedef struct _krb5_authenticator { + krb5_magic magic; + krb5_principal client; + krb5_checksum *checksum; + krb5_int32 cusec; + krb5_timestamp ctime; + krb5_keyblock *subkey; + krb5_ui_4 seq_number; + krb5_authdata **authorization_data; +} krb5_authenticator; + +typedef struct _krb5_tkt_authent { + krb5_magic magic; + krb5_ticket *ticket; + krb5_authenticator *authenticator; + krb5_flags ap_options; +} krb5_tkt_authent; + + +typedef struct _krb5_creds { + krb5_magic magic; + krb5_principal client; + krb5_principal server; + krb5_keyblock keyblock; + krb5_ticket_times times; + krb5_boolean is_skey; + + krb5_flags ticket_flags; + krb5_address **addresses; + krb5_data ticket; + krb5_data second_ticket; + + + krb5_authdata **authdata; +} krb5_creds; + + +typedef struct _krb5_last_req_entry { + krb5_magic magic; + krb5_int32 lr_type; + krb5_timestamp value; +} krb5_last_req_entry; + + +typedef struct _krb5_pa_data { + krb5_magic magic; + krb5_preauthtype pa_type; + unsigned int length; + krb5_octet *contents; +} krb5_pa_data; + +typedef struct _krb5_kdc_req { + krb5_magic magic; + krb5_msgtype msg_type; + krb5_pa_data **padata; + + krb5_flags kdc_options; + krb5_principal client; + krb5_principal server; + + krb5_timestamp from; + krb5_timestamp till; + krb5_timestamp rtime; + krb5_int32 nonce; + int nktypes; + krb5_enctype *ktype; + krb5_address **addresses; + krb5_enc_data authorization_data; + krb5_authdata **unenc_authdata; + + krb5_ticket **second_ticket; +} krb5_kdc_req; + +typedef struct _krb5_enc_kdc_rep_part { + krb5_magic magic; + + krb5_msgtype msg_type; + krb5_keyblock *session; + krb5_last_req_entry **last_req; + krb5_int32 nonce; + krb5_timestamp key_exp; + krb5_flags flags; + krb5_ticket_times times; + krb5_principal server; + krb5_address **caddrs; + +} krb5_enc_kdc_rep_part; + +typedef struct _krb5_kdc_rep { + krb5_magic magic; + + krb5_msgtype msg_type; + krb5_pa_data **padata; + krb5_principal client; + krb5_ticket *ticket; + krb5_enc_data enc_part; + + krb5_enc_kdc_rep_part *enc_part2; +} krb5_kdc_rep; + + +typedef struct _krb5_error { + krb5_magic magic; + + krb5_timestamp ctime; + krb5_int32 cusec; + krb5_int32 susec; + krb5_timestamp stime; + krb5_ui_4 error; + krb5_principal client; + + krb5_principal server; + krb5_data text; + krb5_data e_data; +} krb5_error; + +typedef struct _krb5_ap_req { + krb5_magic magic; + krb5_flags ap_options; + krb5_ticket *ticket; + krb5_enc_data authenticator; +} krb5_ap_req; + +typedef struct _krb5_ap_rep { + krb5_magic magic; + krb5_enc_data enc_part; +} krb5_ap_rep; + +typedef struct _krb5_ap_rep_enc_part { + krb5_magic magic; + krb5_timestamp ctime; + krb5_int32 cusec; + krb5_keyblock *subkey; + krb5_ui_4 seq_number; +} krb5_ap_rep_enc_part; + +typedef struct _krb5_response { + krb5_magic magic; + krb5_octet message_type; + krb5_data response; + krb5_int32 expected_nonce; + krb5_timestamp request_time; +} krb5_response; + +typedef struct _krb5_cred_info { + krb5_magic magic; + krb5_keyblock *session; + + krb5_principal client; + krb5_principal server; + krb5_flags flags; + krb5_ticket_times times; + + krb5_address **caddrs; +} krb5_cred_info; + +typedef struct _krb5_cred_enc_part { + krb5_magic magic; + krb5_int32 nonce; + krb5_timestamp timestamp; + krb5_int32 usec; + krb5_address *s_address; + krb5_address *r_address; + krb5_cred_info **ticket_info; +} krb5_cred_enc_part; + +typedef struct _krb5_cred { + krb5_magic magic; + krb5_ticket **tickets; + krb5_enc_data enc_part; + krb5_cred_enc_part *enc_part2; +} krb5_cred; + + +typedef struct _passwd_phrase_element { + krb5_magic magic; + krb5_data *passwd; + krb5_data *phrase; +} passwd_phrase_element; + +typedef struct _krb5_pwd_data { + krb5_magic magic; + int sequence_count; + passwd_phrase_element **element; +} krb5_pwd_data; +typedef struct krb5_replay_data { + krb5_timestamp timestamp; + krb5_int32 usec; + krb5_ui_4 seq; +} krb5_replay_data; +typedef krb5_error_code +( * krb5_mk_req_checksum_func) (krb5_context, krb5_auth_context , void *, + krb5_data **); +typedef krb5_pointer krb5_cc_cursor; + +struct _krb5_ccache; +typedef struct _krb5_ccache *krb5_ccache; +struct _krb5_cc_ops; +typedef struct _krb5_cc_ops krb5_cc_ops; +const char * +krb5_cc_get_name (krb5_context context, krb5_ccache cache); + +krb5_error_code +krb5_cc_gen_new (krb5_context context, krb5_ccache *cache); + +krb5_error_code +krb5_cc_initialize(krb5_context context, krb5_ccache cache, + krb5_principal principal); + +krb5_error_code +krb5_cc_destroy (krb5_context context, krb5_ccache cache); + +krb5_error_code +krb5_cc_close (krb5_context context, krb5_ccache cache); + +krb5_error_code +krb5_cc_store_cred (krb5_context context, krb5_ccache cache, + krb5_creds *creds); + +krb5_error_code +krb5_cc_retrieve_cred (krb5_context context, krb5_ccache cache, + krb5_flags flags, krb5_creds *mcreds, + krb5_creds *creds); + +krb5_error_code +krb5_cc_get_principal (krb5_context context, krb5_ccache cache, + krb5_principal *principal); + +krb5_error_code +krb5_cc_start_seq_get (krb5_context context, krb5_ccache cache, + krb5_cc_cursor *cursor); + +krb5_error_code +krb5_cc_next_cred (krb5_context context, krb5_ccache cache, + krb5_cc_cursor *cursor, krb5_creds *creds); + +krb5_error_code +krb5_cc_end_seq_get (krb5_context context, krb5_ccache cache, + krb5_cc_cursor *cursor); + +krb5_error_code +krb5_cc_remove_cred (krb5_context context, krb5_ccache cache, krb5_flags flags, + krb5_creds *creds); + +krb5_error_code +krb5_cc_set_flags (krb5_context context, krb5_ccache cache, krb5_flags flags); + +const char * +krb5_cc_get_type (krb5_context context, krb5_ccache cache); +struct krb5_rc_st; +typedef struct krb5_rc_st *krb5_rcache; +typedef krb5_pointer krb5_kt_cursor; + +typedef struct krb5_keytab_entry_st { + krb5_magic magic; + krb5_principal principal; + krb5_timestamp timestamp; + krb5_kvno vno; + krb5_keyblock key; +} krb5_keytab_entry; + + +struct _krb5_kt_ops; +typedef struct _krb5_kt { + krb5_magic magic; + const struct _krb5_kt_ops *ops; + krb5_pointer data; +} *krb5_keytab; + + + + + +char * +krb5_kt_get_type (krb5_context, krb5_keytab keytab); +krb5_error_code +krb5_kt_get_name(krb5_context context, krb5_keytab keytab, char *name, + unsigned int namelen); +krb5_error_code +krb5_kt_close(krb5_context context, krb5_keytab keytab); +krb5_error_code +krb5_kt_get_entry(krb5_context context, krb5_keytab keytab, + krb5_const_principal principal, krb5_kvno vno, + krb5_enctype enctype, krb5_keytab_entry *entry); +krb5_error_code +krb5_kt_start_seq_get(krb5_context context, krb5_keytab keytab, + krb5_kt_cursor *cursor); +krb5_error_code +krb5_kt_next_entry(krb5_context context, krb5_keytab keytab, + krb5_keytab_entry *entry, krb5_kt_cursor *cursor); +krb5_error_code +krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab, + krb5_kt_cursor *cursor); +krb5_error_code krb5_init_context + (krb5_context *); +krb5_error_code krb5_init_secure_context + (krb5_context *); +void krb5_free_context + (krb5_context); + + +krb5_error_code krb5_set_default_in_tkt_ktypes + (krb5_context, + const krb5_enctype *); +krb5_error_code krb5_get_default_in_tkt_ktypes + (krb5_context, + krb5_enctype **); + +krb5_error_code krb5_set_default_tgs_ktypes + (krb5_context, + const krb5_enctype *); + + +krb5_error_code +krb5_set_default_tgs_enctypes + (krb5_context, + const krb5_enctype *); + +krb5_error_code krb5_get_tgs_ktypes + (krb5_context, + krb5_const_principal, + krb5_enctype **); + + +krb5_error_code krb5_get_permitted_enctypes + (krb5_context, krb5_enctype **); + + +void krb5_free_ktypes + (krb5_context, krb5_enctype *); + +krb5_boolean krb5_is_permitted_enctype + (krb5_context, krb5_enctype); + + +krb5_boolean krb5_is_thread_safe(void); + + + +krb5_error_code krb5_kdc_rep_decrypt_proc + (krb5_context, + const krb5_keyblock *, + krb5_const_pointer, + krb5_kdc_rep * ); +krb5_error_code krb5_decrypt_tkt_part + (krb5_context, + const krb5_keyblock *, + krb5_ticket * ); +krb5_error_code krb5_get_cred_from_kdc + (krb5_context, + krb5_ccache, + + krb5_creds *, + krb5_creds **, + krb5_creds *** ); +krb5_error_code krb5_get_cred_from_kdc_validate + (krb5_context, + krb5_ccache, + + krb5_creds *, + krb5_creds **, + krb5_creds *** ); +krb5_error_code krb5_get_cred_from_kdc_renew + (krb5_context, + krb5_ccache, + + krb5_creds *, + krb5_creds **, + krb5_creds *** ); + + +void krb5_free_tgt_creds + (krb5_context, + krb5_creds **); + + + + +krb5_error_code krb5_get_credentials + (krb5_context, + krb5_flags, + krb5_ccache, + krb5_creds *, + krb5_creds **); +krb5_error_code krb5_get_credentials_validate + (krb5_context, + krb5_flags, + krb5_ccache, + krb5_creds *, + krb5_creds **); +krb5_error_code krb5_get_credentials_renew + (krb5_context, + krb5_flags, + krb5_ccache, + krb5_creds *, + krb5_creds **); + +krb5_error_code krb5_get_cred_via_tkt + (krb5_context, + krb5_creds *, + krb5_flags, + krb5_address * const *, + krb5_creds *, + krb5_creds **); + +krb5_error_code krb5_mk_req + (krb5_context, + krb5_auth_context *, + krb5_flags, + char *, + char *, + krb5_data *, + krb5_ccache, + krb5_data * ); +krb5_error_code krb5_mk_req_extended + (krb5_context, + krb5_auth_context *, + krb5_flags, + krb5_data *, + krb5_creds *, + krb5_data * ); +krb5_error_code krb5_mk_rep + (krb5_context, + krb5_auth_context, + krb5_data *); +krb5_error_code krb5_rd_rep + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_ap_rep_enc_part **); +krb5_error_code krb5_mk_error + (krb5_context, + const krb5_error *, + krb5_data * ); +krb5_error_code krb5_rd_error + (krb5_context, + const krb5_data *, + krb5_error ** ); +krb5_error_code krb5_rd_safe + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *); +krb5_error_code krb5_rd_priv + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *); +krb5_error_code krb5_parse_name + (krb5_context, + const char *, + krb5_principal * ); +krb5_error_code krb5_unparse_name + (krb5_context, + krb5_const_principal, + char ** ); +krb5_error_code krb5_unparse_name_ext + (krb5_context, + krb5_const_principal, + char **, + unsigned int *); + +krb5_error_code krb5_set_principal_realm + (krb5_context, krb5_principal, const char *); + +krb5_boolean krb5_address_search + (krb5_context, + const krb5_address *, + krb5_address * const *); +krb5_boolean krb5_address_compare + (krb5_context, + const krb5_address *, + const krb5_address *); +int krb5_address_order + (krb5_context, + const krb5_address *, + const krb5_address *); +krb5_boolean krb5_realm_compare + (krb5_context, + krb5_const_principal, + krb5_const_principal); +krb5_boolean krb5_principal_compare + (krb5_context, + krb5_const_principal, + krb5_const_principal); +krb5_error_code krb5_init_keyblock + (krb5_context, krb5_enctype enctype, + size_t length, krb5_keyblock **out); + + + + + + +krb5_error_code krb5_copy_keyblock + (krb5_context, + const krb5_keyblock *, + krb5_keyblock **); +krb5_error_code krb5_copy_keyblock_contents + (krb5_context, + const krb5_keyblock *, + krb5_keyblock *); +krb5_error_code krb5_copy_creds + (krb5_context, + const krb5_creds *, + krb5_creds **); +krb5_error_code krb5_copy_data + (krb5_context, + const krb5_data *, + krb5_data **); +krb5_error_code krb5_copy_principal + (krb5_context, + krb5_const_principal, + krb5_principal *); + +krb5_error_code krb5_copy_addr + (krb5_context, + const krb5_address *, + krb5_address **); + +krb5_error_code krb5_copy_addresses + (krb5_context, + krb5_address * const *, + krb5_address ***); +krb5_error_code krb5_copy_ticket + (krb5_context, + const krb5_ticket *, + krb5_ticket **); +krb5_error_code krb5_copy_authdata + (krb5_context, + krb5_authdata * const *, + krb5_authdata ***); +krb5_error_code krb5_copy_authenticator + (krb5_context, + const krb5_authenticator *, + krb5_authenticator **); +krb5_error_code krb5_copy_checksum + (krb5_context, + const krb5_checksum *, + krb5_checksum **); + +void krb5_init_ets + (krb5_context); +void krb5_free_ets + (krb5_context); +krb5_error_code krb5_generate_subkey + (krb5_context, + const krb5_keyblock *, krb5_keyblock **); +krb5_error_code krb5_generate_seq_number + (krb5_context, + const krb5_keyblock *, krb5_ui_4 *); + +krb5_error_code krb5_get_server_rcache + (krb5_context, + const krb5_data *, krb5_rcache *); +krb5_error_code krb5_build_principal_ext + (krb5_context, krb5_principal *, unsigned int, const char *, ...); +krb5_error_code krb5_build_principal + (krb5_context, krb5_principal *, unsigned int, const char *, ...); + + + + + + + +krb5_error_code krb5_425_conv_principal + (krb5_context, + const char *name, + const char *instance, const char *realm, + krb5_principal *princ); + +krb5_error_code krb5_524_conv_principal + (krb5_context context, krb5_const_principal princ, + char *name, char *inst, char *realm); + +struct credentials; +int krb5_524_convert_creds + (krb5_context context, krb5_creds *v5creds, + struct credentials *v4creds); + + + + + + + +krb5_error_code krb5_kt_register + (krb5_context, + const struct _krb5_kt_ops * ); + + +krb5_error_code krb5_kt_resolve + (krb5_context, + const char *, + krb5_keytab * ); +krb5_error_code krb5_kt_default_name + (krb5_context, + char *, + int ); +krb5_error_code krb5_kt_default + (krb5_context, + krb5_keytab * ); +krb5_error_code krb5_free_keytab_entry_contents + (krb5_context, + krb5_keytab_entry * ); + + +krb5_error_code krb5_kt_free_entry + (krb5_context, + krb5_keytab_entry * ); + + + +krb5_error_code krb5_kt_remove_entry + (krb5_context, + krb5_keytab, + krb5_keytab_entry * ); +krb5_error_code krb5_kt_add_entry + (krb5_context, + krb5_keytab, + krb5_keytab_entry * ); +krb5_error_code krb5_principal2salt + (krb5_context, + krb5_const_principal, krb5_data *); + +krb5_error_code krb5_principal2salt_norealm + (krb5_context, + krb5_const_principal, krb5_data *); + + + + +krb5_error_code krb5_cc_resolve + (krb5_context, + const char *, + krb5_ccache * ); +const char * krb5_cc_default_name + (krb5_context); +krb5_error_code krb5_cc_set_default_name + (krb5_context, const char *); +krb5_error_code krb5_cc_default + (krb5_context, + krb5_ccache *); + +unsigned int krb5_get_notification_message + (void); + + +krb5_error_code krb5_cc_copy_creds + (krb5_context context, + krb5_ccache incc, + krb5_ccache outcc); + + + + +krb5_error_code krb5_check_transited_list + (krb5_context, const krb5_data *trans, + const krb5_data *realm1, const krb5_data *realm2); + + + + +void krb5_free_realm_tree + (krb5_context, + krb5_principal *); + + + +void krb5_free_principal + (krb5_context, krb5_principal ); +void krb5_free_authenticator + (krb5_context, krb5_authenticator * ); + +void krb5_free_authenticator_contents + (krb5_context, krb5_authenticator * ); + +void krb5_free_addresses + (krb5_context, krb5_address ** ); + +void krb5_free_address + (krb5_context, krb5_address * ); + +void krb5_free_authdata + (krb5_context, krb5_authdata ** ); + +void krb5_free_enc_tkt_part + (krb5_context, krb5_enc_tkt_part * ); + +void krb5_free_ticket + (krb5_context, krb5_ticket * ); + +void krb5_free_tickets + (krb5_context, krb5_ticket ** ); +void krb5_free_kdc_req + (krb5_context, krb5_kdc_req * ); +void krb5_free_kdc_rep + (krb5_context, krb5_kdc_rep * ); +void krb5_free_last_req + (krb5_context, krb5_last_req_entry ** ); +void krb5_free_enc_kdc_rep_part + (krb5_context, krb5_enc_kdc_rep_part * ); + +void krb5_free_error + (krb5_context, krb5_error * ); + +void krb5_free_ap_req + (krb5_context, krb5_ap_req * ); +void krb5_free_ap_rep + (krb5_context, krb5_ap_rep * ); +void krb5_free_cred + (krb5_context, krb5_cred *); + +void krb5_free_creds + (krb5_context, krb5_creds *); +void krb5_free_cred_contents + (krb5_context, krb5_creds *); + +void krb5_free_cred_enc_part + (krb5_context, krb5_cred_enc_part *); + +void krb5_free_checksum + (krb5_context, krb5_checksum *); +void krb5_free_checksum_contents + (krb5_context, krb5_checksum *); +void krb5_free_keyblock + (krb5_context, krb5_keyblock *); +void krb5_free_keyblock_contents + (krb5_context, krb5_keyblock *); + +void krb5_free_pa_data + (krb5_context, krb5_pa_data **); + +void krb5_free_ap_rep_enc_part + (krb5_context, krb5_ap_rep_enc_part *); + +void krb5_free_tkt_authent + (krb5_context, krb5_tkt_authent *); +void krb5_free_pwd_data + (krb5_context, krb5_pwd_data *); +void krb5_free_pwd_sequences + (krb5_context, passwd_phrase_element **); + +void krb5_free_data + (krb5_context, krb5_data *); +void krb5_free_data_contents + (krb5_context, krb5_data *); +void krb5_free_unparsed_name + (krb5_context, char *); +void krb5_free_cksumtypes + (krb5_context, krb5_cksumtype *); + + +krb5_error_code krb5_us_timeofday + (krb5_context, + krb5_int32 *, + krb5_int32 * ); +krb5_error_code krb5_timeofday + (krb5_context, + krb5_int32 * ); + +krb5_error_code krb5_os_localaddr + (krb5_context, + krb5_address ***); +krb5_error_code krb5_get_default_realm + (krb5_context, + char ** ); +krb5_error_code krb5_set_default_realm + (krb5_context, + const char * ); +void krb5_free_default_realm + (krb5_context, + char * ); +krb5_error_code krb5_sname_to_principal + (krb5_context, + const char *, + const char *, + krb5_int32, + krb5_principal *); +krb5_error_code +krb5_change_password + (krb5_context context, krb5_creds *creds, char *newpw, + int *result_code, krb5_data *result_code_string, + krb5_data *result_string); +krb5_error_code +krb5_set_password + (krb5_context context, krb5_creds *creds, char *newpw, krb5_principal change_password_for, + int *result_code, krb5_data *result_code_string, krb5_data *result_string); +krb5_error_code +krb5_set_password_using_ccache + (krb5_context context, krb5_ccache ccache, char *newpw, krb5_principal change_password_for, + int *result_code, krb5_data *result_code_string, krb5_data *result_string); + + +krb5_error_code krb5_set_config_files + (krb5_context, const char **); + +krb5_error_code krb5_get_default_config_files + (char ***filenames); + +void krb5_free_config_files + (char **filenames); + + +krb5_error_code +krb5_get_profile + (krb5_context, struct _profile_t * *); + + +krb5_error_code krb5_send_tgs + (krb5_context, + krb5_flags, + const krb5_ticket_times *, + const krb5_enctype *, + krb5_const_principal, + krb5_address * const *, + krb5_authdata * const *, + krb5_pa_data * const *, + const krb5_data *, + krb5_creds *, + krb5_response * ); + + + +krb5_error_code krb5_get_in_tkt + (krb5_context, + krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + krb5_error_code ( * )(krb5_context, + krb5_enctype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock **), + krb5_const_pointer, + krb5_error_code ( * )(krb5_context, + const krb5_keyblock *, + krb5_const_pointer, + krb5_kdc_rep * ), + krb5_const_pointer, + krb5_creds *, + krb5_ccache, + krb5_kdc_rep ** ); + +krb5_error_code krb5_get_in_tkt_with_password + (krb5_context, + krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + const char *, + krb5_ccache, + krb5_creds *, + krb5_kdc_rep ** ); + +krb5_error_code krb5_get_in_tkt_with_skey + (krb5_context, + krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + const krb5_keyblock *, + krb5_ccache, + krb5_creds *, + krb5_kdc_rep ** ); + +krb5_error_code krb5_get_in_tkt_with_keytab + (krb5_context, + krb5_flags, + krb5_address * const *, + krb5_enctype *, + krb5_preauthtype *, + krb5_keytab, + krb5_ccache, + krb5_creds *, + krb5_kdc_rep ** ); + + + +krb5_error_code krb5_decode_kdc_rep + (krb5_context, + krb5_data *, + const krb5_keyblock *, + krb5_kdc_rep ** ); + + +krb5_error_code krb5_rd_req + (krb5_context, + krb5_auth_context *, + const krb5_data *, + krb5_const_principal, + krb5_keytab, + krb5_flags *, + krb5_ticket **); + + +krb5_error_code krb5_rd_req_decoded + (krb5_context, + krb5_auth_context *, + const krb5_ap_req *, + krb5_const_principal, + krb5_keytab, + krb5_flags *, + krb5_ticket **); + +krb5_error_code krb5_rd_req_decoded_anyflag + (krb5_context, + krb5_auth_context *, + const krb5_ap_req *, + krb5_const_principal, + krb5_keytab, + krb5_flags *, + krb5_ticket **); + + +krb5_error_code krb5_kt_read_service_key + (krb5_context, + krb5_pointer, + krb5_principal, + krb5_kvno, + krb5_enctype, + krb5_keyblock **); +krb5_error_code krb5_mk_safe + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *); +krb5_error_code krb5_mk_priv + (krb5_context, + krb5_auth_context, + const krb5_data *, + krb5_data *, + krb5_replay_data *); + +krb5_error_code krb5_cc_register + (krb5_context, + krb5_cc_ops *, + krb5_boolean ); + + +krb5_error_code krb5_sendauth + (krb5_context, + krb5_auth_context *, + krb5_pointer, + char *, + krb5_principal, + krb5_principal, + krb5_flags, + krb5_data *, + krb5_creds *, + krb5_ccache, + krb5_error **, + krb5_ap_rep_enc_part **, + krb5_creds **); + +krb5_error_code krb5_recvauth + (krb5_context, + krb5_auth_context *, + krb5_pointer, + char *, + krb5_principal, + krb5_int32, + krb5_keytab, + krb5_ticket **); +krb5_error_code krb5_recvauth_version + (krb5_context, + krb5_auth_context *, + krb5_pointer, + krb5_principal, + krb5_int32, + krb5_keytab, + krb5_ticket **, + krb5_data *); + + +krb5_error_code krb5_walk_realm_tree + (krb5_context, + const krb5_data *, + const krb5_data *, + krb5_principal **, + int); + + +krb5_error_code krb5_mk_ncred + (krb5_context, + krb5_auth_context, + krb5_creds **, + krb5_data **, + krb5_replay_data *); + +krb5_error_code krb5_mk_1cred + (krb5_context, + krb5_auth_context, + krb5_creds *, + krb5_data **, + krb5_replay_data *); + +krb5_error_code krb5_rd_cred + (krb5_context, + krb5_auth_context, + krb5_data *, + krb5_creds ***, + krb5_replay_data *); + +krb5_error_code krb5_fwd_tgt_creds + (krb5_context, + krb5_auth_context, + char *, + krb5_principal, + krb5_principal, + krb5_ccache, + int forwardable, + krb5_data *); + +krb5_error_code krb5_auth_con_init + (krb5_context, + krb5_auth_context *); + +krb5_error_code krb5_auth_con_free + (krb5_context, + krb5_auth_context); + +krb5_error_code krb5_auth_con_setflags + (krb5_context, + krb5_auth_context, + krb5_int32); + +krb5_error_code krb5_auth_con_getflags + (krb5_context, + krb5_auth_context, + krb5_int32 *); + +krb5_error_code +krb5_auth_con_set_checksum_func (krb5_context, krb5_auth_context, + krb5_mk_req_checksum_func, void *); + +krb5_error_code +krb5_auth_con_get_checksum_func( krb5_context, krb5_auth_context, + krb5_mk_req_checksum_func *, void **); + +krb5_error_code krb5_auth_con_setaddrs + (krb5_context, + krb5_auth_context, + krb5_address *, + krb5_address *); + +krb5_error_code krb5_auth_con_getaddrs + (krb5_context, + krb5_auth_context, + krb5_address **, + krb5_address **); + +krb5_error_code krb5_auth_con_setports + (krb5_context, + krb5_auth_context, + krb5_address *, + krb5_address *); + +krb5_error_code krb5_auth_con_setuseruserkey + (krb5_context, + krb5_auth_context, + krb5_keyblock *); + +krb5_error_code krb5_auth_con_getkey + (krb5_context, + krb5_auth_context, + krb5_keyblock **); + +krb5_error_code krb5_auth_con_getsendsubkey( + krb5_context, krb5_auth_context, krb5_keyblock **); + +krb5_error_code krb5_auth_con_getrecvsubkey( + krb5_context, krb5_auth_context, krb5_keyblock **); + +krb5_error_code krb5_auth_con_setsendsubkey( + krb5_context, krb5_auth_context, krb5_keyblock *); + +krb5_error_code krb5_auth_con_setrecvsubkey( + krb5_context, krb5_auth_context, krb5_keyblock *); + + +krb5_error_code krb5_auth_con_getlocalsubkey + (krb5_context, + krb5_auth_context, + krb5_keyblock **); + +krb5_error_code krb5_auth_con_getremotesubkey + (krb5_context, + krb5_auth_context, + krb5_keyblock **); + + + +krb5_error_code krb5_auth_con_set_req_cksumtype + (krb5_context, + krb5_auth_context, + krb5_cksumtype); + +krb5_error_code krb5_auth_con_set_safe_cksumtype + (krb5_context, + krb5_auth_context, + krb5_cksumtype); + + +krb5_error_code krb5_auth_con_getlocalseqnumber + (krb5_context, + krb5_auth_context, + krb5_int32 *); + +krb5_error_code krb5_auth_con_getremoteseqnumber + (krb5_context, + krb5_auth_context, + krb5_int32 *); + + +krb5_error_code krb5_auth_con_initivector + (krb5_context, + krb5_auth_context); + + + +krb5_error_code krb5_auth_con_setivector + (krb5_context, + krb5_auth_context, + krb5_pointer); + +krb5_error_code krb5_auth_con_getivector + (krb5_context, + krb5_auth_context, + krb5_pointer *); + + +krb5_error_code krb5_auth_con_setrcache + (krb5_context, + krb5_auth_context, + krb5_rcache); + +krb5_error_code krb5_auth_con_getrcache + (krb5_context, + krb5_auth_context, + krb5_rcache *); + + +krb5_error_code krb5_auth_con_setpermetypes + (krb5_context, + krb5_auth_context, + const krb5_enctype *); + +krb5_error_code krb5_auth_con_getpermetypes + (krb5_context, + krb5_auth_context, + krb5_enctype **); + + +krb5_error_code krb5_auth_con_getauthenticator + (krb5_context, + krb5_auth_context, + krb5_authenticator **); +krb5_error_code krb5_read_message (krb5_context, krb5_pointer, krb5_data *); +krb5_error_code krb5_write_message (krb5_context, krb5_pointer, krb5_data *); +int krb5_net_read (krb5_context, int , char *, int); +int krb5_net_write (krb5_context, int , const char *, int); + + +krb5_error_code krb5_read_password + (krb5_context, + const char *, + const char *, + char *, + unsigned int * ); +krb5_error_code krb5_aname_to_localname + (krb5_context, + krb5_const_principal, + int, + char * ); +krb5_error_code krb5_get_host_realm + (krb5_context, + const char *, + char *** ); +krb5_error_code krb5_free_host_realm + (krb5_context, + char * const * ); + +krb5_error_code krb5_get_realm_domain + (krb5_context, + const char *, + char ** ); + +krb5_boolean krb5_kuserok + (krb5_context, + krb5_principal, const char *); +krb5_error_code krb5_auth_con_genaddrs + (krb5_context, + krb5_auth_context, + int, int); + +krb5_error_code krb5_gen_portaddr + (krb5_context, + const krb5_address *, + krb5_const_pointer, + krb5_address **); +krb5_error_code krb5_gen_replay_name + (krb5_context, + const krb5_address *, + const char *, + char **); +krb5_error_code krb5_make_fulladdr + (krb5_context, + krb5_address *, + krb5_address *, + krb5_address *); + + +krb5_error_code krb5_set_real_time + (krb5_context, krb5_int32, krb5_int32); + + +krb5_error_code krb5_set_debugging_time + (krb5_context, krb5_int32, krb5_int32); +krb5_error_code krb5_use_natural_time + (krb5_context); + +krb5_error_code krb5_get_time_offsets + (krb5_context, krb5_int32 *, krb5_int32 *); + +krb5_error_code krb5_set_time_offsets + (krb5_context, krb5_int32, krb5_int32); + + + +krb5_error_code krb5_string_to_enctype + (char *, krb5_enctype *); +krb5_error_code krb5_string_to_salttype + (char *, krb5_int32 *); +krb5_error_code krb5_string_to_cksumtype + (char *, krb5_cksumtype *); +krb5_error_code krb5_string_to_timestamp + (char *, krb5_timestamp *); +krb5_error_code krb5_string_to_deltat + (char *, krb5_deltat *); +krb5_error_code krb5_enctype_to_string + (krb5_enctype, char *, size_t); +krb5_error_code krb5_salttype_to_string + (krb5_int32, char *, size_t); +krb5_error_code krb5_cksumtype_to_string + (krb5_cksumtype, char *, size_t); +krb5_error_code krb5_timestamp_to_string + (krb5_timestamp, char *, size_t); +krb5_error_code krb5_timestamp_to_sfstring + (krb5_timestamp, char *, size_t, char *); +krb5_error_code krb5_deltat_to_string + (krb5_deltat, char *, size_t); +typedef struct _krb5_prompt { + char *prompt; + int hidden; + krb5_data *reply; +} krb5_prompt; + +typedef krb5_error_code ( *krb5_prompter_fct)(krb5_context context, + void *data, + const char *name, + const char *banner, + int num_prompts, + krb5_prompt prompts[]); + + +krb5_error_code +krb5_prompter_posix (krb5_context context, + void *data, + const char *name, + const char *banner, + int num_prompts, + krb5_prompt prompts[]); + +typedef struct _krb5_get_init_creds_opt { + krb5_flags flags; + krb5_deltat tkt_life; + krb5_deltat renew_life; + int forwardable; + int proxiable; + krb5_enctype *etype_list; + int etype_list_length; + krb5_address **address_list; + krb5_preauthtype *preauth_list; + int preauth_list_length; + krb5_data *salt; +} krb5_get_init_creds_opt; +void +krb5_get_init_creds_opt_init +(krb5_get_init_creds_opt *opt); + +void +krb5_get_init_creds_opt_set_tkt_life +(krb5_get_init_creds_opt *opt, + krb5_deltat tkt_life); + +void +krb5_get_init_creds_opt_set_renew_life +(krb5_get_init_creds_opt *opt, + krb5_deltat renew_life); + +void +krb5_get_init_creds_opt_set_forwardable +(krb5_get_init_creds_opt *opt, + int forwardable); + +void +krb5_get_init_creds_opt_set_proxiable +(krb5_get_init_creds_opt *opt, + int proxiable); + +void +krb5_get_init_creds_opt_set_etype_list +(krb5_get_init_creds_opt *opt, + krb5_enctype *etype_list, + int etype_list_length); + +void +krb5_get_init_creds_opt_set_address_list +(krb5_get_init_creds_opt *opt, + krb5_address **addresses); + +void +krb5_get_init_creds_opt_set_preauth_list +(krb5_get_init_creds_opt *opt, + krb5_preauthtype *preauth_list, + int preauth_list_length); + +void +krb5_get_init_creds_opt_set_salt +(krb5_get_init_creds_opt *opt, + krb5_data *salt); + + + +krb5_error_code +krb5_get_init_creds_password +(krb5_context context, + krb5_creds *creds, + krb5_principal client, + char *password, + krb5_prompter_fct prompter, + void *data, + krb5_deltat start_time, + char *in_tkt_service, + krb5_get_init_creds_opt *k5_gic_options); + +krb5_error_code +krb5_get_init_creds_keytab +(krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_keytab arg_keytab, + krb5_deltat start_time, + char *in_tkt_service, + krb5_get_init_creds_opt *k5_gic_options); + +typedef struct _krb5_verify_init_creds_opt { + krb5_flags flags; + int ap_req_nofail; +} krb5_verify_init_creds_opt; + + + +void +krb5_verify_init_creds_opt_init +(krb5_verify_init_creds_opt *k5_vic_options); +void +krb5_verify_init_creds_opt_set_ap_req_nofail +(krb5_verify_init_creds_opt *k5_vic_options, + int ap_req_nofail); + +krb5_error_code +krb5_verify_init_creds +(krb5_context context, + krb5_creds *creds, + krb5_principal ap_req_server, + krb5_keytab ap_req_keytab, + krb5_ccache *ccache, + krb5_verify_init_creds_opt *k5_vic_options); + +krb5_error_code +krb5_get_validated_creds +(krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_ccache ccache, + char *in_tkt_service); + +krb5_error_code +krb5_get_renewed_creds +(krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_ccache ccache, + char *in_tkt_service); + +krb5_error_code +krb5_decode_ticket +(const krb5_data *code, + krb5_ticket **rep); + +void +krb5_appdefault_string +(krb5_context context, + const char *appname, + const krb5_data *realm, + const char *option, + const char *default_value, + char ** ret_value); + +void +krb5_appdefault_boolean +(krb5_context context, + const char *appname, + const krb5_data *realm, + const char *option, + int default_value, + int *ret_value); + + + + + + +krb5_error_code krb5_realm_iterator_create + (krb5_context context, void **iter_p); + +krb5_error_code krb5_realm_iterator + (krb5_context context, void **iter_p, char **ret_realm); + +void krb5_realm_iterator_free + (krb5_context context, void **iter_p); + +void krb5_free_realm_string + (krb5_context context, char *str); +typedef krb5_int32 krb5_prompt_type; + +krb5_prompt_type* krb5_get_prompt_types + (krb5_context context); + + + + + + + +typedef __builtin_va_list __gnuc_va_list; +typedef __gnuc_va_list va_list; + + +typedef long errcode_t; +typedef void (*et_old_error_hook_func) (const char *, errcode_t, + const char *, va_list ap); + +struct error_table { + char const * const * msgs; + long base; + unsigned int n_msgs; +}; + + + + + + +extern void com_err + (const char *, errcode_t, const char *, ...); +extern void com_err_va + (const char *whoami, errcode_t code, const char *fmt, + va_list ap); +extern const char * error_message + (errcode_t) + ; +extern errcode_t add_error_table + ( const struct error_table *) + ; +extern errcode_t remove_error_table + (const struct error_table *) + ; +extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func); +extern et_old_error_hook_func reset_com_err_hook (void); +extern const struct error_table et_krb5_error_table; + + + +extern void initialize_krb5_error_table (void) ; +extern const struct error_table et_kdb5_error_table; + + + +extern void initialize_kdb5_error_table (void) ; +extern const struct error_table et_kv5m_error_table; + + + +extern void initialize_kv5m_error_table (void) ; +extern const struct error_table et_k524_error_table; + + + +extern void initialize_k524_error_table (void) ; +extern const struct error_table et_asn1_error_table; + + + +extern void initialize_asn1_error_table (void) ; +typedef struct _profile_t *profile_t; +typedef char* profile_filespec_t; +typedef char* profile_filespec_list_t; +typedef const char * const_profile_filespec_t; +typedef const char * const_profile_filespec_list_t; + +long profile_init + (const_profile_filespec_t *files, profile_t *ret_profile); + +long profile_init_path + (const_profile_filespec_list_t filelist, profile_t *ret_profile); + +long profile_flush + (profile_t profile); +long profile_flush_to_file + (profile_t profile, const_profile_filespec_t outfile); +long profile_flush_to_buffer + (profile_t profile, char **bufp); +void profile_free_buffer + (profile_t profile, char *buf); + +long profile_is_writable + (profile_t profile, int *writable); +long profile_is_modified + (profile_t profile, int *modified); + +void profile_abandon + (profile_t profile); + +void profile_release + (profile_t profile); + +long profile_get_values + (profile_t profile, const char *const *names, char ***ret_values); + +void profile_free_list + (char **list); + +long profile_get_string + (profile_t profile, const char *name, const char *subname, + const char *subsubname, const char *def_val, + char **ret_string); +long profile_get_integer + (profile_t profile, const char *name, const char *subname, + const char *subsubname, int def_val, + int *ret_default); + +long profile_get_boolean + (profile_t profile, const char *name, const char *subname, + const char *subsubname, int def_val, + int *ret_default); + +long profile_get_relation_names + (profile_t profile, const char **names, char ***ret_names); + +long profile_get_subsection_names + (profile_t profile, const char **names, char ***ret_names); + +long profile_iterator_create + (profile_t profile, const char *const *names, + int flags, void **ret_iter); + +void profile_iterator_free + (void **iter_p); + +long profile_iterator + (void **iter_p, char **ret_name, char **ret_value); + +void profile_release_string (char *str); + +long profile_update_relation + (profile_t profile, const char **names, + const char *old_value, const char *new_value); + +long profile_clear_relation + (profile_t profile, const char **names); + +long profile_rename_section + (profile_t profile, const char **names, + const char *new_name); + +long profile_add_relation + (profile_t profile, const char **names, + const char *new_value); +extern const struct error_table et_prof_error_table; + + + +extern void initialize_prof_error_table (void) ; + + + + + + + + + + +struct iovec + { + void *iov_base; + size_t iov_len; + }; +extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count) + ; +extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count) + ; +extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count, + __off_t __offset) ; +extern ssize_t pwritev (int __fd, const struct iovec *__iovec, int __count, + __off_t __offset) ; + + + + + + + +typedef __socklen_t socklen_t; + + + + +enum __socket_type +{ + SOCK_STREAM = 1, + + + SOCK_DGRAM = 2, + + + SOCK_RAW = 3, + + SOCK_RDM = 4, + + SOCK_SEQPACKET = 5, + + + SOCK_DCCP = 6, + + SOCK_PACKET = 10, + + + + + + + + SOCK_CLOEXEC = 02000000, + + + SOCK_NONBLOCK = 00004000 + + +}; +typedef unsigned short int sa_family_t; + + +struct sockaddr + { + sa_family_t sa_family; + char sa_data[14]; + }; +struct sockaddr_storage + { + sa_family_t ss_family; + unsigned long int __ss_align; + char __ss_padding[(128 - (2 * sizeof (unsigned long int)))]; + }; + + + +enum + { + MSG_OOB = 0x01, + + MSG_PEEK = 0x02, + + MSG_DONTROUTE = 0x04, + + + + + + + MSG_CTRUNC = 0x08, + + MSG_PROXY = 0x10, + + MSG_TRUNC = 0x20, + + MSG_DONTWAIT = 0x40, + + MSG_EOR = 0x80, + + MSG_WAITALL = 0x100, + + MSG_FIN = 0x200, + + MSG_SYN = 0x400, + + MSG_CONFIRM = 0x800, + + MSG_RST = 0x1000, + + MSG_ERRQUEUE = 0x2000, + + MSG_NOSIGNAL = 0x4000, + + MSG_MORE = 0x8000, + + MSG_WAITFORONE = 0x10000, + + MSG_FASTOPEN = 0x20000000, + + + MSG_CMSG_CLOEXEC = 0x40000000 + + + + }; + + + + +struct msghdr + { + void *msg_name; + socklen_t msg_namelen; + + struct iovec *msg_iov; + size_t msg_iovlen; + + void *msg_control; + size_t msg_controllen; + + + + + int msg_flags; + }; + + +struct cmsghdr + { + size_t cmsg_len; + + + + + int cmsg_level; + int cmsg_type; + + __extension__ unsigned char __cmsg_data []; + + }; +extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, + struct cmsghdr *__cmsg) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern __inline __attribute__ ((__gnu_inline__)) struct cmsghdr * +__attribute__ ((__nothrow__ , __leaf__)) __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) +{ + if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) + + return (struct cmsghdr *) 0; + + __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg + + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))); + if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control + + __mhdr->msg_controllen) + || ((unsigned char *) __cmsg + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1)) + > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) + + return (struct cmsghdr *) 0; + return __cmsg; +} + + + + +enum + { + SCM_RIGHTS = 0x01 + + + + + + }; + + + +struct linger + { + int l_onoff; + int l_linger; + }; + + + + +struct osockaddr + { + unsigned short int sa_family; + unsigned char sa_data[14]; + }; + + + + +enum +{ + SHUT_RD = 0, + + SHUT_WR, + + SHUT_RDWR + +}; +extern int socket (int __domain, int __type, int __protocol) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern int socketpair (int __domain, int __type, int __protocol, + int __fds[2]) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int bind (int __fd, const struct sockaddr * __addr, socklen_t __len) + __attribute__ ((__nothrow__ , __leaf__)); + + +extern int getsockname (int __fd, struct sockaddr *__restrict __addr, + socklen_t *__restrict __len) __attribute__ ((__nothrow__ , __leaf__)); +extern int connect (int __fd, const struct sockaddr * __addr, socklen_t __len); + + + +extern int getpeername (int __fd, struct sockaddr *__restrict __addr, + socklen_t *__restrict __len) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +extern ssize_t send (int __fd, const void *__buf, size_t __n, int __flags); + + + + + + +extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags); + + + + + + +extern ssize_t sendto (int __fd, const void *__buf, size_t __n, + int __flags, const struct sockaddr * __addr, + socklen_t __addr_len); +extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, + int __flags, struct sockaddr *__restrict __addr, + socklen_t *__restrict __addr_len); + + + + + + + +extern ssize_t sendmsg (int __fd, const struct msghdr *__message, + int __flags); +extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); +extern int getsockopt (int __fd, int __level, int __optname, + void *__restrict __optval, + socklen_t *__restrict __optlen) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int setsockopt (int __fd, int __level, int __optname, + const void *__optval, socklen_t __optlen) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern int listen (int __fd, int __n) __attribute__ ((__nothrow__ , __leaf__)); +extern int accept (int __fd, struct sockaddr *__restrict __addr, + socklen_t *__restrict __addr_len); +extern int shutdown (int __fd, int __how) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int sockatmark (int __fd) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + +extern int isfdtype (int __fd, int __fdtype) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + +enum + { + IPPROTO_IP = 0, + + IPPROTO_HOPOPTS = 0, + + IPPROTO_ICMP = 1, + + IPPROTO_IGMP = 2, + + IPPROTO_IPIP = 4, + + IPPROTO_TCP = 6, + + IPPROTO_EGP = 8, + + IPPROTO_PUP = 12, + + IPPROTO_UDP = 17, + + IPPROTO_IDP = 22, + + IPPROTO_TP = 29, + + IPPROTO_DCCP = 33, + + IPPROTO_IPV6 = 41, + + IPPROTO_ROUTING = 43, + + IPPROTO_FRAGMENT = 44, + + IPPROTO_RSVP = 46, + + IPPROTO_GRE = 47, + + IPPROTO_ESP = 50, + + IPPROTO_AH = 51, + + IPPROTO_ICMPV6 = 58, + + IPPROTO_NONE = 59, + + IPPROTO_DSTOPTS = 60, + + IPPROTO_MTP = 92, + + IPPROTO_ENCAP = 98, + + IPPROTO_PIM = 103, + + IPPROTO_COMP = 108, + + IPPROTO_SCTP = 132, + + IPPROTO_UDPLITE = 136, + + IPPROTO_RAW = 255, + + IPPROTO_MAX + }; + + + +typedef uint16_t in_port_t; + + +enum + { + IPPORT_ECHO = 7, + IPPORT_DISCARD = 9, + IPPORT_SYSTAT = 11, + IPPORT_DAYTIME = 13, + IPPORT_NETSTAT = 15, + IPPORT_FTP = 21, + IPPORT_TELNET = 23, + IPPORT_SMTP = 25, + IPPORT_TIMESERVER = 37, + IPPORT_NAMESERVER = 42, + IPPORT_WHOIS = 43, + IPPORT_MTP = 57, + + IPPORT_TFTP = 69, + IPPORT_RJE = 77, + IPPORT_FINGER = 79, + IPPORT_TTYLINK = 87, + IPPORT_SUPDUP = 95, + + + IPPORT_EXECSERVER = 512, + IPPORT_LOGINSERVER = 513, + IPPORT_CMDSERVER = 514, + IPPORT_EFSSERVER = 520, + + + IPPORT_BIFFUDP = 512, + IPPORT_WHOSERVER = 513, + IPPORT_ROUTESERVER = 520, + + + IPPORT_RESERVED = 1024, + + + IPPORT_USERRESERVED = 5000 + }; + + + +typedef uint32_t in_addr_t; +struct in_addr + { + in_addr_t s_addr; + }; +struct in6_addr + { + union + { + uint8_t __u6_addr8[16]; + + uint16_t __u6_addr16[8]; + uint32_t __u6_addr32[4]; + + } __in6_u; + + + + + + }; + +extern const struct in6_addr in6addr_any; +extern const struct in6_addr in6addr_loopback; +struct sockaddr_in + { + sa_family_t sin_family; + in_port_t sin_port; + struct in_addr sin_addr; + + + unsigned char sin_zero[sizeof (struct sockaddr) - + (sizeof (unsigned short int)) - + sizeof (in_port_t) - + sizeof (struct in_addr)]; + }; + + +struct sockaddr_in6 + { + sa_family_t sin6_family; + in_port_t sin6_port; + uint32_t sin6_flowinfo; + struct in6_addr sin6_addr; + uint32_t sin6_scope_id; + }; + + + + +struct ip_mreq + { + + struct in_addr imr_multiaddr; + + + struct in_addr imr_interface; + }; + +struct ip_mreq_source + { + + struct in_addr imr_multiaddr; + + + struct in_addr imr_interface; + + + struct in_addr imr_sourceaddr; + }; + + + + +struct ipv6_mreq + { + + struct in6_addr ipv6mr_multiaddr; + + + unsigned int ipv6mr_interface; + }; + + + + +struct group_req + { + + uint32_t gr_interface; + + + struct sockaddr_storage gr_group; + }; + +struct group_source_req + { + + uint32_t gsr_interface; + + + struct sockaddr_storage gsr_group; + + + struct sockaddr_storage gsr_source; + }; + + + +struct ip_msfilter + { + + struct in_addr imsf_multiaddr; + + + struct in_addr imsf_interface; + + + uint32_t imsf_fmode; + + + uint32_t imsf_numsrc; + + struct in_addr imsf_slist[1]; + }; + + + + + +struct group_filter + { + + uint32_t gf_interface; + + + struct sockaddr_storage gf_group; + + + uint32_t gf_fmode; + + + uint32_t gf_numsrc; + + struct sockaddr_storage gf_slist[1]; +}; +struct ip_opts + { + struct in_addr ip_dst; + char ip_opts[40]; + }; + + +struct ip_mreqn + { + struct in_addr imr_multiaddr; + struct in_addr imr_address; + int imr_ifindex; + }; + + +struct in_pktinfo + { + int ipi_ifindex; + struct in_addr ipi_spec_dst; + struct in_addr ipi_addr; + }; +extern uint32_t ntohl (uint32_t __netlong) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern uint16_t ntohs (uint16_t __netshort) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern uint32_t htonl (uint32_t __hostlong) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern uint16_t htons (uint16_t __hostshort) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); + + + + +extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) + __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern in_addr_t inet_addr (const char *__cp) __attribute__ ((__nothrow__ , __leaf__)); + + +extern in_addr_t inet_lnaof (struct in_addr __in) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host) + __attribute__ ((__nothrow__ , __leaf__)); + + +extern in_addr_t inet_netof (struct in_addr __in) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern in_addr_t inet_network (const char *__cp) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern char *inet_ntoa (struct in_addr __in) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int inet_pton (int __af, const char *__restrict __cp, + void *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern const char *inet_ntop (int __af, const void *__restrict __cp, + char *__restrict __buf, socklen_t __len) + __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +extern int inet_aton (const char *__cp, struct in_addr *__inp) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern char *inet_net_ntop (int __af, const void *__cp, int __bits, + char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int inet_net_pton (int __af, const char *__cp, + void *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern unsigned int inet_nsap_addr (const char *__cp, + unsigned char *__buf, int __len) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp, + char *__buf) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +struct rpcent +{ + char *r_name; + char **r_aliases; + int r_number; +}; + +extern void setrpcent (int __stayopen) __attribute__ ((__nothrow__ , __leaf__)); +extern void endrpcent (void) __attribute__ ((__nothrow__ , __leaf__)); +extern struct rpcent *getrpcbyname (const char *__name) __attribute__ ((__nothrow__ , __leaf__)); +extern struct rpcent *getrpcbynumber (int __number) __attribute__ ((__nothrow__ , __leaf__)); +extern struct rpcent *getrpcent (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int getrpcbyname_r (const char *__name, struct rpcent *__result_buf, + char *__buffer, size_t __buflen, + struct rpcent **__result) __attribute__ ((__nothrow__ , __leaf__)); + +extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf, + char *__buffer, size_t __buflen, + struct rpcent **__result) __attribute__ ((__nothrow__ , __leaf__)); + +extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer, + size_t __buflen, struct rpcent **__result) __attribute__ ((__nothrow__ , __leaf__)); + + + +struct netent +{ + char *n_name; + char **n_aliases; + int n_addrtype; + uint32_t n_net; +}; + + + + + + + + +extern int *__h_errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern void herror (const char *__str) __attribute__ ((__nothrow__ , __leaf__)); + + +extern const char *hstrerror (int __err_num) __attribute__ ((__nothrow__ , __leaf__)); + + + + +struct hostent +{ + char *h_name; + char **h_aliases; + int h_addrtype; + int h_length; + char **h_addr_list; + + + +}; + + + + + + +extern void sethostent (int __stay_open); + + + + + +extern void endhostent (void); + + + + + + +extern struct hostent *gethostent (void); + + + + + + +extern struct hostent *gethostbyaddr (const void *__addr, __socklen_t __len, + int __type); + + + + + +extern struct hostent *gethostbyname (const char *__name); +extern struct hostent *gethostbyname2 (const char *__name, int __af); +extern int gethostent_r (struct hostent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct hostent **__restrict __result, + int *__restrict __h_errnop); + +extern int gethostbyaddr_r (const void *__restrict __addr, __socklen_t __len, + int __type, + struct hostent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct hostent **__restrict __result, + int *__restrict __h_errnop); + +extern int gethostbyname_r (const char *__restrict __name, + struct hostent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct hostent **__restrict __result, + int *__restrict __h_errnop); + +extern int gethostbyname2_r (const char *__restrict __name, int __af, + struct hostent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct hostent **__restrict __result, + int *__restrict __h_errnop); +extern void setnetent (int __stay_open); + + + + + +extern void endnetent (void); + + + + + + +extern struct netent *getnetent (void); + + + + + + +extern struct netent *getnetbyaddr (uint32_t __net, int __type); + + + + + +extern struct netent *getnetbyname (const char *__name); +extern int getnetent_r (struct netent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct netent **__restrict __result, + int *__restrict __h_errnop); + +extern int getnetbyaddr_r (uint32_t __net, int __type, + struct netent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct netent **__restrict __result, + int *__restrict __h_errnop); + +extern int getnetbyname_r (const char *__restrict __name, + struct netent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct netent **__restrict __result, + int *__restrict __h_errnop); + + + + +struct servent +{ + char *s_name; + char **s_aliases; + int s_port; + char *s_proto; +}; + + + + + + +extern void setservent (int __stay_open); + + + + + +extern void endservent (void); + + + + + + +extern struct servent *getservent (void); + + + + + + +extern struct servent *getservbyname (const char *__name, const char *__proto); + + + + + + +extern struct servent *getservbyport (int __port, const char *__proto); +extern int getservent_r (struct servent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct servent **__restrict __result); + +extern int getservbyname_r (const char *__restrict __name, + const char *__restrict __proto, + struct servent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct servent **__restrict __result); + +extern int getservbyport_r (int __port, const char *__restrict __proto, + struct servent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct servent **__restrict __result); + + + + +struct protoent +{ + char *p_name; + char **p_aliases; + int p_proto; +}; + + + + + + +extern void setprotoent (int __stay_open); + + + + + +extern void endprotoent (void); + + + + + + +extern struct protoent *getprotoent (void); + + + + + +extern struct protoent *getprotobyname (const char *__name); + + + + + +extern struct protoent *getprotobynumber (int __proto); +extern int getprotoent_r (struct protoent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct protoent **__restrict __result); + +extern int getprotobyname_r (const char *__restrict __name, + struct protoent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct protoent **__restrict __result); + +extern int getprotobynumber_r (int __proto, + struct protoent *__restrict __result_buf, + char *__restrict __buf, size_t __buflen, + struct protoent **__restrict __result); +extern int setnetgrent (const char *__netgroup); + + + + + + + +extern void endnetgrent (void); +extern int getnetgrent (char **__restrict __hostp, + char **__restrict __userp, + char **__restrict __domainp); +extern int innetgr (const char *__netgroup, const char *__host, + const char *__user, const char *__domain); + + + + + + + +extern int getnetgrent_r (char **__restrict __hostp, + char **__restrict __userp, + char **__restrict __domainp, + char *__restrict __buffer, size_t __buflen); +extern int rcmd (char **__restrict __ahost, unsigned short int __rport, + const char *__restrict __locuser, + const char *__restrict __remuser, + const char *__restrict __cmd, int *__restrict __fd2p); +extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport, + const char *__restrict __locuser, + const char *__restrict __remuser, + const char *__restrict __cmd, int *__restrict __fd2p, + sa_family_t __af); +extern int rexec (char **__restrict __ahost, int __rport, + const char *__restrict __name, + const char *__restrict __pass, + const char *__restrict __cmd, int *__restrict __fd2p); +extern int rexec_af (char **__restrict __ahost, int __rport, + const char *__restrict __name, + const char *__restrict __pass, + const char *__restrict __cmd, int *__restrict __fd2p, + sa_family_t __af); +extern int ruserok (const char *__rhost, int __suser, + const char *__remuser, const char *__locuser); +extern int ruserok_af (const char *__rhost, int __suser, + const char *__remuser, const char *__locuser, + sa_family_t __af); +extern int iruserok (uint32_t __raddr, int __suser, + const char *__remuser, const char *__locuser); +extern int iruserok_af (const void *__raddr, int __suser, + const char *__remuser, const char *__locuser, + sa_family_t __af); +extern int rresvport (int *__alport); +extern int rresvport_af (int *__alport, sa_family_t __af); + + + + + + +struct addrinfo +{ + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + socklen_t ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; +extern int getaddrinfo (const char *__restrict __name, + const char *__restrict __service, + const struct addrinfo *__restrict __req, + struct addrinfo **__restrict __pai); + + +extern void freeaddrinfo (struct addrinfo *__ai) __attribute__ ((__nothrow__ , __leaf__)); + + +extern const char *gai_strerror (int __ecode) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern int getnameinfo (const struct sockaddr *__restrict __sa, + socklen_t __salen, char *__restrict __host, + socklen_t __hostlen, char *__restrict __serv, + socklen_t __servlen, int __flags); + + + + + + + + + + + +extern int __sigismember (const __sigset_t *, int); +extern int __sigaddset (__sigset_t *, int); +extern int __sigdelset (__sigset_t *, int); +extern __inline __attribute__ ((__gnu_inline__)) int __sigismember (const __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return (__set->__val[__word] & __mask) ? 1 : 0; } +extern __inline __attribute__ ((__gnu_inline__)) int __sigaddset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] |= __mask), 0); } +extern __inline __attribute__ ((__gnu_inline__)) int __sigdelset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] &= ~__mask), 0); } + + + + + + + +typedef __sig_atomic_t sig_atomic_t; + + + + + + + + +typedef union sigval + { + int sival_int; + void *sival_ptr; + } sigval_t; +typedef __clock_t __sigchld_clock_t; + + + +typedef struct + { + int si_signo; + int si_errno; + + int si_code; + + union + { + int _pad[((128 / sizeof (int)) - 4)]; + + + struct + { + __pid_t si_pid; + __uid_t si_uid; + } _kill; + + + struct + { + int si_tid; + int si_overrun; + sigval_t si_sigval; + } _timer; + + + struct + { + __pid_t si_pid; + __uid_t si_uid; + sigval_t si_sigval; + } _rt; + + + struct + { + __pid_t si_pid; + __uid_t si_uid; + int si_status; + __sigchld_clock_t si_utime; + __sigchld_clock_t si_stime; + } _sigchld; + + + struct + { + void *si_addr; + short int si_addr_lsb; + } _sigfault; + + + struct + { + long int si_band; + int si_fd; + } _sigpoll; + + + struct + { + void *_call_addr; + int _syscall; + unsigned int _arch; + } _sigsys; + } _sifields; + } siginfo_t ; +enum +{ + SI_ASYNCNL = -60, + + SI_TKILL = -6, + + SI_SIGIO, + + SI_ASYNCIO, + + SI_MESGQ, + + SI_TIMER, + + SI_QUEUE, + + SI_USER, + + SI_KERNEL = 0x80 + +}; + + + +enum +{ + ILL_ILLOPC = 1, + + ILL_ILLOPN, + + ILL_ILLADR, + + ILL_ILLTRP, + + ILL_PRVOPC, + + ILL_PRVREG, + + ILL_COPROC, + + ILL_BADSTK + +}; + + +enum +{ + FPE_INTDIV = 1, + + FPE_INTOVF, + + FPE_FLTDIV, + + FPE_FLTOVF, + + FPE_FLTUND, + + FPE_FLTRES, + + FPE_FLTINV, + + FPE_FLTSUB + +}; + + +enum +{ + SEGV_MAPERR = 1, + + SEGV_ACCERR + +}; + + +enum +{ + BUS_ADRALN = 1, + + BUS_ADRERR, + + BUS_OBJERR, + + BUS_MCEERR_AR, + + BUS_MCEERR_AO + +}; + + +enum +{ + TRAP_BRKPT = 1, + + TRAP_TRACE + +}; + + +enum +{ + CLD_EXITED = 1, + + CLD_KILLED, + + CLD_DUMPED, + + CLD_TRAPPED, + + CLD_STOPPED, + + CLD_CONTINUED + +}; + + +enum +{ + POLL_IN = 1, + + POLL_OUT, + + POLL_MSG, + + POLL_ERR, + + POLL_PRI, + + POLL_HUP + +}; +typedef struct sigevent + { + sigval_t sigev_value; + int sigev_signo; + int sigev_notify; + + union + { + int _pad[((64 / sizeof (int)) - 4)]; + + + + __pid_t _tid; + + struct + { + void (*_function) (sigval_t); + pthread_attr_t *_attribute; + } _sigev_thread; + } _sigev_un; + } sigevent_t; + + + + + + +enum +{ + SIGEV_SIGNAL = 0, + + SIGEV_NONE, + + SIGEV_THREAD, + + + SIGEV_THREAD_ID = 4 + +}; + + + + +typedef void (*__sighandler_t) (int); + + + + +extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler) + __attribute__ ((__nothrow__ , __leaf__)); + + +extern __sighandler_t signal (int __sig, __sighandler_t __handler) + __attribute__ ((__nothrow__ , __leaf__)); + +extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int raise (int __sig) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) + __attribute__ ((__nothrow__ , __leaf__)); +extern int gsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern void psignal (int __sig, const char *__s); + + + + +extern void psiginfo (const siginfo_t *__pinfo, const char *__s); +extern int __sigpause (int __sig_or_mask, int __is_sig); +extern int sigblock (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__)); + + +extern int sigsetmask (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__)); + + +extern int siggetmask (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__)); +typedef __sighandler_t sig_t; + + + + + +extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int sigismember (const sigset_t *__set, int __signo) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +struct sigaction + { + + + union + { + + __sighandler_t sa_handler; + + void (*sa_sigaction) (int, siginfo_t *, void *); + } + __sigaction_handler; + + + + + + + + __sigset_t sa_mask; + + + int sa_flags; + + + void (*sa_restorer) (void); + }; + + +extern int sigprocmask (int __how, const sigset_t *__restrict __set, + sigset_t *__restrict __oset) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1))); + + +extern int sigaction (int __sig, const struct sigaction *__restrict __act, + struct sigaction *__restrict __oact) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + +extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig) + __attribute__ ((__nonnull__ (1, 2))); + + + + + + +extern int sigwaitinfo (const sigset_t *__restrict __set, + siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1))); + + + + + + +extern int sigtimedwait (const sigset_t *__restrict __set, + siginfo_t *__restrict __info, + const struct timespec *__restrict __timeout) + __attribute__ ((__nonnull__ (1))); + + + +extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val) + __attribute__ ((__nothrow__ , __leaf__)); +extern const char *const _sys_siglist[65]; +extern const char *const sys_siglist[65]; + + +struct sigvec + { + __sighandler_t sv_handler; + int sv_mask; + + int sv_flags; + + }; +extern int sigvec (int __sig, const struct sigvec *__vec, + struct sigvec *__ovec) __attribute__ ((__nothrow__ , __leaf__)); + + + +struct _fpx_sw_bytes +{ + __uint32_t magic1; + __uint32_t extended_size; + __uint64_t xstate_bv; + __uint32_t xstate_size; + __uint32_t padding[7]; +}; + +struct _fpreg +{ + unsigned short significand[4]; + unsigned short exponent; +}; + +struct _fpxreg +{ + unsigned short significand[4]; + unsigned short exponent; + unsigned short padding[3]; +}; + +struct _xmmreg +{ + __uint32_t element[4]; +}; +struct _fpstate +{ + + __uint16_t cwd; + __uint16_t swd; + __uint16_t ftw; + __uint16_t fop; + __uint64_t rip; + __uint64_t rdp; + __uint32_t mxcsr; + __uint32_t mxcr_mask; + struct _fpxreg _st[8]; + struct _xmmreg _xmm[16]; + __uint32_t padding[24]; +}; + +struct sigcontext +{ + __uint64_t r8; + __uint64_t r9; + __uint64_t r10; + __uint64_t r11; + __uint64_t r12; + __uint64_t r13; + __uint64_t r14; + __uint64_t r15; + __uint64_t rdi; + __uint64_t rsi; + __uint64_t rbp; + __uint64_t rbx; + __uint64_t rdx; + __uint64_t rax; + __uint64_t rcx; + __uint64_t rsp; + __uint64_t rip; + __uint64_t eflags; + unsigned short cs; + unsigned short gs; + unsigned short fs; + unsigned short __pad0; + __uint64_t err; + __uint64_t trapno; + __uint64_t oldmask; + __uint64_t cr2; + __extension__ union + { + struct _fpstate * fpstate; + __uint64_t __fpstate_word; + }; + __uint64_t __reserved1 [8]; +}; + + + +struct _xsave_hdr +{ + __uint64_t xstate_bv; + __uint64_t reserved1[2]; + __uint64_t reserved2[5]; +}; + +struct _ymmh_state +{ + __uint32_t ymmh_space[64]; +}; + +struct _xstate +{ + struct _fpstate fpstate; + struct _xsave_hdr xstate_hdr; + struct _ymmh_state ymmh; +}; + + +extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + + + + +extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__)); + +struct sigstack + { + void *ss_sp; + int ss_onstack; + }; + + + +enum +{ + SS_ONSTACK = 1, + + SS_DISABLE + +}; +typedef struct sigaltstack + { + void *ss_sp; + int ss_flags; + size_t ss_size; + } stack_t; + + +__extension__ typedef long long int greg_t; + + + + + +typedef greg_t gregset_t[23]; +struct _libc_fpxreg +{ + unsigned short int significand[4]; + unsigned short int exponent; + unsigned short int padding[3]; +}; + +struct _libc_xmmreg +{ + __uint32_t element[4]; +}; + +struct _libc_fpstate +{ + + __uint16_t cwd; + __uint16_t swd; + __uint16_t ftw; + __uint16_t fop; + __uint64_t rip; + __uint64_t rdp; + __uint32_t mxcsr; + __uint32_t mxcr_mask; + struct _libc_fpxreg _st[8]; + struct _libc_xmmreg _xmm[16]; + __uint32_t padding[24]; +}; + + +typedef struct _libc_fpstate *fpregset_t; + + +typedef struct + { + gregset_t gregs; + + fpregset_t fpregs; + __extension__ unsigned long long __reserved1 [8]; +} mcontext_t; + + +typedef struct ucontext + { + unsigned long int uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + mcontext_t uc_mcontext; + __sigset_t uc_sigmask; + struct _libc_fpstate __fpregs_mem; + } ucontext_t; + + + + + +extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__)); + + + +extern int sigaltstack (const struct sigaltstack *__restrict __ss, + struct sigaltstack *__restrict __oss) __attribute__ ((__nothrow__ , __leaf__)); +extern int pthread_sigmask (int __how, + const __sigset_t *__restrict __newmask, + __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__ , __leaf__)); + + +extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__ , __leaf__)); + +extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + + + + + +struct timezone + { + int tz_minuteswest; + int tz_dsttime; + }; + +typedef struct timezone *__restrict __timezone_ptr_t; +extern int gettimeofday (struct timeval *__restrict __tv, + __timezone_ptr_t __tz) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + +extern int settimeofday (const struct timeval *__tv, + const struct timezone *__tz) + __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern int adjtime (const struct timeval *__delta, + struct timeval *__olddelta) __attribute__ ((__nothrow__ , __leaf__)); + + + + +enum __itimer_which + { + + ITIMER_REAL = 0, + + + ITIMER_VIRTUAL = 1, + + + + ITIMER_PROF = 2 + + }; + + + +struct itimerval + { + + struct timeval it_interval; + + struct timeval it_value; + }; + + + + + + +typedef int __itimer_which_t; + + + + +extern int getitimer (__itimer_which_t __which, + struct itimerval *__value) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int setitimer (__itimer_which_t __which, + const struct itimerval *__restrict __new, + struct itimerval *__restrict __old) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int utimes (const char *__file, const struct timeval __tvp[2]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int lutimes (const char *__file, const struct timeval __tvp[2]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int futimes (int __fd, const struct timeval __tvp[2]) __attribute__ ((__nothrow__ , __leaf__)); + +struct if_nameindex + { + unsigned int if_index; + char *if_name; + }; + + + + +enum + { + IFF_UP = 0x1, + + IFF_BROADCAST = 0x2, + + IFF_DEBUG = 0x4, + + IFF_LOOPBACK = 0x8, + + IFF_POINTOPOINT = 0x10, + + IFF_NOTRAILERS = 0x20, + + IFF_RUNNING = 0x40, + + IFF_NOARP = 0x80, + + IFF_PROMISC = 0x100, + + + + IFF_ALLMULTI = 0x200, + + + IFF_MASTER = 0x400, + + IFF_SLAVE = 0x800, + + + IFF_MULTICAST = 0x1000, + + + IFF_PORTSEL = 0x2000, + + IFF_AUTOMEDIA = 0x4000, + + IFF_DYNAMIC = 0x8000 + + }; + + + + + + +struct ifaddr + { + struct sockaddr ifa_addr; + union + { + struct sockaddr ifu_broadaddr; + struct sockaddr ifu_dstaddr; + } ifa_ifu; + struct iface *ifa_ifp; + struct ifaddr *ifa_next; + }; +struct ifmap + { + unsigned long int mem_start; + unsigned long int mem_end; + unsigned short int base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; + + }; + + + + + +struct ifreq + { + + + union + { + char ifrn_name[16]; + } ifr_ifrn; + + union + { + struct sockaddr ifru_addr; + struct sockaddr ifru_dstaddr; + struct sockaddr ifru_broadaddr; + struct sockaddr ifru_netmask; + struct sockaddr ifru_hwaddr; + short int ifru_flags; + int ifru_ivalue; + int ifru_mtu; + struct ifmap ifru_map; + char ifru_slave[16]; + char ifru_newname[16]; + __caddr_t ifru_data; + } ifr_ifru; + }; +struct ifconf + { + int ifc_len; + union + { + __caddr_t ifcu_buf; + struct ifreq *ifcu_req; + } ifc_ifcu; + }; + + + + + + + + +extern unsigned int if_nametoindex (const char *__ifname) __attribute__ ((__nothrow__ , __leaf__)); +extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __attribute__ ((__nothrow__ , __leaf__)); + + +extern struct if_nameindex *if_nameindex (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern void if_freenameindex (struct if_nameindex *__ptr) __attribute__ ((__nothrow__ , __leaf__)); + + + +typedef struct iovec sg_buf; +static __inline__ struct sockaddr_in *sa2sin (struct sockaddr *sa) +{ + return (struct sockaddr_in *) (void *) sa; +} + +static __inline__ struct sockaddr_in6 *sa2sin6 (struct sockaddr *sa) +{ + return (struct sockaddr_in6 *) (void *) sa; +} + +static __inline__ struct sockaddr *ss2sa (struct sockaddr_storage *ss) +{ + return (struct sockaddr *) ss; +} +static __inline__ struct sockaddr_in *ss2sin (struct sockaddr_storage *ss) +{ + return (struct sockaddr_in *) ss; +} + +static __inline__ struct sockaddr_in6 *ss2sin6 (struct sockaddr_storage *ss) +{ + return (struct sockaddr_in6 *) ss; +} +typedef struct _krb5_alt_method { + krb5_magic magic; + krb5_int32 method; + unsigned int length; + krb5_octet *data; +} krb5_alt_method; +typedef struct _krb5_etype_info_entry { + krb5_magic magic; + krb5_enctype etype; + unsigned int length; + krb5_octet *salt; + krb5_data s2kparams; +} krb5_etype_info_entry; +typedef krb5_etype_info_entry ** krb5_etype_info; +typedef struct _krb5_predicted_sam_response { + krb5_magic magic; + krb5_keyblock sam_key; + krb5_flags sam_flags; + krb5_timestamp stime; + krb5_int32 susec; + krb5_principal client; + krb5_data msd; +} krb5_predicted_sam_response; + +typedef struct _krb5_sam_challenge { + krb5_magic magic; + krb5_int32 sam_type; + krb5_flags sam_flags; + krb5_data sam_type_name; + krb5_data sam_track_id; + krb5_data sam_challenge_label; + krb5_data sam_challenge; + krb5_data sam_response_prompt; + krb5_data sam_pk_for_sad; + krb5_int32 sam_nonce; + krb5_checksum sam_cksum; +} krb5_sam_challenge; + +typedef struct _krb5_sam_key { + krb5_magic magic; + krb5_keyblock sam_key; +} krb5_sam_key; + +typedef struct _krb5_enc_sam_response_enc { + krb5_magic magic; + krb5_int32 sam_nonce; + krb5_timestamp sam_timestamp; + krb5_int32 sam_usec; + krb5_data sam_sad; +} krb5_enc_sam_response_enc; + +typedef struct _krb5_sam_response { + krb5_magic magic; + krb5_int32 sam_type; + krb5_flags sam_flags; + krb5_data sam_track_id; + krb5_enc_data sam_enc_key; + krb5_enc_data sam_enc_nonce_or_ts; + krb5_int32 sam_nonce; + krb5_timestamp sam_patimestamp; +} krb5_sam_response; + +typedef struct _krb5_sam_challenge_2 { + krb5_data sam_challenge_2_body; + krb5_checksum **sam_cksum; +} krb5_sam_challenge_2; + +typedef struct _krb5_sam_challenge_2_body { + krb5_magic magic; + krb5_int32 sam_type; + krb5_flags sam_flags; + krb5_data sam_type_name; + krb5_data sam_track_id; + krb5_data sam_challenge_label; + krb5_data sam_challenge; + krb5_data sam_response_prompt; + krb5_data sam_pk_for_sad; + krb5_int32 sam_nonce; + krb5_enctype sam_etype; +} krb5_sam_challenge_2_body; + +typedef struct _krb5_sam_response_2 { + krb5_magic magic; + krb5_int32 sam_type; + krb5_flags sam_flags; + krb5_data sam_track_id; + krb5_enc_data sam_enc_nonce_or_sad; + krb5_int32 sam_nonce; +} krb5_sam_response_2; + +typedef struct _krb5_enc_sam_response_enc_2 { + krb5_magic magic; + krb5_int32 sam_nonce; + krb5_data sam_sad; +} krb5_enc_sam_response_enc_2; + + + + + + + + + + + + + + + +extern void *memcpy (void *__restrict __dest, const void *__restrict __src, + size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern void *memmove (void *__dest, const void *__src, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + + + +extern void *memccpy (void *__restrict __dest, const void *__restrict __src, + int __c, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + + +extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int memcmp (const void *__s1, const void *__s2, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); +extern void *memchr (const void *__s, int __c, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); + + + + +extern char *strcpy (char *__restrict __dest, const char *__restrict __src) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + +extern char *strncpy (char *__restrict __dest, + const char *__restrict __src, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern char *strcat (char *__restrict __dest, const char *__restrict __src) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + +extern char *strncat (char *__restrict __dest, const char *__restrict __src, + size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int strcmp (const char *__s1, const char *__s2) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); + +extern int strncmp (const char *__s1, const char *__s2, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int strcoll (const char *__s1, const char *__s2) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); + +extern size_t strxfrm (char *__restrict __dest, + const char *__restrict __src, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + +extern int strcoll_l (const char *__s1, const char *__s2, __locale_t __l) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); + +extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, + __locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))); + + + + + +extern char *strdup (const char *__s) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); + + + + + + +extern char *strndup (const char *__string, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); + +extern char *strchr (const char *__s, int __c) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); +extern char *strrchr (const char *__s, int __c) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern size_t strcspn (const char *__s, const char *__reject) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern size_t strspn (const char *__s, const char *__accept) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); +extern char *strpbrk (const char *__s, const char *__accept) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); +extern char *strstr (const char *__haystack, const char *__needle) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); + + + + +extern char *strtok (char *__restrict __s, const char *__restrict __delim) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + + + +extern char *__strtok_r (char *__restrict __s, + const char *__restrict __delim, + char **__restrict __save_ptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); + +extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, + char **__restrict __save_ptr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); + + +extern size_t strlen (const char *__s) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern size_t strnlen (const char *__string, size_t __maxlen) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__)); + +extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__)) + + __attribute__ ((__nonnull__ (2))); +extern char *strerror_l (int __errnum, __locale_t __l) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern void bcopy (const void *__src, void *__dest, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern int bcmp (const void *__s1, const void *__s2, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); +extern char *index (const char *__s, int __c) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); +extern char *rindex (const char *__s, int __c) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); + + + + +extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern int strcasecmp (const char *__s1, const char *__s2) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); +extern char *strsep (char **__restrict __stringp, + const char *__restrict __delim) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + +extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__)); + + +extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern char *__stpncpy (char *__restrict __dest, + const char *__restrict __src, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern char *stpncpy (char *__restrict __dest, + const char *__restrict __src, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + +extern void *__rawmemchr (const void *__s, int __c); +extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c1 (const char *__s, int __reject); +extern __inline __attribute__ ((__gnu_inline__)) size_t +__strcspn_c1 (const char *__s, int __reject) +{ + size_t __result = 0; + while (__s[__result] != '\0' && __s[__result] != __reject) + ++__result; + return __result; +} + +extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c2 (const char *__s, int __reject1, + int __reject2); +extern __inline __attribute__ ((__gnu_inline__)) size_t +__strcspn_c2 (const char *__s, int __reject1, int __reject2) +{ + size_t __result = 0; + while (__s[__result] != '\0' && __s[__result] != __reject1 + && __s[__result] != __reject2) + ++__result; + return __result; +} + +extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c3 (const char *__s, int __reject1, + int __reject2, int __reject3); +extern __inline __attribute__ ((__gnu_inline__)) size_t +__strcspn_c3 (const char *__s, int __reject1, int __reject2, + int __reject3) +{ + size_t __result = 0; + while (__s[__result] != '\0' && __s[__result] != __reject1 + && __s[__result] != __reject2 && __s[__result] != __reject3) + ++__result; + return __result; +} +extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c1 (const char *__s, int __accept); +extern __inline __attribute__ ((__gnu_inline__)) size_t +__strspn_c1 (const char *__s, int __accept) +{ + size_t __result = 0; + + while (__s[__result] == __accept) + ++__result; + return __result; +} + +extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c2 (const char *__s, int __accept1, + int __accept2); +extern __inline __attribute__ ((__gnu_inline__)) size_t +__strspn_c2 (const char *__s, int __accept1, int __accept2) +{ + size_t __result = 0; + + while (__s[__result] == __accept1 || __s[__result] == __accept2) + ++__result; + return __result; +} + +extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c3 (const char *__s, int __accept1, + int __accept2, int __accept3); +extern __inline __attribute__ ((__gnu_inline__)) size_t +__strspn_c3 (const char *__s, int __accept1, int __accept2, int __accept3) +{ + size_t __result = 0; + + while (__s[__result] == __accept1 || __s[__result] == __accept2 + || __s[__result] == __accept3) + ++__result; + return __result; +} +extern __inline __attribute__ ((__gnu_inline__)) char *__strpbrk_c2 (const char *__s, int __accept1, + int __accept2); +extern __inline __attribute__ ((__gnu_inline__)) char * +__strpbrk_c2 (const char *__s, int __accept1, int __accept2) +{ + + while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) + ++__s; + return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; +} + +extern __inline __attribute__ ((__gnu_inline__)) char *__strpbrk_c3 (const char *__s, int __accept1, + int __accept2, int __accept3); +extern __inline __attribute__ ((__gnu_inline__)) char * +__strpbrk_c3 (const char *__s, int __accept1, int __accept2, int __accept3) +{ + + while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 + && *__s != __accept3) + ++__s; + return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; +} +extern __inline __attribute__ ((__gnu_inline__)) char *__strtok_r_1c (char *__s, char __sep, char **__nextp); +extern __inline __attribute__ ((__gnu_inline__)) char * +__strtok_r_1c (char *__s, char __sep, char **__nextp) +{ + char *__result; + if (__s == ((void *)0)) + __s = *__nextp; + while (*__s == __sep) + ++__s; + __result = ((void *)0); + if (*__s != '\0') + { + __result = __s++; + while (*__s != '\0') + if (*__s++ == __sep) + { + __s[-1] = '\0'; + break; + } + } + *__nextp = __s; + return __result; +} +extern char *__strsep_g (char **__stringp, const char *__delim); +extern __inline __attribute__ ((__gnu_inline__)) char *__strsep_1c (char **__s, char __reject); +extern __inline __attribute__ ((__gnu_inline__)) char * +__strsep_1c (char **__s, char __reject) +{ + char *__retval = *__s; + if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0)) + *(*__s)++ = '\0'; + return __retval; +} + +extern __inline __attribute__ ((__gnu_inline__)) char *__strsep_2c (char **__s, char __reject1, char __reject2); +extern __inline __attribute__ ((__gnu_inline__)) char * +__strsep_2c (char **__s, char __reject1, char __reject2) +{ + char *__retval = *__s; + if (__retval != ((void *)0)) + { + char *__cp = __retval; + while (1) + { + if (*__cp == '\0') + { + __cp = ((void *)0); + break; + } + if (*__cp == __reject1 || *__cp == __reject2) + { + *__cp++ = '\0'; + break; + } + ++__cp; + } + *__s = __cp; + } + return __retval; +} + +extern __inline __attribute__ ((__gnu_inline__)) char *__strsep_3c (char **__s, char __reject1, char __reject2, + char __reject3); +extern __inline __attribute__ ((__gnu_inline__)) char * +__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) +{ + char *__retval = *__s; + if (__retval != ((void *)0)) + { + char *__cp = __retval; + while (1) + { + if (*__cp == '\0') + { + __cp = ((void *)0); + break; + } + if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) + { + *__cp++ = '\0'; + break; + } + ++__cp; + } + *__s = __cp; + } + return __retval; +} +extern char *__strdup (const char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)); +extern char *__strndup (const char *__string, size_t __n) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)); + + + + + + + + + + + +typedef __useconds_t useconds_t; +extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int faccessat (int __fd, const char *__file, int __type, int __flag) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ; +extern __off_t lseek (int __fd, __off_t __offset, int __whence) __attribute__ ((__nothrow__ , __leaf__)); +extern int close (int __fd); + + + + + + +extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ; + + + + + +extern ssize_t write (int __fd, const void *__buf, size_t __n) ; +extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, + __off_t __offset) ; + + + + + + +extern ssize_t pwrite (int __fd, const void *__buf, size_t __n, + __off_t __offset) ; +extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ; +extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__)); +extern unsigned int sleep (unsigned int __seconds); + + + + + + + +extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) + __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +extern int usleep (__useconds_t __useconds); +extern int pause (void); + + + +extern int chown (const char *__file, __uid_t __owner, __gid_t __group) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + +extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern int lchown (const char *__file, __uid_t __owner, __gid_t __group) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + + + + +extern int fchownat (int __fd, const char *__file, __uid_t __owner, + __gid_t __group, int __flag) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ; + + + +extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + +extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ; +extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ; +extern char *getwd (char *__buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ; + + + + +extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ; + + +extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__)); +extern char **__environ; + + + + + + + +extern int execve (const char *__path, char *const __argv[], + char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + +extern int fexecve (int __fd, char *const __argv[], char *const __envp[]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + + + +extern int execv (const char *__path, char *const __argv[]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern int execle (const char *__path, const char *__arg, ...) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern int execl (const char *__path, const char *__arg, ...) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern int execvp (const char *__file, char *const __argv[]) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + + +extern int execlp (const char *__file, const char *__arg, ...) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern void _exit (int __status) __attribute__ ((__noreturn__)); + + + + + +enum + { + _PC_LINK_MAX, + + _PC_MAX_CANON, + + _PC_MAX_INPUT, + + _PC_NAME_MAX, + + _PC_PATH_MAX, + + _PC_PIPE_BUF, + + _PC_CHOWN_RESTRICTED, + + _PC_NO_TRUNC, + + _PC_VDISABLE, + + _PC_SYNC_IO, + + _PC_ASYNC_IO, + + _PC_PRIO_IO, + + _PC_SOCK_MAXBUF, + + _PC_FILESIZEBITS, + + _PC_REC_INCR_XFER_SIZE, + + _PC_REC_MAX_XFER_SIZE, + + _PC_REC_MIN_XFER_SIZE, + + _PC_REC_XFER_ALIGN, + + _PC_ALLOC_SIZE_MIN, + + _PC_SYMLINK_MAX, + + _PC_2_SYMLINKS + + }; + + +enum + { + _SC_ARG_MAX, + + _SC_CHILD_MAX, + + _SC_CLK_TCK, + + _SC_NGROUPS_MAX, + + _SC_OPEN_MAX, + + _SC_STREAM_MAX, + + _SC_TZNAME_MAX, + + _SC_JOB_CONTROL, + + _SC_SAVED_IDS, + + _SC_REALTIME_SIGNALS, + + _SC_PRIORITY_SCHEDULING, + + _SC_TIMERS, + + _SC_ASYNCHRONOUS_IO, + + _SC_PRIORITIZED_IO, + + _SC_SYNCHRONIZED_IO, + + _SC_FSYNC, + + _SC_MAPPED_FILES, + + _SC_MEMLOCK, + + _SC_MEMLOCK_RANGE, + + _SC_MEMORY_PROTECTION, + + _SC_MESSAGE_PASSING, + + _SC_SEMAPHORES, + + _SC_SHARED_MEMORY_OBJECTS, + + _SC_AIO_LISTIO_MAX, + + _SC_AIO_MAX, + + _SC_AIO_PRIO_DELTA_MAX, + + _SC_DELAYTIMER_MAX, + + _SC_MQ_OPEN_MAX, + + _SC_MQ_PRIO_MAX, + + _SC_VERSION, + + _SC_PAGESIZE, + + + _SC_RTSIG_MAX, + + _SC_SEM_NSEMS_MAX, + + _SC_SEM_VALUE_MAX, + + _SC_SIGQUEUE_MAX, + + _SC_TIMER_MAX, + + + + + _SC_BC_BASE_MAX, + + _SC_BC_DIM_MAX, + + _SC_BC_SCALE_MAX, + + _SC_BC_STRING_MAX, + + _SC_COLL_WEIGHTS_MAX, + + _SC_EQUIV_CLASS_MAX, + + _SC_EXPR_NEST_MAX, + + _SC_LINE_MAX, + + _SC_RE_DUP_MAX, + + _SC_CHARCLASS_NAME_MAX, + + + _SC_2_VERSION, + + _SC_2_C_BIND, + + _SC_2_C_DEV, + + _SC_2_FORT_DEV, + + _SC_2_FORT_RUN, + + _SC_2_SW_DEV, + + _SC_2_LOCALEDEF, + + + _SC_PII, + + _SC_PII_XTI, + + _SC_PII_SOCKET, + + _SC_PII_INTERNET, + + _SC_PII_OSI, + + _SC_POLL, + + _SC_SELECT, + + _SC_UIO_MAXIOV, + + _SC_IOV_MAX = _SC_UIO_MAXIOV, + + _SC_PII_INTERNET_STREAM, + + _SC_PII_INTERNET_DGRAM, + + _SC_PII_OSI_COTS, + + _SC_PII_OSI_CLTS, + + _SC_PII_OSI_M, + + _SC_T_IOV_MAX, + + + + _SC_THREADS, + + _SC_THREAD_SAFE_FUNCTIONS, + + _SC_GETGR_R_SIZE_MAX, + + _SC_GETPW_R_SIZE_MAX, + + _SC_LOGIN_NAME_MAX, + + _SC_TTY_NAME_MAX, + + _SC_THREAD_DESTRUCTOR_ITERATIONS, + + _SC_THREAD_KEYS_MAX, + + _SC_THREAD_STACK_MIN, + + _SC_THREAD_THREADS_MAX, + + _SC_THREAD_ATTR_STACKADDR, + + _SC_THREAD_ATTR_STACKSIZE, + + _SC_THREAD_PRIORITY_SCHEDULING, + + _SC_THREAD_PRIO_INHERIT, + + _SC_THREAD_PRIO_PROTECT, + + _SC_THREAD_PROCESS_SHARED, + + + _SC_NPROCESSORS_CONF, + + _SC_NPROCESSORS_ONLN, + + _SC_PHYS_PAGES, + + _SC_AVPHYS_PAGES, + + _SC_ATEXIT_MAX, + + _SC_PASS_MAX, + + + _SC_XOPEN_VERSION, + + _SC_XOPEN_XCU_VERSION, + + _SC_XOPEN_UNIX, + + _SC_XOPEN_CRYPT, + + _SC_XOPEN_ENH_I18N, + + _SC_XOPEN_SHM, + + + _SC_2_CHAR_TERM, + + _SC_2_C_VERSION, + + _SC_2_UPE, + + + _SC_XOPEN_XPG2, + + _SC_XOPEN_XPG3, + + _SC_XOPEN_XPG4, + + + _SC_CHAR_BIT, + + _SC_CHAR_MAX, + + _SC_CHAR_MIN, + + _SC_INT_MAX, + + _SC_INT_MIN, + + _SC_LONG_BIT, + + _SC_WORD_BIT, + + _SC_MB_LEN_MAX, + + _SC_NZERO, + + _SC_SSIZE_MAX, + + _SC_SCHAR_MAX, + + _SC_SCHAR_MIN, + + _SC_SHRT_MAX, + + _SC_SHRT_MIN, + + _SC_UCHAR_MAX, + + _SC_UINT_MAX, + + _SC_ULONG_MAX, + + _SC_USHRT_MAX, + + + _SC_NL_ARGMAX, + + _SC_NL_LANGMAX, + + _SC_NL_MSGMAX, + + _SC_NL_NMAX, + + _SC_NL_SETMAX, + + _SC_NL_TEXTMAX, + + + _SC_XBS5_ILP32_OFF32, + + _SC_XBS5_ILP32_OFFBIG, + + _SC_XBS5_LP64_OFF64, + + _SC_XBS5_LPBIG_OFFBIG, + + + _SC_XOPEN_LEGACY, + + _SC_XOPEN_REALTIME, + + _SC_XOPEN_REALTIME_THREADS, + + + _SC_ADVISORY_INFO, + + _SC_BARRIERS, + + _SC_BASE, + + _SC_C_LANG_SUPPORT, + + _SC_C_LANG_SUPPORT_R, + + _SC_CLOCK_SELECTION, + + _SC_CPUTIME, + + _SC_THREAD_CPUTIME, + + _SC_DEVICE_IO, + + _SC_DEVICE_SPECIFIC, + + _SC_DEVICE_SPECIFIC_R, + + _SC_FD_MGMT, + + _SC_FIFO, + + _SC_PIPE, + + _SC_FILE_ATTRIBUTES, + + _SC_FILE_LOCKING, + + _SC_FILE_SYSTEM, + + _SC_MONOTONIC_CLOCK, + + _SC_MULTI_PROCESS, + + _SC_SINGLE_PROCESS, + + _SC_NETWORKING, + + _SC_READER_WRITER_LOCKS, + + _SC_SPIN_LOCKS, + + _SC_REGEXP, + + _SC_REGEX_VERSION, + + _SC_SHELL, + + _SC_SIGNALS, + + _SC_SPAWN, + + _SC_SPORADIC_SERVER, + + _SC_THREAD_SPORADIC_SERVER, + + _SC_SYSTEM_DATABASE, + + _SC_SYSTEM_DATABASE_R, + + _SC_TIMEOUTS, + + _SC_TYPED_MEMORY_OBJECTS, + + _SC_USER_GROUPS, + + _SC_USER_GROUPS_R, + + _SC_2_PBS, + + _SC_2_PBS_ACCOUNTING, + + _SC_2_PBS_LOCATE, + + _SC_2_PBS_MESSAGE, + + _SC_2_PBS_TRACK, + + _SC_SYMLOOP_MAX, + + _SC_STREAMS, + + _SC_2_PBS_CHECKPOINT, + + + _SC_V6_ILP32_OFF32, + + _SC_V6_ILP32_OFFBIG, + + _SC_V6_LP64_OFF64, + + _SC_V6_LPBIG_OFFBIG, + + + _SC_HOST_NAME_MAX, + + _SC_TRACE, + + _SC_TRACE_EVENT_FILTER, + + _SC_TRACE_INHERIT, + + _SC_TRACE_LOG, + + + _SC_LEVEL1_ICACHE_SIZE, + + _SC_LEVEL1_ICACHE_ASSOC, + + _SC_LEVEL1_ICACHE_LINESIZE, + + _SC_LEVEL1_DCACHE_SIZE, + + _SC_LEVEL1_DCACHE_ASSOC, + + _SC_LEVEL1_DCACHE_LINESIZE, + + _SC_LEVEL2_CACHE_SIZE, + + _SC_LEVEL2_CACHE_ASSOC, + + _SC_LEVEL2_CACHE_LINESIZE, + + _SC_LEVEL3_CACHE_SIZE, + + _SC_LEVEL3_CACHE_ASSOC, + + _SC_LEVEL3_CACHE_LINESIZE, + + _SC_LEVEL4_CACHE_SIZE, + + _SC_LEVEL4_CACHE_ASSOC, + + _SC_LEVEL4_CACHE_LINESIZE, + + + + _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, + + _SC_RAW_SOCKETS, + + + _SC_V7_ILP32_OFF32, + + _SC_V7_ILP32_OFFBIG, + + _SC_V7_LP64_OFF64, + + _SC_V7_LPBIG_OFFBIG, + + + _SC_SS_REPL_MAX, + + + _SC_TRACE_EVENT_NAME_MAX, + + _SC_TRACE_NAME_MAX, + + _SC_TRACE_SYS_MAX, + + _SC_TRACE_USER_EVENT_MAX, + + + _SC_XOPEN_STREAMS, + + + _SC_THREAD_ROBUST_PRIO_INHERIT, + + _SC_THREAD_ROBUST_PRIO_PROTECT + + }; + + +enum + { + _CS_PATH, + + + _CS_V6_WIDTH_RESTRICTED_ENVS, + + + + _CS_GNU_LIBC_VERSION, + + _CS_GNU_LIBPTHREAD_VERSION, + + + _CS_V5_WIDTH_RESTRICTED_ENVS, + + + + _CS_V7_WIDTH_RESTRICTED_ENVS, + + + + _CS_LFS_CFLAGS = 1000, + + _CS_LFS_LDFLAGS, + + _CS_LFS_LIBS, + + _CS_LFS_LINTFLAGS, + + _CS_LFS64_CFLAGS, + + _CS_LFS64_LDFLAGS, + + _CS_LFS64_LIBS, + + _CS_LFS64_LINTFLAGS, + + + _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, + + _CS_XBS5_ILP32_OFF32_LDFLAGS, + + _CS_XBS5_ILP32_OFF32_LIBS, + + _CS_XBS5_ILP32_OFF32_LINTFLAGS, + + _CS_XBS5_ILP32_OFFBIG_CFLAGS, + + _CS_XBS5_ILP32_OFFBIG_LDFLAGS, + + _CS_XBS5_ILP32_OFFBIG_LIBS, + + _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, + + _CS_XBS5_LP64_OFF64_CFLAGS, + + _CS_XBS5_LP64_OFF64_LDFLAGS, + + _CS_XBS5_LP64_OFF64_LIBS, + + _CS_XBS5_LP64_OFF64_LINTFLAGS, + + _CS_XBS5_LPBIG_OFFBIG_CFLAGS, + + _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, + + _CS_XBS5_LPBIG_OFFBIG_LIBS, + + _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, + + + _CS_POSIX_V6_ILP32_OFF32_CFLAGS, + + _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, + + _CS_POSIX_V6_ILP32_OFF32_LIBS, + + _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, + + _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, + + _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, + + _CS_POSIX_V6_ILP32_OFFBIG_LIBS, + + _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, + + _CS_POSIX_V6_LP64_OFF64_CFLAGS, + + _CS_POSIX_V6_LP64_OFF64_LDFLAGS, + + _CS_POSIX_V6_LP64_OFF64_LIBS, + + _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, + + _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, + + _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, + + _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, + + _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, + + + _CS_POSIX_V7_ILP32_OFF32_CFLAGS, + + _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, + + _CS_POSIX_V7_ILP32_OFF32_LIBS, + + _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, + + _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, + + _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, + + _CS_POSIX_V7_ILP32_OFFBIG_LIBS, + + _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, + + _CS_POSIX_V7_LP64_OFF64_CFLAGS, + + _CS_POSIX_V7_LP64_OFF64_LDFLAGS, + + _CS_POSIX_V7_LP64_OFF64_LIBS, + + _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, + + _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, + + _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, + + _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, + + _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, + + + _CS_V6_ENV, + + _CS_V7_ENV + + }; + + +extern long int pathconf (const char *__path, int __name) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + +extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__)); + + +extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__)); +extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__)); + +extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__)); +extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__)); +extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__)) ; +extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + + +extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ; +extern __pid_t fork (void) __attribute__ ((__nothrow__)); + + + + + + + +extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern int ttyname_r (int __fd, char *__buf, size_t __buflen) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ; + + + +extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int link (const char *__from, const char *__to) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ; + + + + +extern int linkat (int __fromfd, const char *__from, int __tofd, + const char *__to, int __flags) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ; + + + + +extern int symlink (const char *__from, const char *__to) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ; + + + + +extern ssize_t readlink (const char *__restrict __path, + char *__restrict __buf, size_t __len) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ; + + + + +extern int symlinkat (const char *__from, int __tofd, + const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ; + + +extern ssize_t readlinkat (int __fd, const char *__restrict __path, + char *__restrict __buf, size_t __len) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))) ; + + + +extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern int unlinkat (int __fd, const char *__name, int __flag) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + + +extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + +extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + +extern char *getlogin (void); + + + + + + + +extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1))); + + + + +extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern char *optarg; +extern int optind; + + + + +extern int opterr; + + + +extern int optopt; +extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) + __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + +extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + + +extern int sethostname (const char *__name, size_t __len) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + +extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + +extern int getdomainname (char *__name, size_t __len) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; +extern int setdomainname (const char *__name, size_t __len) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + + + +extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + + + + + +extern int profil (unsigned short int *__sample_buffer, size_t __size, + size_t __offset, unsigned int __scale) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__)); +extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__)); +extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + + +extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; + + + +extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1))); + + + + + + + +extern int fsync (int __fd); +extern long int gethostid (void); + + +extern void sync (void) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); + + + + +extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__)); +extern int truncate (const char *__file, __off_t __length) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ; +extern int ftruncate (int __fd, __off_t __length) __attribute__ ((__nothrow__ , __leaf__)) ; +extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + +extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__)); +extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__)); +extern int lockf (int __fd, int __cmd, __off_t __len) ; +extern int fdatasync (int __fildes); + + + +struct stat + { + __dev_t st_dev; + + + + + __ino_t st_ino; + + + + + + + + __nlink_t st_nlink; + __mode_t st_mode; + + __uid_t st_uid; + __gid_t st_gid; + + int __pad0; + + __dev_t st_rdev; + + + + + __off_t st_size; + + + + __blksize_t st_blksize; + + __blkcnt_t st_blocks; + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + __syscall_slong_t __unused[3]; + }; +extern int stat (const char *__restrict __file, + struct stat *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); + + + +extern int fstat (int __fd, struct stat *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); +extern int fstatat (int __fd, const char *__restrict __file, + struct stat *__restrict __buf, int __flag) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); +extern int lstat (const char *__restrict __file, + struct stat *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int chmod (const char *__file, __mode_t __mode) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern int lchmod (const char *__file, __mode_t __mode) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + +extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern int fchmodat (int __fd, const char *__file, __mode_t __mode, + int __flag) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ; + + + + + + +extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__)); +extern int mkdir (const char *__path, __mode_t __mode) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern int mkdirat (int __fd, const char *__path, __mode_t __mode) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + + + + + +extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern int mknodat (int __fd, const char *__path, __mode_t __mode, + __dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + + + + +extern int mkfifo (const char *__path, __mode_t __mode) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + + + + + +extern int mkfifoat (int __fd, const char *__path, __mode_t __mode) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + + + + +extern int utimensat (int __fd, const char *__path, + const struct timespec __times[2], + int __flags) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); + + + + +extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__)); +extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))); +extern int __xstat (int __ver, const char *__filename, + struct stat *__stat_buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); +extern int __lxstat (int __ver, const char *__filename, + struct stat *__stat_buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); +extern int __fxstatat (int __ver, int __fildes, const char *__filename, + struct stat *__stat_buf, int __flag) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))); +extern int __xmknod (int __ver, const char *__path, __mode_t __mode, + __dev_t *__dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))); + +extern int __xmknodat (int __ver, int __fd, const char *__path, + __mode_t __mode, __dev_t *__dev) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 5))); + + + + +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) stat (const char *__path, struct stat *__statbuf) +{ + return __xstat (1, __path, __statbuf); +} + + +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) lstat (const char *__path, struct stat *__statbuf) +{ + return __lxstat (1, __path, __statbuf); +} + + +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) fstat (int __fd, struct stat *__statbuf) +{ + return __fxstat (1, __fd, __statbuf); +} + + +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) fstatat (int __fd, const char *__filename, struct stat *__statbuf, int __flag) + +{ + return __fxstatat (1, __fd, __filename, __statbuf, __flag); +} + + + +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) mknod (const char *__path, __mode_t __mode, __dev_t __dev) +{ + return __xmknod (0, __path, __mode, &__dev); +} + + + +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) mknodat (int __fd, const char *__path, __mode_t __mode, __dev_t __dev) + +{ + return __xmknodat (0, __fd, __path, __mode, &__dev); +} + + + + + + + + +struct flock + { + short int l_type; + short int l_whence; + + __off_t l_start; + __off_t l_len; + + + + + __pid_t l_pid; + }; + + +extern int fcntl (int __fd, int __cmd, ...); +extern int open (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1))); +extern int openat (int __fd, const char *__file, int __oflag, ...) + __attribute__ ((__nonnull__ (2))); +extern int creat (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1))); +extern int posix_fadvise (int __fd, off_t __offset, off_t __len, + int __advise) __attribute__ ((__nothrow__ , __leaf__)); +extern int posix_fallocate (int __fd, off_t __offset, off_t __len); + + + + +extern int flock (int __fd, int __operation) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + +struct _IO_FILE; + + + +typedef struct _IO_FILE FILE; + + + + + +typedef struct _IO_FILE __FILE; + + + + +typedef struct +{ + int __count; + union + { + + unsigned int __wch; + + + + char __wchb[4]; + } __value; +} __mbstate_t; +typedef struct +{ + __off_t __pos; + __mbstate_t __state; +} _G_fpos_t; +typedef struct +{ + __off64_t __pos; + __mbstate_t __state; +} _G_fpos64_t; +struct _IO_jump_t; struct _IO_FILE; +typedef void _IO_lock_t; + + + + + +struct _IO_marker { + struct _IO_marker *_next; + struct _IO_FILE *_sbuf; + + + + int _pos; +}; + + +enum __codecvt_result +{ + __codecvt_ok, + __codecvt_partial, + __codecvt_error, + __codecvt_noconv +}; +struct _IO_FILE { + int _flags; + + + + + char* _IO_read_ptr; + char* _IO_read_end; + char* _IO_read_base; + char* _IO_write_base; + char* _IO_write_ptr; + char* _IO_write_end; + char* _IO_buf_base; + char* _IO_buf_end; + + char *_IO_save_base; + char *_IO_backup_base; + char *_IO_save_end; + + struct _IO_marker *_markers; + + struct _IO_FILE *_chain; + + int _fileno; + + + + int _flags2; + + __off_t _old_offset; + + + + unsigned short _cur_column; + signed char _vtable_offset; + char _shortbuf[1]; + + + + _IO_lock_t *_lock; + __off64_t _offset; + void *__pad1; + void *__pad2; + void *__pad3; + void *__pad4; + size_t __pad5; + + int _mode; + + char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; + +}; + + +typedef struct _IO_FILE _IO_FILE; + + +struct _IO_FILE_plus; + +extern struct _IO_FILE_plus _IO_2_1_stdin_; +extern struct _IO_FILE_plus _IO_2_1_stdout_; +extern struct _IO_FILE_plus _IO_2_1_stderr_; +typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); + + + + + + + +typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf, + size_t __n); + + + + + + + +typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); + + +typedef int __io_close_fn (void *__cookie); +extern int __underflow (_IO_FILE *); +extern int __uflow (_IO_FILE *); +extern int __overflow (_IO_FILE *, int); +extern int _IO_getc (_IO_FILE *__fp); +extern int _IO_putc (int __c, _IO_FILE *__fp); +extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__)); +extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__)); + +extern int _IO_peekc_locked (_IO_FILE *__fp); + + + + + +extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__)); +extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__)); +extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__)); +extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, + __gnuc_va_list, int *__restrict); +extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, + __gnuc_va_list); +extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t); +extern size_t _IO_sgetn (_IO_FILE *, void *, size_t); + +extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int); +extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int); + +extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__)); + + +typedef _G_fpos_t fpos_t; + + + + + + + +extern struct _IO_FILE *stdin; +extern struct _IO_FILE *stdout; +extern struct _IO_FILE *stderr; + + + + + + + +extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)); + +extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__)); + + + + +extern int renameat (int __oldfd, const char *__old, int __newfd, + const char *__new) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + + +extern FILE *tmpfile (void) ; +extern char *tmpnam (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + +extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ; +extern char *tempnam (const char *__dir, const char *__pfx) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ; + + + + + + + + +extern int fclose (FILE *__stream); + + + + +extern int fflush (FILE *__stream); + +extern int fflush_unlocked (FILE *__stream); + + + + + + +extern FILE *fopen (const char *__restrict __filename, + const char *__restrict __modes) ; + + + + +extern FILE *freopen (const char *__restrict __filename, + const char *__restrict __modes, + FILE *__restrict __stream) ; + +extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) ; +extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) + __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + + +extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, + int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); + + + + + +extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, + size_t __size) __attribute__ ((__nothrow__ , __leaf__)); + + +extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); + + + + + + + + +extern int fprintf (FILE *__restrict __stream, + const char *__restrict __format, ...); + + + + +extern int printf (const char *__restrict __format, ...); + +extern int sprintf (char *__restrict __s, + const char *__restrict __format, ...) __attribute__ ((__nothrow__)); + + + + + +extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, + __gnuc_va_list __arg); + + + + +extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg); + +extern int vsprintf (char *__restrict __s, const char *__restrict __format, + __gnuc_va_list __arg) __attribute__ ((__nothrow__)); + + + + + +extern int snprintf (char *__restrict __s, size_t __maxlen, + const char *__restrict __format, ...) + __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); + +extern int vsnprintf (char *__restrict __s, size_t __maxlen, + const char *__restrict __format, __gnuc_va_list __arg) + __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); + +extern int vdprintf (int __fd, const char *__restrict __fmt, + __gnuc_va_list __arg) + __attribute__ ((__format__ (__printf__, 2, 0))); +extern int dprintf (int __fd, const char *__restrict __fmt, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); + + + + + + + + +extern int fscanf (FILE *__restrict __stream, + const char *__restrict __format, ...) ; + + + + +extern int scanf (const char *__restrict __format, ...) ; + +extern int sscanf (const char *__restrict __s, + const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__)); +extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf") + + ; +extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf") + ; +extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__)) + + ; + + + + + + + + +extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, + __gnuc_va_list __arg) + __attribute__ ((__format__ (__scanf__, 2, 0))) ; + + + + + +extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) + __attribute__ ((__format__ (__scanf__, 1, 0))) ; + + +extern int vsscanf (const char *__restrict __s, + const char *__restrict __format, __gnuc_va_list __arg) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0))); +extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf") + + + + __attribute__ ((__format__ (__scanf__, 2, 0))) ; +extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf") + + __attribute__ ((__format__ (__scanf__, 1, 0))) ; +extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__)) + + + + __attribute__ ((__format__ (__scanf__, 2, 0))); + + + + + + + + + +extern int fgetc (FILE *__stream); +extern int getc (FILE *__stream); + + + + + +extern int getchar (void); + +extern int getc_unlocked (FILE *__stream); +extern int getchar_unlocked (void); +extern int fgetc_unlocked (FILE *__stream); + + + + + + + + + + + +extern int fputc (int __c, FILE *__stream); +extern int putc (int __c, FILE *__stream); + + + + + +extern int putchar (int __c); + +extern int fputc_unlocked (int __c, FILE *__stream); + + + + + + + +extern int putc_unlocked (int __c, FILE *__stream); +extern int putchar_unlocked (int __c); + + + + + + +extern int getw (FILE *__stream); + + +extern int putw (int __w, FILE *__stream); + + + + + + + + +extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) + ; + +extern __ssize_t __getdelim (char **__restrict __lineptr, + size_t *__restrict __n, int __delimiter, + FILE *__restrict __stream) ; +extern __ssize_t getdelim (char **__restrict __lineptr, + size_t *__restrict __n, int __delimiter, + FILE *__restrict __stream) ; + + + + + + + +extern __ssize_t getline (char **__restrict __lineptr, + size_t *__restrict __n, + FILE *__restrict __stream) ; + + + + + + + + +extern int fputs (const char *__restrict __s, FILE *__restrict __stream); + + + + + +extern int puts (const char *__s); + + + + + + +extern int ungetc (int __c, FILE *__stream); + + + + + + +extern size_t fread (void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __stream) ; + + + + +extern size_t fwrite (const void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __s); + +extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __stream) ; +extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, + size_t __n, FILE *__restrict __stream); + + + + + + + + +extern int fseek (FILE *__stream, long int __off, int __whence); + + + + +extern long int ftell (FILE *__stream) ; + + + + +extern void rewind (FILE *__stream); + +extern int fseeko (FILE *__stream, __off_t __off, int __whence); + + + + +extern __off_t ftello (FILE *__stream) ; + + + + + + +extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); + + + + +extern int fsetpos (FILE *__stream, const fpos_t *__pos); + + + +extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); + +extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + +extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); +extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; +extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + + + + + +extern void perror (const char *__s); + + + + + + +extern int sys_nerr; +extern const char *const sys_errlist[]; + + + + +extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + + + + +extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; +extern FILE *popen (const char *__command, const char *__modes) ; + + + + + +extern int pclose (FILE *__stream); + + + + + +extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__)); +extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); + + + +extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ; + + +extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); +extern __inline __attribute__ ((__gnu_inline__)) int +vprintf (const char *__restrict __fmt, __gnuc_va_list __arg) +{ + return vfprintf (stdout, __fmt, __arg); +} + + + +extern __inline __attribute__ ((__gnu_inline__)) int +getchar (void) +{ + return _IO_getc (stdin); +} + + + + +extern __inline __attribute__ ((__gnu_inline__)) int +fgetc_unlocked (FILE *__fp) +{ + return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); +} + + + + + +extern __inline __attribute__ ((__gnu_inline__)) int +getc_unlocked (FILE *__fp) +{ + return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); +} + + +extern __inline __attribute__ ((__gnu_inline__)) int +getchar_unlocked (void) +{ + return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); +} + + + + +extern __inline __attribute__ ((__gnu_inline__)) int +putchar (int __c) +{ + return _IO_putc (__c, stdout); +} + + + + +extern __inline __attribute__ ((__gnu_inline__)) int +fputc_unlocked (int __c, FILE *__stream) +{ + return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); +} + + + + + +extern __inline __attribute__ ((__gnu_inline__)) int +putc_unlocked (int __c, FILE *__stream) +{ + return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); +} + + +extern __inline __attribute__ ((__gnu_inline__)) int +putchar_unlocked (int __c) +{ + return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); +} +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) feof_unlocked (FILE *__stream) +{ + return (((__stream)->_flags & 0x10) != 0); +} + + +extern __inline __attribute__ ((__gnu_inline__)) int +__attribute__ ((__nothrow__ , __leaf__)) ferror_unlocked (FILE *__stream) +{ + return (((__stream)->_flags & 0x20) != 0); +} + + + +struct addrlist; + + +krb5_error_code krb5_lock_file (krb5_context, int, int); +krb5_error_code krb5_unlock_file (krb5_context, int); +krb5_error_code krb5_sendto_kdc (krb5_context, const krb5_data *, + const krb5_data *, krb5_data *, int *, int); +krb5_error_code krb5int_sendto (krb5_context, const krb5_data *, + const struct addrlist *, krb5_data *, + struct sockaddr *, socklen_t *, int *); +krb5_error_code krb5_get_krbhst (krb5_context, const krb5_data *, char *** ); +krb5_error_code krb5_free_krbhst (krb5_context, char * const * ); +krb5_error_code krb5_create_secure_file (krb5_context, const char * pathname); +krb5_error_code krb5_sync_disk_file (krb5_context, FILE *fp); + +krb5_error_code krb5int_get_fq_local_hostname (char *, size_t); + +krb5_error_code krb5_os_init_context (krb5_context); + +void krb5_os_free_context (krb5_context); + + + +krb5_error_code os_get_default_config_files + (profile_filespec_t **pfiles, krb5_boolean secure); + +krb5_error_code krb5_find_config_files (void); + +krb5_error_code krb5_os_hostaddr + (krb5_context, const char *, krb5_address ***); + + + +struct addrlist { + struct addrinfo **addrs; + int naddrs; + int space; +}; + +extern void krb5int_free_addrlist (struct addrlist *); +extern int krb5int_grow_addrlist (struct addrlist *, int); +extern int krb5int_add_host_to_list (struct addrlist *, const char *, + int, int, int, int); + +krb5_error_code +krb5int_locate_server (krb5_context, + const krb5_data *realm, + struct addrlist *, + + int want_masters, + + const char *profilename, + + const char *dnsname, + int is_stream_service, + + + + + + int dflport1, int dflport2, + int family); + + + + + +struct krb5_enc_provider { + + + size_t block_size, keybytes, keylength; + + + krb5_error_code (*encrypt) (const krb5_keyblock *key, + const krb5_data *cipher_state, + const krb5_data *input, + krb5_data *output); + + krb5_error_code (*decrypt) (const krb5_keyblock *key, + const krb5_data *ivec, + const krb5_data *input, + krb5_data *output); + + krb5_error_code (*make_key) (const krb5_data *randombits, + krb5_keyblock *key); + + krb5_error_code (*init_state) (const krb5_keyblock *key, + krb5_keyusage keyusage, krb5_data *out_state); + krb5_error_code (*free_state) (krb5_data *state); + +}; + +struct krb5_hash_provider { + size_t hashsize, blocksize; + + + krb5_error_code (*hash) (unsigned int icount, const krb5_data *input, + krb5_data *output); +}; + +struct krb5_keyhash_provider { + size_t hashsize; + + krb5_error_code (*hash) (const krb5_keyblock *key, + krb5_keyusage keyusage, + const krb5_data *ivec, + const krb5_data *input, + krb5_data *output); + + krb5_error_code (*verify) (const krb5_keyblock *key, + krb5_keyusage keyusage, + const krb5_data *ivec, + const krb5_data *input, + const krb5_data *hash, + krb5_boolean *valid); +}; + +typedef void (*krb5_encrypt_length_func) (const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + size_t inputlen, size_t *length); + +typedef krb5_error_code (*krb5_crypt_func) (const struct krb5_enc_provider *enc, + const struct krb5_hash_provider *hash, + const krb5_keyblock *key, krb5_keyusage keyusage, + const krb5_data *ivec, + const krb5_data *input, krb5_data *output); + +typedef krb5_error_code (*krb5_str2key_func) (const struct krb5_enc_provider *enc, const krb5_data *string, + const krb5_data *salt, const krb5_data *parm, krb5_keyblock *key); + +struct krb5_keytypes { + krb5_enctype etype; + char *in_string; + char *out_string; + const struct krb5_enc_provider *enc; + const struct krb5_hash_provider *hash; + krb5_encrypt_length_func encrypt_len; + krb5_crypt_func encrypt; + krb5_crypt_func decrypt; + krb5_str2key_func str2key; + krb5_cksumtype required_ctype; +}; + +struct krb5_cksumtypes { + krb5_cksumtype ctype; + unsigned int flags; + char *in_string; + char *out_string; + + + + + krb5_enctype keyed_etype; + + + + + + const struct krb5_keyhash_provider *keyhash; + const struct krb5_hash_provider *hash; + + + + + + unsigned int trunc_size; +}; +void krb5_nfold +(unsigned int inbits, const unsigned char *in, + unsigned int outbits, unsigned char *out); + +krb5_error_code krb5_hmac +(const struct krb5_hash_provider *hash, + const krb5_keyblock *key, unsigned int icount, + const krb5_data *input, krb5_data *output); + +krb5_error_code krb5int_pbkdf2_hmac_sha1 (const krb5_data *, unsigned long, + const krb5_data *, + const krb5_data *); +krb5_error_code krb5int_des_init_state +(const krb5_keyblock *key, krb5_keyusage keyusage, krb5_data *new_state); + + + + + +krb5_error_code krb5int_default_free_state +(krb5_data *state); + + + + + +krb5_error_code krb5int_c_combine_keys +(krb5_context context, krb5_keyblock *key1, krb5_keyblock *key2, + krb5_keyblock *outkey); + + + + +extern void krb5int_prng_cleanup (void); + + + + + + + +extern const struct krb5_enc_provider krb5int_enc_arcfour; +extern const struct krb5_hash_provider krb5int_hash_md5; + + + + + +krb5_error_code krb5_crypto_os_localaddr + (krb5_address ***); + +krb5_error_code krb5_crypto_us_timeofday + (krb5_int32 *, + krb5_int32 *); + +time_t gmt_mktime (struct tm *); + + + + + +krb5_error_code krb5_encrypt_helper +(krb5_context context, const krb5_keyblock *key, + krb5_keyusage keyusage, const krb5_data *plain, + krb5_enc_data *cipher); +typedef struct _krb5_tl_data { + struct _krb5_tl_data* tl_data_next; + krb5_int16 tl_data_type; + krb5_ui_2 tl_data_length; + krb5_octet * tl_data_contents; +} krb5_tl_data; + + + + + + + +typedef struct _krb5_key_data { + krb5_int16 key_data_ver; + krb5_int16 key_data_kvno; + krb5_int16 key_data_type[2]; + krb5_ui_2 key_data_length[2]; + krb5_octet * key_data_contents[2]; +} krb5_key_data; + + + +typedef struct _krb5_keysalt { + krb5_int16 type; + krb5_data data; +} krb5_keysalt; + +typedef struct _krb5_db_entry_new { + krb5_magic magic; + krb5_ui_2 len; + krb5_flags attributes; + krb5_deltat max_life; + krb5_deltat max_renewable_life; + krb5_timestamp expiration; + krb5_timestamp pw_expiration; + krb5_timestamp last_success; + krb5_timestamp last_failed; + krb5_kvno fail_auth_count; + krb5_int16 n_tl_data; + krb5_int16 n_key_data; + krb5_ui_2 e_length; + krb5_octet * e_data; + + krb5_principal princ; + krb5_tl_data * tl_data; + krb5_key_data * key_data; +} krb5_db_entry; +extern char *krb5_mkey_pwd_prompt1; +extern char *krb5_mkey_pwd_prompt2; +krb5_error_code krb5_db_set_name (krb5_context, char * ); +krb5_error_code krb5_db_init (krb5_context); +krb5_error_code krb5_db_fini (krb5_context); +krb5_error_code krb5_db_get_age (krb5_context, char *, time_t * ); +krb5_error_code krb5_db_create (krb5_context, char *, krb5_int32 ); +krb5_error_code krb5_db_rename (krb5_context, char *, char * ); +krb5_error_code krb5_db_get_principal (krb5_context, krb5_const_principal , + krb5_db_entry *, int *, + krb5_boolean * ); +void krb5_db_free_principal (krb5_context, krb5_db_entry *, int ); +krb5_error_code krb5_db_put_principal (krb5_context, krb5_db_entry *, int * ); +krb5_error_code krb5_db_delete_principal (krb5_context, krb5_const_principal, + int * ); +krb5_error_code krb5_db_iterate (krb5_context, + krb5_error_code (* ) (krb5_pointer, + krb5_db_entry *), + krb5_pointer); +krb5_error_code krb5_db_iterate_ext (krb5_context, + krb5_error_code (* ) (krb5_pointer, + krb5_db_entry *), + krb5_pointer, int, int); +krb5_error_code krb5_db_verify_master_key (krb5_context, krb5_principal, + krb5_keyblock *); +krb5_error_code krb5_db_store_mkey (krb5_context, char *, krb5_principal, + krb5_keyblock *); + +krb5_error_code krb5_db_setup_mkey_name (krb5_context, const char *, + const char *, char **, + krb5_principal *); + +krb5_error_code krb5_db_set_mkey (krb5_context, krb5_keyblock *); + +krb5_error_code krb5_db_get_mkey (krb5_context, krb5_keyblock **); +krb5_error_code krb5_db_destroy (krb5_context, char * ); +krb5_error_code krb5_db_lock (krb5_context, int ); +krb5_error_code krb5_db_unlock (krb5_context); +krb5_error_code krb5_db_set_nonblocking (krb5_context, krb5_boolean, + krb5_boolean * ); +krb5_boolean krb5_db_set_lockmode (krb5_context, krb5_boolean); +krb5_error_code krb5_db_fetch_mkey (krb5_context, krb5_principal, krb5_enctype, + krb5_boolean, krb5_boolean, char *, + krb5_data *, + krb5_keyblock * ); + +krb5_error_code krb5_db_open_database (krb5_context); +krb5_error_code krb5_db_close_database (krb5_context); + +krb5_error_code krb5_dbekd_encrypt_key_data (krb5_context, + const krb5_keyblock *, + const krb5_keyblock *, + const krb5_keysalt *, + int, + krb5_key_data *); +krb5_error_code krb5_dbekd_decrypt_key_data (krb5_context, + const krb5_keyblock *, + const krb5_key_data *, + krb5_keyblock *, + krb5_keysalt *); +krb5_error_code krb5_dbe_create_key_data (krb5_context, + krb5_db_entry *); +krb5_error_code krb5_dbe_update_tl_data (krb5_context, + krb5_db_entry *, + krb5_tl_data *); +krb5_error_code krb5_dbe_lookup_tl_data (krb5_context, + krb5_db_entry *, + krb5_tl_data *); +krb5_error_code krb5_dbe_update_last_pwd_change (krb5_context, + krb5_db_entry *, + krb5_timestamp); +krb5_error_code krb5_dbe_lookup_last_pwd_change (krb5_context, + krb5_db_entry *, + krb5_timestamp *); +krb5_error_code krb5_dbe_update_mod_princ_data (krb5_context, + krb5_db_entry *, + krb5_timestamp, + krb5_const_principal); +krb5_error_code krb5_dbe_lookup_mod_princ_data (krb5_context, + krb5_db_entry *, + krb5_timestamp *, + krb5_principal *); +int krb5_encode_princ_dbkey (krb5_context, krb5_data *, krb5_const_principal); +void krb5_free_princ_dbkey (krb5_context, krb5_data *); +krb5_error_code krb5_encode_princ_contents (krb5_context, krb5_data *, + krb5_db_entry *); +void krb5_free_princ_contents (krb5_context, krb5_data *); +krb5_error_code krb5_decode_princ_contents (krb5_context, krb5_data *, + krb5_db_entry *); +void krb5_dbe_free_contents (krb5_context, krb5_db_entry *); + +krb5_error_code krb5_dbe_find_enctype (krb5_context, krb5_db_entry *, + krb5_int32, + krb5_int32, + krb5_int32, + krb5_key_data **); + +krb5_error_code krb5_dbe_search_enctype (krb5_context, + krb5_db_entry *, + krb5_int32 *, + krb5_int32, + krb5_int32, + krb5_int32, + krb5_key_data **); + +struct __krb5_key_salt_tuple; + +krb5_error_code krb5_dbe_cpw (krb5_context, + krb5_keyblock *, + struct __krb5_key_salt_tuple *, + int, + char *, + int, + krb5_boolean, + krb5_db_entry *); +krb5_error_code krb5_dbe_apw (krb5_context, + krb5_keyblock *, + struct __krb5_key_salt_tuple *, + int, + char *, + krb5_db_entry *); +krb5_error_code krb5_dbe_crk (krb5_context, + krb5_keyblock *, + struct __krb5_key_salt_tuple *, + int, + krb5_boolean, + krb5_db_entry *); +krb5_error_code krb5_dbe_ark (krb5_context, + krb5_keyblock *, + struct __krb5_key_salt_tuple *, + int, + krb5_db_entry *); + +krb5_error_code krb5_ser_db_context_init (krb5_context); + + + + + + + +typedef struct _krb5_os_context { + krb5_magic magic; + krb5_int32 time_offset; + krb5_int32 usec_offset; + krb5_int32 os_flags; + char * default_ccname; +} *krb5_os_context; +typedef struct _krb5_pa_enc_ts { + krb5_timestamp patimestamp; + krb5_int32 pausec; +} krb5_pa_enc_ts; + +typedef krb5_error_code (*krb5_preauth_obtain_proc) + (krb5_context, + krb5_pa_data *, + krb5_etype_info, + krb5_keyblock *, + krb5_error_code ( * )(krb5_context, + const krb5_enctype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock **), + krb5_const_pointer, + krb5_creds *, + krb5_kdc_req *, + krb5_pa_data **); + +typedef krb5_error_code (*krb5_preauth_process_proc) + (krb5_context, + krb5_pa_data *, + krb5_kdc_req *, + krb5_kdc_rep *, + krb5_error_code ( * )(krb5_context, + const krb5_enctype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock **), + krb5_const_pointer, + krb5_error_code ( * )(krb5_context, + const krb5_keyblock *, + krb5_const_pointer, + krb5_kdc_rep * ), + krb5_keyblock **, + krb5_creds *, + krb5_int32 *, + krb5_int32 *); + +typedef struct _krb5_preauth_ops { + krb5_magic magic; + int type; + int flags; + krb5_preauth_obtain_proc obtain; + krb5_preauth_process_proc process; +} krb5_preauth_ops; + +krb5_error_code krb5_obtain_padata + (krb5_context, + krb5_pa_data **, + krb5_error_code ( * )(krb5_context, + const krb5_enctype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock **), + krb5_const_pointer, + krb5_creds *, + krb5_kdc_req *); + +krb5_error_code krb5_process_padata + (krb5_context, + krb5_kdc_req *, + krb5_kdc_rep *, + krb5_error_code ( * )(krb5_context, + const krb5_enctype, + krb5_data *, + krb5_const_pointer, + krb5_keyblock **), + krb5_const_pointer, + krb5_error_code ( * )(krb5_context, + const krb5_keyblock *, + krb5_const_pointer, + krb5_kdc_rep * ), + krb5_keyblock **, + krb5_creds *, + krb5_int32 *); + +void krb5_free_etype_info + (krb5_context, krb5_etype_info); +krb5_error_code +krb5int_copy_data_contents (krb5_context, const krb5_data *, krb5_data *); + +typedef krb5_error_code (*krb5_gic_get_as_key_fct) + (krb5_context, + krb5_principal, + krb5_enctype, + krb5_prompter_fct, + void *prompter_data, + krb5_data *salt, + krb5_data *s2kparams, + krb5_keyblock *as_key, + void *gak_data); + +krb5_error_code +krb5_get_init_creds +(krb5_context context, + krb5_creds *creds, + krb5_principal client, + krb5_prompter_fct prompter, + void *prompter_data, + krb5_deltat start_time, + char *in_tkt_service, + krb5_get_init_creds_opt *gic_options, + krb5_gic_get_as_key_fct gak, + void *gak_data, + int *master, + krb5_kdc_rep **as_reply); + +void krb5int_populate_gic_opt ( + krb5_context, krb5_get_init_creds_opt *, + krb5_flags options, krb5_address * const *addrs, krb5_enctype *ktypes, + krb5_preauthtype *pre_auth_types, krb5_creds *creds); + + +krb5_error_code krb5_do_preauth +(krb5_context, krb5_kdc_req *, + krb5_pa_data **, krb5_pa_data ***, + krb5_data *salt, krb5_data *s2kparams, + krb5_enctype *, + krb5_keyblock *, + krb5_prompter_fct, void *, + krb5_gic_get_as_key_fct, void *); + +void krb5_free_sam_challenge + (krb5_context, krb5_sam_challenge * ); +void krb5_free_sam_challenge_2 + (krb5_context, krb5_sam_challenge_2 * ); +void krb5_free_sam_challenge_2_body + (krb5_context, krb5_sam_challenge_2_body *); +void krb5_free_sam_response + (krb5_context, krb5_sam_response * ); +void krb5_free_sam_response_2 + (krb5_context, krb5_sam_response_2 * ); +void krb5_free_predicted_sam_response + (krb5_context, krb5_predicted_sam_response * ); +void krb5_free_enc_sam_response_enc + (krb5_context, krb5_enc_sam_response_enc * ); +void krb5_free_enc_sam_response_enc_2 + (krb5_context, krb5_enc_sam_response_enc_2 * ); +void krb5_free_sam_challenge_contents + (krb5_context, krb5_sam_challenge * ); +void krb5_free_sam_challenge_2_contents + (krb5_context, krb5_sam_challenge_2 * ); +void krb5_free_sam_challenge_2_body_contents + (krb5_context, krb5_sam_challenge_2_body * ); +void krb5_free_sam_response_contents + (krb5_context, krb5_sam_response * ); +void krb5_free_sam_response_2_contents + (krb5_context, krb5_sam_response_2 *); +void krb5_free_predicted_sam_response_contents + (krb5_context, krb5_predicted_sam_response * ); +void krb5_free_enc_sam_response_enc_contents + (krb5_context, krb5_enc_sam_response_enc * ); +void krb5_free_enc_sam_response_enc_2_contents + (krb5_context, krb5_enc_sam_response_enc_2 * ); + +void krb5_free_pa_enc_ts + (krb5_context, krb5_pa_enc_ts *); + + + +struct _krb5_context { + krb5_magic magic; + krb5_enctype *in_tkt_ktypes; + int in_tkt_ktype_count; + krb5_enctype *tgs_ktypes; + int tgs_ktype_count; + struct _krb5_os_context os_context[1]; + char *default_realm; + profile_t profile; + void *db_context; + int ser_ctx_count; + void *ser_ctx; + + krb5_deltat clockskew; + krb5_cksumtype kdc_req_sumtype; + krb5_cksumtype default_ap_req_sumtype; + krb5_cksumtype default_safe_sumtype; + krb5_flags kdc_default_options; + krb5_flags library_options; + krb5_boolean profile_secure; + int fcc_default_format; + int scc_default_format; + krb5_prompt_type *prompt_types; + + + + int udp_pref_limit; + + + + + + + + krb5_enctype *conf_tgs_ktypes; + int conf_tgs_ktypes_count; + + krb5_boolean use_conf_ktypes; + + + krb5_boolean profile_in_memory; + +}; +typedef struct _krb5_safe { + krb5_magic magic; + krb5_data user_data; + krb5_timestamp timestamp; + krb5_int32 usec; + + krb5_ui_4 seq_number; + krb5_address *s_address; + krb5_address *r_address; + krb5_checksum *checksum; +} krb5_safe; + +typedef struct _krb5_priv { + krb5_magic magic; + krb5_enc_data enc_part; +} krb5_priv; + +typedef struct _krb5_priv_enc_part { + krb5_magic magic; + krb5_data user_data; + krb5_timestamp timestamp; + krb5_int32 usec; + krb5_ui_4 seq_number; + krb5_address *s_address; + krb5_address *r_address; +} krb5_priv_enc_part; + +void krb5_free_safe + (krb5_context, krb5_safe * ); +void krb5_free_priv + (krb5_context, krb5_priv * ); +void krb5_free_priv_enc_part + (krb5_context, krb5_priv_enc_part * ); +krb5_error_code encode_krb5_authenticator + (const krb5_authenticator *rep, krb5_data **code); + +krb5_error_code encode_krb5_ticket + (const krb5_ticket *rep, krb5_data **code); + +krb5_error_code encode_krb5_encryption_key + (const krb5_keyblock *rep, krb5_data **code); + +krb5_error_code encode_krb5_enc_tkt_part + (const krb5_enc_tkt_part *rep, krb5_data **code); + +krb5_error_code encode_krb5_enc_kdc_rep_part + (const krb5_enc_kdc_rep_part *rep, krb5_data **code); + + +krb5_error_code encode_krb5_as_rep + (const krb5_kdc_rep *rep, krb5_data **code); + + +krb5_error_code encode_krb5_tgs_rep + (const krb5_kdc_rep *rep, krb5_data **code); + +krb5_error_code encode_krb5_ap_req + (const krb5_ap_req *rep, krb5_data **code); + +krb5_error_code encode_krb5_ap_rep + (const krb5_ap_rep *rep, krb5_data **code); + +krb5_error_code encode_krb5_ap_rep_enc_part + (const krb5_ap_rep_enc_part *rep, krb5_data **code); + +krb5_error_code encode_krb5_as_req + (const krb5_kdc_req *rep, krb5_data **code); + +krb5_error_code encode_krb5_tgs_req + (const krb5_kdc_req *rep, krb5_data **code); + +krb5_error_code encode_krb5_kdc_req_body + (const krb5_kdc_req *rep, krb5_data **code); + +krb5_error_code encode_krb5_safe + (const krb5_safe *rep, krb5_data **code); + +krb5_error_code encode_krb5_safe_with_body + (const krb5_safe *rep, const krb5_data *body, krb5_data **code); + +krb5_error_code encode_krb5_priv + (const krb5_priv *rep, krb5_data **code); + +krb5_error_code encode_krb5_enc_priv_part + (const krb5_priv_enc_part *rep, krb5_data **code); + +krb5_error_code encode_krb5_cred + (const krb5_cred *rep, krb5_data **code); + +krb5_error_code encode_krb5_enc_cred_part + (const krb5_cred_enc_part *rep, krb5_data **code); + +krb5_error_code encode_krb5_error + (const krb5_error *rep, krb5_data **code); + +krb5_error_code encode_krb5_authdata + (const krb5_authdata **rep, krb5_data **code); + +krb5_error_code encode_krb5_pwd_sequence + (const passwd_phrase_element *rep, krb5_data **code); + +krb5_error_code encode_krb5_pwd_data + (const krb5_pwd_data *rep, krb5_data **code); + +krb5_error_code encode_krb5_padata_sequence + (const krb5_pa_data ** rep, krb5_data **code); + +krb5_error_code encode_krb5_alt_method + (const krb5_alt_method *, krb5_data **code); + +krb5_error_code encode_krb5_etype_info + (const krb5_etype_info_entry **, krb5_data **code); +krb5_error_code encode_krb5_etype_info2 + (const krb5_etype_info_entry **, krb5_data **code); + +krb5_error_code encode_krb5_enc_data + (const krb5_enc_data *, krb5_data **); + +krb5_error_code encode_krb5_pa_enc_ts + (const krb5_pa_enc_ts *, krb5_data **); + +krb5_error_code encode_krb5_sam_challenge + (const krb5_sam_challenge * , krb5_data **); + +krb5_error_code encode_krb5_sam_key + (const krb5_sam_key * , krb5_data **); + +krb5_error_code encode_krb5_enc_sam_response_enc + (const krb5_enc_sam_response_enc * , krb5_data **); + +krb5_error_code encode_krb5_sam_response + (const krb5_sam_response * , krb5_data **); + +krb5_error_code encode_krb5_sam_challenge_2 + (const krb5_sam_challenge_2 * , krb5_data **); + +krb5_error_code encode_krb5_sam_challenge_2_body + (const krb5_sam_challenge_2_body * , krb5_data **); + +krb5_error_code encode_krb5_enc_sam_response_enc_2 + (const krb5_enc_sam_response_enc_2 * , krb5_data **); + +krb5_error_code encode_krb5_sam_response_2 + (const krb5_sam_response_2 * , krb5_data **); + +krb5_error_code encode_krb5_predicted_sam_response + (const krb5_predicted_sam_response * , krb5_data **); + +krb5_error_code encode_krb5_sam_challenge + (const krb5_sam_challenge * , krb5_data **); + +krb5_error_code encode_krb5_sam_key + (const krb5_sam_key * , krb5_data **); + +krb5_error_code encode_krb5_enc_sam_response_enc + (const krb5_enc_sam_response_enc * , krb5_data **); + +krb5_error_code encode_krb5_sam_response + (const krb5_sam_response * , krb5_data **); + +krb5_error_code encode_krb5_predicted_sam_response + (const krb5_predicted_sam_response * , krb5_data **); + +krb5_error_code encode_krb5_setpw_req +(const krb5_principal target, char *password, krb5_data **code); + + + + + +krb5_error_code decode_krb5_sam_challenge + (const krb5_data *, krb5_sam_challenge **); + +krb5_error_code decode_krb5_enc_sam_key + (const krb5_data *, krb5_sam_key **); + +krb5_error_code decode_krb5_enc_sam_response_enc + (const krb5_data *, krb5_enc_sam_response_enc **); + +krb5_error_code decode_krb5_sam_response + (const krb5_data *, krb5_sam_response **); + +krb5_error_code decode_krb5_predicted_sam_response + (const krb5_data *, krb5_predicted_sam_response **); + +krb5_error_code decode_krb5_sam_challenge_2 + (const krb5_data *, krb5_sam_challenge_2 **); + +krb5_error_code decode_krb5_sam_challenge_2_body + (const krb5_data *, krb5_sam_challenge_2_body **); + +krb5_error_code decode_krb5_enc_sam_response_enc_2 + (const krb5_data *, krb5_enc_sam_response_enc_2 **); + +krb5_error_code decode_krb5_sam_response_2 + (const krb5_data *, krb5_sam_response_2 **); + + + + + + +krb5_error_code krb5_validate_times + (krb5_context, + krb5_ticket_times *); +krb5_error_code decode_krb5_authenticator + (const krb5_data *code, krb5_authenticator **rep); + +krb5_error_code decode_krb5_ticket + (const krb5_data *code, krb5_ticket **rep); + +krb5_error_code decode_krb5_encryption_key + (const krb5_data *output, krb5_keyblock **rep); + +krb5_error_code decode_krb5_enc_tkt_part + (const krb5_data *output, krb5_enc_tkt_part **rep); + +krb5_error_code decode_krb5_enc_kdc_rep_part + (const krb5_data *output, krb5_enc_kdc_rep_part **rep); + +krb5_error_code decode_krb5_as_rep + (const krb5_data *output, krb5_kdc_rep **rep); + +krb5_error_code decode_krb5_tgs_rep + (const krb5_data *output, krb5_kdc_rep **rep); + +krb5_error_code decode_krb5_ap_req + (const krb5_data *output, krb5_ap_req **rep); + +krb5_error_code decode_krb5_ap_rep + (const krb5_data *output, krb5_ap_rep **rep); + +krb5_error_code decode_krb5_ap_rep_enc_part + (const krb5_data *output, krb5_ap_rep_enc_part **rep); + +krb5_error_code decode_krb5_as_req + (const krb5_data *output, krb5_kdc_req **rep); + +krb5_error_code decode_krb5_tgs_req + (const krb5_data *output, krb5_kdc_req **rep); + +krb5_error_code decode_krb5_kdc_req_body + (const krb5_data *output, krb5_kdc_req **rep); + +krb5_error_code decode_krb5_safe + (const krb5_data *output, krb5_safe **rep); + +krb5_error_code decode_krb5_safe_with_body + (const krb5_data *output, krb5_safe **rep, krb5_data *body); + +krb5_error_code decode_krb5_priv + (const krb5_data *output, krb5_priv **rep); + +krb5_error_code decode_krb5_enc_priv_part + (const krb5_data *output, krb5_priv_enc_part **rep); + +krb5_error_code decode_krb5_cred + (const krb5_data *output, krb5_cred **rep); + +krb5_error_code decode_krb5_enc_cred_part + (const krb5_data *output, krb5_cred_enc_part **rep); + +krb5_error_code decode_krb5_error + (const krb5_data *output, krb5_error **rep); + +krb5_error_code decode_krb5_authdata + (const krb5_data *output, krb5_authdata ***rep); + +krb5_error_code decode_krb5_pwd_sequence + (const krb5_data *output, passwd_phrase_element **rep); + +krb5_error_code decode_krb5_pwd_data + (const krb5_data *output, krb5_pwd_data **rep); + +krb5_error_code decode_krb5_padata_sequence + (const krb5_data *output, krb5_pa_data ***rep); + +krb5_error_code decode_krb5_alt_method + (const krb5_data *output, krb5_alt_method **rep); + +krb5_error_code decode_krb5_etype_info + (const krb5_data *output, krb5_etype_info_entry ***rep); + +krb5_error_code decode_krb5_etype_info2 + (const krb5_data *output, krb5_etype_info_entry ***rep); + +krb5_error_code decode_krb5_enc_data + (const krb5_data *output, krb5_enc_data **rep); + +krb5_error_code decode_krb5_pa_enc_ts + (const krb5_data *output, krb5_pa_enc_ts **rep); + +krb5_error_code decode_krb5_sam_challenge + (const krb5_data *, krb5_sam_challenge **); + +krb5_error_code decode_krb5_sam_key + (const krb5_data *, krb5_sam_key **); + +krb5_error_code decode_krb5_enc_sam_response_enc + (const krb5_data *, krb5_enc_sam_response_enc **); + +krb5_error_code decode_krb5_sam_response + (const krb5_data *, krb5_sam_response **); + +krb5_error_code decode_krb5_predicted_sam_response + (const krb5_data *, krb5_predicted_sam_response **); +krb5_error_code krb5_encrypt_tkt_part + (krb5_context, + const krb5_keyblock *, + krb5_ticket * ); + + +krb5_error_code krb5_encode_kdc_rep + (krb5_context, + const krb5_msgtype, + const krb5_enc_kdc_rep_part *, + int using_subkey, + const krb5_keyblock *, + krb5_kdc_rep *, + krb5_data ** ); + +krb5_error_code krb5_validate_times + (krb5_context, + krb5_ticket_times *); +krb5_boolean krb5int_auth_con_chkseqnum + (krb5_context ctx, krb5_auth_context ac, krb5_ui_4 in_seq); + + + +struct __krb5_serializer { + krb5_magic odtype; + krb5_error_code (*sizer) (krb5_context, + krb5_pointer, + size_t *); + krb5_error_code (*externalizer) (krb5_context, + krb5_pointer, + krb5_octet **, + size_t *); + krb5_error_code (*internalizer) (krb5_context, + krb5_pointer *, + krb5_octet **, + size_t *); +}; +typedef const struct __krb5_serializer * krb5_ser_handle; +typedef struct __krb5_serializer krb5_ser_entry; + +krb5_ser_handle krb5_find_serializer + (krb5_context, + krb5_magic); +krb5_error_code krb5_register_serializer + (krb5_context, + const krb5_ser_entry *); + + +krb5_error_code krb5_size_opaque + (krb5_context, + krb5_magic, + krb5_pointer, + size_t *); + + +krb5_error_code krb5_externalize_opaque + (krb5_context, + krb5_magic, + krb5_pointer, + krb5_octet **, + size_t *); + + +krb5_error_code krb5_internalize_opaque + (krb5_context, + krb5_magic, + krb5_pointer *, + krb5_octet **, + size_t *); + + +krb5_error_code krb5_externalize_data + (krb5_context, + krb5_pointer, + krb5_octet **, + size_t *); + + + + + +krb5_error_code krb5_ser_context_init + (krb5_context); + + +krb5_error_code krb5_ser_auth_context_init + (krb5_context); + + +krb5_error_code krb5_ser_keytab_init + (krb5_context); + + +krb5_error_code krb5_ser_ccache_init + (krb5_context); + + +krb5_error_code krb5_ser_rcache_init + (krb5_context); + + +krb5_error_code krb5_ser_pack_int32 + (krb5_int32, + krb5_octet **, + size_t *); +krb5_error_code krb5_ser_unpack_int32 + (krb5_int32 *, + krb5_octet **, + size_t *); + +krb5_error_code krb5_ser_pack_int64 + (krb5_int64, krb5_octet **, size_t *); +krb5_error_code krb5_ser_unpack_int64 + (krb5_int64 *, krb5_octet **, size_t *); + +krb5_error_code krb5_ser_pack_bytes + (krb5_octet *, + size_t, + krb5_octet **, + size_t *); +krb5_error_code krb5_ser_unpack_bytes + (krb5_octet *, + size_t, + krb5_octet **, + size_t *); + +krb5_error_code krb5int_cc_default + (krb5_context, krb5_ccache *); + +krb5_error_code krb5_cc_retrieve_cred_default + (krb5_context, krb5_ccache, krb5_flags, + krb5_creds *, krb5_creds *); + +void krb5int_set_prompt_types + (krb5_context, krb5_prompt_type *); + +krb5_error_code +krb5int_generate_and_save_subkey (krb5_context, krb5_auth_context, + krb5_keyblock * ); + + + +krb5_error_code krb5int_mk_chpw_req + (krb5_context context, krb5_auth_context auth_context, + krb5_data *ap_req, char *passwd, krb5_data *packet); +krb5_error_code krb5int_rd_chpw_rep + (krb5_context context, krb5_auth_context auth_context, + krb5_data *packet, int *result_code, + krb5_data *result_data); +krb5_error_code krb5_chpw_result_code_string + (krb5_context context, int result_code, + char **result_codestr); +krb5_error_code krb5int_mk_setpw_req + (krb5_context context, krb5_auth_context auth_context, + krb5_data *ap_req, krb5_principal targetprinc, char *passwd, krb5_data *packet); +krb5_error_code krb5int_rd_setpw_rep + (krb5_context context, krb5_auth_context auth_context, + krb5_data *packet, int *result_code, + krb5_data *result_data); +krb5_error_code krb5int_setpw_result_code_string + (krb5_context context, int result_code, + const char **result_codestr); + +struct srv_dns_entry { + struct srv_dns_entry *next; + int priority; + int weight; + unsigned short port; + char *host; +}; +krb5_error_code +krb5int_make_srv_query_realm(const krb5_data *realm, + const char *service, + const char *protocol, + struct srv_dns_entry **answers); +void krb5int_free_srv_dns_data(struct srv_dns_entry *); +struct ktext; + +typedef struct _krb5int_access { + + const struct krb5_hash_provider *md5_hash_provider; + const struct krb5_enc_provider *arcfour_enc_provider; + krb5_error_code (* krb5_hmac) (const struct krb5_hash_provider *hash, + const krb5_keyblock *key, + unsigned int icount, const krb5_data *input, + krb5_data *output); + + krb5_error_code (*locate_server) (krb5_context, const krb5_data *, + struct addrlist *, int, + const char *, const char *, + int, int, int, int); + krb5_error_code (*sendto_udp) (krb5_context, const krb5_data *msg, + const struct addrlist *, krb5_data *reply, + struct sockaddr *, socklen_t *, int *); + krb5_error_code (*add_host_to_list)(struct addrlist *lp, + const char *hostname, + int port, int secport, + int socktype, int family); + void (*free_addrlist) (struct addrlist *); + + krb5_error_code (*make_srv_query_realm)(const krb5_data *realm, + const char *service, + const char *protocol, + struct srv_dns_entry **answers); + void (*free_srv_dns_data)(struct srv_dns_entry *); + int (*use_dns_kdc)(krb5_context); + + + krb5_int32 (*krb_life_to_time)(krb5_int32, int); + int (*krb_time_to_life)(krb5_int32, krb5_int32); + int (*krb524_encode_v4tkt)(struct ktext *, char *, unsigned int *); + krb5_error_code (*krb5int_c_mandatory_cksumtype) + (krb5_context, krb5_enctype, krb5_cksumtype *); + krb5_error_code ( *krb5_ser_pack_int64) + (krb5_int64, krb5_octet **, size_t *); + krb5_error_code ( *krb5_ser_unpack_int64) + (krb5_int64 *, krb5_octet **, size_t *); +} krb5int_access; + + + + + +krb5_error_code krb5int_accessor + (krb5int_access*, krb5_int32); +extern krb5_int32 krb5int_krb_life_to_time(krb5_int32, int); +extern int krb5int_krb_time_to_life(krb5_int32, krb5_int32); + + +int krb5int_encode_v4tkt + (struct ktext *v4tkt, char *buf, unsigned int *encoded_len); + + +int krb5int_524_sendto_kdc + (krb5_context context, const krb5_data * message, + const krb5_data * realm, krb5_data * reply, + struct sockaddr *, socklen_t *); + + + +struct _krb5_ccache { + krb5_magic magic; + const struct _krb5_cc_ops *ops; + krb5_pointer data; +}; + +struct _krb5_cc_ops { + krb5_magic magic; + char *prefix; + const char * ( *get_name) (krb5_context, krb5_ccache); + krb5_error_code ( *resolve) (krb5_context, krb5_ccache *, + const char *); + krb5_error_code ( *gen_new) (krb5_context, krb5_ccache *); + krb5_error_code ( *init) (krb5_context, krb5_ccache, + krb5_principal); + krb5_error_code ( *destroy) (krb5_context, krb5_ccache); + krb5_error_code ( *close) (krb5_context, krb5_ccache); + krb5_error_code ( *store) (krb5_context, krb5_ccache, + krb5_creds *); + krb5_error_code ( *retrieve) (krb5_context, krb5_ccache, + krb5_flags, krb5_creds *, + krb5_creds *); + krb5_error_code ( *get_princ) (krb5_context, krb5_ccache, + krb5_principal *); + krb5_error_code ( *get_first) (krb5_context, krb5_ccache, + krb5_cc_cursor *); + krb5_error_code ( *get_next) (krb5_context, krb5_ccache, + krb5_cc_cursor *, krb5_creds *); + krb5_error_code ( *end_get) (krb5_context, krb5_ccache, + krb5_cc_cursor *); + krb5_error_code ( *remove_cred) (krb5_context, krb5_ccache, + krb5_flags, krb5_creds *); + krb5_error_code ( *set_flags) (krb5_context, krb5_ccache, + krb5_flags); +}; + +extern const krb5_cc_ops *krb5_cc_dfl_ops; + +typedef struct _krb5_donot_replay { + krb5_magic magic; + krb5_ui_4 hash; + char *server; + char *client; + krb5_int32 cusec; + krb5_timestamp ctime; +} krb5_donot_replay; + +krb5_error_code krb5_rc_default + (krb5_context, + krb5_rcache *); +krb5_error_code krb5_rc_resolve_type + (krb5_context, + krb5_rcache *,char *); +krb5_error_code krb5_rc_resolve_full + (krb5_context, + krb5_rcache *,char *); +char * krb5_rc_get_type + (krb5_context, + krb5_rcache); +char * krb5_rc_default_type + (krb5_context); +char * krb5_rc_default_name + (krb5_context); +krb5_error_code krb5_auth_to_rep + (krb5_context, + krb5_tkt_authent *, + krb5_donot_replay *); + + +krb5_error_code krb5_rc_initialize + (krb5_context, krb5_rcache,krb5_deltat); +krb5_error_code krb5_rc_recover_or_initialize + (krb5_context, krb5_rcache,krb5_deltat); +krb5_error_code krb5_rc_recover + (krb5_context, krb5_rcache); +krb5_error_code krb5_rc_destroy + (krb5_context, krb5_rcache); +krb5_error_code krb5_rc_close + (krb5_context, krb5_rcache); +krb5_error_code krb5_rc_store + (krb5_context, krb5_rcache,krb5_donot_replay *); +krb5_error_code krb5_rc_expunge + (krb5_context, krb5_rcache); +krb5_error_code krb5_rc_get_lifespan + (krb5_context, krb5_rcache,krb5_deltat *); +char * krb5_rc_get_name + (krb5_context, krb5_rcache); +krb5_error_code krb5_rc_resolve + (krb5_context, krb5_rcache, char *); + +typedef struct _krb5_kt_ops { + krb5_magic magic; + char *prefix; + + krb5_error_code ( *resolve) + (krb5_context, + const char *, + krb5_keytab *); + krb5_error_code ( *get_name) + (krb5_context, + krb5_keytab, + char *, + unsigned int); + krb5_error_code ( *close) + (krb5_context, + krb5_keytab); + krb5_error_code ( *get) + (krb5_context, + krb5_keytab, + krb5_const_principal, + krb5_kvno, + krb5_enctype, + krb5_keytab_entry *); + krb5_error_code ( *start_seq_get) + (krb5_context, + krb5_keytab, + krb5_kt_cursor *); + krb5_error_code ( *get_next) + (krb5_context, + krb5_keytab, + krb5_keytab_entry *, + krb5_kt_cursor *); + krb5_error_code ( *end_get) + (krb5_context, + krb5_keytab, + krb5_kt_cursor *); + + krb5_error_code ( *add) + (krb5_context, + krb5_keytab, + krb5_keytab_entry *); + krb5_error_code ( *remove) + (krb5_context, + krb5_keytab, + krb5_keytab_entry *); + + + const krb5_ser_entry *serializer; +} krb5_kt_ops; + +extern const krb5_kt_ops krb5_kt_dfl_ops; + +extern krb5_error_code krb5int_translate_gai_error (int); + + +extern krb5_error_code +krb5int_c_mandatory_cksumtype (krb5_context, krb5_enctype, krb5_cksumtype *); + +extern int krb5int_crypto_init (void); +extern int krb5int_prng_init(void); + + + + +struct _krb5_auth_context { + krb5_magic magic; + krb5_address * remote_addr; + krb5_address * remote_port; + krb5_address * local_addr; + krb5_address * local_port; + krb5_keyblock * keyblock; + krb5_keyblock * send_subkey; + krb5_keyblock * recv_subkey; + + krb5_int32 auth_context_flags; + krb5_ui_4 remote_seq_number; + krb5_ui_4 local_seq_number; + krb5_authenticator *authentp; + krb5_cksumtype req_cksumtype; + krb5_cksumtype safe_cksumtype; + krb5_pointer i_vector; + krb5_rcache rcache; + krb5_enctype * permitted_etypes; + krb5_mk_req_checksum_func checksum_func; + void *checksum_func_data; +}; + + + + +static const char sendauth_version[] = "KRB5_SENDAUTH_V1.0"; + +static krb5_error_code +recvauth_common(krb5_context context, + krb5_auth_context * auth_context, + + krb5_pointer fd, + char *appl_version, + krb5_principal server, + krb5_int32 flags, + krb5_keytab keytab, + + krb5_ticket ** ticket, + krb5_data *version) +{ + krb5_auth_context new_auth_context; + krb5_flags ap_option; + krb5_error_code retval, problem; + krb5_data inbuf; + krb5_data outbuf; + krb5_rcache rcache = 0; + krb5_octet response; + krb5_data null_server; + int need_error_free = 0; + int local_rcache = 0, local_authcon = 0; + + + + + + + + problem = 0; + + if (!(flags & 0x0001)) { + + + + if ((retval = krb5_read_message(context, fd, &inbuf))) + return(retval); + if ( + __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( + inbuf.data + ) && __builtin_constant_p ( + sendauth_version + ) && (__s1_len = strlen ( + inbuf.data + ), __s2_len = strlen ( + sendauth_version + ), (!((size_t)(const void *)(( + inbuf.data + ) + 1) - (size_t)(const void *)( + inbuf.data + ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(( + sendauth_version + ) + 1) - (size_t)(const void *)( + sendauth_version + ) == 1) || __s2_len >= 4)) ? __builtin_strcmp ( + inbuf.data + , + sendauth_version + ) : (__builtin_constant_p ( + inbuf.data + ) && ((size_t)(const void *)(( + inbuf.data + ) + 1) - (size_t)(const void *)( + inbuf.data + ) == 1) && (__s1_len = strlen ( + inbuf.data + ), __s1_len < 4) ? (__builtin_constant_p ( + sendauth_version + ) && ((size_t)(const void *)(( + sendauth_version + ) + 1) - (size_t)(const void *)( + sendauth_version + ) == 1) ? __builtin_strcmp ( + inbuf.data + , + sendauth_version + ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) ( + sendauth_version + ); int __result = (((const unsigned char *) (const char *) ( + inbuf.data + ))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((const unsigned char *) (const char *) ( + inbuf.data + ))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((const unsigned char *) (const char *) ( + inbuf.data + ))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( + inbuf.data + ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ( + sendauth_version + ) && ((size_t)(const void *)(( + sendauth_version + ) + 1) - (size_t)(const void *)( + sendauth_version + ) == 1) && (__s2_len = strlen ( + sendauth_version + ), __s2_len < 4) ? (__builtin_constant_p ( + inbuf.data + ) && ((size_t)(const void *)(( + inbuf.data + ) + 1) - (size_t)(const void *)( + inbuf.data + ) == 1) ? __builtin_strcmp ( + inbuf.data + , + sendauth_version + ) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) ( + inbuf.data + ); int __result = (((const unsigned char *) (const char *) ( + sendauth_version + ))[0] - __s2[0]); if (__s2_len > 0 && __result == 0) { __result = (((const unsigned char *) (const char *) ( + sendauth_version + ))[1] - __s2[1]); if (__s2_len > 1 && __result == 0) { __result = (((const unsigned char *) (const char *) ( + sendauth_version + ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( + sendauth_version + ))[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ( + inbuf.data + , + sendauth_version + )))); }) + ) { + free((char *)(inbuf.data)); + problem = (-1765328180L); + } + free((char *)(inbuf.data)); + } + if (flags & 0x0002) + problem = (-1765328180L); + + + + + if ((retval = krb5_read_message(context, fd, &inbuf))) + return(retval); + if (appl_version && + __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ( + inbuf.data + ) && __builtin_constant_p ( + appl_version + ) && (__s1_len = strlen ( + inbuf.data + ), __s2_len = strlen ( + appl_version + ), (!((size_t)(const void *)(( + inbuf.data + ) + 1) - (size_t)(const void *)( + inbuf.data + ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(( + appl_version + ) + 1) - (size_t)(const void *)( + appl_version + ) == 1) || __s2_len >= 4)) ? __builtin_strcmp ( + inbuf.data + , + appl_version + ) : (__builtin_constant_p ( + inbuf.data + ) && ((size_t)(const void *)(( + inbuf.data + ) + 1) - (size_t)(const void *)( + inbuf.data + ) == 1) && (__s1_len = strlen ( + inbuf.data + ), __s1_len < 4) ? (__builtin_constant_p ( + appl_version + ) && ((size_t)(const void *)(( + appl_version + ) + 1) - (size_t)(const void *)( + appl_version + ) == 1) ? __builtin_strcmp ( + inbuf.data + , + appl_version + ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) ( + appl_version + ); int __result = (((const unsigned char *) (const char *) ( + inbuf.data + ))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((const unsigned char *) (const char *) ( + inbuf.data + ))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((const unsigned char *) (const char *) ( + inbuf.data + ))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( + inbuf.data + ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ( + appl_version + ) && ((size_t)(const void *)(( + appl_version + ) + 1) - (size_t)(const void *)( + appl_version + ) == 1) && (__s2_len = strlen ( + appl_version + ), __s2_len < 4) ? (__builtin_constant_p ( + inbuf.data + ) && ((size_t)(const void *)(( + inbuf.data + ) + 1) - (size_t)(const void *)( + inbuf.data + ) == 1) ? __builtin_strcmp ( + inbuf.data + , + appl_version + ) : (- (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) ( + inbuf.data + ); int __result = (((const unsigned char *) (const char *) ( + appl_version + ))[0] - __s2[0]); if (__s2_len > 0 && __result == 0) { __result = (((const unsigned char *) (const char *) ( + appl_version + ))[1] - __s2[1]); if (__s2_len > 1 && __result == 0) { __result = (((const unsigned char *) (const char *) ( + appl_version + ))[2] - __s2[2]); if (__s2_len > 2 && __result == 0) __result = (((const unsigned char *) (const char *) ( + appl_version + ))[3] - __s2[3]); } } __result; })))) : __builtin_strcmp ( + inbuf.data + , + appl_version + )))); }) + ) { + free((char *)(inbuf.data)); + if (!problem) + problem = (-1765328179L); + } + if (version && !problem) + *version = inbuf; + else + free((char *)(inbuf.data)); + + + + + + switch (problem) { + case 0: + response = 0; + break; + case (-1765328180L): + response = 1; + break; + case (-1765328179L): + response = 2; + break; + default: + + + + response = 255; + + + + + + break; + } + + + + + if ((krb5_net_write(context, *((int *)fd), (char *)&response, 1)) < 0) { + return(problem); + } + if (problem) + return(problem); + + + + + + + if ((retval = krb5_read_message(context, fd, &inbuf))) + return retval; + + if (*auth_context == + ((void *)0) + ) { + problem = krb5_auth_con_init(context, &new_auth_context); + *auth_context = new_auth_context; + local_authcon = 1; + } + krb5_auth_con_getrcache(context, *auth_context, &rcache); + if ((!problem) && rcache == + ((void *)0) + ) { + + + + if (server) { + problem = krb5_get_server_rcache(context, + (((0) < (server)->length) ? (server)->data + (0) : + ((void *)0) + ), &rcache); + } else { + null_server.length = 7; + null_server.data = "default"; + problem = krb5_get_server_rcache(context, &null_server, &rcache); + } + if (!problem) + problem = krb5_auth_con_setrcache(context, *auth_context, rcache); + local_rcache = 1; + } + if (!problem) { + problem = krb5_rd_req(context, auth_context, &inbuf, server, + keytab, &ap_option, ticket); + free((char *)(inbuf.data)); + } + + + + + + + if (problem) { + krb5_error error; + const char *message; + + memset((char *)&error, 0, sizeof(error)); + krb5_us_timeofday(context, &error.stime, &error.susec); + if(server) + error.server = server; + else { + + + (void) krb5_parse_name(context, "????", &error.server); + need_error_free = 1; + } + + error.error = problem - (-1765328384L); + if (error.error > 127) + error.error = 60; + message = error_message(problem); + error.text.length = strlen(message) + 1; + if (!(error.text.data = malloc(error.text.length))) { + retval = + 12 + ; + goto cleanup; + } + strcpy(error.text.data, message); + if ((retval = krb5_mk_error(context, &error, &outbuf))) { + free(error.text.data); + goto cleanup; + } + free(error.text.data); + if(need_error_free) + krb5_free_principal(context, error.server); + + } else { + outbuf.length = 0; + outbuf.data = 0; + } + + retval = krb5_write_message(context, fd, &outbuf); + if (outbuf.data) { + free((char *)(outbuf.data)); + + retval = problem; + goto cleanup; + } + if (retval) + goto cleanup; + + + if ((ap_option & 0x20000000)) { + if ((retval = krb5_mk_rep(context, *auth_context, &outbuf))) { + return(retval); + } + retval = krb5_write_message(context, fd, &outbuf); + free((char *)(outbuf.data)); + } + +cleanup:; + if (retval) { + if (local_authcon) { + krb5_auth_con_free(context, *auth_context); + } else if (local_rcache && rcache != + ((void *)0) + ) { + krb5_rc_close(context, rcache); + krb5_auth_con_setrcache(context, *auth_context, + ((void *)0) + ); + } + } + return retval; +} + +krb5_error_code +krb5_recvauth(krb5_context context, krb5_auth_context *auth_context, krb5_pointer fd, char *appl_version, krb5_principal server, krb5_int32 flags, krb5_keytab keytab, krb5_ticket **ticket) +{ + return recvauth_common (context, auth_context, fd, appl_version, + server, flags, keytab, ticket, 0); +} + +krb5_error_code +krb5_recvauth_version(krb5_context context, + krb5_auth_context *auth_context, + + krb5_pointer fd, + krb5_principal server, + krb5_int32 flags, + krb5_keytab keytab, + + krb5_ticket **ticket, + krb5_data *version) +{ + return recvauth_common (context, auth_context, fd, 0, + server, flags, keytab, ticket, version); +} /* { dg-bogus "analysis bailed out early" "" { xfail *-*-* } } */ -- 1.8.5.3