Statement on glibc/iconv Vulnerability

net_get_interfaces

(PHP 7 >= 7.3, PHP 8)

net_get_interfacesネットワークインターフェイスを取得する

説明

net_get_interfaces(): array|false

ローカルマシン上にあるネットワークインターフェイス(アダプタ) の一覧を返します。

パラメータ

この関数にはパラメータはありません。

戻り値

Returns an associative array where the key is the name of the interface and the value an associative array of interface attributes, 失敗した場合に false を返します.

Each interface associative array contains:

インターフェイスの属性
名前 説明
description インターフェイスの説明を示すオプションの値。 Windows でのみ有効です。
mac インターフェイスのMACアドレスを示すオプションの値。 Windows でのみ有効です。
mtu インターフェイスのMTUを示す整数値。 Windows でのみ有効です。
unicast 連想配列の配列。 詳細は以下のユニキャストに関する属性を参照ください。
up インターフェイスの状態 (on/off) を示す Boolean の値。

Unicast attributes
名前 説明
flags 整数値。
family 整数値。
address IPv4 または IPv6 形式の、アドレスを示す文字列。
netmask IPv4 または IPv6 形式の、ネットマスクを示す文字列。

エラー / 例外

インターフェイス情報を取得できなかった場合は、 E_WARNING が発生します。

add a note

User Contributed Notes 1 note

up
-2
Anonymous
2 years ago
The 'unicast' might also contain the 'broadcast' attribute, which is not listed above. Tested on linux with PHP 8.
To Top