Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 17 Data Types and Structures

ldap_dns_fns

ldap_dns_fns contains a set of pointers to DNS functions (equivalents to the gethostbyname_r() and gethostbyaddr_r() functions that are available on some UNIX platforms.)

You can use this if you want the LDAP SDK to call these functions when looking up the hostname or IP address for the LDAP server. For example, you could use this to call versions of the DNS functions that are safe for use in a multi-threaded application.

After you set the fields in this structure, you can register the functions in this structure for use by the client by calling the ldap_set_option() function and set the LDAP_OPT_DNS_FN_PTRS option to this structure.

ldap_dns_fns is defined as follows:

struct ldap_dns_fns {
   void *lddnsfn_extradata;
   int lddnsfn_bufsize;
   LDAP_DNSFN_GETHOSTBYNAME *lddnsfn_gethostbyname;
   LDAP_DNSFN_GETHOSTBYADDR *lddnsfn_gethostbyaddr;
};
The fields in this structure are described below:

lddnsfn_extradata

Value passed in the extradata argument of the LDAP_DNSFN_GETHOSTBYADDR and LDAP_DNSFN_GETHOSTBYADDR function calls.

lddnsfn_bufsize

Specifies the size of the buffer that you want passed to your DNS callback function. Your LDAP client passes this value as the buflen argument of the LDAP_DNSFN_GETHOSTBYADDR and LDAP_DNSFN_GETHOSTBYADDR function calls.

lddnsfn_gethostbyname

Function pointer for getting the host entry for the LDAP server. This function is called by the client when connecting to the server if the function pointer is not NULL. The function must have the prototype specified by LDAP_DNSFN_GETHOSTBYNAME. If NULL, the standard built-in OS routine is used.

lddnsfn_gethostbyaddr

Function pointer for getting the host name of the LDAP server. This function is called by the client when needed if the function pointer is not NULL.

The function must have the prototype specified by LDAP_DNSFN_GETHOSTBYADDR. If NULL, the standard built-in OS routine is used.


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:05:28