Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
ldappr.h File Reference
#include "nspr.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  prldap_session_info
struct  prldap_socket_info

Defines

#define PRLDAP_OPT_IO_MAX_TIMEOUT   1
#define PRLDAP_SESSIONINFO_SIZE   sizeof( PRLDAPSessionInfo )
#define PRLDAP_SOCKETINFO_SIZE   sizeof( PRLDAPSocketInfo )

Typedefs

typedef struct prldap_session_info PRLDAPSessionInfo
typedef struct prldap_socket_info PRLDAPSocketInfo

Functions

LDAP *LDAP_CALL prldap_init (const char *defhost, int defport, int shared)
int LDAP_CALL prldap_install_routines (LDAP *ld, int shared)
int LDAP_CALL prldap_set_session_option (LDAP *ld, void *sessionarg, int option,...)
int LDAP_CALL prldap_get_session_option (LDAP *ld, void *sessionarg, int option,...)
int LDAP_CALL prldap_set_session_info (LDAP *ld, void *sessionarg, PRLDAPSessionInfo *seip)
int LDAP_CALL prldap_get_session_info (LDAP *ld, void *sessionarg, PRLDAPSessionInfo *seip)
int LDAP_CALL prldap_set_socket_info (int fd, void *socketarg, PRLDAPSocketInfo *soip)
int LDAP_CALL prldap_get_socket_info (int fd, void *socketarg, PRLDAPSocketInfo *soip)

Class Documentation

struct prldap_session_info

Definition at line 160 of file ldappr.h.

Collaboration diagram for prldap_session_info:
Class Members
struct prldap_session_private * seinfo_appdata
int seinfo_size
struct prldap_socket_info

Definition at line 201 of file ldappr.h.

Collaboration diagram for prldap_socket_info:
Class Members
struct prldap_socket_private * soinfo_appdata
PRFileDesc * soinfo_prfd
int soinfo_size

Define Documentation

Definition at line 133 of file ldappr.h.

Definition at line 164 of file ldappr.h.

Definition at line 206 of file ldappr.h.


Typedef Documentation


Function Documentation

int LDAP_CALL prldap_get_session_info ( LDAP *  ld,
void sessionarg,
PRLDAPSessionInfo seip 
)

Definition at line 232 of file ldappr-public.c.

{
    int                            rc;
    PRLDAPIOSessionArg             *prsessp;

    if ( seip == NULL || PRLDAP_SESSIONINFO_SIZE != seip->seinfo_size ) {
       ldap_set_lderrno( ld, LDAP_PARAM_ERROR, NULL, NULL );
       return( LDAP_PARAM_ERROR );
    }

    if ( NULL != ld ) {
       if ( LDAP_SUCCESS !=
              ( rc = prldap_session_arg_from_ld( ld, &prsessp ))) {
           return( rc );
       }
    } else if ( NULL != sessionarg ) {
       prsessp = (PRLDAPIOSessionArg *)sessionarg;
    } else {
       ldap_set_lderrno( ld, LDAP_PARAM_ERROR, NULL, NULL );
       return( LDAP_PARAM_ERROR );
    }

    seip->seinfo_appdata = prsessp->prsess_appdata;
    return( LDAP_SUCCESS );
}

Here is the call graph for this function:

int LDAP_CALL prldap_get_session_option ( LDAP *  ld,
void sessionarg,
int  option,
  ... 
)

Definition at line 158 of file ldappr-public.c.

{
    int                            rc = LDAP_SUCCESS;   /* optimistic */
    PRLDAPIOSessionArg             *prsessp = NULL;
    va_list                 ap;

    if ( NULL != ld ) {
       if ( LDAP_SUCCESS !=
              ( rc = prldap_session_arg_from_ld( ld, &prsessp ))) {
           return( rc );
       }
    } else if ( NULL != sessionarg ) {
       prsessp = (PRLDAPIOSessionArg *)sessionarg;
    }

    va_start( ap, option );
    switch ( option ) {
    case PRLDAP_OPT_IO_MAX_TIMEOUT:
       rc = prldap_get_io_max_timeout( prsessp, va_arg( ap, int * ));
       break;
    default:
       rc = LDAP_PARAM_ERROR;
    }
    va_end( ap );

    return( rc );
}

Here is the call graph for this function:

