#ifndef SAR_MF_H_ #define SAR_MF_H_ /* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file sar_mf.h * \brief header for the Mac Frame use. * \ingroup mac/sar/inc */ #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_SIZE (SAR_MF_MFH_SIZE + SAR_MF_ATS_SIZE) #ifdef __sparc__ #define SAR_MF_SIZE_CACHE ((SAR_MF_MFH_SIZE + SAR_MF_ATS_SIZE + 2) / 4) #endif #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) #define SAR_DIV_BY_BLK_SIZE 9 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; /** Ats confounder. */ uint ats_confounder; /** Job header 1. */ uint header1; /** Job header 2. */ uint header2; }; typedef struct sar_mf_t sar_mf_t; /** * 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 the 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); #endif /*SAR_MF_H_*/