|
Packit |
fd8b60 |
Server location interface (locate)
|
|
Packit |
fd8b60 |
==================================
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
The locate interface allows modules to control how KDCs and similar
|
|
Packit |
fd8b60 |
services are located by clients. For a detailed description of the
|
|
Packit |
fd8b60 |
ccselect interface, see the header file ``<krb5/locate_plugin.h>``.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
.. note: The locate interface does not follow the normal conventions
|
|
Packit |
fd8b60 |
for MIT krb5 pluggable interfaces, because it was made public
|
|
Packit |
fd8b60 |
before those conventions were established.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
A locate module exports a structure object of type
|
|
Packit |
fd8b60 |
krb5plugin_service_locate_ftable, with the name ``service_locator``.
|
|
Packit |
fd8b60 |
The structure contains a minor version and pointers to the module's
|
|
Packit |
fd8b60 |
methods.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
The primary locate method is **lookup**, which accepts a service type,
|
|
Packit |
fd8b60 |
realm name, desired socket type, and desired address family (which
|
|
Packit |
fd8b60 |
will be AF_UNSPEC if no specific address family is desired). The
|
|
Packit |
fd8b60 |
method should invoke the callback function once for each server
|
|
Packit |
fd8b60 |
address it wants to return, passing a socket type (SOCK_STREAM for TCP
|
|
Packit |
fd8b60 |
or SOCK_DGRAM for UDP) and socket address. The **lookup** method
|
|
Packit |
fd8b60 |
should return 0 if it has authoritatively determined the server
|
|
Packit |
fd8b60 |
addresses for the realm, KRB5_PLUGIN_NO_HANDLE if it wants to let
|
|
Packit |
fd8b60 |
other location mechanisms determine the server addresses, or another
|
|
Packit |
fd8b60 |
code if it experienced a failure which should abort the location
|
|
Packit |
fd8b60 |
process.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
A module can create and destroy per-library-context state objects by
|
|
Packit |
fd8b60 |
implementing the **init** and **fini** methods. State objects have
|
|
Packit |
fd8b60 |
the type void \*, and should be cast to an internal type for the state
|
|
Packit |
fd8b60 |
object.
|