#ifndef SAR_MF_H_ #define SAR_MF_H_ /* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file mac/sar/sar_mf.h * \brief header for the Mac Frame use. * \ingroup mac_sar */ #include "mac/pbproc/pbproc.h" #include "common/defs/ethernet.h" #define SAR_MF_MFH_SIZE 2 #define SAR_MF_ATS_SIZE 4 #define SAR_MF_ICV_SIZE 4 #define SAR_MF_LENGTH (SAR_MF_MFH_SIZE + SAR_MF_ICV_SIZE) #define SAR_MF_MAX_SIZE (SAR_MF_MFH_SIZE + SAR_MF_ATS_SIZE + ETH_PACKET_MAX_SIZE + SAR_MF_ICV_SIZE) #define SAR_MF_MIN_SIZE (SAR_MF_MFH_SIZE + SAR_MF_ATS_SIZE + ETH_PACKET_MIN_SIZE + SAR_MF_ICV_SIZE) enum sar_mf_type_t { SAR_MF_TYPE_NONE, SAR_MF_TYPE_DATA, SAR_MF_TYPE_DATA_ATS, SAR_MF_TYPE_MME, SAR_MF_TYPE_NB }; typedef enum sar_mf_type_t sar_mf_type_t; struct sar_mf_t { /** Mac Frame type. */ sar_mf_type_t type; /** Mac Frame length. */ uint length; /** Mac Frame complete length. */ uint length_complete; /** Quantity of PBs. */ uint qte; /** Information complete. */ bool header_complete; }; typedef struct sar_mf_t sar_mf_t; BEGIN_DECLS /** * Initialise the sar_mf structure. * \param pb the PB to read the Mac Frame header from. * \param offset the PB offset. * \param sar_mf the SAR Mac Frame structure to fill. * * Get some data from the header of the Mac frame. * See sar_mf_t structure to have all the information got from this function. */ void sar_mf_header (pb_t *pb, uint offset, sar_mf_t *sar_mf); END_DECLS #endif /*SAR_MF_H_*/