file
connection_state_machine.h
Classes
- struct state_machine_ctx_t
- state_
machine_ ctx_ t - Struct represents connection state machine.
Enums
- enum LdapConnectionState { LDAP_CONNECTION_STATE_INIT = 1, LDAP_CONNECTION_STATE_TLS_NEGOTIATION = 2, LDAP_CONNECTION_STATE_TRANSPORT_READY = 3, LDAP_CONNECTION_STATE_BIND_IN_PROGRESS = 4, LDAP_CONNECTION_STATE_BOUND = 5, LDAP_CONNECTION_STATE_DETECT_DIRECTORY = 6, LDAP_CONNECTION_STATE_RUN = 7, LDAP_CONNECTION_STATE_ERROR = 8, LDAP_CONNECTION_STATE_REQUEST_SCHEMA = 9, LDAP_CONNECTION_STATE_CHECK_SCHEMA = 10 }
Typedefs
-
using state_machine_ctx_t = struct state_
machine_ ctx_ t - state_
machine_ ctx_ t - Struct represents connection state machine.
Functions
-
auto csm_init(struct state_
machine_ ctx_ t* ctx, struct ldap_ connection_ ctx_ t* connection) -> enum OperationReturnCode - csm_init Initializes state machine, sets machine state to LDAP_CONNECTION_STATE_INIT.
-
auto csm_next_state(struct state_
machine_ ctx_ t* ctx) -> enum OperationReturnCode - csm_next_state Advances state based on a current machine state.
-
auto csm_set_state(struct state_
machine_ ctx_ t* ctx, enum LdapConnectionState state) -> enum OperationReturnCode - csm_set_state Sets new state, prints transition between states.
-
auto csm_is_in_state(struct state_
machine_ ctx_ t* ctx, enum LdapConnectionState state) -> bool - csm_is_in_state Checks if state macheine is in desired state.
Enum documentation
enum LdapConnectionState
Enumerators | |
---|---|
LDAP_CONNECTION_STATE_INIT |
Initial state of the LDAP connection. |
LDAP_CONNECTION_STATE_TLS_NEGOTIATION |
The connection is in the process of negotiating TLS encryption. |
LDAP_CONNECTION_STATE_TRANSPORT_READY |
The underlying transport layer is ready for communication. |
LDAP_CONNECTION_STATE_BIND_IN_PROGRESS |
The connection is in the process of binding. |
LDAP_CONNECTION_STATE_BOUND |
The connection has successfully performed LDAP bound. |
LDAP_CONNECTION_STATE_DETECT_DIRECTORY |
The connection is in the process of detecting type of the LDAP directory service. |
LDAP_CONNECTION_STATE_RUN |
The LDAP connection is active and ready for operations. |
LDAP_CONNECTION_STATE_ERROR |
The LDAP connection is in an error state. |
LDAP_CONNECTION_STATE_REQUEST_SCHEMA |
The LDAP connection is in the process of loading schema. |
LDAP_CONNECTION_STATE_CHECK_SCHEMA |
The LDAP connection is in the process of checking schema readiness. |
Function documentation
enum OperationReturnCode csm_init(struct state_ machine_ ctx_ t* ctx,
struct ldap_ connection_ ctx_ t* connection)
csm_init Initializes state machine, sets machine state to LDAP_CONNECTION_STATE_INIT.
Parameters | |
---|---|
ctx in | state machine to initialize |
connection in | connection to use |
Returns | RETURN_CODE_SUCCESS. |
enum OperationReturnCode csm_next_state(struct state_ machine_ ctx_ t* ctx)
csm_next_state Advances state based on a current machine state.
Parameters | |
---|---|
ctx in | state machine to use |
Returns |
|
enum OperationReturnCode csm_set_state(struct state_ machine_ ctx_ t* ctx,
enum LdapConnectionState state)
csm_set_state Sets new state, prints transition between states.
Parameters | |
---|---|
ctx in | state machine to use |
state in | state to set |
Returns | RETURN_CODE_SUCCESS. |
bool csm_is_in_state(struct state_ machine_ ctx_ t* ctx,
enum LdapConnectionState state)
csm_is_in_state Checks if state macheine is in desired state.
Parameters | |
---|---|
ctx in | state machine to use |
state in | state to set |
Returns |
|