file
connection_state_machine.c
Classes
- struct csm_state_value_t
Typedefs
-
using csm_state_value_t = struct csm_
state_ value_ t
Functions
- auto csm_state2str(int state) -> const char*
-
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(state_
machine_ ctx_ t* ctx, enum LdapConnectionState state) -> bool - csm_is_in_state Checks if state macheine is in desired state.
Variables
-
const csm_
state_ value_ t state_strings - const int state_strings_size
- static const int MAX_RECONNECT_ATTEMPTS
Defines
- #define number_of_elements(x)
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(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 |
|