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

Linux 6.18.37 · Userspace API / Media / DVB / Network

ioctl NET_GET_IF

기존 DVB virtual interface의 PID와 encapsulation 설정을 조회합니다.

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

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

1. 요약·해설

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

요약·해설

net-get-if.rst:1-50

`ifnum`을 입력하면 PID와 encapsulation type을 반환합니다. 생성되지 않은 interface는 EINVAL입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: DTV.net
3
4 .. _NET_GET_IF:
5
6 ****************
7 ioctl NET_GET_IF
8 ****************
9
10 Name
11 ====
12
13 NET_GET_IF - Read the configuration data of an interface created via - :ref:`NET_ADD_IF <net>`.
14
15 Synopsis
16 ========
17
18 .. c:macro:: NET_GET_IF
19
20 ``int ioctl(int fd, NET_GET_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_GET_IF ioctl uses the interface number given by the struct
35 :c:type:`dvb_net_if`::ifnum field and fills the content of
36 struct :c:type:`dvb_net_if` with the packet ID and
37 encapsulation type used on such interface. If the interface was not
38 created yet with :ref:`NET_ADD_IF <net>`, it will return -1 and fill
39 the ``errno`` with ``EINVAL`` error code.
40
41 Return Value
42 ============
43
44 On success 0 is returned, and :c:type:`ca_slot_info` is filled.
45
46 On error -1 is returned, and the ``errno`` variable is set
47 appropriately.
48
49 The generic error codes are described at the
50 :ref:`Generic Error Codes <gen-errors>` chapter.
51

3. 한국어 전문 번역

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

interface 설정 조회

1-50

`NET_GET_IF`는 `dvb_net_if::ifnum`으로 기존 virtual interface를 선택하고 해당 interface가 사용하는 PID와 encapsulation type을 `dvb_net_if`에 채웁니다.

NET_GET_IF 호출
인자/필드의미
int fdnet device를 `open()`해 얻은 file descriptor
net_if->ifnum조회할 interface 번호
net_if PID / feedtype성공 시 반환되는 Packet ID와 encapsulation type
EINVAL해당 interface가 `NET_ADD_IF`로 생성되지 않음

조회할 interface 번호는 입력, PID와 encapsulation은 출력입니다.

성공하면 0, 오류이면 -1을 반환하고 `errno`를 설정합니다. 원문의 성공 반환 설명은 무관한 `ca_slot_info`를 언급하므로 자동 수정하지 않고 검수 지점으로 남겼습니다.

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

.. _NET_GET_IF:

****************
ioctl NET_GET_IF
****************

Name
====

NET_GET_IF - Read the configuration data of an interface created via - :ref:`NET_ADD_IF <net>`.

Synopsis
========

.. c:macro:: NET_GET_IF

``int ioctl(int fd, NET_GET_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_GET_IF ioctl uses the interface number given by the struct
:c:type:`dvb_net_if`::ifnum field and fills the content of
struct :c:type:`dvb_net_if` with the packet ID and
encapsulation type used on such interface. If the interface was not
created yet with :ref:`NET_ADD_IF <net>`, it will return -1 and fill
the ``errno`` with ``EINVAL`` error code.

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.