Metered


Description:

[ CCode ( cprefix = "NM_METERED_" , type_id = "nm_metered_get_type ()" ) ]
[ Version ( since = "1.2" ) ]
public enum Metered

The NMMetered enum has two different purposes: one is to configure "connection.

metered" setting of a connection profile in SettingConnection, and the other is to express the actual metered state of the Device at a given moment.

For the connection profile only UNKNOWN, NO and YES are allowed.

The device's metered state at runtime is determined by the profile which is currently active. If the profile explicitly specifies NO or YES, then the device's metered state is as such. If the connection profile leaves it undecided at UNKNOWN (the default), then NetworkManager tries to guess the metered state, for example based on the device type or on DHCP options (like Android devices exposing a "ANDROID_METERED" DHCP vendor option). This then leads to either GUESS_NO or GUESS_YES.

Most applications probably should treat the runtime state GUESS_YES like YES, and all other states as not metered.

Note that the per-device metered states are then combined to a global metered state. This is basically the metered state of the device with the best default route. However, that generalization of a global metered state may not be correct if the default routes for IPv4 and IPv6 are on different devices, or if policy routing is configured. In general, the global metered state tries to express whether the traffic is likely metered, but since that depends on the traffic itself, there is not one answer in all cases. Hence, an application may want to consider the per-device's metered states.


Namespace: NM
Package: libnm

Content:

Enum values: