1 | #ifndef _MODULE_MCA_H_
|
---|
2 | #define _MODULE_MCA_H_
|
---|
3 |
|
---|
4 | #include "extapi/openxcas/openxcas_message.h"
|
---|
5 |
|
---|
6 | #define MCA_DVBI "/tmp/mdvbi"
|
---|
7 | #define MCA_DESC "/tmp/mdesc"
|
---|
8 | #define MCA_FLT "/tmp/mflt"
|
---|
9 |
|
---|
10 | enum eOPENXCAS_FILTER_TYPE {
|
---|
11 | OPENXCAS_FILTER_UNKNOWN = 0,
|
---|
12 | OPENXCAS_FILTER_ECM,
|
---|
13 | OPENXCAS_FILTER_EMM,
|
---|
14 | };
|
---|
15 |
|
---|
16 | #define ECM_PIDS_MATRIX 20
|
---|
17 | #define MAX_FILTER_MATRIX 10
|
---|
18 |
|
---|
19 | struct s_ecmpids_matrix
|
---|
20 | {
|
---|
21 | uint16_t CAID;
|
---|
22 | uint32_t PROVID;
|
---|
23 | uint16_t ECM_PID;
|
---|
24 | uint16_t EMM_PID;
|
---|
25 | int32_t irdeto_numchids;
|
---|
26 | int32_t irdeto_curchid;
|
---|
27 | int32_t irdeto_chid;
|
---|
28 | int32_t checked;
|
---|
29 | int32_t status;
|
---|
30 | unsigned char table;
|
---|
31 | int32_t index;
|
---|
32 | uint32_t streams;
|
---|
33 | };
|
---|
34 |
|
---|
35 | typedef struct filter_s_matrix
|
---|
36 | {
|
---|
37 | uint32_t fd; //FilterHandle
|
---|
38 | int32_t pidindex;
|
---|
39 | int32_t pid;
|
---|
40 | uint16_t type;
|
---|
41 | int32_t count;
|
---|
42 | } FILTERTYPE_MATRIX;
|
---|
43 |
|
---|
44 | struct s_emmpids_matrix
|
---|
45 | {
|
---|
46 | uint16_t CAID;
|
---|
47 | uint32_t PROVID;
|
---|
48 | uint16_t PID;
|
---|
49 | uint8_t type;
|
---|
50 | };
|
---|
51 |
|
---|
52 | typedef struct demux_s_matrix
|
---|
53 | {
|
---|
54 | int32_t demux_index;
|
---|
55 | FILTERTYPE_MATRIX demux_fd[MAX_FILTER_MATRIX];
|
---|
56 | int32_t ca_mask;
|
---|
57 | int32_t adapter_index;
|
---|
58 | int32_t socket_fd;
|
---|
59 | int32_t ECMpidcount;
|
---|
60 | struct s_ecmpids_matrix ECMpids[ECM_PIDS_MATRIX];
|
---|
61 | int32_t EMMpidcount;
|
---|
62 | struct s_emmpids_matrix EMMpids[ECM_PIDS_MATRIX];
|
---|
63 | int32_t STREAMpidcount;
|
---|
64 | uint16_t STREAMpids[ECM_PIDS_MATRIX];
|
---|
65 | int32_t pidindex;
|
---|
66 | int32_t curindex;
|
---|
67 | int32_t tries;
|
---|
68 | int32_t max_status;
|
---|
69 | uint16_t program_number;
|
---|
70 | unsigned char lastcw[2][8];
|
---|
71 | int32_t emm_filter;
|
---|
72 | uchar hexserial[8];
|
---|
73 | struct s_reader *rdr;
|
---|
74 | char pmt_file[30];
|
---|
75 | int32_t pmt_time;
|
---|
76 | } DEMUXMATRIX;
|
---|
77 |
|
---|
78 | int mca_open(void);
|
---|
79 | int mca_exit(void);
|
---|
80 | int mca_get_message(openxcas_msg_t * message, int timeout);
|
---|
81 | int mca_write_flt(DEMUXMATRIX * demux_matrix, int timeout);
|
---|
82 | int mca_set_key(unsigned char * mca_cw);
|
---|
83 | int mca_capmt_remove_duplicates(uchar *capmt, int len);
|
---|
84 |
|
---|
85 | void mca_ecm_callback(int32_t stream_id, uint32_t sequence, int32_t cipher_index, uint32_t caid, unsigned char *ecm_data, int32_t l, uint16_t pid);
|
---|
86 | void mca_ex_callback(int32_t stream_id, uint32_t seq, int32_t idx, uint32_t pid, unsigned char *ecm_data, int32_t l);
|
---|
87 | void mca_send_dcw(struct s_client *client, ECM_REQUEST *er);
|
---|
88 |
|
---|
89 | void * mca_main_thread(void * cli);
|
---|
90 |
|
---|
91 | #if defined(HAVE_DVBAPI) && defined(WITH_MCA)
|
---|
92 | void mca_init(void);
|
---|
93 | void mca_close(void);
|
---|
94 | #else
|
---|
95 | static inline void mca_init(void) { }
|
---|
96 | static inline void mca_close(void) { }
|
---|
97 | #endif
|
---|
98 |
|
---|
99 | #endif
|
---|