- fix Building without Nagra not possible at Nagra_Merlin https://trac.streamboard...
[oscam.git] / module-streamrelay.h
blobe0b2ba5fda44a508b54117514d246c0618634f6f
1 #ifndef MODULE_STREAMRELAY_H_
2 #define MODULE_STREAMRELAY_H_
4 #ifdef MODULE_STREAMRELAY
6 #define STREAM_SERVER_MAX_CONNECTIONS 16
8 #define DVB_MAX_TS_PACKETS 278
9 #define DVB_BUFFER_SIZE_CSA 188*DVB_MAX_TS_PACKETS
10 #define DVB_BUFFER_WAIT_CSA 188*(DVB_MAX_TS_PACKETS-128)
11 #define DVB_BUFFER_SIZE DVB_BUFFER_SIZE_CSA
13 //#define __BISS__
14 #ifdef __BISS__
15 #define MAX_STREAM_PIDS 32
16 #endif
18 #include "cscrypt/md5.h"
19 #include <dvbcsa/dvbcsa.h>
20 #if DVBCSA_KEY_ECM
21 #define DVBCSA_HEADER_ECM 1
22 #define dvbcsa_bs_key_set(a,b) dvbcsa_bs_key_set_ecm(ecm,a,b)
23 #else
24 #define DVBCSA_HEADER_ECM 0
25 #endif
26 #ifndef STATIC_LIBDVBCSA
27 #define STATIC_LIBDVBCSA 0
28 #endif
30 #define EVEN 0
31 #define ODD 1
33 typedef struct
35 struct dvbcsa_bs_key_s *key[2];
36 } stream_client_key_data;
38 typedef struct
40 int32_t connid;
41 int8_t have_cat_data;
42 int8_t have_pat_data;
43 int8_t have_pmt_data;
44 int8_t have_ecm_data;
45 int8_t have_emm_data;
46 uint8_t cat_data[1024+208];
47 uint8_t pat_data[1024+208];
48 uint8_t pmt_data[1024+208];
49 uint8_t ecm_data[1024+208];
50 uint8_t emm_data[1024+208];
51 uint16_t cat_data_pos;
52 uint16_t pat_data_pos;
53 uint16_t pmt_data_pos;
54 uint16_t ecm_data_pos;
55 uint16_t emm_data_pos;
56 uint16_t srvid;
57 uint16_t caid;
58 uint16_t tsid;
59 uint16_t onid;
60 uint32_t ens;
61 uint16_t pmt_pid;
62 uint16_t ecm_pid;
63 uint16_t emm_pid;
64 uint16_t pcr_pid;
65 #ifdef __BISS__
66 uint8_t STREAMpidcount;
67 uint16_t STREAMpids[MAX_STREAM_PIDS];
68 #endif
69 uint8_t ecm_md5[MD5_DIGEST_LENGTH];
70 } stream_client_data;
72 void *stream_server(void *a);
73 void init_stream_server(void);
74 void stop_stream_server(void);
76 bool stream_write_cw(ECM_REQUEST *er);
78 #endif // MODULE_STREAMRELAY
80 #endif // MODULE_STREAMRELAY_H_