file
connection.c
Classes
- struct option_value_t
Typedefs
-
using option_value_t = struct option_
value_ t
Functions
- static auto ldap_option2string(int option) -> const char*
-
static void ldap_requests_init(struct ldap_
request_ t* requests, int size) -
static void search_requests_init(struct ldap_
search_ request_ t* requests, int size) - auto connection_microseconds_to_timeval(TALLOC_CTX* talloc_ctx, int microseconds) -> struct timeval*
- connection_microseconds_to_timeval
-
auto connection_configure(struct ldap_
global_ context_ t* global_ctx, struct ldap_ connection_ ctx_ t* connection, struct ldap_ connection_ config_ t* config) -> enum OperationReturnCode - connection_configure Configures connection while performing following actions:
-
auto connection_install_handlers(struct ldap_
connection_ ctx_ t* connection) -> enum OperationReturnCode - connection_install_handlers Installs handlers for read and write operations.
-
auto connection_start_tls(struct ldap_
connection_ ctx_ t* connection) -> enum OperationReturnCode - connection_start_tls Setups tls transport.
-
auto connection_sasl_bind(struct ldap_
connection_ ctx_ t* connection) -> enum OperationReturnCode - connection_sasl_bind Tries to perform non interactive connection using sasl bind. Installs connection_bind_on_read operation handler.
- auto sasl_interact_gssapi(LDAP* ld, unsigned flags, void* indefaults, void* in) -> int
- sasl_interact_gssapi This function is a callback that is called by ldap_sasl_interactive_bind.
-
auto connection_ldap_bind(struct ldap_
connection_ ctx_ t* connection) -> enum OperationReturnCode - connection_ldap_bind Performs interactive bind and installs connection_bind_on_read operation handler.
-
void connection_optional_transition_on_error(struct ldap_
connection_ ctx_ t* connection) - void connection_on_read(verto_ctx* ctx, verto_ev* ev)
- connection_on_read This callback is performed on read operation.
- void connection_on_write(verto_ctx* ctx, verto_ev* ev)
- connection_on_read This callback is performed on write operation.
-
auto connection_close(struct ldap_
connection_ ctx_ t* connection) -> enum OperationReturnCode - connection_close Closes connection and frees resources associated with said connection.
-
auto connection_bind_on_read(int rc,
LDAPMessage* message,
struct ldap_
connection_ ctx_ t* connection) -> enum OperationReturnCode - connection_bind_on_read This callback is performed during bind operation.
-
auto connection_start_tls_on_read(int rc,
LDAPMessage* message,
ldap_
connection_ ctx_ t* connection) -> enum OperationReturnCode - connection_start_tls_on_read This callback is performed during initiation of tls connection.
Variables
-
const option_
value_ t option_strings - const int option_strings_size
Defines
- #define container_of(ptr, type, member)
- #define number_of_elements(x)
- #define set_ldap_option(ldap, option, value)
- #define set_bool_option(ldap, option, value)
- #define get_ldap_option(ldap, option, value)
Function documentation
struct timeval* connection_microseconds_to_timeval(TALLOC_CTX* talloc_ctx, int microseconds)
connection_microseconds_to_timeval
Parameters | |
---|---|
talloc_ctx in | |
microseconds in | Number of microseconds for timeout. |
Returns | Pointer to timeval struct. |
enum OperationReturnCode connection_configure(struct ldap_ global_ context_ t* global_ctx,
struct ldap_ connection_ ctx_ t* connection,
struct ldap_ connection_ config_ t* config)
connection_configure Configures connection while performing following actions:
Parameters | |
---|---|
global_ctx | [in] global context to use |
connection | [out] configured connection ready to be supplied to connection state machine |
config | [in] connection configuration contains parameters for sasl, tls, etc. |
Returns |
|
- Creates LDAP handle and sets protocol version, turns on async connection flag.
- Depending on usage of sasl configures sals flags for connection. Allocates structure to hold sasl parameters.
- Depending on usage of TLS configures TLS flags for connection.
- Creates event base for connection.
enum OperationReturnCode connection_install_handlers(struct ldap_ connection_ ctx_ t* connection)
connection_install_handlers Installs handlers for read and write operations.
Parameters | |
---|---|
connection | [in] connection to install handlers for. |
Returns |
|
enum OperationReturnCode connection_start_tls(struct ldap_ connection_ ctx_ t* connection)
connection_start_tls Setups tls transport.
Parameters | |
---|---|
connection in | connection to use |
enum OperationReturnCode connection_sasl_bind(struct ldap_ connection_ ctx_ t* connection)
connection_sasl_bind Tries to perform non interactive connection using sasl bind. Installs connection_bind_on_read operation handler.
Parameters | |
---|---|
connection | [in] connection to perform bind with. |
Returns |
|
int sasl_interact_gssapi(LDAP* ld, unsigned flags, void* indefaults, void* in)
sasl_interact_gssapi This function is a callback that is called by ldap_sasl_interactive_bind.
Parameters | |
---|---|
ld | [in] ldap handle to use |
flags | [in] unused |
indefaults | [in] we need to provide ldap_ |
in | [in] list of client interactions with user for caller to fill in |
Returns |
|
enum OperationReturnCode connection_ldap_bind(struct ldap_ connection_ ctx_ t* connection)
connection_ldap_bind Performs interactive bind and installs connection_bind_on_read operation handler.
Parameters | |
---|---|
connection | [in] connection to perform bind on |
Returns |
|
void connection_on_read(verto_ctx* ctx, verto_ev* ev)
connection_on_read This callback is performed on read operation.
Parameters | |
---|---|
ctx | [in] event context |
ev | [in] event |
void connection_on_write(verto_ctx* ctx, verto_ev* ev)
connection_on_read This callback is performed on write operation.
Parameters | |
---|---|
ctx | [in] event context |
ev | [in] event |
enum OperationReturnCode connection_close(struct ldap_ connection_ ctx_ t* connection)
connection_close Closes connection and frees resources associated with said connection.
Parameters | |
---|---|
connection | [in] connection to use |
Returns | RETURN_CODE_SUCCESS. |
enum OperationReturnCode connection_bind_on_read(int rc,
LDAPMessage* message,
struct ldap_ connection_ ctx_ t* connection)
connection_bind_on_read This callback is performed during bind operation.
Parameters | |
---|---|
rc | [in] result code of bind operation. |
message | [in] message received during operation. |
connection | [in] connection used during bind operation. |
Returns |
|
enum OperationReturnCode connection_start_tls_on_read(int rc,
LDAPMessage* message,
ldap_ connection_ ctx_ t* connection)
connection_start_tls_on_read This callback is performed during initiation of tls connection.
Parameters | |
---|---|
rc in | result code of bind operation. |
message in | message received during operation. |
connection in | connection used during bind operation. |
Returns |
|