18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 28c2ecf20Sopenharmony_ci.. c:namespace:: DTV.net 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci.. _NET_ADD_IF: 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci**************** 78c2ecf20Sopenharmony_ciioctl NET_ADD_IF 88c2ecf20Sopenharmony_ci**************** 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciName 118c2ecf20Sopenharmony_ci==== 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciNET_ADD_IF - Creates a new network interface for a given Packet ID. 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciSynopsis 168c2ecf20Sopenharmony_ci======== 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci.. c:macro:: NET_ADD_IF 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci``int ioctl(int fd, NET_ADD_IF, struct dvb_net_if *net_if)`` 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciArguments 238c2ecf20Sopenharmony_ci========= 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci``fd`` 268c2ecf20Sopenharmony_ci File descriptor returned by :c:func:`open()`. 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci``net_if`` 298c2ecf20Sopenharmony_ci pointer to struct :c:type:`dvb_net_if` 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciDescription 328c2ecf20Sopenharmony_ci=========== 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciThe NET_ADD_IF ioctl system call selects the Packet ID (PID) that 358c2ecf20Sopenharmony_cicontains a TCP/IP traffic, the type of encapsulation to be used (MPE or 368c2ecf20Sopenharmony_ciULE) and the interface number for the new interface to be created. When 378c2ecf20Sopenharmony_cithe system call successfully returns, a new virtual network interface is 388c2ecf20Sopenharmony_cicreated. 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ciThe struct :c:type:`dvb_net_if`::ifnum field will be 418c2ecf20Sopenharmony_cifilled with the number of the created interface. 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ciReturn Value 448c2ecf20Sopenharmony_ci============ 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ciOn success 0 is returned, and :c:type:`ca_slot_info` is filled. 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ciOn error -1 is returned, and the ``errno`` variable is set 498c2ecf20Sopenharmony_ciappropriately. 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ciThe generic error codes are described at the 528c2ecf20Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter. 53