From 70585b725f15e984d0c08ce4c1540f09a8c711c6 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 8 Mar 2006 02:56:48 +0000 Subject: krb5.h, which is built after util/et, which is built after the support code. Fix: Put service location decls in k5-locate.h, pull plugin support decls out of k5-int.h into k5-plugin.h, and make it stand on its own, which includes changing the return type from krb5_error_code to int32_t. Oops: The plugin support code included k5-int.h, which includes git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17707 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-plugin.h | 119 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 91 insertions(+), 28 deletions(-) (limited to 'src/include/k5-plugin.h') diff --git a/src/include/k5-plugin.h b/src/include/k5-plugin.h index a49c79ad24..2ce5b9f972 100644 --- a/src/include/k5-plugin.h +++ b/src/include/k5-plugin.h @@ -1,30 +1,93 @@ -#ifndef K5_PLUGIN_H_INCLUDED -#define K5_PLUGIN_H_INCLUDED -#include "krb5.h" - -enum locate_service_type { - locate_service_kdc = 1, - locate_service_master_kdc, - locate_service_kadmin, - locate_service_krb524, - locate_service_kpasswd -}; +/* + * Copyright (C) 2006 Massachusetts Institute of Technology. + * All Rights Reserved. + * + * This software is being provided to you, the LICENSEE, by the + * Massachusetts Institute of Technology (M.I.T.) under the following + * license. By obtaining, using and/or copying this software, you agree + * that you have read, understood, and will comply with these terms and + * conditions: + * + * 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 or + * royalty is hereby granted, provided that you agree to comply with the + * following copyright notice and statements, including the disclaimer, and + * that the same appear on ALL copies of the software and documentation, + * including modifications that you make for internal use or for + * distribution: + * + * THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS + * OR WARRANTIES, EXPRESS OR IMPLIED. By way of example, but not + * limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF + * MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF + * THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY + * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. + * + * The name of the Massachusetts Institute of Technology or M.I.T. may NOT + * be used in advertising or publicity pertaining to distribution of the + * software. Title to copyright in this software and any associated + * documentation shall at all times remain with M.I.T., and USER agrees to + * preserve same. + * + * 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. + */ -struct krb5plugin_service_locate_ftable { - int vmajor, vminor; - /* Per-context setup and teardown. Returned void* blob is - private to the plugin. */ - krb5_error_code (*init)(krb5_context, void **); - void (*fini)(void *); - /* Callback function returns non-zero if the plugin function - should quit and return; this may be because of an error, or may - indicate we've already contacted the service, whatever. The - lookup function should only return an error if it detects a - problem, not if the callback function tells it to quit. */ - krb5_error_code (*lookup)(void *, - enum locate_service_type svc, const char *realm, - int socktype, int family, - int (*cbfunc)(void *,int,struct sockaddr *), - void *cbdata); -}; +/* Just those definitions which are needed by util/support/plugins.c, + which gets compiled before util/et is built, which happens before + we can construct krb5.h, which is included by k5-int.h. + + So, no krb5 types. */ + +#if defined(_MSDOS) || defined(_WIN32) +#include "win-mac.h" #endif +#include "autoconf.h" +#ifndef KRB5_CALLCONV +#define KRB5_CALLCONV +#define KRB5_CALLCONV_C +#endif + +#ifdef HAVE_STDINT_H +# include +#elif defined(HAVE_INTTYPES_H) +# include +#endif + +struct plugin_file_handle; /* opaque */ + +struct plugin_dir_handle { + /* This points to a list of plugin_file_handle structs, terminated + by one passing NULL_HANDLE. */ + struct plugin_file_handle *files; +}; +#define PLUGIN_DIR_INIT(P) ((P)->files = NULL) +#define PLUGIN_DIR_OPEN(P) ((P)->files != NULL) + +int32_t KRB5_CALLCONV +krb5int_open_plugin (const char *, struct plugin_file_handle **); + +int32_t KRB5_CALLCONV +krb5int_get_plugin_data (struct plugin_file_handle *, const char *, void **); + +int32_t KRB5_CALLCONV +krb5int_get_plugin_func (struct plugin_file_handle *, const char *, + void (**)()); + +void KRB5_CALLCONV +krb5int_close_plugin (struct plugin_file_handle *); + +int32_t KRB5_CALLCONV krb5int_open_plugin_dir (const char *, struct plugin_dir_handle *); +void KRB5_CALLCONV krb5int_close_plugin_dir (struct plugin_dir_handle *); +void KRB5_CALLCONV krb5int_free_plugin_dir_data (void **); +int32_t KRB5_CALLCONV krb5int_get_plugin_dir_data (struct plugin_dir_handle *, + const char *, void ***); +void KRB5_CALLCONV krb5int_free_plugin_dir_func (void (**)(void)); +int32_t KRB5_CALLCONV krb5int_get_plugin_dir_func (struct plugin_dir_handle *, + const char *, void (***)(void)); -- cgit