+2001-10-12 Ken Raeburn <raeburn@mit.edu>
+
+ * k5-int.h (struct _krb5_kt_ops, krb5_kt_ops, krb5_kt_dfl_ops):
+ Definitions and declarations moved here...
+ * krb5.hin: ...from here.
+ (krb5_kt_get_type, krb5_kt_get_name, krb5_kt_close,
+ krb5_kt_get_entry, krb5_kt_start_seq_get, krb5_kt_next_entry,
+ krb5_kt_end_seq_get): Replaced macro definitions with declarations
+ for functions now in lib/krb5/keytab/ktfns.c.
+
2001-10-09 Ken Raeburn <raeburn@mit.edu>
* fake-stdlib.h: Make prototypes unconditional.
typedef struct _krb5_rc_ops krb5_rc_ops;
-krb5_error_code krb5_rc_register_type
- (krb5_context,
- krb5_rc_ops *);
+krb5_error_code krb5_rc_register_type (krb5_context, krb5_rc_ops *);
extern krb5_rc_ops krb5_rc_dfl_ops;
+typedef struct _krb5_kt_ops {
+ krb5_magic magic;
+ char *prefix;
+ /* routines always present */
+ krb5_error_code (KRB5_CALLCONV *resolve)
+ (krb5_context,
+ krb5_const char *,
+ krb5_keytab *);
+ krb5_error_code (KRB5_CALLCONV *get_name)
+ (krb5_context,
+ krb5_keytab,
+ char *,
+ unsigned int);
+ krb5_error_code (KRB5_CALLCONV *close)
+ (krb5_context,
+ krb5_keytab);
+ krb5_error_code (KRB5_CALLCONV *get)
+ (krb5_context,
+ krb5_keytab,
+ krb5_const_principal,
+ krb5_kvno,
+ krb5_enctype,
+ krb5_keytab_entry *);
+ krb5_error_code (KRB5_CALLCONV *start_seq_get)
+ (krb5_context,
+ krb5_keytab,
+ krb5_kt_cursor *);
+ krb5_error_code (KRB5_CALLCONV *get_next)
+ (krb5_context,
+ krb5_keytab,
+ krb5_keytab_entry *,
+ krb5_kt_cursor *);
+ krb5_error_code (KRB5_CALLCONV *end_get)
+ (krb5_context,
+ krb5_keytab,
+ krb5_kt_cursor *);
+ /* routines to be included on extended version (write routines) */
+ krb5_error_code (KRB5_CALLCONV *add)
+ (krb5_context,
+ krb5_keytab,
+ krb5_keytab_entry *);
+ krb5_error_code (KRB5_CALLCONV *remove)
+ (krb5_context,
+ krb5_keytab,
+ krb5_keytab_entry *);
+
+ /* Handle for serializer */
+ void * serializer;
+} krb5_kt_ops;
+
+extern krb5_kt_ops krb5_kt_dfl_ops;
+
extern krb5_error_code krb5int_translate_gai_error (int);
#endif /* _KRB5_INT_H */
} krb5_keytab_entry;
+struct _krb5_kt_ops;
typedef struct _krb5_kt {
krb5_magic magic;
struct _krb5_kt_ops *ops;
krb5_pointer data;
} *krb5_keytab;
-
-typedef struct _krb5_kt_ops {
- krb5_magic magic;
- char *prefix;
- /* routines always present */
- krb5_error_code (KRB5_CALLCONV *resolve)
- (krb5_context,
- krb5_const char *,
- krb5_keytab *);
- krb5_error_code (KRB5_CALLCONV *get_name)
- (krb5_context,
- krb5_keytab,
- char *,
- unsigned int);
- krb5_error_code (KRB5_CALLCONV *close)
- (krb5_context,
- krb5_keytab);
- krb5_error_code (KRB5_CALLCONV *get)
- (krb5_context,
- krb5_keytab,
- krb5_const_principal,
- krb5_kvno,
- krb5_enctype,
- krb5_keytab_entry *);
- krb5_error_code (KRB5_CALLCONV *start_seq_get)
- (krb5_context,
- krb5_keytab,
- krb5_kt_cursor *);
- krb5_error_code (KRB5_CALLCONV *get_next)
- (krb5_context,
- krb5_keytab,
- krb5_keytab_entry *,
- krb5_kt_cursor *);
- krb5_error_code (KRB5_CALLCONV *end_get)
- (krb5_context,
- krb5_keytab,
- krb5_kt_cursor *);
- /* routines to be included on extended version (write routines) */
- krb5_error_code (KRB5_CALLCONV *add)
- (krb5_context,
- krb5_keytab,
- krb5_keytab_entry *);
- krb5_error_code (KRB5_CALLCONV *remove)
- (krb5_context,
- krb5_keytab,
- krb5_keytab_entry *);
-
- /* Handle for serializer */
- void * serializer;
-} krb5_kt_ops;
-
-#define krb5_kt_get_type(context, keytab) ((keytab)->ops->prefix)
-#define krb5_kt_get_name(context, keytab, name, namelen) krb5_x((keytab)->ops->get_name,(context, keytab,name,namelen))
-#define krb5_kt_close(context, keytab) krb5_x((keytab)->ops->close,(context, keytab))
-#define krb5_kt_get_entry(context, keytab, principal, vno, enctype, entry) krb5_x((keytab)->ops->get,(context, keytab, principal, vno, enctype, entry))
-#define krb5_kt_start_seq_get(context, keytab, cursor) krb5_x((keytab)->ops->start_seq_get,(context, keytab, cursor))
-#define krb5_kt_next_entry(context, keytab, entry, cursor) krb5_x((keytab)->ops->get_next,(context, keytab, entry, cursor))
-#define krb5_kt_end_seq_get(context, keytab, cursor) krb5_x((keytab)->ops->end_get,(context, keytab, cursor))
-/* remove and add are functions, so that they can return NOWRITE
- if not a writable keytab */
-
-
-extern krb5_kt_ops krb5_kt_dfl_ops;
+char *
+krb5_kt_get_type (krb5_context, krb5_keytab keytab);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_get_name(krb5_context context, krb5_keytab keytab, char *name,
+ unsigned int namelen);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_close(krb5_context context, krb5_keytab keytab);
+krb5_error_code KRB5_CALLCONV
+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_CALLCONV
+krb5_kt_start_seq_get(krb5_context context, krb5_keytab keytab,
+ krb5_kt_cursor *cursor);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_next_entry(krb5_context context, krb5_keytab keytab,
+ krb5_keytab_entry *entry, krb5_kt_cursor *cursor);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab,
+ krb5_kt_cursor *cursor);
/*
* end "keytab.h"
/* libkt.spec */
krb5_error_code KRB5_CALLCONV krb5_kt_register
(krb5_context,
- krb5_kt_ops * );
+ struct _krb5_kt_ops * );
krb5_error_code KRB5_CALLCONV krb5_kt_resolve
(krb5_context,
krb5_const char *,
+2001-10-12 Ken Raeburn <raeburn@mit.edu>
+
+ * ktfns.c: New file.
+ * Makefile.in (STLIBOBJS, OBJS, SRCS): Build it.
+
2001-10-09 Ken Raeburn <raeburn@mit.edu>
* ktbase.c: Make prototypes unconditional.
ktdefault.o \
ktfr_entry.o \
ktremove.o \
+ ktfns.o \
read_servi.o
OBJS= \
$(OUTPRE)ktdefault.$(OBJEXT) \
$(OUTPRE)ktfr_entry.$(OBJEXT) \
$(OUTPRE)ktremove.$(OBJEXT) \
+ $(OUTPRE)ktfns.$(OBJEXT) \
$(OUTPRE)read_servi.$(OBJEXT)
SRCS= \
$(srcdir)/ktdefault.c \
$(srcdir)/ktfr_entry.c \
$(srcdir)/ktremove.c \
+ $(srcdir)/ktfns.c \
$(srcdir)/read_servi.c
all-windows:: subdirs $(OBJFILE)
--- /dev/null
+/*
+ * lib/krb5/keytab/ktfns.c
+ *
+ * Copyright 2001 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
+ *
+ * Export of this software from the United States of America may
+ * require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of M.I.T. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ */
+
+/*
+ * Dispatch methods for keytab code.
+ */
+
+#include "k5-int.h"
+
+char *
+krb5_kt_get_type (krb5_context context, krb5_keytab keytab)
+{
+ return keytab->ops->prefix;
+}
+
+krb5_error_code KRB5_CALLCONV
+krb5_kt_get_name(krb5_context context, krb5_keytab keytab, char *name,
+ unsigned int namelen)
+{
+ return krb5_x((keytab)->ops->get_name,(context, keytab,name,namelen));
+}
+
+krb5_error_code KRB5_CALLCONV
+krb5_kt_close(krb5_context context, krb5_keytab keytab)
+{
+ return krb5_x((keytab)->ops->close,(context, keytab));
+}
+
+krb5_error_code KRB5_CALLCONV
+krb5_kt_get_entry(krb5_context context, krb5_keytab keytab,
+ krb5_const_principal principal, krb5_kvno vno,
+ krb5_enctype enctype, krb5_keytab_entry *entry)
+{
+ return krb5_x((keytab)->ops->get,(context, keytab, principal, vno, enctype, entry));
+}
+
+krb5_error_code KRB5_CALLCONV
+krb5_kt_start_seq_get(krb5_context context, krb5_keytab keytab,
+ krb5_kt_cursor *cursor)
+{
+ return krb5_x((keytab)->ops->start_seq_get,(context, keytab, cursor));
+}
+
+krb5_error_code KRB5_CALLCONV
+krb5_kt_next_entry(krb5_context context, krb5_keytab keytab,
+ krb5_keytab_entry *entry, krb5_kt_cursor *cursor)
+{
+ return krb5_x((keytab)->ops->get_next,(context, keytab, entry, cursor));
+}
+
+krb5_error_code KRB5_CALLCONV
+krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab,
+ krb5_kt_cursor *cursor)
+{
+ return krb5_x((keytab)->ops->end_get,(context, keytab, cursor));
+}