1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 15:31:17 +01:00

pkg ccn-lite: set alternative caching strategies

This commit is contained in:
Oleg Hahm 2016-05-22 22:33:18 +02:00
parent 49a76ba3b5
commit d4577b9f5e

View File

@ -144,8 +144,15 @@ extern struct ccnl_relay_s ccnl_relay;
/**
* @brief Function pointer type for local producer function
*/
typedef int (*ccnl_producer_func)(struct ccnl_relay_s *relay, struct
ccnl_face_s *from, struct ccnl_pkt_s *pkt);
typedef int (*ccnl_producer_func)(struct ccnl_relay_s *relay,
struct ccnl_face_s *from,
struct ccnl_pkt_s *pkt);
/**
* @brief Function pointer type for caching strategy function
*/
typedef int (*ccnl_cache_strategy_func)(struct ccnl_relay_s *relay,
struct ccnl_content_s *c);
/**
* @brief Start the main CCN-Lite event-loop
@ -229,6 +236,21 @@ void ccnl_fib_show(struct ccnl_relay_s *relay);
*/
void ccnl_set_local_producer(ccnl_producer_func func);
/**
* @brief Set a function to control the caching strategy
*
* The given function will be called if the cache is full and a new content
* chunk arrives. It shall remove (at least) one entry from the cache.
*
* If the return value of @p func is 0, the default caching strategy will be
* applied by the CCN-lite stack. If the return value is 1, it is assumed that
* (at least) one entry has been removed from the cache.
*
* @param[in] func The function to be called for an incoming content chunk if
* the cache is full.
*/
void ccnl_set_cache_strategy_remove(ccnl_cache_strategy_func func);
#ifdef __cplusplus
}
#endif