2 * @file frescan_bwres_robjs.h
4 * @brief FRESCAN bandwith reservation layer: reply objects
6 * This module contains the definition of the data object and operations to
7 * create a pool of objects, obtain the id of an unused object, wait upon it,
8 * signal it, and finish using it.
14 * @author Daniel Sangorrin <daniel.sangorrin@unican.es>
18 #ifndef _FRESCAN_BWRES_ROBJS_H_
19 #define _FRESCAN_BWRES_ROBJS_H_
21 #include <time.h> /* for timespec */
22 #include "fosa_opaque_types.h" /* for FOSA_ETIMEDOUT */
24 typedef unsigned int frescan_robj_id_t; /* 0 .. MX_REPLY_OBJECTS-1 */
25 #define FRESCAN_ETIMEDOUT FOSA_ETIMEDOUT
27 extern int frescan_bwres_robjs_init(int max_ceiling);
28 extern int frescan_bwres_robjs_alloc(frescan_robj_id_t *id, int ceiling);
29 extern int frescan_bwres_robjs_free(frescan_robj_id_t id);
30 extern int frescan_bwres_robjs_signal(frescan_robj_id_t id);
31 extern int frescan_bwres_robjs_wait(frescan_robj_id_t id);
32 extern int frescan_bwres_robjs_timedwait(frescan_robj_id_t id,
33 const struct timespec *abstime);
35 #endif // _FRESCAN_BWRES_ROBJS_H_