This type defines all addresses (and flags) associated with the interface.
Note
Not all fields of this map has to be present. The flags field can be used to test for some of the fields. For example broadaddr
will only be present if the broadcast
flag is present in flags.
ifaddrs_flag() =
up | broadcast | debug | loopback | pointopoint | notrailers |
running | noarp | promisc | master | slave | multicast |
portsel | automedia | dynamic
ifaddrs_filter_map() =
#{family := default | inet | inet6 | packet | all,
flags := any | [ifaddrs_flag()]}
The family
field can only have the (above) specified values (and not all the values of socket:domain()).
The use of the flags
field is that any flag provided must exist for the interface.
For example, if family
is set to inet
and flags
to [broadcast, multicast]
only interfaces with address family inet
and the flags broadcast
and multicast
will be listed.
ifaddrs_filter_fun() = fun((ifaddrs()) -> boolean())
For each ifaddrs
entry, return either true
to keep the entry or false
to discard the entry.
For example, to get an interface list which only contains non-loopback
inet
interfaces:
net:getifaddrs(fun(#{addr := #{family := inet},
flags := Flags}) ->
not lists:member(loopback, Flags);
(_) ->
false
end).
name_info() = #{host := string(), service := string()}
name_info_flag() =
namereqd | dgram | nofqdn | numerichost | numericserv
name_info_flag_ext() = idn
network_interface_name() = string()
network_interface_index() = integer() >= 0