- fix Building without Nagra not possible at Nagra_Merlin https://trac.streamboard...
[oscam.git] / extapi / openxcas / openxcas_api.h
blob740bb476241fc5358173a0af3d840f38f0b773b1
1 #ifndef __OPENXCAS_API_H__
2 #define __OPENXCAS_API_H__
4 #include "openxcas_message.h"
5 #include "openxcas_smartcard.h"
7 /*
8 * Be careful! This API is not safe in multi-process
12 enum eOPENXCAS_FILTER_TYPE {
13 OPENXCAS_FILTER_UNKNOWN = 0,
14 OPENXCAS_FILTER_ECM,
15 OPENXCAS_FILTER_EMM,
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
22 /* This function will be used for checking compatibility with API
23 * After printing information, it is terminated automatically
24 * Be careful! Module name & version info should set exactly
26 void openxcas_show_info_and_exit(char * module_name, char * version_info);
28 /* RETURN VALUE: status
29 * -1 : error
30 * 0 : success
32 int openxcas_open(char * module_name);
34 /* RETURN VALUE: status
35 * -1 : error
36 * 0 : success
38 int openxcas_open_with_smartcard(char * module_name);
40 /* RETURN VALUE: status
41 * -1 : error
42 * 0 : success
44 int openxcas_close(void);
47 * This function should be called after opening openxcas
49 void openxcas_debug_message_onoff(int bVerbose);
51 /* RETURN VALUE: device fd
52 * -1 : error
53 * >0 : success
55 int openxcas_get_smartcard_device(unsigned int idx);
57 /* RETURN VALUE: status
58 * -1 : error
59 * 0 : success
61 int openxcas_release_smartcard_device(unsigned int idx);
64 /* RETURN VALUE: status
65 * path of working directory
68 char * openxcas_get_working_directory(void);
70 /* RETURN VALUE: status
71 * -1 : error
72 * 0 : timeout
73 * 1 : success
75 int openxcas_get_message(openxcas_msg_t * message, int wait_time);
77 /* RETURN VALUE: status
78 * -1 : error
79 * 0 : timeout
80 * 1 : success
82 int openxcas_put_message(int streamd_id, unsigned int sequence,
83 int msg_type, unsigned char *msg_buf, unsigned int msg_size);
86 * DVB-CSA Key API
90 /* RETURN VALUE: status
91 * -1 : error
92 * 0 : timeout
93 * 1 : success
95 int openxcas_set_key(int stream_id, unsigned int sequence,
96 unsigned short ca_system_id, unsigned short cipher_index,
97 unsigned char * even, unsigned char * odd);
99 /* RETURN VALUE: status
100 * -1 : error
101 * 0 : timeout
102 * 1 : success
104 * Be careful!
105 * If you call this function,
106 * all filter information is reset(same to call openxcas_remove_filter)
108 int openxcas_key_not_found(int stream_id, unsigned int sequence);
111 /* for ADAPTOR */
114 * Filter API
115 * Use for ECM & EMM
119 /* RETURN VALUE: filter_index
120 * -1 : error
121 * >= 0 : success
123 int openxcas_add_filter(int stream_id,
124 int type, unsigned short ca_system_id,
125 unsigned short target_pid, unsigned short pid,
126 unsigned char * mask, unsigned char * comp,
127 ecmemm_callback callback_func);
129 /* RETURN VALUE: status
130 * -1 : error
131 * 0 : timeout
132 * 1 : success
134 int openxcas_start_filter(int stream_id, unsigned int sequence, int type);
136 /* RETURN VALUE: status
137 * -1 : error
138 * 0 : timeout
139 * 1 : success
141 int openxcas_stop_filter(int stream_id, int type);
143 /* RETURN VALUE: status
144 * -1 : error
145 * 0 : success
147 int openxcas_remove_filter(int stream_id, int type);
149 /* RETURN VALUE: status
150 * -1 : error
151 * 0 : success
153 int openxcas_filter_callback(int stream_id, unsigned int sequence, int type,
154 struct stOpenXCAS_Data * openxcas_data);
157 int openxcas_send_private_message(int stream_id, unsigned int sequence, int msg_type,
158 unsigned char *msg_buf, unsigned int msg_size);
161 const char * openxcas_get_time(void);
175 /* RETURN VALUE: filter_index
176 * -1 : error
177 * >= 0 : success
179 int openxcas_start_filter_ex(int stream_id, unsigned int sequence,
180 unsigned short pid, unsigned char * mask, unsigned char * comp,
181 filter_callback callback_func);
183 /* RETURN VALUE: status
184 * -1 : error
185 * 0 : success
187 int openxcas_stop_filter_ex(int stream_id, unsigned int sequence,
188 int filter_index);
191 int openxcas_filter_callback_ex(int stream_id, unsigned int sequence,
192 struct stOpenXCAS_Data * openxcas_data);
194 /* RETURN VALUE: status
195 * -1 : error
196 * 0 : timeout
197 * 1 : success
199 int openxcas_create_cipher_ex(int stream_id, unsigned int sequence,
200 unsigned short ca_system_id,
201 unsigned short ecm_pid,
202 unsigned short video_pid, unsigned short video_ecm_pid,
203 unsigned short audio_pid, unsigned short audio_ecm_pid,
204 unsigned short data_pid, unsigned short data_ecm_pid);
206 /* RETURN VALUE: status
207 * -1 : error
208 * 0 : timeout
209 * 1 : success
211 int openxcas_destory_cipher_ex(int stream_id, unsigned int sequence);
213 /* RETURN VALUE: status
214 * -1 : error
215 * 0 : timeout
216 * 1 : success
218 int openxcas_set_key_ex(int stream_id, unsigned int sequence,
219 unsigned short ca_system_id,
220 unsigned short ecm_pid,
221 unsigned char * even, unsigned char * odd);
224 #ifdef __cplusplus
226 #endif
228 #endif