|
NAMEkrb5_krbhst_init ,
krb5_krbhst_init_flags ,
krb5_krbhst_next ,
krb5_krbhst_next_as_string ,
krb5_krbhst_reset ,
krb5_krbhst_free ,
krb5_krbhst_format_string ,
krb5_krbhst_get_addrinfo —
lookup Kerberos KDC hosts
LIBRARYKerberos 5 Library (libkrb5, -lkrb5)SYNOPSIS#include <krb5.h>
krb5_error_code
krb5_error_code
krb5_error_code
krb5_error_code
void
void
krb5_error_code
krb5_error_code
DESCRIPTIONThese functions are used to sequence through all Kerberos hosts of a particular realm and service. The service type can be the KDCs, the administrative servers, the password changing servers, or the servers for Kerberos 4 ticket conversion.First a handle to a particular service is obtained by calling
The handle is returned to the caller, and should be passed to the other functions. The flag argument to
For each call to typedef struct krb5_krbhst_info { enum { KRB5_KRBHST_UDP, KRB5_KRBHST_TCP, KRB5_KRBHST_HTTP } proto; unsigned short port; struct addrinfo *ai; struct krb5_krbhst_info *next; char hostname[1]; } krb5_krbhst_info; The related function,
When there are no more hosts, these functions return
To re-iterate over all hosts, call
When done with the handle,
To use a krb5_krbhst_info, there are two
functions: EXAMPLESThe following code will print the KDCs of the realm “MY.REALM”:krb5_krbhst_handle handle; char host[MAXHOSTNAMELEN]; krb5_krbhst_init(context, "MY.REALM", KRB5_KRBHST_KDC, &handle); while(krb5_krbhst_next_as_string(context, handle, host, sizeof(host)) == 0) printf("%s\n", host); krb5_krbhst_free(context, handle); SEE ALSOgetaddrinfo(3), krb5_get_krbhst(3), krb5_send_to_kdc_flags(3)HISTORYThese functions first appeared in Heimdal 0.3g.
Visit the GSP FreeBSD Man Page Interface. |