- fix Building without Nagra not possible at Nagra_Merlin https://trac.streamboard...
[oscam.git] / module-cacheex.h
blob1d6b80c627229dd66a02eb2fba58df5bc3b8234a
1 #ifndef MODULE_CACHEEX_H_
2 #define MODULE_CACHEEX_H_
4 static inline uint64_t cacheex_node_id(void *var)
6 uint64_t *x = var;
7 return *x;
10 uint32_t get_cacheex_wait_time(ECM_REQUEST *er, struct s_client *cl);
11 CWCHECK get_cwcheck(ECM_REQUEST *er);
12 uint16_t get_cacheex_mode1_delay(ECM_REQUEST *er);
13 int32_t chk_csp_ctab(ECM_REQUEST *er, CECSPVALUETAB *tab);
14 uint8_t check_cacheex_filter(struct s_client *cl, ECM_REQUEST *er);
15 void cacheex_add_to_cache(struct s_client *cl, ECM_REQUEST *er);
16 void cacheex_add_to_cache_from_csp(struct s_client *cl, ECM_REQUEST *er);
17 void cacheex_cache_push(ECM_REQUEST *er);
18 int32_t cacheex_add_stats(struct s_client *cl, uint16_t caid, uint16_t srvid, uint32_t prid, uint8_t direction
19 #ifdef CS_CACHEEX_AIO
20 , uint8_t localgenerated
21 #endif
23 int8_t cacheex_maxhop(struct s_client *cl);
24 #ifdef CS_CACHEEX_AIO
25 int8_t cacheex_maxhop_lg(struct s_client *cl);
26 #endif
28 #ifdef CS_CACHEEX
29 extern void cacheex_init(void);
30 extern void cacheex_clear_account_stats(struct s_auth *account);
31 extern void cacheex_clear_client_stats(struct s_client *client);
32 extern void cacheex_load_config_file(void);
33 static inline bool cacheex_reader(struct s_reader *rdr) { return rdr ? (rdr->cacheex.mode == 1 ? 1 : 0) : 0; }
34 extern bool cacheex_is_match_alias(struct s_client *cl, ECM_REQUEST *er);
35 void cacheex_set_csp_lastnode(ECM_REQUEST *er);
36 void cacheex_set_cacheex_src(ECM_REQUEST *ecm, struct s_client *cl);
37 void cacheex_init_cacheex_src(ECM_REQUEST *ecm, ECM_REQUEST *er);
38 void cacheex_free_csp_lastnodes(ECM_REQUEST *er);
39 void checkcache_process_thread_start(void);
40 void cacheex_push_out(struct s_client *cl, ECM_REQUEST *er);
41 bool cacheex_check_queue_length(struct s_client *cl);
42 static inline int8_t cacheex_get_rdr_mode(struct s_reader *reader) { return reader ? reader->cacheex.mode : 0; }
43 void cacheex_init_hitcache(void);
44 void cacheex_free_hitcache(void);
45 void cacheex_cleanup_hitcache(bool force);
46 void cacheex_update_hash(ECM_REQUEST *er);
47 void cacheex_mode1_delay(ECM_REQUEST *er);
48 void cacheex_timeout(ECM_REQUEST *er);
49 #ifdef CS_CACHEEX_AIO
50 char* cxaio_ftab_to_buf(FTAB *lg_only_ftab);
51 FTAB caidtab2ftab(CAIDTAB *ctab);
52 void caidtab2ftab_add(CAIDTAB *lgonly_ctab, FTAB *lgonly_tab);
53 #define CACHEEX_FEATURES 127
54 #endif
55 #else
56 static inline void cacheex_init(void) { }
57 static inline void cacheex_clear_account_stats(struct s_auth *UNUSED(account)) { }
58 static inline void cacheex_clear_client_stats(struct s_client *UNUSED(client)) { }
59 static inline void cacheex_load_config_file(void) { }
60 static inline bool cacheex_reader(struct s_reader *UNUSED(rdr)) { return false; }
61 static inline bool cacheex_is_match_alias(struct s_client *UNUSED(cl), ECM_REQUEST *UNUSED(er)) { return false; }
62 static inline void cacheex_set_csp_lastnode(ECM_REQUEST *UNUSED(er)) { }
63 static inline void cacheex_free_csp_lastnodes(ECM_REQUEST *UNUSED(er)) { }
64 static inline void cacheex_set_cacheex_src(ECM_REQUEST *UNUSED(ecm), struct s_client *UNUSED(cl)) { }
65 static inline void cacheex_init_cacheex_src(ECM_REQUEST *UNUSED(ecm), ECM_REQUEST *UNUSED(er)) { }
66 static inline void checkcache_process_thread_start(void) { }
67 static inline void cacheex_push_out(struct s_client *UNUSED(cl), ECM_REQUEST *UNUSED(er)) { }
68 static inline bool cacheex_check_queue_length(struct s_client *UNUSED(cl)) { return 0; }
69 static inline int8_t cacheex_get_rdr_mode(struct s_reader *UNUSED(reader)) { return 0; }
70 static inline void cacheex_init_hitcache(void) { }
71 static inline void cacheex_free_hitcache(void) { }
72 static inline void cacheex_cleanup_hitcache(bool UNUSED(force)) { }
73 static inline void cacheex_update_hash(ECM_REQUEST *UNUSED(er)) { }
74 static inline void cacheex_mode1_delay(ECM_REQUEST *UNUSED(er)) { }
75 static inline void cacheex_timeout(ECM_REQUEST *UNUSED(er)) { }
76 #endif
78 #endif