connectivity/networking/api/net_hostname.html · connectivity/networking/api/net_hostname.rst 공식 원문 ↗

Zephyr 3.7.0 · Connectivity · Networking API

Hostname Configuration

mDNS용 hostname에 interface identity 기반 postfix를 한 번 설정합니다.

Official pathconnectivity/networking/api/net_hostname.html
Source fileconnectivity/networking/api/net_hostname.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

hostname enable/default, MAC 기반 unique postfix와 interface 생성 전 수동 postfix 설정을 설명합니다.

Default

zephyr

Unique

Link-local postfix

Timing

Before interface init

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 542CEFE827691D98A6EE22142CBA8E723C2A46BC63B9E5D0D67591AC9A6E0AC9
.. _net_hostname_interface:

Hostname Configuration
######################

.. contents::
    :local:
    :depth: 2

Overview
********

A networked device might need a hostname, for example, if the device
is configured to be a mDNS responder (see :ref:`dns_resolve_interface` for
details) and needs to respond to ``<hostname>.local`` DNS queries.

The :kconfig:option:`CONFIG_NET_HOSTNAME_ENABLE` must be set in order
to store the hostname and enable the relevant APIs. If the option is enabled,
then the default hostname is set to be ``zephyr`` by
:kconfig:option:`CONFIG_NET_HOSTNAME` option.

If the same firmware image is used to flash multiple boards, then it is not
practical to use the same hostname in all of the boards. In that case, one
can enable :kconfig:option:`CONFIG_NET_HOSTNAME_UNIQUE` which will add a unique
postfix to the hostname. By default the link local address of the first network
interface is used as a postfix. In Ethernet networks, the link local address
refers to MAC address. For example, if the link local address is
``01:02:03:04:05:06``, then the unique hostname could be
``zephyr010203040506``. If you want to set the prefix yourself, then call
``net_hostname_set_postfix()`` before the network interfaces are created.
For example for the Ethernet networks, the initialization priority is set by
:kconfig:option:`CONFIG_ETH_INIT_PRIORITY` so you would need to set the postfix before
that. The postfix can be set only once.

API Reference
*************

.. doxygengroup:: net_hostname

Part 3

한국어 전문 번역

Hostname Configuration

Overview

Network device가 mDNS responder로 설정되어 <hostname>.local DNS query에 응답해야 하는 경우처럼 hostname이 필요할 수 있습니다.

CONFIG_NET_HOSTNAME_ENABLE을 설정해야 hostname을 저장하고 관련 API를 활성화할 수 있습니다. 활성화하면 CONFIG_NET_HOSTNAME option에 의해 default hostname이 zephyr로 설정됩니다.

CONFIG_NET_HOSTNAME_UNIQUE를 활성화하면 같은 firmware image를 여러 board에 flash해도 hostname에 unique postfix가 붙습니다. 기본 postfix는 첫 network interface의 link-local address이며 Ethernet에서는 MAC address입니다. 예를 들어 01:02:03:04:05:06이면 zephyr010203040506이 될 수 있습니다.

net_hostname_set_postfix()를 network interface 생성 전에 호출하면 postfix를 직접 정할 수 있습니다. Ethernet initialization priority는 CONFIG_ETH_INIT_PRIORITY가 정하므로 그보다 먼저 설정해야 합니다. Postfix는 한 번만 설정할 수 있습니다.

API Reference

Doxygen group net_hostname이 API reference를 제공합니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.