1 | #ifndef MODULE_STAT_H_
|
---|
2 | #define MODULE_STAT_H_
|
---|
3 |
|
---|
4 | void save_stat_to_file(int32_t thread);
|
---|
5 | int32_t clean_stat_by_rc(struct s_reader *rdr, int8_t rc, int8_t inverse);
|
---|
6 | int32_t clean_all_stats_by_rc(int8_t rc, int8_t inverse);
|
---|
7 | int32_t clean_stat_by_id(struct s_reader *rdr, uint16_t caid, uint32_t prid, uint16_t srvid, uint16_t chid, uint16_t ecmlen);
|
---|
8 | void clear_reader_stat(struct s_reader *rdr);
|
---|
9 | void clear_all_stat(void);
|
---|
10 | READER_STAT **get_sorted_stat_copy(struct s_reader *rdr, int32_t reverse, int32_t *size);
|
---|
11 | void update_ecmlen_from_stat(struct s_reader *rdr);
|
---|
12 | int32_t lb_valid_btun(ECM_REQUEST *er, uint16_t caidto);
|
---|
13 | uint32_t lb_auto_timeout(ECM_REQUEST *er, uint32_t ctimeout);
|
---|
14 |
|
---|
15 | #ifdef WITH_LB
|
---|
16 | void init_stat(void);
|
---|
17 | void stat_finish(void);
|
---|
18 | void load_stat_from_file(void);
|
---|
19 | void send_reader_stat(struct s_reader *rdr, ECM_REQUEST *er, struct s_ecm_answer *ea, int8_t rc);
|
---|
20 | void stat_get_best_reader(ECM_REQUEST *er);
|
---|
21 | void lb_mark_last_reader(ECM_REQUEST *er);
|
---|
22 | uint16_t get_betatunnel_caid_to(uint16_t caid);
|
---|
23 | uint16_t is_betatunnel_caid(uint16_t caid);
|
---|
24 | void check_lb_auto_betatunnel_mode(ECM_REQUEST *er);
|
---|
25 | #else
|
---|
26 | static inline void init_stat(void) { }
|
---|
27 | static inline void stat_finish(void) { }
|
---|
28 | static inline void load_stat_from_file(void) { }
|
---|
29 | static inline void send_reader_stat(struct s_reader *UNUSED(rdr), ECM_REQUEST *UNUSED(er), struct s_ecm_answer *UNUSED(ea), int8_t UNUSED(rc)) { }
|
---|
30 | static inline void stat_get_best_reader(ECM_REQUEST *UNUSED(er)) { }
|
---|
31 | static inline void lb_mark_last_reader(ECM_REQUEST *UNUSED(er)) { }
|
---|
32 | static inline uint16_t get_betatunnel_caid_to(uint16_t UNUSED(caid)) { return 0; }
|
---|
33 | static inline uint16_t is_betatunnel_caid(uint16_t UNUSED(caid)) { return 0; }
|
---|
34 | static inline void check_lb_auto_betatunnel_mode(ECM_REQUEST *UNUSED(er)) { }
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | #endif
|
---|