xref: /freebsd/crypto/krb5/src/include/krb5/locate_plugin.h (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  * Copyright 2006 Massachusetts Institute of Technology.
4  * All Rights Reserved.
5  *
6  * Export of this software from the United States of America may
7  *   require a specific license from the United States Government.
8  *   It is the responsibility of any person or organization contemplating
9  *   export to obtain such a license before exporting.
10  *
11  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
12  * distribute this software and its documentation for any purpose and
13  * without fee is hereby granted, provided that the above copyright
14  * notice appear in all copies and that both that copyright notice and
15  * this permission notice appear in supporting documentation, and that
16  * the name of M.I.T. not be used in advertising or publicity pertaining
17  * to distribution of the software without specific, written prior
18  * permission.  Furthermore if you modify this software you must label
19  * your software as modified software and not distribute it in such a
20  * fashion that it might be confused with the original M.I.T. software.
21  * M.I.T. makes no representations about the suitability of
22  * this software for any purpose.  It is provided "as is" without express
23  * or implied warranty.
24  */
25 
26 /*
27  *
28  * Service location plugin definitions for Kerberos 5.
29  */
30 
31 #ifndef KRB5_LOCATE_PLUGIN_H_INCLUDED
32 #define KRB5_LOCATE_PLUGIN_H_INCLUDED
33 #include <krb5/krb5.h>
34 
35 enum locate_service_type {
36     locate_service_kdc = 1,
37     locate_service_primary_kdc,
38     locate_service_kadmin,
39     locate_service_krb524,
40     locate_service_kpasswd
41 };
42 #define locate_service_master_kdc locate_service_primary_kdc
43 
44 typedef struct krb5plugin_service_locate_ftable {
45     int minor_version;          /* currently 0 */
46     /* Per-context setup and teardown.  Returned void* blob is
47        private to the plugin.  */
48     krb5_error_code (*init)(krb5_context, void **);
49     void (*fini)(void *);
50     /* Callback function returns non-zero if the plugin function
51        should quit and return; this may be because of an error, or may
52        indicate we've already contacted the service, whatever.  The
53        lookup function should only return an error if it detects a
54        problem, not if the callback function tells it to quit.  */
55     krb5_error_code (*lookup)(void *,
56                               enum locate_service_type svc, const char *realm,
57                               int socktype, int family,
58                               int (*cbfunc)(void *,int,struct sockaddr *),
59                               void *cbdata);
60 } krb5plugin_service_locate_ftable;
61 /* extern krb5plugin_service_locate_ftable service_locator; */
62 #endif
63