1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Appendix&#160;G.&#160;DVB Conditional Access Header File</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="dvbapi.html" title="Part&#160;II.&#160;LINUX DVB API"><link rel="prev" href="audio_h.html" title="Appendix&#160;F.&#160;DVB Audio Header File"><link rel="next" href="dmx_h.html" title="Appendix&#160;H.&#160;DVB Demux Header File"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix&#160;G.&#160;DVB Conditional Access Header File</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="audio_h.html">Prev</a>&#160;</td><th width="60%" align="center">Part&#160;II.&#160;LINUX DVB API</th><td width="20%" align="right">&#160;<a accesskey="n" href="dmx_h.html">Next</a></td></tr></table><hr></div><div class="appendix"><div class="titlepage"><div><div><h2 class="title"><a name="ca_h"></a>Appendix&#160;G.&#160;DVB Conditional Access Header File</h2></div></div></div><pre class="programlisting">
2/*
3 * ca.h
4 *
5 * Copyright (C) 2000 Ralph  Metzler &lt;ralph@convergence.de&gt;
6 *                  &amp; Marcus Metzler &lt;marcus@convergence.de&gt;
7 *                    for convergence integrated media GmbH
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Lesser Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 *
23 */
24
25#ifndef _DVBCA_H_
26#define _DVBCA_H_
27
28/* slot interface types and info */
29
30typedef struct <a class="link" href="dvb_ca.html#ca-slot-info" title="ca_slot_info_t">ca_slot_info</a> {
31        int num;               /* slot number */
32
33        int type;              /* CA interface this slot supports */
34#define CA_CI            1     /* CI high level interface */
35#define CA_CI_LINK       2     /* CI link layer level interface */
36#define CA_CI_PHYS       4     /* CI physical layer level interface */
37#define CA_DESCR         8     /* built-in descrambler */
38#define CA_SC          128     /* simple smart card interface */
39
40        unsigned int flags;
41#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */
42#define CA_CI_MODULE_READY   2
43} <a class="link" href="dvb_ca.html#ca-slot-info" title="ca_slot_info_t">ca_slot_info_t</a>;
44
45
46/* descrambler types and info */
47
48typedef struct <a class="link" href="dvb_ca.html#ca-descr-info" title="ca_descr_info_t">ca_descr_info</a> {
49        unsigned int num;          /* number of available descramblers (keys) */
50        unsigned int type;         /* type of supported scrambling system */
51#define CA_ECD           1
52#define CA_NDS           2
53#define CA_DSS           4
54} <a class="link" href="dvb_ca.html#ca-descr-info" title="ca_descr_info_t">ca_descr_info_t</a>;
55
56typedef struct <a class="link" href="dvb_ca.html#ca-caps" title="ca_caps_t">ca_caps</a> {
57        unsigned int slot_num;     /* total number of CA card and module slots */
58        unsigned int slot_type;    /* OR of all supported types */
59        unsigned int descr_num;    /* total number of descrambler slots (keys) */
60        unsigned int descr_type;   /* OR of all supported types */
61} <a class="link" href="dvb_ca.html#ca-caps" title="ca_caps_t">ca_caps_t</a>;
62
63/* a message to/from a CI-CAM */
64typedef struct <a class="link" href="dvb_ca.html#ca-msg" title="ca_msg_t">ca_msg</a> {
65        unsigned int index;
66        unsigned int type;
67        unsigned int length;
68        unsigned char msg[256];
69} <a class="link" href="dvb_ca.html#ca-msg" title="ca_msg_t">ca_msg_t</a>;
70
71typedef struct <a class="link" href="dvb_ca.html#ca-descr" title="ca_descr_t">ca_descr</a> {
72        unsigned int index;
73        unsigned int parity;    /* 0 == even, 1 == odd */
74        unsigned char cw[8];
75} <a class="link" href="dvb_ca.html#ca-descr" title="ca_descr_t">ca_descr_t</a>;
76
77typedef struct <a class="link" href="dvb_ca.html#ca-pid" title="ca-pid">ca_pid</a> {
78        unsigned int pid;
79        int index;              /* -1 == disable*/
80} <a class="link" href="dvb_ca.html#ca-pid" title="ca-pid">ca_pid_t</a>;
81
82#define <a class="link" href="ca_function_calls.html#CA_RESET" title="CA_RESET">CA_RESET</a>          _IO('o', 128)
83#define <a class="link" href="ca_function_calls.html#CA_GET_CAP" title="CA_GET_CAP">CA_GET_CAP</a>        _IOR('o', 129, ca_caps_t)
84#define <a class="link" href="ca_function_calls.html#CA_GET_SLOT_INFO" title="CA_GET_SLOT_INFO">CA_GET_SLOT_INFO</a>  _IOR('o', 130, ca_slot_info_t)
85#define <a class="link" href="ca_function_calls.html#CA_GET_DESCR_INFO" title="CA_GET_DESCR_INFO">CA_GET_DESCR_INFO</a> _IOR('o', 131, ca_descr_info_t)
86#define <a class="link" href="ca_function_calls.html#CA_GET_MSG" title="CA_GET_MSG">CA_GET_MSG</a>        _IOR('o', 132, ca_msg_t)
87#define <a class="link" href="ca_function_calls.html#CA_SEND_MSG" title="CA_SEND_MSG">CA_SEND_MSG</a>       _IOW('o', 133, ca_msg_t)
88#define <a class="link" href="ca_function_calls.html#CA_SET_DESCR" title="CA_SET_DESCR">CA_SET_DESCR</a>      _IOW('o', 134, ca_descr_t)
89#define <a class="link" href="ca_function_calls.html#CA_SET_PID" title="CA_SET_PID">CA_SET_PID</a>        _IOW('o', 135, ca_pid_t)
90
91#endif
92</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="audio_h.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="dvbapi.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="dmx_h.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix&#160;F.&#160;DVB Audio Header File&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Appendix&#160;H.&#160;DVB Demux Header File</td></tr></table></div></body></html>
93