1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//! NetworkManager connectivity types.
/// Internet connectivity state.
/// The NMMetered enum has two different purposes: one is to configure
/// "connection.metered" setting of a connection profile in NMSettingConnection,
/// and the other is to express the actual metered state of the NMDevice at a
/// given moment.
///
/// For the connection profile only NM_METERED_UNKNOWN, NM_METERED_NO and
/// NM_METERED_YES are allowed.
///
/// The device's metered state at runtime is determined by the profile which is
/// currently active. If the profile explicitly specifies NM_METERED_NO or
/// NM_METERED_YES, then the device's metered state is as such. If the connection
/// profile leaves it undecided at NM_METERED_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
/// NM_METERED_GUESS_NO or NM_METERED_GUESS_YES.
///
/// Most applications probably should treat the runtime state NM_METERED_GUESS_YES
/// like NM_METERED_YES, and all other states as not metered.
///
/// Note that the per-device metered states are then combined to a global metered
/// state. 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.
///
/// Since: 1.2
/// Primary network connection type as reported by NetworkManager's
/// `PrimaryConnectionType` D-Bus property.
///
/// Uncommon types are passed through via Other(string)
///
/// Reference: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/tree/main/src/libnm-core-public?ref_type=heads