#ifndef cp2_cco_action_h #define cp2_cco_action_h /* Cesar project {{{ * * Copyright (C) 2008 Spidcom * * <<>> * * }}} */ /** * \file cp2/cco/cco_action.h * \brief CCo Public functions. * \ingroup cp2_cco * */ #include "cp2/cp.h" #include "cp2/mme.h" #include "cp2/beacon/beacon.h" #include "cp2/sta/mgr/sta.h" /** Forward declaration. */ typedef struct cp_cco_action_t cp_cco_action_t; /** * initialisation of CCo action module. * \param ctx the module context. * */ void cp_cco_action_init (cp_t *ctx); /** * Uninitialisation of CCo action module. * \param ctx the module context. * */ void cp_cco_action_uninit (cp_t *ctx); /** * Change the SNID. * \param ctx the module context. * * It shall request the SNIDs in use from the station manager to choose * one randomly in the available SNIDs */ void cp_cco_action_snid_change (cp_t *ctx); /** * perform garbage actions of CCo's responsibility. * \param ctx the module context. */ void cp_cco_action_garbage (cp_t *ctx); /** * generate a new NEK value. * \param ctx the module context. * \param sl security level * * NEK shall be used no more than 1 hour, so must be changed after 1 * hour for that purpose, NEK expiration date is checked at every occurrence * of the global garbage collector timer and if current NEK expiration * date reached, a new NEK value shall be generated by calling this function */ void cp_cco_action_gen_nek (cp_t *ctx, u8 sl); /** * manage association of a station. * \param ctx the module context. * \param assoc_req CM_ASSOC.REQ MME msg having being received */ void cp_cco_action_manage_sta_assoc (cp_t *ctx, cp_mme_rx_t * assoc_req); /** * manage authentication of a station. * \param ctx the module context. * \param get_key_req CM_GET_KEY.REQ MME msg having being decrypted */ void cp_cco_action_manage_sta_auth (cp_t *ctx, cp_mme_rx_t * get_key_req); /** * manage explicit leave request of a station. * \param ctx the module context. * \param leave_req The MME leave req message. * \param sta provided by the garbage function to send a CC_LEAVE_IND. * * Remove the station from the station manager */ void cp_cco_action_manage_sta_leave (cp_t *ctx, cp_mme_rx_t * leave_req, cp_sta_t *sta); /** * manage explicit leave request of a station. * \param ctx the module context. * \param leave_req The MME leave req message. * * Remove the station from the station manager */ extern inline void cp_cco_action_manage_sta_leave_req (cp_t *ctx, cp_mme_rx_t * leave_req) { dbg_assert (ctx); dbg_assert (leave_req); cp_cco_action_manage_sta_leave (ctx, leave_req, NULL); } #endif /* cp2_cco_action_h */