1159d09a2SMark Phalan 
2159d09a2SMark Phalan /*
3159d09a2SMark Phalan  * <krb5/locate_plugin.h>
4159d09a2SMark Phalan  *
5159d09a2SMark Phalan  * Copyright 2006 Massachusetts Institute of Technology.
6159d09a2SMark Phalan  * All Rights Reserved.
7159d09a2SMark Phalan  *
8159d09a2SMark Phalan  * Export of this software from the United States of America may
9159d09a2SMark Phalan  *   require a specific license from the United States Government.
10159d09a2SMark Phalan  *   It is the responsibility of any person or organization contemplating
11159d09a2SMark Phalan  *   export to obtain such a license before exporting.
12*55fea89dSDan Cross  *
13159d09a2SMark Phalan  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
14159d09a2SMark Phalan  * distribute this software and its documentation for any purpose and
15159d09a2SMark Phalan  * without fee is hereby granted, provided that the above copyright
16159d09a2SMark Phalan  * notice appear in all copies and that both that copyright notice and
17159d09a2SMark Phalan  * this permission notice appear in supporting documentation, and that
18159d09a2SMark Phalan  * the name of M.I.T. not be used in advertising or publicity pertaining
19159d09a2SMark Phalan  * to distribution of the software without specific, written prior
20159d09a2SMark Phalan  * permission.	Furthermore if you modify this software you must label
21159d09a2SMark Phalan  * your software as modified software and not distribute it in such a
22159d09a2SMark Phalan  * fashion that it might be confused with the original M.I.T. software.
23159d09a2SMark Phalan  * M.I.T. makes no representations about the suitability of
24159d09a2SMark Phalan  * this software for any purpose.  It is provided "as is" without express
25159d09a2SMark Phalan  * or implied warranty.
26*55fea89dSDan Cross  *
27159d09a2SMark Phalan  *
28159d09a2SMark Phalan  * Service location plugin definitions for Kerberos 5.
29159d09a2SMark Phalan  */
30159d09a2SMark Phalan 
31159d09a2SMark Phalan #ifndef KRB5_LOCATE_PLUGIN_H_INCLUDED
32159d09a2SMark Phalan #define KRB5_LOCATE_PLUGIN_H_INCLUDED
33159d09a2SMark Phalan #include <krb5.h>
34159d09a2SMark Phalan 
35159d09a2SMark Phalan enum locate_service_type {
36159d09a2SMark Phalan     locate_service_kdc = 1,
37159d09a2SMark Phalan     locate_service_master_kdc,
38159d09a2SMark Phalan     locate_service_kadmin,
39159d09a2SMark Phalan     locate_service_krb524,
40159d09a2SMark Phalan     locate_service_kpasswd
41159d09a2SMark Phalan };
42159d09a2SMark Phalan 
43159d09a2SMark Phalan typedef struct krb5plugin_service_locate_ftable {
44159d09a2SMark Phalan     int minor_version;		/* currently 0 */
45159d09a2SMark Phalan     /* Per-context setup and teardown.  Returned void* blob is
46159d09a2SMark Phalan        private to the plugin.  */
47159d09a2SMark Phalan     krb5_error_code (*init)(krb5_context, void **);
48159d09a2SMark Phalan     void (*fini)(void *);
49159d09a2SMark Phalan     /* Callback function returns non-zero if the plugin function
50159d09a2SMark Phalan        should quit and return; this may be because of an error, or may
51159d09a2SMark Phalan        indicate we've already contacted the service, whatever.  The
52159d09a2SMark Phalan        lookup function should only return an error if it detects a
53159d09a2SMark Phalan        problem, not if the callback function tells it to quit.  */
54159d09a2SMark Phalan     krb5_error_code (*lookup)(void *,
55159d09a2SMark Phalan 			      enum locate_service_type svc, const char *realm,
56159d09a2SMark Phalan 			      int socktype, int family,
57159d09a2SMark Phalan 			      int (*cbfunc)(void *,int,struct sockaddr *),
58159d09a2SMark Phalan 			      void *cbdata);
59159d09a2SMark Phalan } krb5plugin_service_locate_ftable;
60159d09a2SMark Phalan /* extern krb5plugin_service_locate_ftable service_locator; */
61159d09a2SMark Phalan #endif
62