1 <title>DVB Network API</title>
2 <para>The DVB net device controls the mapping of data packages that are
3 part of a transport stream to be mapped into a virtual network interface,
4 visible through the standard Linux network protocol stack.</para>
5 <para>Currently, two encapsulations are supported:</para>
7 <listitem><para><ulink url="http://en.wikipedia.org/wiki/Multiprotocol_Encapsulation">
8 Multi Protocol Encapsulation (MPE)</ulink></para></listitem>
9 <listitem><para><ulink url="http://en.wikipedia.org/wiki/Unidirectional_Lightweight_Encapsulation">
10 Ultra Lightweight Encapsulation (ULE)</ulink></para></listitem>
13 <para>In order to create the Linux virtual network interfaces, an application
14 needs to tell to the Kernel what are the PIDs and the encapsulation types
15 that are present on the transport stream. This is done through
16 <constant>/dev/dvb/adapter?/net?</constant> device node.
17 The data will be available via virtual <constant>dvb?_?</constant>
18 network interfaces, and will be controled/routed via the standard
19 ip tools (like ip, route, netstat, ifconfig, etc).</para>
20 <para> Data types and and ioctl definitions are defined via
21 <constant>linux/dvb/net.h</constant> header.</para>
23 <section id="net_fcalls">
24 <title>DVB net Function Calls</title>
27 <refentry id="NET_ADD_IF">
29 <refentrytitle>ioctl NET_ADD_IF</refentrytitle>
34 <refname>NET_ADD_IF</refname>
35 <refpurpose>Creates a new network interface for a given Packet ID.</refpurpose>
41 <funcdef>int <function>ioctl</function></funcdef>
42 <paramdef>int <parameter>fd</parameter></paramdef>
43 <paramdef>int <parameter>request</parameter></paramdef>
44 <paramdef>struct dvb_net_if *<parameter>net_if</parameter></paramdef>
50 <title>Arguments</title>
53 <term><parameter>fd</parameter></term>
59 <term><parameter>request</parameter></term>
61 <para>FE_SET_TONE</para>
65 <term><parameter>net_if</parameter></term>
67 <para>pointer to &dvb-net-if;</para>
74 <title>Description</title>
76 <para>The NET_ADD_IF ioctl system call selects the Packet ID (PID) that
77 contains a TCP/IP traffic, the type of encapsulation to be used (MPE or ULE)
78 and the interface number for the new interface to be created. When the
79 system call successfully returns, a new virtual network interface is created.</para>
80 <para>The &dvb-net-if;::ifnum field will be filled with the number of the
81 created interface.</para>
86 <refsect1 id="dvb-net-if-t">
87 <title>struct <structname>dvb_net_if</structname> description</title>
89 <table pgwide="1" frame="none" id="dvb-net-if">
90 <title>struct <structname>dvb_net_if</structname></title>
96 <entry>Description</entry>
101 <entry align="char">pid</entry>
102 <entry align="char">Packet ID (PID) of the MPEG-TS that contains
105 <entry align="char">ifnum</entry>
106 <entry align="char">number of the DVB interface.</entry>
108 <entry align="char">feedtype</entry>
109 <entry align="char">Encapsulation type of the feed. It can be:
110 <constant>DVB_NET_FEEDTYPE_MPE</constant> for MPE encoding
112 <constant>DVB_NET_FEEDTYPE_ULE</constant> for ULE encoding.
121 <refentry id="NET_REMOVE_IF">
123 <refentrytitle>ioctl NET_REMOVE_IF</refentrytitle>
128 <refname>NET_REMOVE_IF</refname>
129 <refpurpose>Removes a network interface.</refpurpose>
135 <funcdef>int <function>ioctl</function></funcdef>
136 <paramdef>int <parameter>fd</parameter></paramdef>
137 <paramdef>int <parameter>request</parameter></paramdef>
138 <paramdef>int <parameter>ifnum</parameter></paramdef>
144 <title>Arguments</title>
147 <term><parameter>fd</parameter></term>
153 <term><parameter>request</parameter></term>
155 <para>FE_SET_TONE</para>
159 <term><parameter>net_if</parameter></term>
161 <para>number of the interface to be removed</para>
168 <title>Description</title>
170 <para>The NET_REMOVE_IF ioctl deletes an interface previously created
171 via &NET-ADD-IF;.</para>
178 <refentry id="NET_GET_IF">
180 <refentrytitle>ioctl NET_GET_IF</refentrytitle>
185 <refname>NET_GET_IF</refname>
186 <refpurpose>Read the configuration data of an interface created via
187 &NET-ADD-IF;.</refpurpose>
193 <funcdef>int <function>ioctl</function></funcdef>
194 <paramdef>int <parameter>fd</parameter></paramdef>
195 <paramdef>int <parameter>request</parameter></paramdef>
196 <paramdef>struct dvb_net_if *<parameter>net_if</parameter></paramdef>
202 <title>Arguments</title>
205 <term><parameter>fd</parameter></term>
211 <term><parameter>request</parameter></term>
213 <para>FE_SET_TONE</para>
217 <term><parameter>net_if</parameter></term>
219 <para>pointer to &dvb-net-if;</para>
226 <title>Description</title>
228 <para>The NET_GET_IF ioctl uses the interface number given by the
229 &dvb-net-if;::ifnum field and fills the content of &dvb-net-if; with
230 the packet ID and encapsulation type used on such interface. If the
231 interface was not created yet with &NET-ADD-IF;, it will return -1 and
232 fill the <constant>errno</constant> with <constant>EINVAL</constant>