summaryrefslogtreecommitdiff
path: root/cesar/cp/eoc/cco/action/test/utest_eoc/inc/scenario_defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/cp/eoc/cco/action/test/utest_eoc/inc/scenario_defs.h')
-rw-r--r--cesar/cp/eoc/cco/action/test/utest_eoc/inc/scenario_defs.h351
1 files changed, 351 insertions, 0 deletions
diff --git a/cesar/cp/eoc/cco/action/test/utest_eoc/inc/scenario_defs.h b/cesar/cp/eoc/cco/action/test/utest_eoc/inc/scenario_defs.h
new file mode 100644
index 0000000000..94bfa6c180
--- /dev/null
+++ b/cesar/cp/eoc/cco/action/test/utest_eoc/inc/scenario_defs.h
@@ -0,0 +1,351 @@
+#ifndef inc_scenario_defs_h
+#define inc_scenario_defs_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file inc/scenario_defs.h
+ * \brief Scenario definitions.
+ * \ingroup test
+ */
+
+#include "cp/msg/msg.h"
+#include "cp/sta/mgr/sta.h"
+#include "cp/sta/mgr/net.h"
+#include "cp/fsm/fsm.h"
+
+#include "cp/mme.h"
+#include "cl/cl_mactotei.h"
+#include "mac/common/tonemap.h"
+#include "cp/eoc/cco/bw/service.h"
+#include "cp/eoc/msg/inc/msg_vs.h"
+
+/* Scenario globals. */
+#define SCENARIO_DEFS_GLOBALS \
+ cp_t *cp;\
+ u16 prn; \
+ u32 my_nonce; \
+ u32 your_nonce; \
+ cp_mme_tx_t *mme;
+
+/* Scenario actions. */
+#define SCENARIO_DEFS_ACTIONS \
+ post_and_process, \
+ post, \
+ trigger, \
+ post_urgent, \
+ process, \
+ process_urgent,\
+ vs__started__vs_get_tonemap_req,\
+ vs_eoc__cco__vs_eoc_cco_get_ports_req,\
+ vs_eoc__cco__vs_eoc_cco_get_services_req,\
+ vs__started__vs_get_attenuation_list_req
+
+/* Actions with MME and parameters. */
+#define __m(action, param...) \
+typedef struct \
+{ \
+ cp_mme_peer_t peer; \
+ PREPROC_FOR_EACH (__m_, param) \
+} scenario_action_ ## action ## _t; \
+void \
+scenario_action_ ## action ## _cb ( \
+ scenario_globals_t *globals, scenario_params_t *params);
+#define __m_(param) param;
+
+
+__m (vs__started__vs_get_tonemap_req)
+__m (vs_eoc__cco__vs_eoc_cco_get_ports_req)
+__m (vs_eoc__cco__vs_eoc_cco_get_services_req)
+__m (vs__started__vs_get_attenuation_list_req)
+
+#undef __m_
+#undef __m
+
+typedef struct
+{
+ cp_fsm_event_type_t type;
+ cp_mme_rx_t *mme;
+ bsu_beacon_t *beacon;
+ cp_net_t *net;
+ cp_sta_t *sta;
+} scenario_action_event_param_t;
+
+typedef scenario_action_event_param_t scenario_action_post_and_process_t;
+typedef scenario_action_event_param_t scenario_action_post_t;
+typedef scenario_action_event_param_t scenario_action_trigger_t;
+typedef scenario_action_event_param_t scenario_action_post_urgent_t;
+typedef scenario_empty_t scenario_action_process_t;
+typedef scenario_empty_t scenario_action_process_urgent_t;
+
+void
+scenario_action_post_and_process_cb (scenario_globals_t *globals,
+ scenario_params_t *params);
+
+void
+scenario_action_post_cb (scenario_globals_t *globals,
+ scenario_params_t *params);
+
+void
+scenario_action_trigger_cb (scenario_globals_t *globals,
+ scenario_params_t *params);
+
+void
+scenario_action_post_urgent_cb (scenario_globals_t *globals,
+ scenario_params_t *params);
+
+void
+scenario_action_process_cb (scenario_globals_t *globals,
+ scenario_params_t *params);
+
+void
+scenario_action_process_urgent_cb (scenario_globals_t *globals,
+ scenario_params_t *params);
+
+/* Scenario events. */
+
+#define SCENARIO_DEFS_EVENTS \
+ cp_fsm__STOPPED__drv_sta_set_mac_addr_req, \
+ cp_fsm__STOPPED__drv_sta_set_cco_pref_req, \
+ cp_fsm__STOPPED__drv_sta_set_was_cco_req, \
+ cp_fsm__STOPPED__drv_sta_set_dpw_req, \
+ cp_fsm__STOPPED__drv_sta_set_nid_req, \
+ cp_fsm__STOPPED__drv_sta_set_tonemask_req, \
+ cp_fsm__STOPPED__drv_sta_set_key_req, \
+ cp_fsm__STOPPED__drv_sta_set_dak_req, \
+ cp_fsm__STOPPED__drv_sta_mac_start_req, \
+ cp_fsm__STOPPED__drv_sta_set_npw_req, \
+ cp_fsm__STOPPED__drv_sta_set_sl_req,\
+ cp_fsm__STOPPED__drv_sta_set_m_sta_hfid_req,\
+ cp_fsm__STOPPED__drv_sta_set_u_sta_hfid_req,\
+ cp_fsm__STOPPED__drv_sta_set_avln_hfid_req,\
+ cp_fsm__STARTED__poweron__idle__to_poweron, \
+ cp_fsm__STARTED__drv_sta_mac_stop_req,\
+ cp_fsm__POWER_ON__beacon_not_received, \
+ cp_fsm__POWER_ON__power_on_rx_beacon, \
+ cp_fsm__POWER_ON__power_on_no_beacons, \
+ cp_fsm__CCO__cco_drv_mac_stop, \
+ cp_fsm__CCO__send_central_beacon, \
+ cp_fsm__CCO__event_dispatch, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_topo_req, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_wl_req, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_set_wl_req, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_set_ports_req, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_ports_req, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_set_services_req, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_services_req, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_info_req, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_diagnostic_info_req, \
+ cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_real_time_statistics_req, \
+ cp_msg_drv_sta_set_key_req_receive, \
+ cp_msg_drv_any_cnf_send, \
+ cp_msg_drv_sta_set_dak_req_receive, \
+ cp_msg_drv_sta_status_req_receive, \
+ cp_msg_drv_sta_status_cnf_send, \
+ cp_msg_drv_sta_status_ind_send, \
+ cp_msg_cc_relay_req_receive, \
+ cp_msg_cc_relay_ind_send, \
+ cp_msg_drv_sta_set_avln_hfid_ind_send, \
+ cp_msg_drv_sta_set_u_sta_hfid_ind_send, \
+ cp_msg_cm_nw_stats_cnf_send_begin, \
+ cp_msg_cm_nw_stats_cnf_send, \
+ cp_msg_cm_nw_stats_cnf_send_end, \
+ cp_msg_cm_link_stats_req_receive, \
+ cp_msg_cm_link_stats_cnf_send, \
+ cp_msg_cm_link_stats_cnf_send_begin, \
+ cp_msg_cm_link_stats_cnf_send_end, \
+ cp_msg_vs_get_attenuation_list_req_receive, \
+ cp_msg_vs_get_attenuation_list_cnf_send_begin, \
+ cp_msg_vs_get_attenuation_list_cnf_send_entry, \
+ cp_msg_vs_get_attenuation_list_cnf_send_end, \
+ cp_msg_vs_get_snr_req_receive, \
+ cp_msg_vs_get_snr_cnf_send, \
+ cp_msg_vs_get_ce_stats_cnf_send, \
+ cp_msg_imac_get_discover_list_req_receive, \
+ cp_msg_imac_get_discover_list_cnf_send_begin, \
+ cp_msg_imac_get_discover_list_cnf_send, \
+ cp_msg_imac_get_discover_list_cnf_send_end, \
+ cp_msg_vs_get_tonemap_req_receive, \
+ cp_msg_vs_get_tonemap_cnf_send, \
+ cp_msg_vs_eoc_cco_get_ports_req_receive, \
+ cp_msg_vs_eoc_cco_get_ports_cnf_send, \
+ cp_msg_vs_eoc_cco_get_services_req_receive, \
+ cp_msg_vs_eoc_cco_get_services_cnf_send, \
+ cp_fsm__CCO__bridge_first_com,\
+ cp_fsm__CCO__nek_provide,\
+ cp_fsm__CCO__set_key_cnf,\
+ cp_fsm__CCO__nek_change_timeout,\
+ cp_fsm__CCO__vs_eoc__cco__leave_remove_timeout, \
+ cp_fsm__CCO__drv_sta_get_key_req, \
+ cp_fsm__BCCO__bcco_drv_mac_stop, \
+ cp_fsm__BCCO__bcco_no_beacons,\
+ cp_fsm__STOPPING__poweron__many__to_idle,\
+ cp_fsm__STOPPING__stopped
+
+/* MME send event. */
+#define __ms(event, param...) \
+typedef struct \
+{ \
+ cp_mme_peer_t peer; \
+ PREPROC_FOR_EACH (__p_, ## param) \
+} scenario_event_ ## event ## _t;
+
+/* MME send event complex. */
+#define __msc(event, param...) \
+typedef struct \
+{ \
+ PREPROC_FOR_EACH (__p_, ## param) \
+} scenario_event_ ## event ## _t;
+
+/* MME receive event. */
+#define __mr(event, param...) \
+typedef struct \
+{ \
+ bool ok; \
+ PREPROC_FOR_EACH (__p_, ## param) \
+} scenario_event_ ## event ## _t;
+
+#define __p_(param) param;
+
+/* MME send event for CC_RELAY.IND. */
+#define __msr(event, param...) \
+ typedef struct \
+{ \
+ mac_t mac_fa; \
+ cp_tei_t ftei; \
+ PREPROC_FOR_EACH (__p_, ## param) \
+} scenario_event_ ## event ## _t;
+
+__mr (cp_msg_drv_sta_set_key_req_receive,
+ cp_key_t nmk, cp_msg_drv_sta_set_key_type_t type,
+ cp_nid_t nid, cp_security_level_t sl)
+__ms (cp_msg_drv_any_cnf_send, mmtype_t mmtype, cp_msg_drv_result_t result)
+__mr (cp_msg_drv_sta_set_dak_req_receive, cp_key_t dak)
+__mr (cp_msg_drv_sta_status_req_receive)
+__ms (cp_msg_drv_sta_status_cnf_send, const cp_msg_drv_sta_status_cnf_t data)
+__ms (cp_msg_drv_sta_status_ind_send, const cp_msg_drv_sta_status_t data)
+__mr (cp_msg_cc_relay_req_receive, uint length, uint mmtype)
+__msr (cp_msg_cc_relay_ind_send, mac_t osa, cp_tei_t stei, uint length)
+__ms (cp_msg_drv_sta_set_avln_hfid_ind_send, char *avln_hfid)
+__ms (cp_msg_drv_sta_set_u_sta_hfid_ind_send, char *u_sta_hfid)
+__ms (cp_msg_cm_nw_stats_cnf_send_begin, uint num_stats)
+__msc (cp_msg_cm_nw_stats_cnf_send, mac_t mac, uint phy_dr_tx, uint phy_dr_rx)
+__msc (cp_msg_cm_nw_stats_cnf_send_end)
+__mr (cp_msg_cm_link_stats_req_receive, cp_msg_cm_link_stats_req_t data)
+__msc (cp_msg_cm_link_stats_cnf_send, mfs_t *mfs,
+ cp_msg_cm_link_stats_tlflag_t transmit)
+__ms (cp_msg_cm_link_stats_cnf_send_begin, u8 req_id, u8 res_type)
+__msc (cp_msg_cm_link_stats_cnf_send_end)
+__mr (cp_msg_vs_get_snr_req_receive, mac_t mac_addr,
+ cp_msg_vs_get_snr_req_int_t tm_int_i, u8 int_id, u8 carrier_gr)
+__ms (cp_msg_vs_get_snr_cnf_send, const cp_msg_vs_get_snr_cnf_t data)
+__mr (cp_msg_vs_get_attenuation_list_req_receive)
+__ms (cp_msg_vs_get_attenuation_list_cnf_send_begin, uint nb)
+__msc (cp_msg_vs_get_attenuation_list_cnf_send_entry,
+ mac_t mac, cp_tei_t tei,
+ vs_get_attenuation_list_att_status_t status, s8 attenuation_db)
+__msc (cp_msg_vs_get_attenuation_list_cnf_send_end)
+
+__ms (cp_msg_vs_get_ce_stats_cnf_send, u8 version, u8 result, sta_t *sta,
+ tonemask_info_t *ti)
+__mr (cp_msg_imac_get_discover_list_req_receive)
+__ms (cp_msg_imac_get_discover_list_cnf_send_begin,
+ cp_msg_imac_get_discover_list_cnf_result_t result, u8 version,
+ u8 num_stations)
+__msc (cp_msg_imac_get_discover_list_cnf_send,
+ const cp_msg_imac_discover_list_sta_info_t *data)
+__msc (cp_msg_imac_get_discover_list_cnf_send_end)
+
+__mr (cp_msg_vs_get_tonemap_req_receive,
+ mac_t mac_addr, cp_msg_vs_get_tonemap_tmi_t tmi,
+ u8 int_id, cp_msg_vs_get_tonemap_req_dir_t dir)
+__ms (cp_msg_vs_get_tonemap_cnf_send,
+ cp_msg_vs_get_tonemap_cnf_result_t result,
+ uint beacon_delta, u8 int_id,
+ tonemaps_t *tms, cp_msg_vs_get_tonemap_tmi_t tmi)
+
+__mr (cp_msg_vs_eoc_cco_get_ports_req_receive,
+ u8 first_mac_index_nb)
+
+__ms (cp_msg_vs_eoc_cco_get_ports_cnf_send,
+ cp_msg_vs_eoc_cco_get_ports_req_result_t result,
+ uint numStas, mac_t* stas_macs, bool (*stas_port_ed)[PORT_NB],
+ u8 (*stas_port_service)[PORT_NB], u8 first_mac_index_nb)
+
+__mr (cp_msg_vs_eoc_cco_get_services_req_receive,
+ u8 first_service_index_nb)
+
+__ms (cp_msg_vs_eoc_cco_get_services_cnf_send,
+ cp_msg_vs_eoc_cco_get_services_req_result_t result,
+ u8 services_number, u8* service_indexes, u8* classifier_rules,
+ u16* classifier_values, u8* acses, u8* parameters_numbers,
+ u16 (*parameters_lists)[SERVICE_PARAMETERS_NB],
+ u8 first_service_index_nb)
+
+#undef __ms
+#undef __msc
+#undef __mr
+#undef __msr
+typedef struct
+{
+ cp_fsm_branch_t branch;
+} scenario_event_transition_with_branch_t;
+
+/* Any event. */
+#define __e(event, param...) \
+typedef struct \
+{ \
+ PREPROC_FOR_EACH (__p_, ## param) \
+} scenario_event_ ## event ## _t;
+
+__e (cp_fsm__STOPPED__drv_sta_set_mac_addr_req)
+__e (cp_fsm__STOPPED__drv_sta_set_cco_pref_req)
+__e (cp_fsm__STOPPED__drv_sta_set_was_cco_req)
+__e (cp_fsm__STOPPED__drv_sta_set_dpw_req)
+__e (cp_fsm__STOPPED__drv_sta_set_nid_req)
+__e (cp_fsm__STOPPED__drv_sta_set_tonemask_req)
+__e (cp_fsm__STOPPED__drv_sta_set_key_req)
+__e (cp_fsm__STOPPED__drv_sta_set_dak_req)
+__e (cp_fsm__STOPPED__drv_sta_mac_start_req)
+__e (cp_fsm__STARTED__poweron__idle__to_poweron)
+__e (cp_fsm__STARTED__drv_sta_mac_stop_req)
+__e (cp_fsm__POWER_ON__beacon_not_received)
+__e (cp_fsm__POWER_ON__power_on_rx_beacon)
+__e (cp_fsm__POWER_ON__power_on_no_beacons)
+__e (cp_fsm__CCO__cco_drv_mac_stop)
+__e (cp_fsm__CCO__bridge_first_com)
+__e (cp_fsm__CCO__event_dispatch)
+__e (cp_fsm__CCO__send_central_beacon)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_topo_req)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_wl_req)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_set_wl_req)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_set_ports_req)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_ports_req)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_set_services_req)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_services_req)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_info_req)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_diagnostic_info_req)
+__e (cp_fsm__CCO__vs_eoc__cco__vs_eoc_get_real_time_statistics_req)
+__e (cp_fsm__CCO__nek_provide)
+__e (cp_fsm__CCO__set_key_cnf)
+__e (cp_fsm__CCO__nek_change_timeout, cp_fsm_branch_t branch)
+__e (cp_fsm__CCO__vs_eoc__cco__leave_remove_timeout)
+__e (cp_fsm__CCO__drv_sta_get_key_req)
+__e (cp_fsm__BCCO__bcco_no_beacons)
+__e (cp_fsm__BCCO__bcco_drv_mac_stop)
+__e (cp_fsm__STOPPING__poweron__many__to_idle)
+__e (cp_fsm__STOPPING__stopped)
+__e (cp_fsm__STOPPED__drv_sta_set_npw_req)
+__e (cp_fsm__STOPPED__drv_sta_set_sl_req)
+__e (cp_fsm__STOPPED__drv_sta_set_m_sta_hfid_req)
+__e (cp_fsm__STOPPED__drv_sta_set_u_sta_hfid_req)
+__e (cp_fsm__STOPPED__drv_sta_set_avln_hfid_req)
+
+#undef __e
+#undef __p_
+
+#endif /* inc_scenario_defs_h */