#ifndef CL_CL_H_ #define CL_CL_H_ /* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file cl/cl.h * \brief Public functions * \ingroup cl * */ #include "common/defs/igmp.h" #include "bufmgr/bufmgr.h" #include "hal/ipmbox/ipmbox.h" #include "mac/common/config.h" #include "mac/common/store.h" #include "mac/sar/sar.h" #include "cl/mbx/mbx.h" #if MODULE_INCLUDED (cl) # include "config/cl.h" #else # define CONFIG_CL_DATA_RATE 0 #endif /** forward declaration. */ typedef struct cl_t cl_t; BEGIN_DECLS /** * Init the Convergence Layer and return a pointer on the CL context. * \param mac_store the mac store. * \param sar the sar context. * \param mac_config the mac config. * \param ipmbox context. * \param bufmgr context. * \return the convergence layer context. */ cl_t * cl_init (mac_store_t *mac_store, sar_t *sar, mac_config_t *mac_config, ipmbox_t *ipmbox, bufmgr_t *bufmgr); /** * Uninit the Convergence layer context. * \param ctx the convergence layer context */ void cl_uninit (cl_t *ctx); /** * Clean data send link. * \param ctx CL context. */ void cl_data_send_link_clear (cl_t *ctx); /** * Get the access to the igmp data in the cl context. * \param cl the CL context. * \return the pointer to the igmp data. */ igmp_groups_t * cl_get_igmp_groups (cl_t *cl); /** * Update the igmp groups based on the mactotei table. * \param cl the CL context. */ void cl_update_igmp_groups (cl_t *ctx); /** * Send an MME from the CP to the PLC or to linux if TEI is foreign. * \param ctx the CL context * \param buffer the buffer containing the MME * \param length the length of the MME * \param tei the destination TEI (MAC_TEI_FOREIGN for linux) */ void cl_mme_send (cl_t *ctx, u8 *buffer, uint length, uint tei); /** * Compute the data rate on the station. * \param ctx the module context * \param mfs the mfs to use * \param length the payload length */ void cl_compute_datarate_on_sta_ (cl_t *ctx, mfs_t *mfs, uint length); extern inline void cl_compute_datarate_on_sta (cl_t *ctx, mfs_t *mfs, uint length) { #if CONFIG_CL_DATA_RATE cl_compute_datarate_on_sta_ (ctx, mfs, length); #endif } /** * For some users which needs mbx. * \param ctx the module context. * \return cl_mbx context. */ cl_mbx_t* cl_mbx_get (cl_t *ctx); END_DECLS #endif /* CL_CL_H_ */