| 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 | /* |
| 3 | * Copyright (C) 2011, 2015 Red Hat, Inc. |
| 4 | */ |
| 5 | |
| 6 | #ifndef NM_VERSION_H |
| 7 | #define NM_VERSION_H |
| 8 | |
| 9 | #include <glib.h> |
| 10 | |
| 11 | #include "nm-version-macros.h" |
| 12 | |
| 13 | /* Deprecation / Availability macros */ |
| 14 | |
| 15 | #if !defined(NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0) |
| 16 | #undef NM_VERSION_MIN_REQUIRED |
| 17 | #define NM_VERSION_MIN_REQUIRED (NM_API_VERSION) |
| 18 | #endif |
| 19 | |
| 20 | #if !defined(NM_VERSION_MAX_ALLOWED) || (NM_VERSION_MAX_ALLOWED == 0) |
| 21 | #undef NM_VERSION_MAX_ALLOWED |
| 22 | #define NM_VERSION_MAX_ALLOWED (NM_API_VERSION) |
| 23 | #endif |
| 24 | |
| 25 | /* sanity checks */ |
| 26 | #if NM_VERSION_MIN_REQUIRED > NM_API_VERSION |
| 27 | #error "NM_VERSION_MIN_REQUIRED must be <= NM_API_VERSION" |
| 28 | #endif |
| 29 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_MIN_REQUIRED |
| 30 | #error "NM_VERSION_MAX_ALLOWED must be >= NM_VERSION_MIN_REQUIRED" |
| 31 | #endif |
| 32 | #if NM_VERSION_MIN_REQUIRED < NM_VERSION_0_9_8 |
| 33 | #error "NM_VERSION_MIN_REQUIRED must be >= NM_VERSION_0_9_8" |
| 34 | #endif |
| 35 | |
| 36 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_0_9_10 |
| 37 | #define NM_DEPRECATED_IN_0_9_10 G_DEPRECATED |
| 38 | #define NM_DEPRECATED_IN_0_9_10_FOR(f) G_DEPRECATED_FOR(f) |
| 39 | #else |
| 40 | #define NM_DEPRECATED_IN_0_9_10 |
| 41 | #define NM_DEPRECATED_IN_0_9_10_FOR(f) |
| 42 | #endif |
| 43 | |
| 44 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_0_9_10 |
| 45 | #define NM_AVAILABLE_IN_0_9_10 G_UNAVAILABLE(0.9, 10) |
| 46 | #else |
| 47 | #define NM_AVAILABLE_IN_0_9_10 |
| 48 | #endif |
| 49 | |
| 50 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_0 |
| 51 | #define NM_DEPRECATED_IN_1_0 G_DEPRECATED |
| 52 | #define NM_DEPRECATED_IN_1_0_FOR(f) G_DEPRECATED_FOR(f) |
| 53 | #else |
| 54 | #define NM_DEPRECATED_IN_1_0 |
| 55 | #define NM_DEPRECATED_IN_1_0_FOR(f) |
| 56 | #endif |
| 57 | |
| 58 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_0 |
| 59 | #define NM_AVAILABLE_IN_1_0 G_UNAVAILABLE(1, 0) |
| 60 | #else |
| 61 | #define NM_AVAILABLE_IN_1_0 |
| 62 | #endif |
| 63 | |
| 64 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_2 |
| 65 | #define NM_DEPRECATED_IN_1_2 G_DEPRECATED |
| 66 | #define NM_DEPRECATED_IN_1_2_FOR(f) G_DEPRECATED_FOR(f) |
| 67 | #else |
| 68 | #define NM_DEPRECATED_IN_1_2 |
| 69 | #define NM_DEPRECATED_IN_1_2_FOR(f) |
| 70 | #endif |
| 71 | |
| 72 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_2 |
| 73 | #define NM_AVAILABLE_IN_1_2 G_UNAVAILABLE(1, 2) |
| 74 | #else |
| 75 | #define NM_AVAILABLE_IN_1_2 |
| 76 | #endif |
| 77 | |
| 78 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_4 |
| 79 | #define NM_DEPRECATED_IN_1_4 G_DEPRECATED |
| 80 | #define NM_DEPRECATED_IN_1_4_FOR(f) G_DEPRECATED_FOR(f) |
| 81 | #else |
| 82 | #define NM_DEPRECATED_IN_1_4 |
| 83 | #define NM_DEPRECATED_IN_1_4_FOR(f) |
| 84 | #endif |
| 85 | |
| 86 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_4 |
| 87 | #define NM_AVAILABLE_IN_1_4 G_UNAVAILABLE(1, 4) |
| 88 | #else |
| 89 | #define NM_AVAILABLE_IN_1_4 |
| 90 | #endif |
| 91 | |
| 92 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_6 |
| 93 | #define NM_DEPRECATED_IN_1_6 G_DEPRECATED |
| 94 | #define NM_DEPRECATED_IN_1_6_FOR(f) G_DEPRECATED_FOR(f) |
| 95 | #else |
| 96 | #define NM_DEPRECATED_IN_1_6 |
| 97 | #define NM_DEPRECATED_IN_1_6_FOR(f) |
| 98 | #endif |
| 99 | |
| 100 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_6 |
| 101 | #define NM_AVAILABLE_IN_1_6 G_UNAVAILABLE(1, 6) |
| 102 | #else |
| 103 | #define NM_AVAILABLE_IN_1_6 |
| 104 | #endif |
| 105 | |
| 106 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_8 |
| 107 | #define NM_DEPRECATED_IN_1_8 G_DEPRECATED |
| 108 | #define NM_DEPRECATED_IN_1_8_FOR(f) G_DEPRECATED_FOR(f) |
| 109 | #else |
| 110 | #define NM_DEPRECATED_IN_1_8 |
| 111 | #define NM_DEPRECATED_IN_1_8_FOR(f) |
| 112 | #endif |
| 113 | |
| 114 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_8 |
| 115 | #define NM_AVAILABLE_IN_1_8 G_UNAVAILABLE(1, 8) |
| 116 | #else |
| 117 | #define NM_AVAILABLE_IN_1_8 |
| 118 | #endif |
| 119 | |
| 120 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_10 |
| 121 | #define NM_DEPRECATED_IN_1_10 G_DEPRECATED |
| 122 | #define NM_DEPRECATED_IN_1_10_FOR(f) G_DEPRECATED_FOR(f) |
| 123 | #else |
| 124 | #define NM_DEPRECATED_IN_1_10 |
| 125 | #define NM_DEPRECATED_IN_1_10_FOR(f) |
| 126 | #endif |
| 127 | |
| 128 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_10 |
| 129 | #define NM_AVAILABLE_IN_1_10 G_UNAVAILABLE(1, 10) |
| 130 | #else |
| 131 | #define NM_AVAILABLE_IN_1_10 |
| 132 | #endif |
| 133 | |
| 134 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_12 |
| 135 | #define NM_DEPRECATED_IN_1_12 G_DEPRECATED |
| 136 | #define NM_DEPRECATED_IN_1_12_FOR(f) G_DEPRECATED_FOR(f) |
| 137 | #else |
| 138 | #define NM_DEPRECATED_IN_1_12 |
| 139 | #define NM_DEPRECATED_IN_1_12_FOR(f) |
| 140 | #endif |
| 141 | |
| 142 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_12 |
| 143 | #define NM_AVAILABLE_IN_1_12 G_UNAVAILABLE(1, 12) |
| 144 | #else |
| 145 | #define NM_AVAILABLE_IN_1_12 |
| 146 | #endif |
| 147 | |
| 148 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_14 |
| 149 | #define NM_DEPRECATED_IN_1_14 G_DEPRECATED |
| 150 | #define NM_DEPRECATED_IN_1_14_FOR(f) G_DEPRECATED_FOR(f) |
| 151 | #else |
| 152 | #define NM_DEPRECATED_IN_1_14 |
| 153 | #define NM_DEPRECATED_IN_1_14_FOR(f) |
| 154 | #endif |
| 155 | |
| 156 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_14 |
| 157 | #define NM_AVAILABLE_IN_1_14 G_UNAVAILABLE(1, 14) |
| 158 | #else |
| 159 | #define NM_AVAILABLE_IN_1_14 |
| 160 | #endif |
| 161 | |
| 162 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_16 |
| 163 | #define NM_DEPRECATED_IN_1_16 G_DEPRECATED |
| 164 | #define NM_DEPRECATED_IN_1_16_FOR(f) G_DEPRECATED_FOR(f) |
| 165 | #else |
| 166 | #define NM_DEPRECATED_IN_1_16 |
| 167 | #define NM_DEPRECATED_IN_1_16_FOR(f) |
| 168 | #endif |
| 169 | |
| 170 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_16 |
| 171 | #define NM_AVAILABLE_IN_1_16 G_UNAVAILABLE(1, 16) |
| 172 | #else |
| 173 | #define NM_AVAILABLE_IN_1_16 |
| 174 | #endif |
| 175 | |
| 176 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_18 |
| 177 | #define NM_DEPRECATED_IN_1_18 G_DEPRECATED |
| 178 | #define NM_DEPRECATED_IN_1_18_FOR(f) G_DEPRECATED_FOR(f) |
| 179 | #else |
| 180 | #define NM_DEPRECATED_IN_1_18 |
| 181 | #define NM_DEPRECATED_IN_1_18_FOR(f) |
| 182 | #endif |
| 183 | |
| 184 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_18 |
| 185 | #define NM_AVAILABLE_IN_1_18 G_UNAVAILABLE(1, 18) |
| 186 | #else |
| 187 | #define NM_AVAILABLE_IN_1_18 |
| 188 | #endif |
| 189 | |
| 190 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_20 |
| 191 | #define NM_DEPRECATED_IN_1_20 G_DEPRECATED |
| 192 | #define NM_DEPRECATED_IN_1_20_FOR(f) G_DEPRECATED_FOR(f) |
| 193 | #else |
| 194 | #define NM_DEPRECATED_IN_1_20 |
| 195 | #define NM_DEPRECATED_IN_1_20_FOR(f) |
| 196 | #endif |
| 197 | |
| 198 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_20 |
| 199 | #define NM_AVAILABLE_IN_1_20 G_UNAVAILABLE(1, 20) |
| 200 | #else |
| 201 | #define NM_AVAILABLE_IN_1_20 |
| 202 | #endif |
| 203 | |
| 204 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_22 |
| 205 | #define NM_DEPRECATED_IN_1_22 G_DEPRECATED |
| 206 | #define NM_DEPRECATED_IN_1_22_FOR(f) G_DEPRECATED_FOR(f) |
| 207 | #else |
| 208 | #define NM_DEPRECATED_IN_1_22 |
| 209 | #define NM_DEPRECATED_IN_1_22_FOR(f) |
| 210 | #endif |
| 211 | |
| 212 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_22 |
| 213 | #define NM_AVAILABLE_IN_1_22 G_UNAVAILABLE(1, 22) |
| 214 | #else |
| 215 | #define NM_AVAILABLE_IN_1_22 |
| 216 | #endif |
| 217 | |
| 218 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_24 |
| 219 | #define NM_DEPRECATED_IN_1_24 G_DEPRECATED |
| 220 | #define NM_DEPRECATED_IN_1_24_FOR(f) G_DEPRECATED_FOR(f) |
| 221 | #else |
| 222 | #define NM_DEPRECATED_IN_1_24 |
| 223 | #define NM_DEPRECATED_IN_1_24_FOR(f) |
| 224 | #endif |
| 225 | |
| 226 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_24 |
| 227 | #define NM_AVAILABLE_IN_1_24 G_UNAVAILABLE(1, 24) |
| 228 | #else |
| 229 | #define NM_AVAILABLE_IN_1_24 |
| 230 | #endif |
| 231 | |
| 232 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_26 |
| 233 | #define NM_DEPRECATED_IN_1_26 G_DEPRECATED |
| 234 | #define NM_DEPRECATED_IN_1_26_FOR(f) G_DEPRECATED_FOR(f) |
| 235 | #else |
| 236 | #define NM_DEPRECATED_IN_1_26 |
| 237 | #define NM_DEPRECATED_IN_1_26_FOR(f) |
| 238 | #endif |
| 239 | |
| 240 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_26 |
| 241 | #define NM_AVAILABLE_IN_1_26 G_UNAVAILABLE(1, 26) |
| 242 | #else |
| 243 | #define NM_AVAILABLE_IN_1_26 |
| 244 | #endif |
| 245 | |
| 246 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_28 |
| 247 | #define NM_DEPRECATED_IN_1_28 G_DEPRECATED |
| 248 | #define NM_DEPRECATED_IN_1_28_FOR(f) G_DEPRECATED_FOR(f) |
| 249 | #else |
| 250 | #define NM_DEPRECATED_IN_1_28 |
| 251 | #define NM_DEPRECATED_IN_1_28_FOR(f) |
| 252 | #endif |
| 253 | |
| 254 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_28 |
| 255 | #define NM_AVAILABLE_IN_1_28 G_UNAVAILABLE(1, 28) |
| 256 | #else |
| 257 | #define NM_AVAILABLE_IN_1_28 |
| 258 | #endif |
| 259 | |
| 260 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_30 |
| 261 | #define NM_DEPRECATED_IN_1_30 G_DEPRECATED |
| 262 | #define NM_DEPRECATED_IN_1_30_FOR(f) G_DEPRECATED_FOR(f) |
| 263 | #else |
| 264 | #define NM_DEPRECATED_IN_1_30 |
| 265 | #define NM_DEPRECATED_IN_1_30_FOR(f) |
| 266 | #endif |
| 267 | |
| 268 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_30 |
| 269 | #define NM_AVAILABLE_IN_1_30 G_UNAVAILABLE(1, 30) |
| 270 | #else |
| 271 | #define NM_AVAILABLE_IN_1_30 |
| 272 | #endif |
| 273 | |
| 274 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_32 |
| 275 | #define NM_DEPRECATED_IN_1_32 G_DEPRECATED |
| 276 | #define NM_DEPRECATED_IN_1_32_FOR(f) G_DEPRECATED_FOR(f) |
| 277 | #else |
| 278 | #define NM_DEPRECATED_IN_1_32 |
| 279 | #define NM_DEPRECATED_IN_1_32_FOR(f) |
| 280 | #endif |
| 281 | |
| 282 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_32 |
| 283 | #define NM_AVAILABLE_IN_1_32 G_UNAVAILABLE(1, 32) |
| 284 | #else |
| 285 | #define NM_AVAILABLE_IN_1_32 |
| 286 | #endif |
| 287 | |
| 288 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_34 |
| 289 | #define NM_DEPRECATED_IN_1_34 G_DEPRECATED |
| 290 | #define NM_DEPRECATED_IN_1_34_FOR(f) G_DEPRECATED_FOR(f) |
| 291 | #else |
| 292 | #define NM_DEPRECATED_IN_1_34 |
| 293 | #define NM_DEPRECATED_IN_1_34_FOR(f) |
| 294 | #endif |
| 295 | |
| 296 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_34 |
| 297 | #define NM_AVAILABLE_IN_1_34 G_UNAVAILABLE(1, 34) |
| 298 | #else |
| 299 | #define NM_AVAILABLE_IN_1_34 |
| 300 | #endif |
| 301 | |
| 302 | #if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_36 |
| 303 | #define NM_DEPRECATED_IN_1_36 G_DEPRECATED |
| 304 | #define NM_DEPRECATED_IN_1_36_FOR(f) G_DEPRECATED_FOR(f) |
| 305 | #else |
| 306 | #define NM_DEPRECATED_IN_1_36 |
| 307 | #define NM_DEPRECATED_IN_1_36_FOR(f) |
| 308 | #endif |
| 309 | |
| 310 | #if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_36 |
| 311 | #define NM_AVAILABLE_IN_1_36 G_UNAVAILABLE(1, 36) |
| 312 | #else |
| 313 | #define NM_AVAILABLE_IN_1_36 |
| 314 | #endif |
| 315 | |
| 316 | /* |
| 317 | * Synchronous API for calling D-Bus in libnm is deprecated. See |
| 318 | * https://developer.gnome.org/libnm/stable/usage.html#sync-api |
| 319 | * |
| 320 | * Note that "deprecated" here does not really mean that the API is going |
| 321 | * to be removed. We don't break API. Just comment that it is awkward and |
| 322 | * discouraged. The user may: |
| 323 | * |
| 324 | * - continue to use this API. It's deprecated, awkward and discouraged, |
| 325 | * but if it works for you, that's fine. |
| 326 | * |
| 327 | * - use asynchronous API. That's the only sensible way to use D-Bus. |
| 328 | * If libnm lacks a certain asynchronous counterpart, it should be |
| 329 | * added. |
| 330 | * |
| 331 | * - use GDBusConnection directly. There really isn't anything wrong |
| 332 | * with D-Bus or GDBusConnection. This deprecated API is just a wrapper |
| 333 | * around g_dbus_connection_call_sync(). You may call it directly |
| 334 | * without feeling dirty. |
| 335 | * |
| 336 | * The API is marked as deprecated since 1.22, however the macro only starts |
| 337 | * complaining in 1.24. That's intentional, because in 1.22 the asynchronous |
| 338 | * alternative was not yet available. |
| 339 | */ |
| 340 | #define _NM_DEPRECATED_SYNC_METHOD NM_DEPRECATED_IN_1_24 |
| 341 | #define _NM_DEPRECATED_SYNC_WRITABLE_PROPERTY /* NM_DEPRECATED_IN_1_22 */ |
| 342 | |
| 343 | #endif /* NM_VERSION_H */ |
| 344 | |