Classes |
| struct | event |
| struct | state |
Defines |
| #define | STATUS_FLAG(status_type) (1<<(unsigned int)status_type) |
| | All state and transition definitions can be found here The server monitoring observes different states for multiple status types.
|
| #define | FIRST_STATUS 0 |
| #define | FIRST_EVENT 0 |
| #define | ENTRY_STATE 0 |
| #define | DOM_ELEMENT_STATUS_MESSAGE_NAME "StatusMessage" |
| #define | DOM_ELEMENT_STATE_NAME "State" |
| #define | DOM_ELEMENT_STATE_LEVEL_NAME "StateLevel" |
| #define | DOM_ELEMENT_STATE_DESCRIPTION_NAME "StateDescription" |
| #define | MAX_DESCRIPTION_LENGTH 50 |
| #define | MONITORING_SERVER_PORT 8080 |
| #define | XML_STATUS_MESSAGE_MAX_SIZE 3000 |
| #define | XML_STATUS_MESSAGE_START "<StatusMessage>" |
| #define | HTTP_ANSWER_PREFIX_FORMAT "HTTP/1.1 200 OK\nContent-Length: %u\nConnection: close\nContent-Type: text/xml; charset=UTF-8\n\n" |
| #define | HTTP_ANSWER_PREFIX_MAX_LENGTH 100 |
| #define | EVER 1 |
| #define | NR_STATUS_TYPES stat_all |
| #define | NETWORKING_STATUS_NAME "NetworkingStatus" |
| #define | NR_NETWORKING_STATES st_net_overall |
| #define | NR_NETWORKING_EVENTS ev_net_overall |
| #define | SYSTEM_STATUS_NAME "SystemStatus" |
| #define | NR_SYSTEM_STATES st_sys_overall |
| #define | NR_SYSTEM_EVENTS ev_sys_overall |
| #define | NR_STATE_LEVELS stl_all |
| #define | FINISH_STATE_DEFINITIONS(state_array) |
| | helper macros for defining states and events:
|
| #define | FINISH_EVENT_DEFINITIONS(event_array) |
| #define | FINISH_NETWORKING_STATE_DEFINITIONS(state_array) |
| #define | FINISH_NETWORKING_EVENT_DEFINITIONS(event_array) |
| #define | FINISH_PAYMENT_STATE_DEFINITIONS(state_array) |
| #define | FINISH_PAYMENT_EVENT_DEFINITIONS(event_array) |
| #define | FINISH_SYSTEM_STATE_DEFINITIONS(state_array) |
| #define | FINISH_SYSTEM_EVENT_DEFINITIONS(event_array) |
| #define | NET_STATE_DEF(state_array, state_type, description, transitions, stateLevel) STATE_DEF(state_array, stat_networking, state_type, description, transitions, stateLevel) |
| #define | NET_EVENT_DEF(event_array, event_type, description) EVENT_DEF(event_array, stat_networking, event_type, description) |
| #define | PAY_STATE_DEF(state_array, state_type, description, transitions, stateLevel) |
| #define | PAY_EVENT_DEF(event_array, event_type, description) |
| #define | SYS_STATE_DEF(state_array, state_type, description, transitions, stateLevel) STATE_DEF(state_array, stat_system, state_type, description, transitions, stateLevel) |
| #define | SYS_EVENT_DEF(event_array, event_type, description) EVENT_DEF(event_array, stat_system, event_type, description) |
| #define | STATE_DEF(state_array, status_type, state_type, description, transitions, stateLevel) |
| #define | EVENT_DEF(event_array, status_type, event_type, description) event_array[status_type][event_type]->ev_description = (char *) description; |
| #define | TRANS_NET_ENTRY |
| | NETWORKING STATE TRANSITIONS.
|
| #define | TRANS_NET_FIRST_MIX_INIT |
| #define | TRANS_NET_FIRST_MIX_CONNECTED_TO_NEXT |
| #define | TRANS_NET_FIRST_MIX_ONLINE |
| #define | TRANS_NET_MIDDLE_MIX_INIT |
| #define | TRANS_NET_MIDDLE_MIX_CONNECTED_TO_PREV |
| #define | TRANS_NET_MIDDLE_MIX_CONNECTED_TO_NEXT |
| #define | TRANS_NET_MIDDLE_MIX_ONLINE |
| #define | TRANS_NET_LAST_MIX_INIT |
| #define | TRANS_NET_LAST_MIX_CONNECTED_TO_PREV |
| #define | TRANS_NET_LAST_MIX_ONLINE |
| #define | TRANS_SYS_ENTRY |
| | SYSTEM STATE TRANSITIONS.
|
| #define | TRANS_SYS_INITIALIZING |
| #define | TRANS_SYS_OPERATING |
| #define | TRANS_SYS_RESTARTING |
| #define | TRANS_SYS_SHUTTING_DOWN |
| #define | TRANS_SYS_SHUTTING_DOWN_AFTER_SEG_FAULT (defineTransitions(stat_system, 0)) |
Typedefs |
| typedef enum state_type | state_type_t |
| typedef enum status_type | status_type_t |
| typedef enum state_type | transition_t |
| typedef enum event_type | event_type_t |
| typedef enum state_level | state_level_t |
| typedef struct state | state_t |
| typedef struct event | event_t |
Enumerations |
| enum | status_type { stat_undef = -1,
stat_networking = 0,
stat_system,
stat_all
} |
| enum | state_type {
st_ignore = -1,
st_net_entry = 0,
st_net_firstMixInit,
st_net_firstMixConnectedToNext,
st_net_firstMixOnline,
st_net_middleMixInit,
st_net_middleMixConnectedToPrev,
st_net_middleMixConnectedToNext,
st_net_middleMixOnline,
st_net_lastMixInit,
st_net_lastMixConnectedToPrev,
st_net_lastMixOnline,
st_net_overall,
st_sys_entry = 0,
st_sys_initializing,
st_sys_operating,
st_sys_restarting,
st_sys_shuttingDown,
st_sys_ShuttingDownAfterSegFault,
st_sys_overall
} |
| enum | event_type {
ev_net_firstMixInited = 0,
ev_net_middleMixInited,
ev_net_lastMixInited,
ev_net_prevConnected,
ev_net_nextConnected,
ev_net_prevConnectionClosed,
ev_net_nextConnectionClosed,
ev_net_keyExchangePrevSuccessful,
ev_net_keyExchangeNextSuccessful,
ev_net_keyExchangePrevFailed,
ev_net_keyExchangeNextFailed,
ev_net_overall,
ev_sys_start = 0,
ev_sys_enterMainLoop,
ev_sys_leavingMainLoop,
ev_sys_sigTerm,
ev_sys_sigInt,
ev_sys_sigSegV,
ev_sys_overall
} |
| enum | state_level {
stl_ok = 0,
stl_warning,
stl_critical,
stl_unknown,
stl_all
} |
Functions |
| transition_t * | defineTransitions (status_type_t s_type, int transitionCount,...) |
| | a convenience function for easily defining state transitions
|
Variables |
| static const char * | STATUS_NAMES [NR_STATUS_TYPES] |
| static const int | EVENT_COUNT [NR_STATUS_TYPES] |
| static const int | STATE_COUNT [NR_STATUS_TYPES] |
| static const char * | STATUS_LEVEL_NAMES [NR_STATE_LEVELS] |
All state and transition definitions can be found here The server monitoring observes different states for multiple status types.
The status types are currently:
1. "Network" which contains informations about the connection of the current mix to the others 2. "Payment" refers to the current state of the mixes accounting instance module. 3. "System" reflects general information about the actual state of the mix process.
A state has a level that shows if the current state of a mix is ok, unknown or critical. To realize a state machine events can be defined here. The events can be linked with states to realize transitions from one state to another if an event is fired.
Several macros can be found here for the definition of status types, states and events. Transitions can also be realized via macros.