socket_getifidx - Man Page

get interface number

Syntax

#include <socket.h>

int socket_getifidx(const char* ifname);

Description

socket_getifidx returns the interface number for a symbolic network interface name (like "eth0" on Linux, for example).

The interface number can be used as scope_id for IPv6 communications on link-local addresses.

If something goes wrong, socket_getifidx returns -1, setting errno appropriately.

See Also

socket_getifname(3), socket_connect6(3)

Referenced By

socket_bind6(3), socket_getifname(3), socket_mcjoin4(3), socket_mcjoin6(3), socket_mcleave4(3), socket_mcleave6(3), socket_send6(3).