← Documents Documentation/userspace-api/media/dvb/net-add-if.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / DVB / Network

ioctl NET_ADD_IF

PID와 encapsulation을 지정해 DVB virtual network interface를 생성합니다.

Source pathDocumentation/userspace-api/media/dvb/net-add-if.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

net-add-if.rst:1-52

성공 시 `dvb_net_if::ifnum`에 생성된 interface 번호가 기록됩니다. 원문의 `ca_slot_info` 반환 문구는 복사 오류로 보이며 자동 수정하지 않았습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: DTV.net
3
4 .. _NET_ADD_IF:
5
6 ****************
7 ioctl NET_ADD_IF
8 ****************
9
10 Name
11 ====
12
13 NET_ADD_IF - Creates a new network interface for a given Packet ID.
14
15 Synopsis
16 ========
17
18 .. c:macro:: NET_ADD_IF
19
20 ``int ioctl(int fd, NET_ADD_IF, struct dvb_net_if *net_if)``
21
22 Arguments
23 =========
24
25 ``fd``
26 File descriptor returned by :c:func:`open()`.
27
28 ``net_if``
29 pointer to struct :c:type:`dvb_net_if`
30
31 Description
32 ===========
33
34 The NET_ADD_IF ioctl system call selects the Packet ID (PID) that
35 contains a TCP/IP traffic, the type of encapsulation to be used (MPE or
36 ULE) and the interface number for the new interface to be created. When
37 the system call successfully returns, a new virtual network interface is
38 created.
39
40 The struct :c:type:`dvb_net_if`::ifnum field will be
41 filled with the number of the created interface.
42
43 Return Value
44 ============
45
46 On success 0 is returned, and :c:type:`ca_slot_info` is filled.
47
48 On error -1 is returned, and the ``errno`` variable is set
49 appropriately.
50
51 The generic error codes are described at the
52 :ref:`Generic Error Codes <gen-errors>` chapter.
53

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

PID와 encapsulation으로 interface 생성

1-52

`NET_ADD_IF`는 TCP/IP traffic이 든 Packet ID(PID), MPE 또는 ULE encapsulation type을 선택해 새 virtual network interface를 생성합니다.

NET_ADD_IF 호출
인자/필드의미
int fd`/dev/dvb/adapter?/net?`를 `open()`해 얻은 file descriptor
struct dvb_net_if *net_ifPID, encapsulation 입력과 생성된 `ifnum` 출력 구조체
net_if->ifnum성공 시 생성된 interface 번호

호출자가 `dvb_net_if`의 PID와 encapsulation을 채우고 kernel이 interface 번호를 돌려줍니다.

DVB network interface 생성
Transport stream에서 TCP/IP traffic PID 확인MPE 또는 ULE encapsulation 선택NET_ADD_IF에 dvb_net_if 전달Kernel이 virtual dvb?_? interface 생성생성된 interface 번호를 net_if->ifnum으로 반환

Transport stream의 IP data를 Linux network stack에 연결합니다.

성공하면 0, 오류이면 -1을 반환하고 `errno`를 설정합니다. 원문은 성공 시 `ca_slot_info`가 채워진다고 적지만 이 ioctl의 실제 출력은 `dvb_net_if::ifnum`입니다. 무관한 원문 문구는 수정하지 않고 검수 지점으로 표시했습니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: DTV.net

.. _NET_ADD_IF:

****************
ioctl NET_ADD_IF
****************

Name
====

NET_ADD_IF - Creates a new network interface for a given Packet ID.

Synopsis
========

.. c:macro:: NET_ADD_IF

``int ioctl(int fd, NET_ADD_IF, struct dvb_net_if *net_if)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open()`.

``net_if``
    pointer to struct :c:type:`dvb_net_if`

Description
===========

The NET_ADD_IF ioctl system call selects the Packet ID (PID) that
contains a TCP/IP traffic, the type of encapsulation to be used (MPE or
ULE) and the interface number for the new interface to be created. When
the system call successfully returns, a new virtual network interface is
created.

The struct :c:type:`dvb_net_if`::ifnum field will be
filled with the number of the created interface.

Return Value
============

On success 0 is returned, and :c:type:`ca_slot_info` is filled.

On error -1 is returned, and the ``errno`` variable is set
appropriately.

The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.