Signature |
hs.network.interfaceName([interface | favorIPv6]) -> string |
Type |
Function |
Description |
Returns the user defined name for the specified interface or the primary interface if no interface is specified.
|
Parameters |
- interface - an optional string specifying the interface to retrieve the name for. Defaults to the primary interface if not specified.
- favorIPv6 - an optional boolean specifying whether or not to prefer the primary IPv6 or the primary IPv4 interface if
interface is not specified. Defaults to false.
|
Returns |
- A string containing the user defined name for the interface, if one exists, or false if the interface does not have a user defined name. Logs an error and returns nil if there was a problem retrieving this information.
|
Notes |
Only interfaces which show up in the System Preferences Network panel will have a user defined name.
When determining the primary interface, the favorIPv6 flag only determines interface search order. If you specify true for this flag, but no primary IPv6 interface exists (i.e. your DHCP server only provides an IPv4 address an IPv6 is limited to local only traffic), then the primary IPv4 interface will be used instead.
|
Source |
extensions/network/network.lua line 190 |