int LDAP_CALL prldap_get_socket_info ( int  fd,
void socketarg,
PRLDAPSocketInfo soip 
)

Definition at line 298 of file ldappr-public.c.

{
    PRLDAPIOSocketArg       *prsockp;

    if ( NULL == socketarg || NULL == soip ||
              PRLDAP_SOCKETINFO_SIZE != soip->soinfo_size ) {
       return( LDAP_PARAM_ERROR );
    }

    prsockp = (PRLDAPIOSocketArg *)socketarg;
    soip->soinfo_prfd = prsockp->prsock_prfd;
    soip->soinfo_appdata = prsockp->prsock_appdata;

    return( LDAP_SUCCESS );
}
LDAP* LDAP_CALL prldap_init ( const char *  defhost,
int  defport,
int  shared 
)

Definition at line 59 of file ldappr-public.c.

{
    LDAP      *ld;

    if (( ld = ldap_init( defhost, defport )) != NULL ) {
       if ( prldap_install_routines( ld, shared ) != LDAP_SUCCESS ) {
           prldap_set_system_errno( EINVAL );    /* XXXmcs: just a guess! */
           ldap_unbind( ld );
           ld = NULL;
       }
    }

    return( ld );
}

Here is the call graph for this function:

Here is the caller graph for this function:

int LDAP_CALL prldap_install_routines ( LDAP *  ld,
int  shared 
)

Definition at line 91 of file ldappr-public.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int LDAP_CALL prldap_set_session_info ( LDAP *  ld,
void sessionarg,
PRLDAPSessionInfo seip 
)

Definition at line 196 of file ldappr-public.c.

{
    int                            rc;
    PRLDAPIOSessionArg             *prsessp;

    if ( seip == NULL || PRLDAP_SESSIONINFO_SIZE != seip->seinfo_size ) {
       ldap_set_lderrno( ld, LDAP_PARAM_ERROR, NULL, NULL );
       return( LDAP_PARAM_ERROR );
    }

    if ( NULL != ld ) {
       if ( LDAP_SUCCESS !=
              ( rc = prldap_session_arg_from_ld( ld, &prsessp ))) {
           return( rc );
       }
    } else if ( NULL != sessionarg ) {
       prsessp = (PRLDAPIOSessionArg *)sessionarg;
    } else {
       ldap_set_lderrno( ld, LDAP_PARAM_ERROR, NULL, NULL );
       return( LDAP_PARAM_ERROR );
    }

    prsessp->prsess_appdata = seip->seinfo_appdata;
    return( LDAP_SUCCESS );
}

Here is the call graph for this function:

int LDAP_CALL prldap_set_session_option ( LDAP *  ld,
void sessionarg,
int  option,
  ... 
)

Definition at line 117 of file ldappr-public.c.

{
    int                            rc = LDAP_SUCCESS;   /* optimistic */
    PRLDAPIOSessionArg             *prsessp = NULL;
    va_list                 ap;

    if ( NULL != ld ) {
       if ( LDAP_SUCCESS !=
              ( rc = prldap_session_arg_from_ld( ld, &prsessp ))) {
           return( rc );
       }
    } else if ( NULL != sessionarg ) {
       prsessp = (PRLDAPIOSessionArg *)sessionarg;
    }

    va_start( ap, option );
    switch ( option ) {
    case PRLDAP_OPT_IO_MAX_TIMEOUT:
       rc = prldap_set_io_max_timeout( prsessp, va_arg( ap, int ));
       break;
    default:
       rc = LDAP_PARAM_ERROR;
    }
    va_end( ap );

    return( rc );
}

Here is the call graph for this function:

Here is the caller graph for this function:

int LDAP_CALL prldap_set_socket_info ( int  fd,
void socketarg,
PRLDAPSocketInfo soip 
)

Definition at line 271 of file ldappr-public.c.

{
    PRLDAPIOSocketArg       *prsockp;

    if ( NULL == socketarg || NULL == soip ||
              PRLDAP_SOCKETINFO_SIZE != soip->soinfo_size ) {
       return( LDAP_PARAM_ERROR );
    }

    prsockp = (PRLDAPIOSocketArg *)socketarg;
    prsockp->prsock_prfd = soip->soinfo_prfd;
    prsockp->prsock_appdata = soip->soinfo_appdata;

    return( LDAP_SUCCESS );
}