ldap_server_conf_save()-- Store Server Information into Local Configuration
Syntax
#include <ldap.h> typedef struct LDAP_Server_Info { char *lsi_host; /* LDAP server's hostname */ unsigned short lsi_port; /* LDAP port */ char *lsi_suffix; /* Server's LDAP suffix */ char *lsi_query_key; /* service_key[.edomain]*/ char *lsi_dns_domain; /* Publishing DNS domain */ int lsi_replica_type;/* master or replica */ #define LDAP_LSI_MASTER 1 /* LDAP Master */ #define LDAP_LSI_REPLICA 2 /* LDAP Replica */ int lsi_sec_type; /* SSL or non-SSL */ #define LDAP_LSI_NOSSL 1 /* Non-SSL */ #define LDAP_LSI_SSL 2 /* Secure Server */ unsigned short lsi_priority; /* Server priority */ unsigned short lsi_weight; /* load balancing weight */ char *lsi_vendor_info; /* vendor information */ char *lsi_info; /* LDAP Info string */ struct LDAP_Server_Info *prev; /* linked list previous ptr */ struct LDAP_Server_Info *next; /* linked list next ptr */ } LDAPServerInfo; int ldap_server_conf_save( char *filename, unsigned long ttl, LDAPServerInfo *server_info_listp );
Default Public Authority: *USE
Library Name/Service Program: QSYS/QGLDCLNT
Threadsafe: Yes
The ldap_server_conf_save() API is used to store server information for the local configuration.
Authorities and Locks
- Object Authorities
- The caller must have Execute (*X) authority to each directory in the path name preceding the name of the configuration file. The caller must have Write (*W) authority to the configuration file.
Parameters
- server_info_listp
- (input) A linked list of LDAPServerInfo structures. Each LDAPServerInfo
structure defined in the list contains information about an LDAP server. This
information will be stored in a file and can be retrieved using ldap_server_locate(). The LDAPServerInfo structure
contains the following fields:
lsi_host Fully-qualified hostname of the target server (NULL-terminated string). lsi_port Integer representation of the LDAP server's port. lsi_suffix String that specifies a supported suffix for the LDAP server (NULL-terminated string). lsi_query_key Specifies the The eNetwork domain to which the LDAP server belongs, prefixed by the service key. For example, if service key is ldap and eNetwork domain is sales, then lsi_query_key would be set to ldap.sales. If the server is not associated with an eNetwork domain (as published in DNS), then lsi_query_key consists solely of the service key value. lsi_dns_domain DNS domain in which the LDAP server was published. For example, the DNS search may have been for ldap.sales.tcp.austin.ibm.com, but the resulting server(s) has a fully-qualified DNS host name of ldap2.raleigh.ibm.com. In this example, lsi_host would be set to ldap2.raleigh.ibm.com whilst lsi_dns_domain would be set to austin.ibm.com. The actual domain in which the server was " published" may be of interest, particularly when multiple DNS domains are configured (or supplied as input). lsi_replica_type Specifies the type of server, LDAP_LSI_MASTER or LDAP_LSI_REPLICA. If set to zero, the type is unknown. lsi_sec_type Specifies the port's security type, LDAP_LSI_NOSSL or LDAP_LSI_SSL. This value is derived from the "ldap" or "ldaps" prefix on the LDAP URL. If the LDAP URL is not defined, the security type is unknown and lsi_sectype is set to zero. lsi_priority The priority value obtained from the SRV RR (or the "pseudo-SRV" TXT RR). Set to zero if unknown or notavailable. lsi_weight The weight value obtained from the SRV RR (or the "pseudo-SRV" TXT RR). Set to zero if unknown or not available. lsi_vendor_info NULL-terminated string obtained from the ldapvendor TXT RR (if defined). May be used to identify the LDAP server vendor/version information. lsi_info NULL-terminated information string obtained from the ldapinfo TXT RR (if defined). If not defined, lsi_info is set to NULL. This information string can be used by the LDAP or network administrator to publish additional information about the target LDAP server.
- filename
- (input) The configuration filename. Specify NULL to get the default filename, /QIBM/UserData/OS400/DirSrv/ldap_server_info.conf.
- ttl
- (input) Specifies the time-to-live (in minutes) for server information saved in the configuration file. Set ttl to zero if it is intended to be a permanent repository of information.
Return Value
- LDAP_SUCCESS
- if the request was successful.
- another LDAP error code
- if the request was not successful.
Error Conditions
If ldap_server_conf_save() is not successful, an LDAP error code will be returned. See LDAP Client API Error Conditions for possible LDAP error code values.
Error Messages
The following message may be sent from this function.
Message ID | Error Message Text |
---|---|
CPF3CF2 E | Error(s) occurred during running of ldap_server_conf_save API. |
Related Information
- ldap_init() -- Perform an LDAP initialization operation.
- ldap_server_locate() -- Locate suitable LDAP servers.
- ldap_server_free_list() -- Free the list of LDAP servers.
API introduced: V4R5
[ Back to top | LDAP APIs | APIs by category ]