From d61b48d4da8cc74b36be97557aa2ea1e4608fd31 Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Fri, 15 Sep 1995 06:19:14 +0000 Subject: [PATCH] Header files for the rkinit suite. --- eBones/include/rkinit.h | 42 +++++++++++++ eBones/include/rkinit_private.h | 106 ++++++++++++++++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 eBones/include/rkinit.h create mode 100644 eBones/include/rkinit_private.h diff --git a/eBones/include/rkinit.h b/eBones/include/rkinit.h new file mode 100644 index 000000000000..8be12029cd8e --- /dev/null +++ b/eBones/include/rkinit.h @@ -0,0 +1,42 @@ +/* + * $Id: rkinit.h,v 1.2 1993/12/23 16:47:27 dglo Exp $ + * $Source: /usr/sww/share/src/kerberosIV.BSD/include/RCS/rkinit.h,v $ + * $Author: dglo $ + * + * Main header file for rkinit library users + */ + +#ifndef __RKINIT_H__ +#define __RKINIT_H__ + +#if !defined(lint) && !defined(SABER) && !defined(LOCORE) && defined(RCS_HDRS) +static char *rcsid_rkinit_h = "$Id: rkinit.h,v 1.2 1993/12/23 16:47:27 dglo Exp $"; +#endif /* lint || SABER || LOCORE || RCS_HDRS */ + +#include +#include + +#ifdef __STDC__ +#define RK_PROTO(x) x +#else +#define RK_PROTO(x) () +#endif /* __STDC__ */ + +typedef struct { + char aname[ANAME_SZ + 1]; + char inst[INST_SZ + 1]; + char realm[REALM_SZ + 1]; + char sname[ANAME_SZ + 1]; + char sinst[INST_SZ + 1]; + char username[9]; /* max local name length + 1 */ + char tktfilename[MAXPATHLEN + 1]; + u_int lifetime; +} rkinit_info; + +#define RKINIT_SUCCESS 0 + +/* Function declarations */ +extern int rkinit RK_PROTO((char *, char *, rkinit_info *, int)); +extern char *rkinit_errmsg RK_PROTO((char *)); + +#endif /* __RKINIT_H__ */ diff --git a/eBones/include/rkinit_private.h b/eBones/include/rkinit_private.h new file mode 100644 index 000000000000..7784b6e51d0a --- /dev/null +++ b/eBones/include/rkinit_private.h @@ -0,0 +1,106 @@ +/* + * $Id: rkinit_private.h,v 1.4 1993/12/23 16:47:39 dglo Exp $ + * $Source: /usr/sww/share/src/kerberosIV.BSD/include/RCS/rkinit_private.h,v $ + * $Author: dglo $ + * + * Header file for rkinit library and server internal use + */ + +#ifndef __RKINIT_PRIVATE_H__ +#define __RKINIT_PRIVATE_H__ + +#if !defined(lint) && !defined(SABER) +static const char *rcsid_rkinit_private_h = "$Id: rkinit_private.h,v 1.4 1993/12/23 16:47:39 dglo Exp $"; +#endif /* lint || SABER */ + +#include +#include + +#ifdef __STDC__ +#define RK_PROTO(x) x +#else +#define RK_PROTO(x) () +#define const +#endif /* __STDC__ */ + +/* Lowest and highest versions supported */ +#define RKINIT_LVERSION 3 +#define RKINIT_HVERSION 3 + +/* Service to be used; port number to fall back on if service isn't found */ +#define SERVENT "rkinit" +#define PORT 2108 + +/* Key for kerberos authentication */ +#define KEY "rcmd" + +/* Packet format information */ +#define PKT_TYPE 0 +#define PKT_LEN 1 +#define PKT_DATA (PKT_LEN + sizeof(u_int32_t)) + +/* Number of retries during message reads */ +#define RETRIES 15 + +/* + * Message types for packets. Make sure that rki_mt_to_string is right in + * rk_util.c + */ +#define MT_STATUS 0 +#define MT_CVERSION 1 +#define MT_SVERSION 2 +#define MT_RKINIT_INFO 3 +#define MT_SKDC 4 +#define MT_CKDC 5 +#define MT_AUTH 6 +#define MT_DROP 7 + +/* Miscellaneous protocol constants */ +#define VERSION_INFO_SIZE 2 + +/* Useful definitions */ +#define BCLEAR(a) bzero((char *)(a), sizeof(a)) +#define SBCLEAR(a) bzero((char *)&(a), sizeof(a)) +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#define max(a,b) (((a) > (b)) ? (a) : (b)) + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifdef _JBLEN +#define SETJMP_TYPEDEFED +#endif + +/* Function declarations */ +int rki_key_proc RK_PROTO((char *, char *, char *, char *, des_cblock *)); +int rki_get_tickets RK_PROTO((int, char *, char *, rkinit_info *)); +int rki_send_packet RK_PROTO((int, char, u_int32_t, const char *)); +int rki_get_packet RK_PROTO((int, u_char, u_int32_t *, char *)); +int rki_setup_rpc RK_PROTO((char *)); +int rki_rpc_exchange_version_info RK_PROTO((int, int, int *, int *)); +int rki_rpc_send_rkinit_info RK_PROTO((rkinit_info *)); +int rki_rpc_get_status RK_PROTO((void)); +int rki_rpc_get_ktext RK_PROTO((int, KTEXT, u_char)); +int rki_rpc_sendauth RK_PROTO((KTEXT)); +int rki_rpc_get_skdc RK_PROTO((KTEXT)); +int rki_rpc_send_ckdc RK_PROTO((MSG_DAT *)); +int rki_get_csaddr RK_PROTO((struct sockaddr_in *, struct sockaddr_in *)); +void rki_drop_server RK_PROTO((void)); +void rki_cleanup_rpc RK_PROTO((void)); +void rki_dmsg RK_PROTO((char *)); +const char *rki_mt_to_string RK_PROTO((int)); +int rki_choose_version RK_PROTO((int *)); +int rki_send_rkinit_info RK_PROTO((int, rkinit_info *)); +#ifdef SETJMP_TYPEDEFED +void (*rki_setup_timer RK_PROTO((jmp_buf env))) RK_PROTO((int)); +#endif +void rki_restore_timer RK_PROTO((void (*old_alrm)(int))); +void rki_cleanup_rpc RK_PROTO((void)); + + +#endif /* __RKINIT_PRIVATE_H__ */