/* $Id: kauth.h,v 1.4 1996/04/29 11:57:36 bg Exp $ */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <signal.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <pwd.h>
#include <grp.h>

/* For getopt() */

extern char *optarg;
extern int optind, opterr;

#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif /* HAVE_SYS_RESOURCE_H */
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <errno.h>

#include <krb.h>
#include <kafs.h>

#include <roken.h>

int rkinit (char *name, char *inst, char *realm, int lifetime,
	    char *locuser, char *tktfile, des_cblock *key, char *hostname);

int write_encrypted (int fd, void *buf, size_t len,
		     des_key_schedule schedule, des_cblock *session,
		     struct sockaddr_in *me, struct sockaddr_in *her);

int read_encrypted (int fd, void *buf, size_t len, void **ret,
		    des_key_schedule schedule, des_cblock *session,
		    struct sockaddr_in *her, struct sockaddr_in *me);

unsigned pack_args (char *buf, char *name, char *inst, char *realm,
		    int lifetime, char *locuser, char *tktfile);

int unpack_args (char *buf, char *name, char *inst, char *realm,
		 int *lifetime, char *locuser, char *tktfile);
