#ifndef interface_interface_h #define interface_interface_h /* Cesar project {{{ * * Copyright (C) 2008 Spidcom * * <<>> * * }}} */ /** * \file interface/interface.h * \brief Interface module public functions. * \ingroup interface * * The interface module allows the communication between Actors and * the Data plane. */ #include "cl/cl.h" #include "cl/mbx/mbx.h" #include "mac/sar/sar.h" #include "bsu/bsu.h" #include "interface/interface_module.h" #include "interface/forward.h" /** * Function to call when the interface receives a new MME. * \param ctx the interface context * \param tei the station's source TEI. * \param buffer the buffer containing the MME. * \param length the MME length * \param encrypted inform if the packet comes from the PWL if it has been * crypted. */ typedef void (*interface_mme_recv_cb_t) (void *user_data, uint tei, u8 *buffer, uint length, bool encryption); BEGIN_DECLS /** * Initialise the interface module. * \param cl the cl context. * \param mbx the mbx context. * \param sar the sar context. * \param mac_config the mac config context. * \param bufmgr the buffer manager context. * \return the interface module context. */ interface_t* interface_init (cl_t *cl, cl_mbx_t *mbx, sar_t *sar, mac_config_t *mac_config, bufmgr_t *bufmgr); /** * Interface uninit. * \param ctx the interface context. */ void interface_uninit (interface_t *ctx); /** * Initialise the callbacks functions. * \param ctx the interface context. * \param mme_recv_cb the function to call on reception of a MME. * \param user_data the data to provide on each callback function. */ void interface_callback_init ( interface_t *ctx, interface_mme_recv_cb_t mme_recv_cb, void *user_data); /** Receives an MME from the PWL or the HLE. * \param ctx the interface context * \param tei the station's source TEI. * \param buffer the buffer containing the MME. * \param length the MME length * \param encrypted inform if the packet comes from the PWL if it has been * crypted. */ void interface_mme_recv (interface_t *ctx, uint tei, u8 *buffer, uint length, bool encrypted); /** Provides a MME to send to the CL. This MME can be send as a MME or a data. * \param ctx the interface context. * \param buffer the buffer containing the MME. * \param length the length of the MME. * \param tei the destination TEI. */ void interface_mme_send (interface_t *ctx, u8* buffer, uint length, uint tei); /** * Sends a beacon, the interface will provide it to the SAR. * \param ctx the interface context. * \param beacon the beacon to send. */ void interface_beacon (interface_t *ctx, bsu_beacon_t *beacon); END_DECLS #endif /* interface_interface_h */