locate_plugin.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. * Service location plugin definitions for Kerberos 5.
  28. */
  29. #ifndef KRB5_LOCATE_PLUGIN_H_INCLUDED
  30. #define KRB5_LOCATE_PLUGIN_H_INCLUDED
  31. #include <krb5/krb5.h>
  32. enum locate_service_type {
  33. locate_service_kdc = 1,
  34. locate_service_primary_kdc,
  35. locate_service_kadmin,
  36. locate_service_krb524,
  37. locate_service_kpasswd
  38. };
  39. #define locate_service_master_kdc locate_service_primary_kdc
  40. typedef struct krb5plugin_service_locate_ftable {
  41. int minor_version; /* currently 0 */
  42. /* Per-context setup and teardown. Returned void* blob is
  43. private to the plugin. */
  44. krb5_error_code (*init)(krb5_context, void **);
  45. void (*fini)(void *);
  46. /* Callback function returns non-zero if the plugin function
  47. should quit and return; this may be because of an error, or may
  48. indicate we've already contacted the service, whatever. The
  49. lookup function should only return an error if it detects a
  50. problem, not if the callback function tells it to quit. */
  51. krb5_error_code (*lookup)(void *,
  52. enum locate_service_type svc, const char *realm,
  53. int socktype, int family,
  54. int (*cbfunc)(void *,int,struct sockaddr *),
  55. void *cbdata);
  56. } krb5plugin_service_locate_ftable;
  57. /* extern krb5plugin_service_locate_ftable service_locator; */
  58. #endif