сопоставить имя сетевого интерфейса с соответствующим индексом (map a network interface name to its corresponding index)
Пролог (Prolog)
This manual page is part of the POSIX Programmer's Manual. The
Linux implementation of this interface may differ (consult the
corresponding Linux manual page for details of Linux behavior),
or the interface may not be implemented on Linux.
Имя (Name)
if_nametoindex — map a network interface name to its
corresponding index
Синопсис (Synopsis)
#include <net/if.h>
unsigned if_nametoindex(const char *ifname);
Описание (Description)
The if_nametoindex() function shall return the interface index
corresponding to name ifname.
Возвращаемое значение (Return value)
The corresponding index if ifname is the name of an interface;
otherwise, zero.
Ошибки (Error)
No errors are defined.
The following sections are informative.
Примеры (Examples)
None.
Использование в приложениях (Application usage)
None.
Обоснование (Rationale)
None.
Будущие направления (Future directions)
None.
Смотри также (See also)
getsockopt(3p), if_freenameindex(3p), if_indextoname(3p),
if_nameindex(3p), setsockopt(3p)
The Base Definitions volume of POSIX.1‐2017, net_if.h(0p)