Back to index

lightning-sunbird  0.9+nobinonly
Functions
ldappr-dns.c File Reference
#include "ldappr-int.h"

Go to the source code of this file.

Functions

static LDAPHostEntprldap_gethostbyname (const char *name, LDAPHostEnt *result, char *buffer, int buflen, int *statusp, void *extradata)
static LDAPHostEntprldap_gethostbyaddr (const char *addr, int length, int type, LDAPHostEnt *result, char *buffer, int buflen, int *statusp, void *extradata)
static LDAPHostEntprldap_convert_hostent (LDAPHostEnt *ldhp, PRHostEnt *prhp)
int prldap_install_dns_functions (LDAP *ld)

Function Documentation

static LDAPHostEnt * prldap_convert_hostent ( LDAPHostEnt ldhp,
PRHostEnt prhp 
) [static]

Definition at line 128 of file ldappr-dns.c.

{
       ldhp->ldaphe_name = prhp->h_name;
       ldhp->ldaphe_aliases = prhp->h_aliases;
       ldhp->ldaphe_addrtype = prhp->h_addrtype;
       ldhp->ldaphe_length =  prhp->h_length;
       ldhp->ldaphe_addr_list =  prhp->h_addr_list;
       return( ldhp );
}

Here is the caller graph for this function:

static LDAPHostEnt * prldap_gethostbyaddr ( const char *  addr,
int  length,
int  type,
LDAPHostEnt result,
char *  buffer,
int  buflen,
int statusp,
void extradata 
) [static]

Definition at line 96 of file ldappr-dns.c.

{
    PRHostEnt prhent;
    PRNetAddr iaddr;

    if ( NULL == statusp ) {
       return( NULL );
    }

    memset( &iaddr, 0, sizeof( iaddr ));
    if ( PR_StringToNetAddr( addr, &iaddr ) == PR_FAILURE ) {
       return( NULL );
    }
    PRLDAP_SET_PORT( &iaddr, 0 );

    if( PR_FAILURE == (*statusp =
                     PR_GetHostByAddr(&iaddr, buffer, buflen, &prhent ))) {
       return( NULL );
    }

    return( prldap_convert_hostent( result, &prhent ));
}

Here is the call graph for this function:

Here is the caller graph for this function:

static LDAPHostEnt * prldap_gethostbyname ( const char *  name,
LDAPHostEnt result,
char *  buffer,
int  buflen,
int statusp,
void extradata 
) [static]

Definition at line 80 of file ldappr-dns.c.

{
    PRHostEnt prhent;

    if( !statusp || ( *statusp = (int)PR_GetIPNodeByName( name,
              PRLDAP_DEFAULT_ADDRESS_FAMILY, PR_AI_DEFAULT,
              buffer, buflen, &prhent )) == PR_FAILURE ) {
       return( NULL );
    }

    return( prldap_convert_hostent( result, &prhent ));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 63 of file ldappr-dns.c.

{
    struct ldap_dns_fns                   dnsfns;

    memset( &dnsfns, '\0', sizeof(struct ldap_dns_fns) );
    dnsfns.lddnsfn_bufsize = PR_NETDB_BUF_SIZE;
    dnsfns.lddnsfn_gethostbyname = prldap_gethostbyname;
    dnsfns.lddnsfn_gethostbyaddr = prldap_gethostbyaddr;
    if ( ldap_set_option( ld, LDAP_OPT_DNS_FN_PTRS, (void *)&dnsfns ) != 0 ) {
       return( -1 );
    }

    return( 0 );
}

Here is the call graph for this function:

Here is the caller graph for this function: