#ifndef inc_utils_h #define inc_utils_h /* Cesar project {{{ * * Copyright (C) 2007 Spidcom * * <<>> * * }}} */ /** * \file inc/utils.h * \brief Utilities. * \ingroup test */ #include "mac/common/mfs.h" #include "mac/common/tonemap.h" #include "mac/common/store.h" #include "inc/test_pbproc.h" /** Step between created PBs' expiration date. Needed, because of the hysteresis * offset used in the expiration process, to have some control on the number of * expired PBs. */ #define UTILS_MFS_EXPIRATION_NTB_STEP PBPROC_EXPIRATION_HYSTERESIS_OFFSET /** Define interval properties. */ struct utils_interval_t { /** Interval end offset, 0 to stop. */ uint end_offset_tck; /** TMI for this interval. */ u8 tmi; /** Number of bits in this tonemap if it has to be created, else 0. */ uint tm_mod; }; typedef struct utils_interval_t utils_interval_t; BEGIN_DECLS mfs_tx_t * utils_mfs_tx_prepare (bool bcast, bool mme, uint lid, uint tei, int seg_nb); mfs_tx_t * utils_mfs_tx_holes_prepare (bool bcast, bool mme, uint lid, uint tei, int seg_nb, u64 holes_bmp, mac_store_t *store); void utils_mfs_tx_cleanup (mfs_tx_t *mfs); tonemap_t * utils_sta_prepare_default_tonemap (test_pbproc_t *tp, bool tx, uint tei, uint tmi, uint tm_mod, uint tm_max_fl_tck, uint *dx); /** * Prepare tonemaps intervals. * \param tp test context * \param tei STA TEI * \param intervals list of intervals to prepare * \param default_tmi new default TMI * \return intervals version * * utils_sta_prepare_default_tonemap should have been called before. */ uint utils_sta_prepare_intervals (test_pbproc_t *tp, uint tei, utils_interval_t *intervals, uint default_tmi); void utils_prepare_encryption (test_pbproc_t *tp, bool encrypted, bool sta_auth, uint tei, uint nek_switch); void utils_delete_mfs_saved(void); mfs_tx_t * utils_mfs_tx_prepare_save (bool bcast, bool mme, uint lid, uint tei, uint seg_nb); END_DECLS #endif /* inc_utils_h */