1 | #ifndef MODULE_CACHEEX_H_
|
---|
2 | #define MODULE_CACHEEX_H_
|
---|
3 |
|
---|
4 | static inline uint64_t cacheex_node_id(void *var)
|
---|
5 | {
|
---|
6 | uint64_t *x = var;
|
---|
7 | return *x;
|
---|
8 | }
|
---|
9 |
|
---|
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 | int8_t cacheex_maxhop(struct s_client *cl);
|
---|
20 |
|
---|
21 | #ifdef CS_CACHEEX
|
---|
22 | extern void cacheex_init(void);
|
---|
23 | extern void cacheex_clear_account_stats(struct s_auth *account);
|
---|
24 | extern void cacheex_clear_client_stats(struct s_client *client);
|
---|
25 | extern void cacheex_load_config_file(void);
|
---|
26 | static inline bool cacheex_reader(struct s_reader *rdr) { return rdr->cacheex.mode == 1; }
|
---|
27 | extern bool cacheex_is_match_alias(struct s_client *cl, ECM_REQUEST *er);
|
---|
28 | void cacheex_set_csp_lastnode(ECM_REQUEST *er);
|
---|
29 | void cacheex_set_cacheex_src(ECM_REQUEST *ecm, struct s_client *cl);
|
---|
30 | void cacheex_init_cacheex_src(ECM_REQUEST *ecm, ECM_REQUEST *er);
|
---|
31 | void cacheex_free_csp_lastnodes(ECM_REQUEST *er);
|
---|
32 | void checkcache_process_thread_start(void);
|
---|
33 | void cacheex_push_out(struct s_client *cl, ECM_REQUEST *er);
|
---|
34 | bool cacheex_check_queue_length(struct s_client *cl);
|
---|
35 | static inline int8_t cacheex_get_rdr_mode(struct s_reader *reader) { return reader->cacheex.mode; }
|
---|
36 | void cacheex_init_hitcache(void);
|
---|
37 | void cacheex_free_hitcache(void);
|
---|
38 | void cacheex_cleanup_hitcache(bool force);
|
---|
39 | void cacheex_update_hash(ECM_REQUEST *er);
|
---|
40 | void cacheex_mode1_delay(ECM_REQUEST *er);
|
---|
41 | void cacheex_timeout(ECM_REQUEST *er);
|
---|
42 | #else
|
---|
43 | static inline void cacheex_init(void) { }
|
---|
44 | static inline void cacheex_clear_account_stats(struct s_auth *UNUSED(account)) { }
|
---|
45 | static inline void cacheex_clear_client_stats(struct s_client *UNUSED(client)) { }
|
---|
46 | static inline void cacheex_load_config_file(void) { }
|
---|
47 | static inline bool cacheex_reader(struct s_reader *UNUSED(rdr)) { return false; }
|
---|
48 | static inline bool cacheex_is_match_alias(struct s_client *UNUSED(cl), ECM_REQUEST *UNUSED(er)) { return false; }
|
---|
49 | static inline void cacheex_set_csp_lastnode(ECM_REQUEST *UNUSED(er)) { }
|
---|
50 | static inline void cacheex_free_csp_lastnodes(ECM_REQUEST *UNUSED(er)) { }
|
---|
51 | static inline void cacheex_set_cacheex_src(ECM_REQUEST *UNUSED(ecm), struct s_client *UNUSED(cl)) { }
|
---|
52 | static inline void cacheex_init_cacheex_src(ECM_REQUEST *UNUSED(ecm), ECM_REQUEST *UNUSED(er)) { }
|
---|
53 | static inline void checkcache_process_thread_start(void) { }
|
---|
54 | static inline void cacheex_push_out(struct s_client *UNUSED(cl), ECM_REQUEST *UNUSED(er)) { }
|
---|
55 | static inline bool cacheex_check_queue_length(struct s_client *UNUSED(cl)) { return 0; }
|
---|
56 | static inline int8_t cacheex_get_rdr_mode(struct s_reader *UNUSED(reader)) { return 0; }
|
---|
57 | static inline void cacheex_init_hitcache(void) { }
|
---|
58 | static inline void cacheex_free_hitcache(void) { }
|
---|
59 | static inline void cacheex_cleanup_hitcache(bool UNUSED(force)) { }
|
---|
60 | static inline void cacheex_update_hash(ECM_REQUEST *UNUSED(er)) { }
|
---|
61 | static inline void cacheex_mode1_delay(ECM_REQUEST *UNUSED(er)) { }
|
---|
62 | static inline void cacheex_timeout(ECM_REQUEST *UNUSED(er)) { }
|
---|
63 | #endif
|
---|
64 |
|
---|
65 | #endif
|
---|