1 .. -*- coding: utf-8; mode: rst -*-
8 The DVB net device controls the mapping of data packages that are part
9 of a transport stream to be mapped into a virtual network interface,
10 visible through the standard Linux network protocol stack.
12 Currently, two encapsulations are supported:
14 - `Multi Protocol Encapsulation (MPE) <http://en.wikipedia.org/wiki/Multiprotocol_Encapsulation>`__
16 - `Ultra Lightweight Encapsulation (ULE) <http://en.wikipedia.org/wiki/Unidirectional_Lightweight_Encapsulation>`__
18 In order to create the Linux virtual network interfaces, an application
19 needs to tell to the Kernel what are the PIDs and the encapsulation
20 types that are present on the transport stream. This is done through
21 ``/dev/dvb/adapter?/net?`` device node. The data will be available via
22 virtual ``dvb?_?`` network interfaces, and will be controlled/routed via
23 the standard ip tools (like ip, route, netstat, ifconfig, etc).
25 Data types and and ioctl definitions are defined via ``linux/dvb/net.h``
31 ######################
32 DVB net Function Calls
33 ######################
43 Creates a new network interface for a given Packet ID.
49 .. cpp:function:: int ioctl( int fd, int request, struct dvb_net_if *net_if )
55 File descriptor returned by :ref:`open() <frontend_f_open>`.
61 pointer to struct :ref:`dvb_net_if <dvb-net-if>`
67 The NET_ADD_IF ioctl system call selects the Packet ID (PID) that
68 contains a TCP/IP traffic, the type of encapsulation to be used (MPE or
69 ULE) and the interface number for the new interface to be created. When
70 the system call successfully returns, a new virtual network interface is
73 The struct :ref:`dvb_net_if <dvb-net-if>`::ifnum field will be
74 filled with the number of the created interface.
78 On success 0 is returned, on error -1 and the ``errno`` variable is set
79 appropriately. The generic error codes are described at the
80 :ref:`Generic Error Codes <gen-errors>` chapter.
85 struct dvb_net_if description
86 =============================
91 .. flat-table:: struct dvb_net_if
106 - Packet ID (PID) of the MPEG-TS that contains data
112 - number of the DVB interface.
118 - Encapsulation type of the feed. It can be:
119 ``DVB_NET_FEEDTYPE_MPE`` for MPE encoding or
120 ``DVB_NET_FEEDTYPE_ULE`` for ULE encoding.
130 *man NET_REMOVE_IF(2)*
132 Removes a network interface.
138 .. cpp:function:: int ioctl( int fd, int request, int ifnum )
144 File descriptor returned by :ref:`open() <frontend_f_open>`.
150 number of the interface to be removed
156 The NET_REMOVE_IF ioctl deletes an interface previously created via
157 :ref:`NET_ADD_IF <net>`.
161 On success 0 is returned, on error -1 and the ``errno`` variable is set
162 appropriately. The generic error codes are described at the
163 :ref:`Generic Error Codes <gen-errors>` chapter.
174 Read the configuration data of an interface created via
175 :ref:`NET_ADD_IF <net>`.
181 .. cpp:function:: int ioctl( int fd, int request, struct dvb_net_if *net_if )
187 File descriptor returned by :ref:`open() <frontend_f_open>`.
193 pointer to struct :ref:`dvb_net_if <dvb-net-if>`
199 The NET_GET_IF ioctl uses the interface number given by the struct
200 :ref:`dvb_net_if <dvb-net-if>`::ifnum field and fills the content of
201 struct :ref:`dvb_net_if <dvb-net-if>` with the packet ID and
202 encapsulation type used on such interface. If the interface was not
203 created yet with :ref:`NET_ADD_IF <net>`, it will return -1 and fill
204 the ``errno`` with ``EINVAL`` error code.
208 On success 0 is returned, on error -1 and the ``errno`` variable is set
209 appropriately. The generic error codes are described at the
210 :ref:`Generic Error Codes <gen-errors>` chapter.
213 .. ------------------------------------------------------------------------------
214 .. This file was automatically converted from DocBook-XML with the dbxml
215 .. library (https://github.com/return42/sphkerneldoc). The origin XML comes
216 .. from the linux kernel, refer to:
218 .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
219 .. ------------------------------------------------------------------------------