slapi_get_source_ip()

This slapi routine returns the IP address that is sent in the audit control.

Syntax
#include <slapi-plugin.h>
int slapi_get_source_ip(
Slapi_PBlock *pb,
char ** sourceIP );
Input Parameters
pb
A pointer to a parameter block.
sourceIP
The IP address of the connection source.
Returns
If the return code is LDAP_SUCCESS and sourceIP is set, then this source IP is used for connection.
Usage
A slapi API that returns the IP address that is sent in the audit control.
Note: The user must free the returned sourceIP after its use. In addition, it must be checked that the clientIP is from a trusted proxy web administration or application.
Errors
This API returns the following error codes:
  • LDAP_PARAM_ERROR - If the pb parameter is null
  • LDAP_OPERATIONS_ERROR - If the API encounters error that processes the request
  • LDAP_NO_MEMORY - Failed to allocate required memory.
See also
slapi_get_client_ip().