Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef STATE_MACHINE_H
00027 #define STATE_MACHINE_H
00028
00038 #define SM_STATE(machine, state) \
00039 static void sm_ ## machine ## _ ## state ## _Enter(STATE_MACHINE_DATA *sm, \
00040 int global)
00041
00052 #define SM_ENTRY(machine, state) \
00053 if (!global || sm->machine ## _state != machine ## _ ## state) { \
00054 sm->changed = TRUE; \
00055 wpa_printf(MSG_DEBUG, STATE_MACHINE_DEBUG_PREFIX ": " #machine \
00056 " entering state " #state); \
00057 } \
00058 sm->machine ## _state = machine ## _ ## state;
00059
00071 #define SM_ENTRY_M(machine, _state, data) \
00072 if (!global || sm->data ## _ ## state != machine ## _ ## _state) { \
00073 sm->changed = TRUE; \
00074 wpa_printf(MSG_DEBUG, STATE_MACHINE_DEBUG_PREFIX ": " \
00075 #machine " entering state " #_state); \
00076 } \
00077 sm->data ## _ ## state = machine ## _ ## _state;
00078
00089 #define SM_ENTRY_MA(machine, _state, data) \
00090 if (!global || sm->data ## _ ## state != machine ## _ ## _state) { \
00091 sm->changed = TRUE; \
00092 wpa_printf(MSG_DEBUG, STATE_MACHINE_DEBUG_PREFIX ": " MACSTR " " \
00093 #machine " entering state " #_state, \
00094 MAC2STR(STATE_MACHINE_ADDR)); \
00095 } \
00096 sm->data ## _ ## state = machine ## _ ## _state;
00097
00107 #define SM_ENTER(machine, state) \
00108 sm_ ## machine ## _ ## state ## _Enter(sm, 0)
00109
00120 #define SM_ENTER_GLOBAL(machine, state) \
00121 sm_ ## machine ## _ ## state ## _Enter(sm, 1)
00122
00132 #define SM_STEP(machine) \
00133 static void sm_ ## machine ## _Step(STATE_MACHINE_DATA *sm)
00134
00142 #define SM_STEP_RUN(machine) sm_ ## machine ## _Step(sm)
00143
00144 #endif