nm-rs 0.1.3

Rust bindings for the libnm library.
Documentation
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir
// from gtk-girs (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::ffi;
use glib::{bitflags::bitflags, prelude::*, translate::*};

bitflags! {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    pub struct NM80211ApFlags: u32 {
        #[doc(alias = "NM_802_11_AP_FLAGS_NONE")]
        const NONE = ffi::NM_802_11_AP_FLAGS_NONE as _;
        #[doc(alias = "NM_802_11_AP_FLAGS_PRIVACY")]
        const PRIVACY = ffi::NM_802_11_AP_FLAGS_PRIVACY as _;
        #[doc(alias = "NM_802_11_AP_FLAGS_WPS")]
        const WPS = ffi::NM_802_11_AP_FLAGS_WPS as _;
        #[doc(alias = "NM_802_11_AP_FLAGS_WPS_PBC")]
        const WPS_PBC = ffi::NM_802_11_AP_FLAGS_WPS_PBC as _;
        #[doc(alias = "NM_802_11_AP_FLAGS_WPS_PIN")]
        const WPS_PIN = ffi::NM_802_11_AP_FLAGS_WPS_PIN as _;
    }
}

#[doc(hidden)]
impl IntoGlib for NM80211ApFlags {
    type GlibType = ffi::NM80211ApFlags;

    #[inline]
    fn into_glib(self) -> ffi::NM80211ApFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NM80211ApFlags> for NM80211ApFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NM80211ApFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for NM80211ApFlags {
    #[inline]
    #[doc(alias = "nm_802_11_ap_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_802_11_ap_flags_get_type()) }
    }
}

impl glib::HasParamSpec for NM80211ApFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for NM80211ApFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for NM80211ApFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for NM80211ApFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<NM80211ApFlags> for glib::Value {
    #[inline]
    fn from(v: NM80211ApFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    pub struct NM80211ApSecurityFlags: u32 {
        #[doc(alias = "NM_802_11_AP_SEC_NONE")]
        const NONE = ffi::NM_802_11_AP_SEC_NONE as _;
        #[doc(alias = "NM_802_11_AP_SEC_PAIR_WEP40")]
        const PAIR_WEP40 = ffi::NM_802_11_AP_SEC_PAIR_WEP40 as _;
        #[doc(alias = "NM_802_11_AP_SEC_PAIR_WEP104")]
        const PAIR_WEP104 = ffi::NM_802_11_AP_SEC_PAIR_WEP104 as _;
        #[doc(alias = "NM_802_11_AP_SEC_PAIR_TKIP")]
        const PAIR_TKIP = ffi::NM_802_11_AP_SEC_PAIR_TKIP as _;
        #[doc(alias = "NM_802_11_AP_SEC_PAIR_CCMP")]
        const PAIR_CCMP = ffi::NM_802_11_AP_SEC_PAIR_CCMP as _;
        #[doc(alias = "NM_802_11_AP_SEC_GROUP_WEP40")]
        const GROUP_WEP40 = ffi::NM_802_11_AP_SEC_GROUP_WEP40 as _;
        #[doc(alias = "NM_802_11_AP_SEC_GROUP_WEP104")]
        const GROUP_WEP104 = ffi::NM_802_11_AP_SEC_GROUP_WEP104 as _;
        #[doc(alias = "NM_802_11_AP_SEC_GROUP_TKIP")]
        const GROUP_TKIP = ffi::NM_802_11_AP_SEC_GROUP_TKIP as _;
        #[doc(alias = "NM_802_11_AP_SEC_GROUP_CCMP")]
        const GROUP_CCMP = ffi::NM_802_11_AP_SEC_GROUP_CCMP as _;
        #[doc(alias = "NM_802_11_AP_SEC_KEY_MGMT_PSK")]
        const KEY_MGMT_PSK = ffi::NM_802_11_AP_SEC_KEY_MGMT_PSK as _;
        #[doc(alias = "NM_802_11_AP_SEC_KEY_MGMT_802_1X")]
        const KEY_MGMT_802_1X = ffi::NM_802_11_AP_SEC_KEY_MGMT_802_1X as _;
        #[doc(alias = "NM_802_11_AP_SEC_KEY_MGMT_SAE")]
        const KEY_MGMT_SAE = ffi::NM_802_11_AP_SEC_KEY_MGMT_SAE as _;
        #[doc(alias = "NM_802_11_AP_SEC_KEY_MGMT_OWE")]
        const KEY_MGMT_OWE = ffi::NM_802_11_AP_SEC_KEY_MGMT_OWE as _;
        #[doc(alias = "NM_802_11_AP_SEC_KEY_MGMT_OWE_TM")]
        const KEY_MGMT_OWE_TM = ffi::NM_802_11_AP_SEC_KEY_MGMT_OWE_TM as _;
        #[doc(alias = "NM_802_11_AP_SEC_KEY_MGMT_EAP_SUITE_B_192")]
        const KEY_MGMT_EAP_SUITE_B_192 = ffi::NM_802_11_AP_SEC_KEY_MGMT_EAP_SUITE_B_192 as _;
    }
}

#[doc(hidden)]
impl IntoGlib for NM80211ApSecurityFlags {
    type GlibType = ffi::NM80211ApSecurityFlags;

    #[inline]
    fn into_glib(self) -> ffi::NM80211ApSecurityFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NM80211ApSecurityFlags> for NM80211ApSecurityFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NM80211ApSecurityFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for NM80211ApSecurityFlags {
    #[inline]
    #[doc(alias = "nm_802_11_ap_security_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_802_11_ap_security_flags_get_type()) }
    }
}

impl glib::HasParamSpec for NM80211ApSecurityFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for NM80211ApSecurityFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for NM80211ApSecurityFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for NM80211ApSecurityFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<NM80211ApSecurityFlags> for glib::Value {
    #[inline]
    fn from(v: NM80211ApSecurityFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_10")]
bitflags! {
    /// Flags describing the current activation state.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMActivationStateFlags")]
    pub struct ActivationStateFlags: u32 {
        /// an alias for numeric zero, no flags set.
        #[doc(alias = "NM_ACTIVATION_STATE_FLAG_NONE")]
        const NONE = ffi::NM_ACTIVATION_STATE_FLAG_NONE as _;
        /// the device is a controller.
        #[doc(alias = "NM_ACTIVATION_STATE_FLAG_IS_CONTROLLER")]
        const IS_CONTROLLER = ffi::NM_ACTIVATION_STATE_FLAG_IS_CONTROLLER as _;
        /// the device is a port.
        #[doc(alias = "NM_ACTIVATION_STATE_FLAG_IS_PORT")]
        const IS_PORT = ffi::NM_ACTIVATION_STATE_FLAG_IS_PORT as _;
        /// layer2 is activated and ready.
        #[doc(alias = "NM_ACTIVATION_STATE_FLAG_LAYER2_READY")]
        const LAYER2_READY = ffi::NM_ACTIVATION_STATE_FLAG_LAYER2_READY as _;
        /// IPv4 setting is completed.
        #[doc(alias = "NM_ACTIVATION_STATE_FLAG_IP4_READY")]
        const IP4_READY = ffi::NM_ACTIVATION_STATE_FLAG_IP4_READY as _;
        /// IPv6 setting is completed.
        #[doc(alias = "NM_ACTIVATION_STATE_FLAG_IP6_READY")]
        const IP6_READY = ffi::NM_ACTIVATION_STATE_FLAG_IP6_READY as _;
        /// The controller has any port devices attached.
        ///   This only makes sense if the device is a controller.
        #[doc(alias = "NM_ACTIVATION_STATE_FLAG_CONTROLLER_HAS_PORTS")]
        const CONTROLLER_HAS_PORTS = ffi::NM_ACTIVATION_STATE_FLAG_CONTROLLER_HAS_PORTS as _;
        /// the lifetime
        ///   of the activation is bound to the visibility of the connection profile,
        ///   which in turn depends on "connection.permissions" and whether a session
        ///   for the user exists. Since: 1.16.
        #[doc(alias = "NM_ACTIVATION_STATE_FLAG_LIFETIME_BOUND_TO_PROFILE_VISIBILITY")]
        const LIFETIME_BOUND_TO_PROFILE_VISIBILITY = ffi::NM_ACTIVATION_STATE_FLAG_LIFETIME_BOUND_TO_PROFILE_VISIBILITY as _;
        /// the active connection was generated to
        ///  represent an external configuration of a networking device. Since: 1.26.
        #[doc(alias = "NM_ACTIVATION_STATE_FLAG_EXTERNAL")]
        const EXTERNAL = ffi::NM_ACTIVATION_STATE_FLAG_EXTERNAL as _;
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
#[doc(hidden)]
impl IntoGlib for ActivationStateFlags {
    type GlibType = ffi::NMActivationStateFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMActivationStateFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
#[doc(hidden)]
impl FromGlib<ffi::NMActivationStateFlags> for ActivationStateFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMActivationStateFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl StaticType for ActivationStateFlags {
    #[inline]
    #[doc(alias = "nm_activation_state_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_activation_state_flags_get_type()) }
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl glib::HasParamSpec for ActivationStateFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl glib::value::ValueType for ActivationStateFlags {
    type Type = Self;
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
unsafe impl<'a> glib::value::FromValue<'a> for ActivationStateFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl ToValue for ActivationStateFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl From<ActivationStateFlags> for glib::Value {
    #[inline]
    fn from(v: ActivationStateFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// #NMBluetoothCapabilities values indicate the usable capabilities of a
    /// Bluetooth device.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMBluetoothCapabilities")]
    pub struct BluetoothCapabilities: u32 {
        /// device has no usable capabilities
        #[doc(alias = "NM_BT_CAPABILITY_NONE")]
        const NONE = ffi::NM_BT_CAPABILITY_NONE as _;
        /// device provides Dial-Up Networking capability
        #[doc(alias = "NM_BT_CAPABILITY_DUN")]
        const DUN = ffi::NM_BT_CAPABILITY_DUN as _;
        /// device provides Network Access Point capability
        #[doc(alias = "NM_BT_CAPABILITY_NAP")]
        const NAP = ffi::NM_BT_CAPABILITY_NAP as _;
    }
}

#[doc(hidden)]
impl IntoGlib for BluetoothCapabilities {
    type GlibType = ffi::NMBluetoothCapabilities;

    #[inline]
    fn into_glib(self) -> ffi::NMBluetoothCapabilities {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMBluetoothCapabilities> for BluetoothCapabilities {
    #[inline]
    unsafe fn from_glib(value: ffi::NMBluetoothCapabilities) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for BluetoothCapabilities {
    #[inline]
    #[doc(alias = "nm_bluetooth_capabilities_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_bluetooth_capabilities_get_type()) }
    }
}

impl glib::HasParamSpec for BluetoothCapabilities {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for BluetoothCapabilities {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for BluetoothCapabilities {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for BluetoothCapabilities {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<BluetoothCapabilities> for glib::Value {
    #[inline]
    fn from(v: BluetoothCapabilities) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_12")]
bitflags! {
    /// The flags for CheckpointCreate call
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMCheckpointCreateFlags")]
    pub struct CheckpointCreateFlags: u32 {
        /// no flags
        #[doc(alias = "NM_CHECKPOINT_CREATE_FLAG_NONE")]
        const NONE = ffi::NM_CHECKPOINT_CREATE_FLAG_NONE as _;
        /// when creating
        ///   a new checkpoint, destroy all existing ones.
        #[doc(alias = "NM_CHECKPOINT_CREATE_FLAG_DESTROY_ALL")]
        const DESTROY_ALL = ffi::NM_CHECKPOINT_CREATE_FLAG_DESTROY_ALL as _;
        /// upon rollback,
        ///   delete any new connection added after the checkpoint. Since: 1.6.
        #[doc(alias = "NM_CHECKPOINT_CREATE_FLAG_DELETE_NEW_CONNECTIONS")]
        const DELETE_NEW_CONNECTIONS = ffi::NM_CHECKPOINT_CREATE_FLAG_DELETE_NEW_CONNECTIONS as _;
        /// upon rollback,
        ///   disconnect any new device appeared after the checkpoint. Since: 1.6.
        #[doc(alias = "NM_CHECKPOINT_CREATE_FLAG_DISCONNECT_NEW_DEVICES")]
        const DISCONNECT_NEW_DEVICES = ffi::NM_CHECKPOINT_CREATE_FLAG_DISCONNECT_NEW_DEVICES as _;
        /// by default, creating
        ///   a checkpoint fails if there are already existing checkpoints that
        ///   reference the same devices. With this flag, creation of such
        ///   checkpoints is allowed, however, if an older checkpoint
        ///   that references overlapping devices gets rolled back, it will
        ///   automatically destroy this checkpoint during rollback. This
        ///   allows one to create several overlapping checkpoints in parallel,
        ///   and rollback to them at will. With the special case that
        ///   rolling back to an older checkpoint will invalidate all
        ///   overlapping younger checkpoints. This opts-in that the
        ///   checkpoint can be automatically destroyed by the rollback
        ///   of an older checkpoint. Since: 1.12.
        #[doc(alias = "NM_CHECKPOINT_CREATE_FLAG_ALLOW_OVERLAPPING")]
        const ALLOW_OVERLAPPING = ffi::NM_CHECKPOINT_CREATE_FLAG_ALLOW_OVERLAPPING as _;
        /// during rollback,
        ///   by default externally added ports attached to bridge devices are preserved.
        ///   With this flag, the rollback detaches all external ports.
        ///   This only has an effect for bridge ports. Before 1.38, this was the default
        ///   behavior. Since: 1.38.
        #[doc(alias = "NM_CHECKPOINT_CREATE_FLAG_NO_PRESERVE_EXTERNAL_PORTS")]
        const NO_PRESERVE_EXTERNAL_PORTS = ffi::NM_CHECKPOINT_CREATE_FLAG_NO_PRESERVE_EXTERNAL_PORTS as _;
        /// during rollback,
        ///   by default changes to global DNS via D-BUS interface are preserved.
        ///   With this flag, the rollback reverts the global DNS changes made via D-Bus
        ///   interface. Global DNS defined in [global-dns] section of
        ///   NetworkManager.conf is not impacted by this flag. Since: 1.48.
        #[doc(alias = "NM_CHECKPOINT_CREATE_FLAG_TRACK_INTERNAL_GLOBAL_DNS")]
        const TRACK_INTERNAL_GLOBAL_DNS = ffi::NM_CHECKPOINT_CREATE_FLAG_TRACK_INTERNAL_GLOBAL_DNS as _;
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl IntoGlib for CheckpointCreateFlags {
    type GlibType = ffi::NMCheckpointCreateFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMCheckpointCreateFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl FromGlib<ffi::NMCheckpointCreateFlags> for CheckpointCreateFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMCheckpointCreateFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl StaticType for CheckpointCreateFlags {
    #[inline]
    #[doc(alias = "nm_checkpoint_create_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_checkpoint_create_flags_get_type()) }
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::HasParamSpec for CheckpointCreateFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::value::ValueType for CheckpointCreateFlags {
    type Type = Self;
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
unsafe impl<'a> glib::value::FromValue<'a> for CheckpointCreateFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl ToValue for CheckpointCreateFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl From<CheckpointCreateFlags> for glib::Value {
    #[inline]
    fn from(v: CheckpointCreateFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_24")]
bitflags! {
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMClientInstanceFlags")]
    pub struct ClientInstanceFlags: u32 {
        /// special value to indicate no flags.
        #[doc(alias = "NM_CLIENT_INSTANCE_FLAGS_NONE")]
        const NONE = ffi::NM_CLIENT_INSTANCE_FLAGS_NONE as _;
        /// by default, NMClient
        ///   will fetch the permissions via "GetPermissions" and refetch them when
        ///   "CheckPermissions" signal gets received. By setting this flag, this behavior
        ///   can be disabled. You can toggle this flag to enable and disable automatic
        ///   fetching of the permissions. Watch also nm_client_get_permissions_state()
        ///   to know whether the permissions are up to date.
        #[doc(alias = "NM_CLIENT_INSTANCE_FLAGS_NO_AUTO_FETCH_PERMISSIONS")]
        const NO_AUTO_FETCH_PERMISSIONS = ffi::NM_CLIENT_INSTANCE_FLAGS_NO_AUTO_FETCH_PERMISSIONS as _;
        /// as #NMClient is an GInitable
        ///   and GAsyncInitable, nm_client_get_instance_flags() returns this flag
        ///   once initialization completed with success. This flag cannot be set
        ///   as NM_CLIENT_INSTANCE_FLAGS property. Since: 1.42.
        #[doc(alias = "NM_CLIENT_INSTANCE_FLAGS_INITIALIZED_GOOD")]
        const INITIALIZED_GOOD = ffi::NM_CLIENT_INSTANCE_FLAGS_INITIALIZED_GOOD as _;
        /// like @NM_CLIENT_INSTANCE_FLAGS_INITIALIZED_GOOD
        ///   indicates that the instance completed initialization with failure. In that
        ///   case the instance is unusable. Since: 1.42.
        #[doc(alias = "NM_CLIENT_INSTANCE_FLAGS_INITIALIZED_BAD")]
        const INITIALIZED_BAD = ffi::NM_CLIENT_INSTANCE_FLAGS_INITIALIZED_BAD as _;
    }
}

#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(hidden)]
impl IntoGlib for ClientInstanceFlags {
    type GlibType = ffi::NMClientInstanceFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMClientInstanceFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(hidden)]
impl FromGlib<ffi::NMClientInstanceFlags> for ClientInstanceFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMClientInstanceFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
impl StaticType for ClientInstanceFlags {
    #[inline]
    #[doc(alias = "nm_client_instance_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_client_instance_flags_get_type()) }
    }
}

#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
impl glib::HasParamSpec for ClientInstanceFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
impl glib::value::ValueType for ClientInstanceFlags {
    type Type = Self;
}

#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
unsafe impl<'a> glib::value::FromValue<'a> for ClientInstanceFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
impl ToValue for ClientInstanceFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
impl From<ClientInstanceFlags> for glib::Value {
    #[inline]
    fn from(v: ClientInstanceFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// These flags determine which properties are serialized when calling
    /// nm_connection_to_dbus().
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMConnectionSerializationFlags")]
    pub struct ConnectionSerializationFlags: u32 {
        /// serialize all properties (including secrets)
        #[doc(alias = "NM_CONNECTION_SERIALIZE_ALL")]
        const ALL = ffi::NM_CONNECTION_SERIALIZE_ALL as _;
        /// serialize properties that are
        ///   not secrets. Since 1.32.
        #[doc(alias = "NM_CONNECTION_SERIALIZE_WITH_NON_SECRET")]
        const WITH_NON_SECRET = ffi::NM_CONNECTION_SERIALIZE_WITH_NON_SECRET as _;
        /// this is a deprecated alias for
        ///   @NM_CONNECTION_SERIALIZE_WITH_NON_SECRET.
        #[doc(alias = "NM_CONNECTION_SERIALIZE_NO_SECRETS")]
        const NO_SECRETS = ffi::NM_CONNECTION_SERIALIZE_NO_SECRETS as _;
        /// serialize all secrets. This flag is
        ///   ignored if any of @NM_CONNECTION_SERIALIZE_WITH_SECRETS_AGENT_OWNED,
        ///   @NM_CONNECTION_SERIALIZE_WITH_SECRETS_SYSTEM_OWNED or
        ///   @NM_CONNECTION_SERIALIZE_WITH_SECRETS_NOT_SAVED is set. Since 1.32.
        #[doc(alias = "NM_CONNECTION_SERIALIZE_WITH_SECRETS")]
        const WITH_SECRETS = ffi::NM_CONNECTION_SERIALIZE_WITH_SECRETS as _;
        /// a deprecated alias for
        ///   @NM_CONNECTION_SERIALIZE_WITH_SECRETS.
        #[doc(alias = "NM_CONNECTION_SERIALIZE_ONLY_SECRETS")]
        const ONLY_SECRETS = ffi::NM_CONNECTION_SERIALIZE_ONLY_SECRETS as _;
        /// serialize agent-owned
        ///   secrets. Since: 1.20.
        #[doc(alias = "NM_CONNECTION_SERIALIZE_WITH_SECRETS_AGENT_OWNED")]
        const WITH_SECRETS_AGENT_OWNED = ffi::NM_CONNECTION_SERIALIZE_WITH_SECRETS_AGENT_OWNED as _;
        /// serialize system-owned
        ///   secrets. Since: 1.32.
        #[doc(alias = "NM_CONNECTION_SERIALIZE_WITH_SECRETS_SYSTEM_OWNED")]
        const WITH_SECRETS_SYSTEM_OWNED = ffi::NM_CONNECTION_SERIALIZE_WITH_SECRETS_SYSTEM_OWNED as _;
        /// serialize secrets that
        ///   are marked as never saved. Since: 1.32.
        #[doc(alias = "NM_CONNECTION_SERIALIZE_WITH_SECRETS_NOT_SAVED")]
        const WITH_SECRETS_NOT_SAVED = ffi::NM_CONNECTION_SERIALIZE_WITH_SECRETS_NOT_SAVED as _;
    }
}

#[doc(hidden)]
impl IntoGlib for ConnectionSerializationFlags {
    type GlibType = ffi::NMConnectionSerializationFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMConnectionSerializationFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMConnectionSerializationFlags> for ConnectionSerializationFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMConnectionSerializationFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for ConnectionSerializationFlags {
    #[inline]
    #[doc(alias = "nm_connection_serialization_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_connection_serialization_flags_get_type()) }
    }
}

impl glib::HasParamSpec for ConnectionSerializationFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for ConnectionSerializationFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for ConnectionSerializationFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for ConnectionSerializationFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<ConnectionSerializationFlags> for glib::Value {
    #[inline]
    fn from(v: ConnectionSerializationFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// General device capability flags.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMDeviceCapabilities")]
    pub struct DeviceCapabilities: u32 {
        /// device has no special capabilities
        #[doc(alias = "NM_DEVICE_CAP_NONE")]
        const NONE = ffi::NM_DEVICE_CAP_NONE as _;
        /// NetworkManager supports this device
        #[doc(alias = "NM_DEVICE_CAP_NM_SUPPORTED")]
        const NM_SUPPORTED = ffi::NM_DEVICE_CAP_NM_SUPPORTED as _;
        /// this device can indicate carrier status
        #[doc(alias = "NM_DEVICE_CAP_CARRIER_DETECT")]
        const CARRIER_DETECT = ffi::NM_DEVICE_CAP_CARRIER_DETECT as _;
        /// this device is a software device
        #[doc(alias = "NM_DEVICE_CAP_IS_SOFTWARE")]
        const IS_SOFTWARE = ffi::NM_DEVICE_CAP_IS_SOFTWARE as _;
        /// this device supports single-root I/O virtualization
        #[doc(alias = "NM_DEVICE_CAP_SRIOV")]
        const SRIOV = ffi::NM_DEVICE_CAP_SRIOV as _;
    }
}

#[doc(hidden)]
impl IntoGlib for DeviceCapabilities {
    type GlibType = ffi::NMDeviceCapabilities;

    #[inline]
    fn into_glib(self) -> ffi::NMDeviceCapabilities {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMDeviceCapabilities> for DeviceCapabilities {
    #[inline]
    unsafe fn from_glib(value: ffi::NMDeviceCapabilities) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for DeviceCapabilities {
    #[inline]
    #[doc(alias = "nm_device_capabilities_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_device_capabilities_get_type()) }
    }
}

impl glib::HasParamSpec for DeviceCapabilities {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for DeviceCapabilities {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for DeviceCapabilities {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for DeviceCapabilities {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<DeviceCapabilities> for glib::Value {
    #[inline]
    fn from(v: DeviceCapabilities) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_22")]
bitflags! {
    /// Flags for a network interface.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMDeviceInterfaceFlags")]
    pub struct DeviceInterfaceFlags: u32 {
        /// the interface is enabled from the
        ///   administrative point of view. Corresponds to kernel IFF_UP.
        #[doc(alias = "NM_DEVICE_INTERFACE_FLAG_UP")]
        const UP = ffi::NM_DEVICE_INTERFACE_FLAG_UP as _;
        /// the physical link is up. Corresponds
        ///   to kernel IFF_LOWER_UP.
        #[doc(alias = "NM_DEVICE_INTERFACE_FLAG_LOWER_UP")]
        const LOWER_UP = ffi::NM_DEVICE_INTERFACE_FLAG_LOWER_UP as _;
        /// receive all packets. Corresponds to
        ///   kernel IFF_PROMISC. Since: 1.32.
        #[doc(alias = "NM_DEVICE_INTERFACE_FLAG_PROMISC")]
        const PROMISC = ffi::NM_DEVICE_INTERFACE_FLAG_PROMISC as _;
        /// the interface has carrier. In most
        ///   cases this is equal to the value of @NM_DEVICE_INTERFACE_FLAG_LOWER_UP.
        ///   However some devices have a non-standard carrier detection mechanism.
        #[doc(alias = "NM_DEVICE_INTERFACE_FLAG_CARRIER")]
        const CARRIER = ffi::NM_DEVICE_INTERFACE_FLAG_CARRIER as _;
        /// the flag to indicate device
        ///   LLDP status. Since: 1.32.
        #[doc(alias = "NM_DEVICE_INTERFACE_FLAG_LLDP_CLIENT_ENABLED")]
        const LLDP_CLIENT_ENABLED = ffi::NM_DEVICE_INTERFACE_FLAG_LLDP_CLIENT_ENABLED as _;
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl IntoGlib for DeviceInterfaceFlags {
    type GlibType = ffi::NMDeviceInterfaceFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMDeviceInterfaceFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl FromGlib<ffi::NMDeviceInterfaceFlags> for DeviceInterfaceFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMDeviceInterfaceFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl StaticType for DeviceInterfaceFlags {
    #[inline]
    #[doc(alias = "nm_device_interface_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_device_interface_flags_get_type()) }
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::HasParamSpec for DeviceInterfaceFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::value::ValueType for DeviceInterfaceFlags {
    type Type = Self;
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
unsafe impl<'a> glib::value::FromValue<'a> for DeviceInterfaceFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl ToValue for DeviceInterfaceFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl From<DeviceInterfaceFlags> for glib::Value {
    #[inline]
    fn from(v: DeviceInterfaceFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// #NMDeviceModemCapabilities values indicate the generic radio access
    /// technology families a modem device supports.  For more information on the
    /// specific access technologies the device supports use the ModemManager D-Bus
    /// API.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMDeviceModemCapabilities")]
    pub struct DeviceModemCapabilities: u32 {
        /// modem has no usable capabilities
        #[doc(alias = "NM_DEVICE_MODEM_CAPABILITY_NONE")]
        const NONE = ffi::NM_DEVICE_MODEM_CAPABILITY_NONE as _;
        /// modem uses the analog wired telephone
        /// network and is not a wireless/cellular device
        #[doc(alias = "NM_DEVICE_MODEM_CAPABILITY_POTS")]
        const POTS = ffi::NM_DEVICE_MODEM_CAPABILITY_POTS as _;
        /// modem supports at least one of CDMA
        /// 1xRTT, EVDO revision 0, EVDO revision A, or EVDO revision B
        #[doc(alias = "NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO")]
        const CDMA_EVDO = ffi::NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO as _;
        /// modem supports at least one of GSM,
        /// GPRS, EDGE, UMTS, HSDPA, HSUPA, or HSPA+ packet switched data capability
        #[doc(alias = "NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS")]
        const GSM_UMTS = ffi::NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS as _;
        /// modem has LTE data capability
        #[doc(alias = "NM_DEVICE_MODEM_CAPABILITY_LTE")]
        const LTE = ffi::NM_DEVICE_MODEM_CAPABILITY_LTE as _;
        /// modem has 5GNR data capability. Since: 1.36.
        #[doc(alias = "NM_DEVICE_MODEM_CAPABILITY_5GNR")]
        const _5GNR = ffi::NM_DEVICE_MODEM_CAPABILITY_5GNR as _;
    }
}

#[doc(hidden)]
impl IntoGlib for DeviceModemCapabilities {
    type GlibType = ffi::NMDeviceModemCapabilities;

    #[inline]
    fn into_glib(self) -> ffi::NMDeviceModemCapabilities {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMDeviceModemCapabilities> for DeviceModemCapabilities {
    #[inline]
    unsafe fn from_glib(value: ffi::NMDeviceModemCapabilities) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for DeviceModemCapabilities {
    #[inline]
    #[doc(alias = "nm_device_modem_capabilities_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_device_modem_capabilities_get_type()) }
    }
}

impl glib::HasParamSpec for DeviceModemCapabilities {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for DeviceModemCapabilities {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for DeviceModemCapabilities {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for DeviceModemCapabilities {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<DeviceModemCapabilities> for glib::Value {
    #[inline]
    fn from(v: DeviceModemCapabilities) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_42")]
bitflags! {
    /// Flags for the Reapply() D-Bus call of a device and
    /// nm_device_reapply_async().
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMDeviceReapplyFlags")]
    pub struct DeviceReapplyFlags: u32 {
        /// no flag set.
        #[doc(alias = "NM_DEVICE_REAPPLY_FLAGS_NONE")]
        const NONE = ffi::NM_DEVICE_REAPPLY_FLAGS_NONE as _;
        /// during reapply,
        ///   preserve external IP addresses and routes.
        #[doc(alias = "NM_DEVICE_REAPPLY_FLAGS_PRESERVE_EXTERNAL_IP")]
        const PRESERVE_EXTERNAL_IP = ffi::NM_DEVICE_REAPPLY_FLAGS_PRESERVE_EXTERNAL_IP as _;
    }
}

#[cfg(feature = "v1_42")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
#[doc(hidden)]
impl IntoGlib for DeviceReapplyFlags {
    type GlibType = ffi::NMDeviceReapplyFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMDeviceReapplyFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_42")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
#[doc(hidden)]
impl FromGlib<ffi::NMDeviceReapplyFlags> for DeviceReapplyFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMDeviceReapplyFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_42")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
impl StaticType for DeviceReapplyFlags {
    #[inline]
    #[doc(alias = "nm_device_reapply_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_device_reapply_flags_get_type()) }
    }
}

#[cfg(feature = "v1_42")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
impl glib::HasParamSpec for DeviceReapplyFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_42")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
impl glib::value::ValueType for DeviceReapplyFlags {
    type Type = Self;
}

#[cfg(feature = "v1_42")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
unsafe impl<'a> glib::value::FromValue<'a> for DeviceReapplyFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_42")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
impl ToValue for DeviceReapplyFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_42")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_42")))]
impl From<DeviceReapplyFlags> for glib::Value {
    #[inline]
    fn from(v: DeviceReapplyFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// 802.11 specific device encryption and authentication capabilities.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMDeviceWifiCapabilities")]
    pub struct DeviceWifiCapabilities: u32 {
        /// device has no encryption/authentication capabilities
        #[doc(alias = "NM_WIFI_DEVICE_CAP_NONE")]
        const NONE = ffi::NM_WIFI_DEVICE_CAP_NONE as _;
        /// device supports 40/64-bit WEP encryption
        #[doc(alias = "NM_WIFI_DEVICE_CAP_CIPHER_WEP40")]
        const CIPHER_WEP40 = ffi::NM_WIFI_DEVICE_CAP_CIPHER_WEP40 as _;
        /// device supports 104/128-bit WEP encryption
        #[doc(alias = "NM_WIFI_DEVICE_CAP_CIPHER_WEP104")]
        const CIPHER_WEP104 = ffi::NM_WIFI_DEVICE_CAP_CIPHER_WEP104 as _;
        /// device supports TKIP encryption
        #[doc(alias = "NM_WIFI_DEVICE_CAP_CIPHER_TKIP")]
        const CIPHER_TKIP = ffi::NM_WIFI_DEVICE_CAP_CIPHER_TKIP as _;
        /// device supports AES/CCMP encryption
        #[doc(alias = "NM_WIFI_DEVICE_CAP_CIPHER_CCMP")]
        const CIPHER_CCMP = ffi::NM_WIFI_DEVICE_CAP_CIPHER_CCMP as _;
        /// device supports WPA1 authentication
        #[doc(alias = "NM_WIFI_DEVICE_CAP_WPA")]
        const WPA = ffi::NM_WIFI_DEVICE_CAP_WPA as _;
        /// device supports WPA2/RSN authentication
        #[doc(alias = "NM_WIFI_DEVICE_CAP_RSN")]
        const RSN = ffi::NM_WIFI_DEVICE_CAP_RSN as _;
        /// device supports Access Point mode
        #[doc(alias = "NM_WIFI_DEVICE_CAP_AP")]
        const AP = ffi::NM_WIFI_DEVICE_CAP_AP as _;
        /// device supports Ad-Hoc mode
        #[doc(alias = "NM_WIFI_DEVICE_CAP_ADHOC")]
        const ADHOC = ffi::NM_WIFI_DEVICE_CAP_ADHOC as _;
        /// device reports frequency capabilities
        #[doc(alias = "NM_WIFI_DEVICE_CAP_FREQ_VALID")]
        const FREQ_VALID = ffi::NM_WIFI_DEVICE_CAP_FREQ_VALID as _;
        /// device supports 2.4GHz frequencies
        #[doc(alias = "NM_WIFI_DEVICE_CAP_FREQ_2GHZ")]
        const FREQ_2GHZ = ffi::NM_WIFI_DEVICE_CAP_FREQ_2GHZ as _;
        /// device supports 5GHz frequencies
        #[doc(alias = "NM_WIFI_DEVICE_CAP_FREQ_5GHZ")]
        const FREQ_5GHZ = ffi::NM_WIFI_DEVICE_CAP_FREQ_5GHZ as _;
        /// device supports 6GHz frequencies. Since: 1.46.
        #[doc(alias = "NM_WIFI_DEVICE_CAP_FREQ_6GHZ")]
        const FREQ_6GHZ = ffi::NM_WIFI_DEVICE_CAP_FREQ_6GHZ as _;
        /// device supports acting as a mesh point. Since: 1.20.
        #[doc(alias = "NM_WIFI_DEVICE_CAP_MESH")]
        const MESH = ffi::NM_WIFI_DEVICE_CAP_MESH as _;
        /// device supports WPA2/RSN in an IBSS network. Since: 1.22.
        #[doc(alias = "NM_WIFI_DEVICE_CAP_IBSS_RSN")]
        const IBSS_RSN = ffi::NM_WIFI_DEVICE_CAP_IBSS_RSN as _;
    }
}

#[doc(hidden)]
impl IntoGlib for DeviceWifiCapabilities {
    type GlibType = ffi::NMDeviceWifiCapabilities;

    #[inline]
    fn into_glib(self) -> ffi::NMDeviceWifiCapabilities {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMDeviceWifiCapabilities> for DeviceWifiCapabilities {
    #[inline]
    unsafe fn from_glib(value: ffi::NMDeviceWifiCapabilities) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for DeviceWifiCapabilities {
    #[inline]
    #[doc(alias = "nm_device_wifi_capabilities_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_device_wifi_capabilities_get_type()) }
    }
}

impl glib::HasParamSpec for DeviceWifiCapabilities {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for DeviceWifiCapabilities {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for DeviceWifiCapabilities {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for DeviceWifiCapabilities {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<DeviceWifiCapabilities> for glib::Value {
    #[inline]
    fn from(v: DeviceWifiCapabilities) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_22")]
bitflags! {
    /// #NMDhcpHostnameFlags describe flags related to the DHCP hostname and
    /// FQDN.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMDhcpHostnameFlags")]
    pub struct DhcpHostnameFlags: u32 {
        /// no flag set. The default value from
        ///   Networkmanager global configuration is used. If such value is unset
        ///   or still zero, the DHCP request will use standard FQDN flags, i.e.
        ///   [`FQDN_SERV_UPDATE`][Self::FQDN_SERV_UPDATE] and
        ///   [`FQDN_ENCODED`][Self::FQDN_ENCODED] for IPv4 and
        ///   [`FQDN_SERV_UPDATE`][Self::FQDN_SERV_UPDATE] for IPv6.
        #[doc(alias = "NM_DHCP_HOSTNAME_FLAG_NONE")]
        const NONE = ffi::NM_DHCP_HOSTNAME_FLAG_NONE as _;
        /// whether the server should
        ///   do the A RR (FQDN-to-address) DNS updates.
        #[doc(alias = "NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE")]
        const FQDN_SERV_UPDATE = ffi::NM_DHCP_HOSTNAME_FLAG_FQDN_SERV_UPDATE as _;
        /// if set, the FQDN is encoded
        ///   using canonical wire format. Otherwise it uses the deprecated
        ///   ASCII encoding. This flag is allowed only for DHCPv4.
        #[doc(alias = "NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED")]
        const FQDN_ENCODED = ffi::NM_DHCP_HOSTNAME_FLAG_FQDN_ENCODED as _;
        /// when not set, request the
        ///   server to perform updates (the PTR RR and possibly the A RR
        ///   based on the [`FQDN_SERV_UPDATE`][Self::FQDN_SERV_UPDATE] flag). If
        ///   this is set, the [`FQDN_SERV_UPDATE`][Self::FQDN_SERV_UPDATE] flag
        ///   should be cleared.
        #[doc(alias = "NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE")]
        const FQDN_NO_UPDATE = ffi::NM_DHCP_HOSTNAME_FLAG_FQDN_NO_UPDATE as _;
        /// when set, no FQDN flags are
        ///   sent in the DHCP FQDN option. When cleared and all other FQDN
        ///   flags are zero, standard FQDN flags are sent. This flag is
        ///   incompatible with any other FQDN flag.
        #[doc(alias = "NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS")]
        const FQDN_CLEAR_FLAGS = ffi::NM_DHCP_HOSTNAME_FLAG_FQDN_CLEAR_FLAGS as _;
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl IntoGlib for DhcpHostnameFlags {
    type GlibType = ffi::NMDhcpHostnameFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMDhcpHostnameFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl FromGlib<ffi::NMDhcpHostnameFlags> for DhcpHostnameFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMDhcpHostnameFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl StaticType for DhcpHostnameFlags {
    #[inline]
    #[doc(alias = "nm_dhcp_hostname_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_dhcp_hostname_flags_get_type()) }
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::HasParamSpec for DhcpHostnameFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::value::ValueType for DhcpHostnameFlags {
    type Type = Self;
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
unsafe impl<'a> glib::value::FromValue<'a> for DhcpHostnameFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl ToValue for DhcpHostnameFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl From<DhcpHostnameFlags> for glib::Value {
    #[inline]
    fn from(v: DhcpHostnameFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_22")]
bitflags! {
    /// Compare flags for nm_ip_address_cmp_full().
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMIPAddressCmpFlags")]
    pub struct IPAddressCmpFlags: u32 {
        /// no flags.
        #[doc(alias = "NM_IP_ADDRESS_CMP_FLAGS_NONE")]
        const NONE = ffi::NM_IP_ADDRESS_CMP_FLAGS_NONE as _;
        /// when comparing two addresses,
        ///   also consider their attributes. Warning: note that attributes are GVariants
        ///   and they don't have a total order. In other words, if the address differs only
        ///   by their attributes, the returned compare order is not total. In that case,
        ///   the return value merely indicates equality (zero) or inequality.
        #[doc(alias = "NM_IP_ADDRESS_CMP_FLAGS_WITH_ATTRS")]
        const WITH_ATTRS = ffi::NM_IP_ADDRESS_CMP_FLAGS_WITH_ATTRS as _;
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl IntoGlib for IPAddressCmpFlags {
    type GlibType = ffi::NMIPAddressCmpFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMIPAddressCmpFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl FromGlib<ffi::NMIPAddressCmpFlags> for IPAddressCmpFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMIPAddressCmpFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl StaticType for IPAddressCmpFlags {
    #[inline]
    #[doc(alias = "nm_ip_address_cmp_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_ip_address_cmp_flags_get_type()) }
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::HasParamSpec for IPAddressCmpFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::value::ValueType for IPAddressCmpFlags {
    type Type = Self;
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
unsafe impl<'a> glib::value::FromValue<'a> for IPAddressCmpFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl ToValue for IPAddressCmpFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl From<IPAddressCmpFlags> for glib::Value {
    #[inline]
    fn from(v: IPAddressCmpFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_18")]
bitflags! {
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMIPRoutingRuleAsStringFlags")]
    pub struct IPRoutingRuleAsStringFlags: u32 {
        /// no flags selected.
        #[doc(alias = "NM_IP_ROUTING_RULE_AS_STRING_FLAGS_NONE")]
        const NONE = ffi::NM_IP_ROUTING_RULE_AS_STRING_FLAGS_NONE as _;
        /// whether to allow parsing
        ///   IPv4 addresses.
        #[doc(alias = "NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET")]
        const AF_INET = ffi::NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET as _;
        /// whether to allow parsing
        ///   IPv6 addresses. If both @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET and
        ///   @NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET6 are unset, it's the same
        ///   as setting them both.
        #[doc(alias = "NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET6")]
        const AF_INET6 = ffi::NM_IP_ROUTING_RULE_AS_STRING_FLAGS_AF_INET6 as _;
        /// if set, ensure that the
        ///   rule verfies or fail.
        #[doc(alias = "NM_IP_ROUTING_RULE_AS_STRING_FLAGS_VALIDATE")]
        const VALIDATE = ffi::NM_IP_ROUTING_RULE_AS_STRING_FLAGS_VALIDATE as _;
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(hidden)]
impl IntoGlib for IPRoutingRuleAsStringFlags {
    type GlibType = ffi::NMIPRoutingRuleAsStringFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMIPRoutingRuleAsStringFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
#[doc(hidden)]
impl FromGlib<ffi::NMIPRoutingRuleAsStringFlags> for IPRoutingRuleAsStringFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMIPRoutingRuleAsStringFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl StaticType for IPRoutingRuleAsStringFlags {
    #[inline]
    #[doc(alias = "nm_ip_routing_rule_as_string_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_ip_routing_rule_as_string_flags_get_type()) }
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl glib::HasParamSpec for IPRoutingRuleAsStringFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl glib::value::ValueType for IPRoutingRuleAsStringFlags {
    type Type = Self;
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
unsafe impl<'a> glib::value::FromValue<'a> for IPRoutingRuleAsStringFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl ToValue for IPRoutingRuleAsStringFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_18")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
impl From<IPRoutingRuleAsStringFlags> for glib::Value {
    #[inline]
    fn from(v: IPRoutingRuleAsStringFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_12")]
bitflags! {
    /// IP tunnel flags.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMIPTunnelFlags")]
    pub struct IPTunnelFlags: u32 {
        /// no flag
        #[doc(alias = "NM_IP_TUNNEL_FLAG_NONE")]
        const NONE = ffi::NM_IP_TUNNEL_FLAG_NONE as _;
        /// don't add encapsulation limit
        ///     if one isn't present in inner packet
        #[doc(alias = "NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT")]
        const IP6_IGN_ENCAP_LIMIT = ffi::NM_IP_TUNNEL_FLAG_IP6_IGN_ENCAP_LIMIT as _;
        /// copy the traffic class field
        ///     from the inner packet
        #[doc(alias = "NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_TCLASS")]
        const IP6_USE_ORIG_TCLASS = ffi::NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_TCLASS as _;
        /// copy the flowlabel from the
        ///     inner packet
        #[doc(alias = "NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FLOWLABEL")]
        const IP6_USE_ORIG_FLOWLABEL = ffi::NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FLOWLABEL as _;
        /// used for Mobile IPv6
        #[doc(alias = "NM_IP_TUNNEL_FLAG_IP6_MIP6_DEV")]
        const IP6_MIP6_DEV = ffi::NM_IP_TUNNEL_FLAG_IP6_MIP6_DEV as _;
        /// copy DSCP from the outer packet
        #[doc(alias = "NM_IP_TUNNEL_FLAG_IP6_RCV_DSCP_COPY")]
        const IP6_RCV_DSCP_COPY = ffi::NM_IP_TUNNEL_FLAG_IP6_RCV_DSCP_COPY as _;
        /// copy fwmark from inner packet
        #[doc(alias = "NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FWMARK")]
        const IP6_USE_ORIG_FWMARK = ffi::NM_IP_TUNNEL_FLAG_IP6_USE_ORIG_FWMARK as _;
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl IntoGlib for IPTunnelFlags {
    type GlibType = ffi::NMIPTunnelFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMIPTunnelFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl FromGlib<ffi::NMIPTunnelFlags> for IPTunnelFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMIPTunnelFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl StaticType for IPTunnelFlags {
    #[inline]
    #[doc(alias = "nm_ip_tunnel_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_ip_tunnel_flags_get_type()) }
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::HasParamSpec for IPTunnelFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::value::ValueType for IPTunnelFlags {
    type Type = Self;
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
unsafe impl<'a> glib::value::FromValue<'a> for IPTunnelFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl ToValue for IPTunnelFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl From<IPTunnelFlags> for glib::Value {
    #[inline]
    fn from(v: IPTunnelFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_30")]
bitflags! {
    /// Flags for customizing nm_keyfile_read() and nm_keyfile_write().
    ///
    /// Currently no flags are implemented.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMKeyfileHandlerFlags")]
    pub struct KeyfileHandlerFlags: u32 {
        /// no flags set.
        #[doc(alias = "NM_KEYFILE_HANDLER_FLAGS_NONE")]
        const NONE = ffi::NM_KEYFILE_HANDLER_FLAGS_NONE as _;
    }
}

#[cfg(feature = "v1_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
#[doc(hidden)]
impl IntoGlib for KeyfileHandlerFlags {
    type GlibType = ffi::NMKeyfileHandlerFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMKeyfileHandlerFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
#[doc(hidden)]
impl FromGlib<ffi::NMKeyfileHandlerFlags> for KeyfileHandlerFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMKeyfileHandlerFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
impl StaticType for KeyfileHandlerFlags {
    #[inline]
    #[doc(alias = "nm_keyfile_handler_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_keyfile_handler_flags_get_type()) }
    }
}

#[cfg(feature = "v1_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
impl glib::HasParamSpec for KeyfileHandlerFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
impl glib::value::ValueType for KeyfileHandlerFlags {
    type Type = Self;
}

#[cfg(feature = "v1_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
unsafe impl<'a> glib::value::FromValue<'a> for KeyfileHandlerFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
impl ToValue for KeyfileHandlerFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_30")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
impl From<KeyfileHandlerFlags> for glib::Value {
    #[inline]
    fn from(v: KeyfileHandlerFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_22")]
bitflags! {
    /// Flags for the manager Reload() call.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMManagerReloadFlags")]
    pub struct ManagerReloadFlags: u32 {
        /// reload the NetworkManager.conf configuration
        ///   from disk. Note that this does not include connections, which can be
        ///   reloaded via Setting's ReloadConnections().
        #[doc(alias = "NM_MANAGER_RELOAD_FLAG_CONF")]
        const CONF = ffi::NM_MANAGER_RELOAD_FLAG_CONF as _;
        /// update DNS configuration, which usually
        ///   involves writing /etc/resolv.conf anew.
        #[doc(alias = "NM_MANAGER_RELOAD_FLAG_DNS_RC")]
        const DNS_RC = ffi::NM_MANAGER_RELOAD_FLAG_DNS_RC as _;
        /// means to restart the DNS plugin. This
        ///   is for example useful when using dnsmasq plugin, which uses additional
        ///   configuration in /etc/NetworkManager/dnsmasq.d. If you edit those files,
        ///   you can restart the DNS plugin. This action shortly interrupts name
        ///   resolution.
        #[doc(alias = "NM_MANAGER_RELOAD_FLAG_DNS_FULL")]
        const DNS_FULL = ffi::NM_MANAGER_RELOAD_FLAG_DNS_FULL as _;
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl IntoGlib for ManagerReloadFlags {
    type GlibType = ffi::NMManagerReloadFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMManagerReloadFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
#[doc(hidden)]
impl FromGlib<ffi::NMManagerReloadFlags> for ManagerReloadFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMManagerReloadFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl StaticType for ManagerReloadFlags {
    #[inline]
    #[doc(alias = "nm_manager_reload_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_manager_reload_flags_get_type()) }
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::HasParamSpec for ManagerReloadFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl glib::value::ValueType for ManagerReloadFlags {
    type Type = Self;
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
unsafe impl<'a> glib::value::FromValue<'a> for ManagerReloadFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl ToValue for ManagerReloadFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_22")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
impl From<ManagerReloadFlags> for glib::Value {
    #[inline]
    fn from(v: ManagerReloadFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_40")]
bitflags! {
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMMptcpFlags")]
    pub struct MptcpFlags: u32 {
        /// The default, meaning that no MPTCP flags are set.
        #[doc(alias = "NM_MPTCP_FLAGS_NONE")]
        const NONE = ffi::NM_MPTCP_FLAGS_NONE as _;
        /// don't configure MPTCP endpoints on the device.
        #[doc(alias = "NM_MPTCP_FLAGS_DISABLED")]
        const DISABLED = ffi::NM_MPTCP_FLAGS_DISABLED as _;
        /// MPTCP is enabled and endpoints will be configured.
        ///   This flag is implied if any of the other flags indicate that
        ///   MPTCP is enabled and therefore in most cases unnecessary.
        ///   Note that if "/proc/sys/net/mptcp/enabled" sysctl is disabled, MPTCP
        ///   handling is disabled despite this flag. This can be overruled with the
        ///   "also-without-sysctl" flag.
        ///   Note that by default interfaces that don't have a default route are
        ///   excluded from having MPTCP endpoints configured. This can be overruled
        ///   with the "also-without-default-route" and this affects endpoints
        ///   per address family.
        #[doc(alias = "NM_MPTCP_FLAGS_ENABLED")]
        const ENABLED = ffi::NM_MPTCP_FLAGS_ENABLED as _;
        /// even if MPTCP handling is enabled
        ///   via the "enabled" flag, it is ignored unless "/proc/sys/net/mptcp/enabled"
        ///   is on. With this flag, MPTCP endpoints will be configured regardless
        ///   of the sysctl setting.
        #[doc(alias = "NM_MPTCP_FLAGS_ALSO_WITHOUT_SYSCTL")]
        const ALSO_WITHOUT_SYSCTL = ffi::NM_MPTCP_FLAGS_ALSO_WITHOUT_SYSCTL as _;
        /// even if MPTCP handling is enabled
        ///   via the "enabled" flag, it is ignored per-address family unless NetworkManager
        ///   configures a default route. With this flag, NetworkManager will also configure
        ///   MPTCP endpoints if there is no default route. This takes effect per-address
        ///   family.
        #[doc(alias = "NM_MPTCP_FLAGS_ALSO_WITHOUT_DEFAULT_ROUTE")]
        const ALSO_WITHOUT_DEFAULT_ROUTE = ffi::NM_MPTCP_FLAGS_ALSO_WITHOUT_DEFAULT_ROUTE as _;
        /// Flag for the MPTCP endpoint. The endpoint will be
        ///   announced/signaled to each peer via an MPTCP ADD_ADDR sub-option.
        #[doc(alias = "NM_MPTCP_FLAGS_SIGNAL")]
        const SIGNAL = ffi::NM_MPTCP_FLAGS_SIGNAL as _;
        /// Flag for the MPTCP endpoint. If additional subflow creation
        ///   is allowed by the MPTCP limits, the MPTCP path manager will try to create an
        ///   additional subflow using this endpoint as the source address after the MPTCP connection
        ///   is established.
        #[doc(alias = "NM_MPTCP_FLAGS_SUBFLOW")]
        const SUBFLOW = ffi::NM_MPTCP_FLAGS_SUBFLOW as _;
        /// Flag for the MPTCP endpoint. If this is a subflow endpoint, the
        ///   subflows created using this endpoint will have the backup flag set during the connection
        ///   process. This flag instructs the peer to only send data on a given subflow when all
        ///   non-backup subflows are unavailable. This does not affect outgoing data,
        ///   where subflow priority is determined by the backup/non-backup flag received
        ///   from the peer
        #[doc(alias = "NM_MPTCP_FLAGS_BACKUP")]
        const BACKUP = ffi::NM_MPTCP_FLAGS_BACKUP as _;
        /// Flag for the MPTCP endpoint. If this is a subflow endpoint and additional
        ///   subflow creation is allowed by the MPTCP limits, the MPTCP path manager will try to create an
        ///   additional subflow for each known peer address, using this endpoint as the source address.
        ///   This will occur after the MPTCP connection is established. If the peer did not announce
        ///   any additional addresses using the MPTCP ADD_ADDR sub-option, this will behave the same
        ///   as a plain subflow endpoint. When the peer does announce addresses, each received ADD_ADDR
        ///   sub-option will trigger creation of an additional subflow to generate a full mesh topology.
        #[doc(alias = "NM_MPTCP_FLAGS_FULLMESH")]
        const FULLMESH = ffi::NM_MPTCP_FLAGS_FULLMESH as _;
    }
}

#[cfg(feature = "v1_40")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
#[doc(hidden)]
impl IntoGlib for MptcpFlags {
    type GlibType = ffi::NMMptcpFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMMptcpFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_40")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
#[doc(hidden)]
impl FromGlib<ffi::NMMptcpFlags> for MptcpFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMMptcpFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_40")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
impl StaticType for MptcpFlags {
    #[inline]
    #[doc(alias = "nm_mptcp_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_mptcp_flags_get_type()) }
    }
}

#[cfg(feature = "v1_40")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
impl glib::HasParamSpec for MptcpFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_40")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
impl glib::value::ValueType for MptcpFlags {
    type Type = Self;
}

#[cfg(feature = "v1_40")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
unsafe impl<'a> glib::value::FromValue<'a> for MptcpFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_40")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
impl ToValue for MptcpFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_40")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_40")))]
impl From<MptcpFlags> for glib::Value {
    #[inline]
    fn from(v: MptcpFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_38")]
bitflags! {
    /// Flags related to radio interfaces.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_38")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMRadioFlags")]
    pub struct RadioFlags: u32 {
        /// an alias for numeric zero, no flags set.
        #[doc(alias = "NM_RADIO_FLAG_NONE")]
        const NONE = ffi::NM_RADIO_FLAG_NONE as _;
        /// A Wireless LAN device or rfkill switch
        ///   is detected in the system.
        #[doc(alias = "NM_RADIO_FLAG_WLAN_AVAILABLE")]
        const WLAN_AVAILABLE = ffi::NM_RADIO_FLAG_WLAN_AVAILABLE as _;
        /// A Wireless WAN device or rfkill switch
        ///   is detected in the system.
        #[doc(alias = "NM_RADIO_FLAG_WWAN_AVAILABLE")]
        const WWAN_AVAILABLE = ffi::NM_RADIO_FLAG_WWAN_AVAILABLE as _;
    }
}

#[cfg(feature = "v1_38")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_38")))]
#[doc(hidden)]
impl IntoGlib for RadioFlags {
    type GlibType = ffi::NMRadioFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMRadioFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_38")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_38")))]
#[doc(hidden)]
impl FromGlib<ffi::NMRadioFlags> for RadioFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMRadioFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_38")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_38")))]
impl StaticType for RadioFlags {
    #[inline]
    #[doc(alias = "nm_radio_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_radio_flags_get_type()) }
    }
}

#[cfg(feature = "v1_38")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_38")))]
impl glib::HasParamSpec for RadioFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_38")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_38")))]
impl glib::value::ValueType for RadioFlags {
    type Type = Self;
}

#[cfg(feature = "v1_38")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_38")))]
unsafe impl<'a> glib::value::FromValue<'a> for RadioFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_38")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_38")))]
impl ToValue for RadioFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_38")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_38")))]
impl From<RadioFlags> for glib::Value {
    #[inline]
    fn from(v: RadioFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// #NMSecretAgentCapabilities indicate various capabilities of the agent.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSecretAgentCapabilities")]
    pub struct SecretAgentCapabilities: u32 {
        /// the agent supports no special capabilities
        #[doc(alias = "NM_SECRET_AGENT_CAPABILITY_NONE")]
        const NONE = ffi::NM_SECRET_AGENT_CAPABILITY_NONE as _;
        /// the agent supports passing hints to
        /// VPN plugin authentication dialogs.
        #[doc(alias = "NM_SECRET_AGENT_CAPABILITY_VPN_HINTS")]
        const VPN_HINTS = ffi::NM_SECRET_AGENT_CAPABILITY_VPN_HINTS as _;
        /// bounds checking value; should not be used.
        #[doc(alias = "NM_SECRET_AGENT_CAPABILITY_LAST")]
        const LAST = ffi::NM_SECRET_AGENT_CAPABILITY_LAST as _;
    }
}

#[doc(hidden)]
impl IntoGlib for SecretAgentCapabilities {
    type GlibType = ffi::NMSecretAgentCapabilities;

    #[inline]
    fn into_glib(self) -> ffi::NMSecretAgentCapabilities {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMSecretAgentCapabilities> for SecretAgentCapabilities {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSecretAgentCapabilities) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for SecretAgentCapabilities {
    #[inline]
    #[doc(alias = "nm_secret_agent_capabilities_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_secret_agent_capabilities_get_type()) }
    }
}

impl glib::HasParamSpec for SecretAgentCapabilities {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for SecretAgentCapabilities {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for SecretAgentCapabilities {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for SecretAgentCapabilities {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<SecretAgentCapabilities> for glib::Value {
    #[inline]
    fn from(v: SecretAgentCapabilities) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// #NMSecretAgentGetSecretsFlags values modify the behavior of a GetSecrets request.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSecretAgentGetSecretsFlags")]
    pub struct SecretAgentGetSecretsFlags: u32 {
        /// no special behavior; by default no
        ///   user interaction is allowed and requests for secrets are fulfilled from
        ///   persistent storage, or if no secrets are available an error is returned.
        #[doc(alias = "NM_SECRET_AGENT_GET_SECRETS_FLAG_NONE")]
        const NONE = ffi::NM_SECRET_AGENT_GET_SECRETS_FLAG_NONE as _;
        /// allows the request to
        ///   interact with the user, possibly prompting via UI for secrets if any are
        ///   required, or if none are found in persistent storage.
        #[doc(alias = "NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION")]
        const ALLOW_INTERACTION = ffi::NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION as _;
        /// explicitly prompt for new
        ///   secrets from the user.  This flag signals that NetworkManager thinks any
        ///   existing secrets are invalid or wrong.  This flag implies that interaction
        ///   is allowed.
        #[doc(alias = "NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW")]
        const REQUEST_NEW = ffi::NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW as _;
        /// set if the request was
        ///   initiated by user-requested action via the D-Bus interface, as opposed to
        ///   automatically initiated by NetworkManager in response to (for example) scan
        ///   results or carrier changes.
        #[doc(alias = "NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED")]
        const USER_REQUESTED = ffi::NM_SECRET_AGENT_GET_SECRETS_FLAG_USER_REQUESTED as _;
        /// indicates that WPS enrollment
        ///   is active with PBC method. The agent may suggest that the user pushes a button
        ///   on the router instead of supplying a PSK.
        #[doc(alias = "NM_SECRET_AGENT_GET_SECRETS_FLAG_WPS_PBC_ACTIVE")]
        const WPS_PBC_ACTIVE = ffi::NM_SECRET_AGENT_GET_SECRETS_FLAG_WPS_PBC_ACTIVE as _;
        /// Internal flag, not part of
        ///   the D-Bus API.
        #[doc(alias = "NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM")]
        const ONLY_SYSTEM = ffi::NM_SECRET_AGENT_GET_SECRETS_FLAG_ONLY_SYSTEM as _;
        /// Internal flag, not part of
        ///   the D-Bus API.
        #[doc(alias = "NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS")]
        const NO_ERRORS = ffi::NM_SECRET_AGENT_GET_SECRETS_FLAG_NO_ERRORS as _;
    }
}

#[doc(hidden)]
impl IntoGlib for SecretAgentGetSecretsFlags {
    type GlibType = ffi::NMSecretAgentGetSecretsFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMSecretAgentGetSecretsFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMSecretAgentGetSecretsFlags> for SecretAgentGetSecretsFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSecretAgentGetSecretsFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for SecretAgentGetSecretsFlags {
    #[inline]
    #[doc(alias = "nm_secret_agent_get_secrets_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_secret_agent_get_secrets_flags_get_type()) }
    }
}

impl glib::HasParamSpec for SecretAgentGetSecretsFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for SecretAgentGetSecretsFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for SecretAgentGetSecretsFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for SecretAgentGetSecretsFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<SecretAgentGetSecretsFlags> for glib::Value {
    #[inline]
    fn from(v: SecretAgentGetSecretsFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_8")]
bitflags! {
    /// #NMSetting8021xAuthFlags values indicate which authentication settings
    /// should be used.
    ///
    /// Before 1.22, this was wrongly marked as a enum and not as a flags
    /// type.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSetting8021xAuthFlags")]
    pub struct Setting8021xAuthFlags: u32 {
        /// No flags
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_NONE")]
        const NONE = ffi::NM_SETTING_802_1X_AUTH_FLAGS_NONE as _;
        /// Disable TLSv1.0
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_0_DISABLE")]
        const TLS_1_0_DISABLE = ffi::NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_0_DISABLE as _;
        /// Disable TLSv1.1
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_1_DISABLE")]
        const TLS_1_1_DISABLE = ffi::NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_1_DISABLE as _;
        /// Disable TLSv1.2
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_2_DISABLE")]
        const TLS_1_2_DISABLE = ffi::NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_2_DISABLE as _;
        /// Disable TLS time checks. Since 1.42.
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_TLS_DISABLE_TIME_CHECKS")]
        const TLS_DISABLE_TIME_CHECKS = ffi::NM_SETTING_802_1X_AUTH_FLAGS_TLS_DISABLE_TIME_CHECKS as _;
        /// Disable TLSv1.3. Since 1.42.
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_3_DISABLE")]
        const TLS_1_3_DISABLE = ffi::NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_3_DISABLE as _;
        /// Enable TLSv1.0. Since 1.42.
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_0_ENABLE")]
        const TLS_1_0_ENABLE = ffi::NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_0_ENABLE as _;
        /// Enable TLSv1.1. Since 1.42.
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_1_ENABLE")]
        const TLS_1_1_ENABLE = ffi::NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_1_ENABLE as _;
        /// Enable TLSv1.2. Since 1.42.
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_2_ENABLE")]
        const TLS_1_2_ENABLE = ffi::NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_2_ENABLE as _;
        /// Enable TLSv1.3. Since 1.42.
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_3_ENABLE")]
        const TLS_1_3_ENABLE = ffi::NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_3_ENABLE as _;
        /// All supported flags
        #[doc(alias = "NM_SETTING_802_1X_AUTH_FLAGS_ALL")]
        const ALL = ffi::NM_SETTING_802_1X_AUTH_FLAGS_ALL as _;
    }
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
#[doc(hidden)]
impl IntoGlib for Setting8021xAuthFlags {
    type GlibType = ffi::NMSetting8021xAuthFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMSetting8021xAuthFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
#[doc(hidden)]
impl FromGlib<ffi::NMSetting8021xAuthFlags> for Setting8021xAuthFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSetting8021xAuthFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
impl StaticType for Setting8021xAuthFlags {
    #[inline]
    #[doc(alias = "nm_setting_802_1x_auth_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_setting_802_1x_auth_flags_get_type()) }
    }
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
impl glib::HasParamSpec for Setting8021xAuthFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
impl glib::value::ValueType for Setting8021xAuthFlags {
    type Type = Self;
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
unsafe impl<'a> glib::value::FromValue<'a> for Setting8021xAuthFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
impl ToValue for Setting8021xAuthFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_8")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_8")))]
impl From<Setting8021xAuthFlags> for glib::Value {
    #[inline]
    fn from(v: Setting8021xAuthFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// DCB feature flags.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSettingDcbFlags")]
    pub struct SettingDcbFlags: u32 {
        /// no flag
        #[doc(alias = "NM_SETTING_DCB_FLAG_NONE")]
        const NONE = ffi::NM_SETTING_DCB_FLAG_NONE as _;
        /// the feature is enabled
        #[doc(alias = "NM_SETTING_DCB_FLAG_ENABLE")]
        const ENABLE = ffi::NM_SETTING_DCB_FLAG_ENABLE as _;
        /// the feature is advertised
        #[doc(alias = "NM_SETTING_DCB_FLAG_ADVERTISE")]
        const ADVERTISE = ffi::NM_SETTING_DCB_FLAG_ADVERTISE as _;
        /// the feature is willing to change based on
        /// peer configuration advertisements
        #[doc(alias = "NM_SETTING_DCB_FLAG_WILLING")]
        const WILLING = ffi::NM_SETTING_DCB_FLAG_WILLING as _;
    }
}

#[doc(hidden)]
impl IntoGlib for SettingDcbFlags {
    type GlibType = ffi::NMSettingDcbFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMSettingDcbFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMSettingDcbFlags> for SettingDcbFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSettingDcbFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for SettingDcbFlags {
    #[inline]
    #[doc(alias = "nm_setting_dcb_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_setting_dcb_flags_get_type()) }
    }
}

impl glib::HasParamSpec for SettingDcbFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for SettingDcbFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for SettingDcbFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for SettingDcbFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<SettingDcbFlags> for glib::Value {
    #[inline]
    fn from(v: SettingDcbFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_52")]
bitflags! {
    /// These flags modify the ethtool FEC(Forward Error Correction) mode.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSettingEthtoolFecMode")]
    pub struct SettingEthtoolFecMode: u32 {
        /// Select default/best FEC mode automatically.
        #[doc(alias = "NM_SETTING_ETHTOOL_FEC_MODE_AUTO")]
        const AUTO = ffi::NM_SETTING_ETHTOOL_FEC_MODE_AUTO as _;
        /// No FEC mode.
        #[doc(alias = "NM_SETTING_ETHTOOL_FEC_MODE_OFF")]
        const OFF = ffi::NM_SETTING_ETHTOOL_FEC_MODE_OFF as _;
        /// Reed-Solomon FEC Mode.
        #[doc(alias = "NM_SETTING_ETHTOOL_FEC_MODE_RS")]
        const RS = ffi::NM_SETTING_ETHTOOL_FEC_MODE_RS as _;
        /// Base-R/Reed-Solomon FEC Mode.
        #[doc(alias = "NM_SETTING_ETHTOOL_FEC_MODE_BASER")]
        const BASER = ffi::NM_SETTING_ETHTOOL_FEC_MODE_BASER as _;
        /// Low Latency Reed Solomon FEC Mode.
        #[doc(alias = "NM_SETTING_ETHTOOL_FEC_MODE_LLRS")]
        const LLRS = ffi::NM_SETTING_ETHTOOL_FEC_MODE_LLRS as _;
    }
}

#[cfg(feature = "v1_52")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
#[doc(hidden)]
impl IntoGlib for SettingEthtoolFecMode {
    type GlibType = ffi::NMSettingEthtoolFecMode;

    #[inline]
    fn into_glib(self) -> ffi::NMSettingEthtoolFecMode {
        self.bits()
    }
}

#[cfg(feature = "v1_52")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
#[doc(hidden)]
impl FromGlib<ffi::NMSettingEthtoolFecMode> for SettingEthtoolFecMode {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSettingEthtoolFecMode) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_52")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
impl StaticType for SettingEthtoolFecMode {
    #[inline]
    #[doc(alias = "nm_setting_ethtool_fec_mode_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_setting_ethtool_fec_mode_get_type()) }
    }
}

#[cfg(feature = "v1_52")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
impl glib::HasParamSpec for SettingEthtoolFecMode {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_52")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
impl glib::value::ValueType for SettingEthtoolFecMode {
    type Type = Self;
}

#[cfg(feature = "v1_52")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
unsafe impl<'a> glib::value::FromValue<'a> for SettingEthtoolFecMode {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_52")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
impl ToValue for SettingEthtoolFecMode {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_52")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_52")))]
impl From<SettingEthtoolFecMode> for glib::Value {
    #[inline]
    fn from(v: SettingEthtoolFecMode) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// These flags indicate specific behavior related to handling of a secret.  Each
    /// secret has a corresponding set of these flags which indicate how the secret
    /// is to be stored and/or requested when it is needed.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSettingSecretFlags")]
    pub struct SettingSecretFlags: u32 {
        /// the system is responsible for providing and
        /// storing this secret (default)
        #[doc(alias = "NM_SETTING_SECRET_FLAG_NONE")]
        const NONE = ffi::NM_SETTING_SECRET_FLAG_NONE as _;
        /// a user secret agent is responsible
        /// for providing and storing this secret; when it is required agents will be
        /// asked to retrieve it
        #[doc(alias = "NM_SETTING_SECRET_FLAG_AGENT_OWNED")]
        const AGENT_OWNED = ffi::NM_SETTING_SECRET_FLAG_AGENT_OWNED as _;
        /// this secret should not be saved, but
        /// should be requested from the user each time it is needed
        #[doc(alias = "NM_SETTING_SECRET_FLAG_NOT_SAVED")]
        const NOT_SAVED = ffi::NM_SETTING_SECRET_FLAG_NOT_SAVED as _;
        /// in situations where it cannot be
        /// automatically determined that the secret is required (some VPNs and PPP
        /// providers don't require all secrets) this flag indicates that the specific
        /// secret is not required
        #[doc(alias = "NM_SETTING_SECRET_FLAG_NOT_REQUIRED")]
        const NOT_REQUIRED = ffi::NM_SETTING_SECRET_FLAG_NOT_REQUIRED as _;
    }
}

#[doc(hidden)]
impl IntoGlib for SettingSecretFlags {
    type GlibType = ffi::NMSettingSecretFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMSettingSecretFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMSettingSecretFlags> for SettingSecretFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSettingSecretFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for SettingSecretFlags {
    #[inline]
    #[doc(alias = "nm_setting_secret_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_setting_secret_flags_get_type()) }
    }
}

impl glib::HasParamSpec for SettingSecretFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for SettingSecretFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for SettingSecretFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for SettingSecretFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<SettingSecretFlags> for glib::Value {
    #[inline]
    fn from(v: SettingSecretFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_2")]
bitflags! {
    /// Options for #NMSettingWired:wake-on-lan. Note that not all options
    /// are supported by all devices.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSettingWiredWakeOnLan")]
    pub struct SettingWiredWakeOnLan: u32 {
        /// Wake on PHY activity
        #[doc(alias = "NM_SETTING_WIRED_WAKE_ON_LAN_PHY")]
        const PHY = ffi::NM_SETTING_WIRED_WAKE_ON_LAN_PHY as _;
        /// Wake on unicast messages
        #[doc(alias = "NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST")]
        const UNICAST = ffi::NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST as _;
        /// Wake on multicast messages
        #[doc(alias = "NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST")]
        const MULTICAST = ffi::NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST as _;
        /// Wake on broadcast messages
        #[doc(alias = "NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST")]
        const BROADCAST = ffi::NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST as _;
        /// Wake on ARP
        #[doc(alias = "NM_SETTING_WIRED_WAKE_ON_LAN_ARP")]
        const ARP = ffi::NM_SETTING_WIRED_WAKE_ON_LAN_ARP as _;
        /// Wake on magic packet
        #[doc(alias = "NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC")]
        const MAGIC = ffi::NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC as _;
        /// Use the default value
        #[doc(alias = "NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT")]
        const DEFAULT = ffi::NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT as _;
        /// Don't change configured settings
        #[doc(alias = "NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE")]
        const IGNORE = ffi::NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE as _;
    }
}

#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(hidden)]
impl IntoGlib for SettingWiredWakeOnLan {
    type GlibType = ffi::NMSettingWiredWakeOnLan;

    #[inline]
    fn into_glib(self) -> ffi::NMSettingWiredWakeOnLan {
        self.bits()
    }
}

#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
#[doc(hidden)]
impl FromGlib<ffi::NMSettingWiredWakeOnLan> for SettingWiredWakeOnLan {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSettingWiredWakeOnLan) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
impl StaticType for SettingWiredWakeOnLan {
    #[inline]
    #[doc(alias = "nm_setting_wired_wake_on_lan_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_setting_wired_wake_on_lan_get_type()) }
    }
}

#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
impl glib::HasParamSpec for SettingWiredWakeOnLan {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
impl glib::value::ValueType for SettingWiredWakeOnLan {
    type Type = Self;
}

#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
unsafe impl<'a> glib::value::FromValue<'a> for SettingWiredWakeOnLan {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
impl ToValue for SettingWiredWakeOnLan {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
impl From<SettingWiredWakeOnLan> for glib::Value {
    #[inline]
    fn from(v: SettingWiredWakeOnLan) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_10")]
bitflags! {
    /// Configure the use of WPS by a connection while it activates.
    ///
    /// Note: prior to 1.16, this was a GEnum type instead of a GFlags type
    /// although, with the same numeric values.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSettingWirelessSecurityWpsMethod")]
    pub struct SettingWirelessSecurityWpsMethod: u32 {
        /// Attempt whichever method AP supports
        #[doc(alias = "NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_DEFAULT")]
        const DEFAULT = ffi::NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_DEFAULT as _;
        /// WPS can not be used.
        #[doc(alias = "NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_DISABLED")]
        const DISABLED = ffi::NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_DISABLED as _;
        /// Use WPS, any method
        #[doc(alias = "NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_AUTO")]
        const AUTO = ffi::NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_AUTO as _;
        /// use WPS push-button method
        #[doc(alias = "NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_PBC")]
        const PBC = ffi::NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_PBC as _;
        /// use PIN method
        #[doc(alias = "NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_PIN")]
        const PIN = ffi::NM_SETTING_WIRELESS_SECURITY_WPS_METHOD_PIN as _;
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
#[doc(hidden)]
impl IntoGlib for SettingWirelessSecurityWpsMethod {
    type GlibType = ffi::NMSettingWirelessSecurityWpsMethod;

    #[inline]
    fn into_glib(self) -> ffi::NMSettingWirelessSecurityWpsMethod {
        self.bits()
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
#[doc(hidden)]
impl FromGlib<ffi::NMSettingWirelessSecurityWpsMethod> for SettingWirelessSecurityWpsMethod {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSettingWirelessSecurityWpsMethod) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl StaticType for SettingWirelessSecurityWpsMethod {
    #[inline]
    #[doc(alias = "nm_setting_wireless_security_wps_method_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_setting_wireless_security_wps_method_get_type()) }
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl glib::HasParamSpec for SettingWirelessSecurityWpsMethod {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl glib::value::ValueType for SettingWirelessSecurityWpsMethod {
    type Type = Self;
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
unsafe impl<'a> glib::value::FromValue<'a> for SettingWirelessSecurityWpsMethod {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl ToValue for SettingWirelessSecurityWpsMethod {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_10")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_10")))]
impl From<SettingWirelessSecurityWpsMethod> for glib::Value {
    #[inline]
    fn from(v: SettingWirelessSecurityWpsMethod) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_12")]
bitflags! {
    /// Options for #NMSettingWireless:wake-on-wlan. Note that not all options
    /// are supported by all devices.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSettingWirelessWakeOnWLan")]
    pub struct SettingWirelessWakeOnWLan: u32 {
        /// Wake on any activity
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_ANY")]
        const ANY = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_ANY as _;
        /// Wake on disconnect
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_DISCONNECT")]
        const DISCONNECT = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_DISCONNECT as _;
        /// Wake on magic packet
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_MAGIC")]
        const MAGIC = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_MAGIC as _;
        /// Wake on GTK rekey failure
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_GTK_REKEY_FAILURE")]
        const GTK_REKEY_FAILURE = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_GTK_REKEY_FAILURE as _;
        /// Wake on EAP identity request
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_EAP_IDENTITY_REQUEST")]
        const EAP_IDENTITY_REQUEST = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_EAP_IDENTITY_REQUEST as _;
        /// Wake on 4way handshake
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_4WAY_HANDSHAKE")]
        const _4WAY_HANDSHAKE = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_4WAY_HANDSHAKE as _;
        /// Wake on rfkill release
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_RFKILL_RELEASE")]
        const RFKILL_RELEASE = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_RFKILL_RELEASE as _;
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_TCP")]
        const TCP = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_TCP as _;
        /// Wake on all events. This does not
        ///   include the exclusive flags @NM_SETTING_WIRELESS_WAKE_ON_WLAN_DEFAULT or
        ///   @NM_SETTING_WIRELESS_WAKE_ON_WLAN_IGNORE.
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_ALL")]
        const ALL = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_ALL as _;
        /// Use the default value
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_DEFAULT")]
        const DEFAULT = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_DEFAULT as _;
        /// Don't change configured settings
        #[doc(alias = "NM_SETTING_WIRELESS_WAKE_ON_WLAN_IGNORE")]
        const IGNORE = ffi::NM_SETTING_WIRELESS_WAKE_ON_WLAN_IGNORE as _;
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl IntoGlib for SettingWirelessWakeOnWLan {
    type GlibType = ffi::NMSettingWirelessWakeOnWLan;

    #[inline]
    fn into_glib(self) -> ffi::NMSettingWirelessWakeOnWLan {
        self.bits()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl FromGlib<ffi::NMSettingWirelessWakeOnWLan> for SettingWirelessWakeOnWLan {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSettingWirelessWakeOnWLan) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl StaticType for SettingWirelessWakeOnWLan {
    #[inline]
    #[doc(alias = "nm_setting_wireless_wake_on_wlan_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_setting_wireless_wake_on_wlan_get_type()) }
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::HasParamSpec for SettingWirelessWakeOnWLan {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::value::ValueType for SettingWirelessWakeOnWLan {
    type Type = Self;
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
unsafe impl<'a> glib::value::FromValue<'a> for SettingWirelessWakeOnWLan {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl ToValue for SettingWirelessWakeOnWLan {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl From<SettingWirelessWakeOnWLan> for glib::Value {
    #[inline]
    fn from(v: SettingWirelessWakeOnWLan) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_20")]
bitflags! {
    /// Numeric flags for the "flags" argument of AddConnection2() D-Bus API.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSettingsAddConnection2Flags")]
    pub struct SettingsAddConnection2Flags: u32 {
        /// an alias for numeric zero, no flags set.
        #[doc(alias = "NM_SETTINGS_ADD_CONNECTION2_FLAG_NONE")]
        const NONE = ffi::NM_SETTINGS_ADD_CONNECTION2_FLAG_NONE as _;
        /// to persist the connection to disk.
        #[doc(alias = "NM_SETTINGS_ADD_CONNECTION2_FLAG_TO_DISK")]
        const TO_DISK = ffi::NM_SETTINGS_ADD_CONNECTION2_FLAG_TO_DISK as _;
        /// to make the connection in-memory only.
        #[doc(alias = "NM_SETTINGS_ADD_CONNECTION2_FLAG_IN_MEMORY")]
        const IN_MEMORY = ffi::NM_SETTINGS_ADD_CONNECTION2_FLAG_IN_MEMORY as _;
        /// usually, when the connection
        ///   has autoconnect enabled and gets added, it becomes eligible to autoconnect
        ///   right away. Setting this flag, disables autoconnect until the connection
        ///   is manually activated.
        #[doc(alias = "NM_SETTINGS_ADD_CONNECTION2_FLAG_BLOCK_AUTOCONNECT")]
        const BLOCK_AUTOCONNECT = ffi::NM_SETTINGS_ADD_CONNECTION2_FLAG_BLOCK_AUTOCONNECT as _;
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
#[doc(hidden)]
impl IntoGlib for SettingsAddConnection2Flags {
    type GlibType = ffi::NMSettingsAddConnection2Flags;

    #[inline]
    fn into_glib(self) -> ffi::NMSettingsAddConnection2Flags {
        self.bits()
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
#[doc(hidden)]
impl FromGlib<ffi::NMSettingsAddConnection2Flags> for SettingsAddConnection2Flags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSettingsAddConnection2Flags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl StaticType for SettingsAddConnection2Flags {
    #[inline]
    #[doc(alias = "nm_settings_add_connection2_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_settings_add_connection2_flags_get_type()) }
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl glib::HasParamSpec for SettingsAddConnection2Flags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl glib::value::ValueType for SettingsAddConnection2Flags {
    type Type = Self;
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
unsafe impl<'a> glib::value::FromValue<'a> for SettingsAddConnection2Flags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl ToValue for SettingsAddConnection2Flags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_20")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
impl From<SettingsAddConnection2Flags> for glib::Value {
    #[inline]
    fn from(v: SettingsAddConnection2Flags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_12")]
bitflags! {
    /// Flags describing the current activation state.
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSettingsConnectionFlags")]
    pub struct SettingsConnectionFlags: u32 {
        /// an alias for numeric zero, no flags set.
        #[doc(alias = "NM_SETTINGS_CONNECTION_FLAG_NONE")]
        const NONE = ffi::NM_SETTINGS_CONNECTION_FLAG_NONE as _;
        /// the connection is not saved to disk.
        ///   That either means, that the connection is in-memory only and currently
        ///   is not backed by a file. Or, that the connection is backed by a file,
        ///   but has modifications in-memory that were not persisted to disk.
        #[doc(alias = "NM_SETTINGS_CONNECTION_FLAG_UNSAVED")]
        const UNSAVED = ffi::NM_SETTINGS_CONNECTION_FLAG_UNSAVED as _;
        /// A connection is "nm-generated" if
        ///  it was generated by NetworkManger. If the connection gets modified or saved
        ///  by the user, the flag gets cleared. A nm-generated is also unsaved
        ///  and has no backing file as it is in-memory only.
        #[doc(alias = "NM_SETTINGS_CONNECTION_FLAG_NM_GENERATED")]
        const NM_GENERATED = ffi::NM_SETTINGS_CONNECTION_FLAG_NM_GENERATED as _;
        /// The connection will be deleted
        ///  when it disconnects. That is for in-memory connections (unsaved), which are
        ///  currently active but deleted on disconnect. Volatile connections are
        ///  always unsaved, but they are also no backing file on disk and are entirely
        ///  in-memory only.
        #[doc(alias = "NM_SETTINGS_CONNECTION_FLAG_VOLATILE")]
        const VOLATILE = ffi::NM_SETTINGS_CONNECTION_FLAG_VOLATILE as _;
        /// the profile was generated to represent
        ///  an external configuration of a networking device. Since: 1.26.
        #[doc(alias = "NM_SETTINGS_CONNECTION_FLAG_EXTERNAL")]
        const EXTERNAL = ffi::NM_SETTINGS_CONNECTION_FLAG_EXTERNAL as _;
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl IntoGlib for SettingsConnectionFlags {
    type GlibType = ffi::NMSettingsConnectionFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMSettingsConnectionFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl FromGlib<ffi::NMSettingsConnectionFlags> for SettingsConnectionFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSettingsConnectionFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl StaticType for SettingsConnectionFlags {
    #[inline]
    #[doc(alias = "nm_settings_connection_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_settings_connection_flags_get_type()) }
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::HasParamSpec for SettingsConnectionFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::value::ValueType for SettingsConnectionFlags {
    type Type = Self;
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
unsafe impl<'a> glib::value::FromValue<'a> for SettingsConnectionFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl ToValue for SettingsConnectionFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl From<SettingsConnectionFlags> for glib::Value {
    #[inline]
    fn from(v: SettingsConnectionFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_12")]
bitflags! {
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMSettingsUpdate2Flags")]
    pub struct SettingsUpdate2Flags: u32 {
        /// an alias for numeric zero, no flags set.
        #[doc(alias = "NM_SETTINGS_UPDATE2_FLAG_NONE")]
        const NONE = ffi::NM_SETTINGS_UPDATE2_FLAG_NONE as _;
        /// to persist the connection to disk.
        #[doc(alias = "NM_SETTINGS_UPDATE2_FLAG_TO_DISK")]
        const TO_DISK = ffi::NM_SETTINGS_UPDATE2_FLAG_TO_DISK as _;
        /// makes the profile in-memory.
        ///   Note that such profiles are stored in keyfile format under /run.
        ///   If the file is already in-memory, the file in /run is updated in-place.
        ///   Otherwise, the previous storage for the profile is left unchanged
        ///   on disk, and the in-memory copy shadows it.
        ///   Note that the original filename of the previous persistent storage (if any)
        ///   is remembered. That means, when later persisting the profile again to disk,
        ///   the file on disk will be overwritten again.
        ///   Likewise, when finally deleting the profile, both the storage from /run
        ///   and persistent storage are deleted (or if the persistent storage does not
        ///   allow deletion, and nmmeta file is written to mark the UUID as deleted).
        #[doc(alias = "NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY")]
        const IN_MEMORY = ffi::NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY as _;
        /// this is almost the same
        ///   as [`IN_MEMORY`][Self::IN_MEMORY], with one difference: when later deleting
        ///   the profile, the original profile will not be deleted. Instead a nmmeta
        ///   file is written to /run to indicate that the profile is gone.
        ///   Note that if such a nmmeta tombstone file exists and hides a file in persistent
        ///   storage, then when re-adding the profile with the same UUID, then the original
        ///   storage is taken over again.
        #[doc(alias = "NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY_DETACHED")]
        const IN_MEMORY_DETACHED = ffi::NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY_DETACHED as _;
        /// this is like [`IN_MEMORY`][Self::IN_MEMORY],
        ///   but if the connection has a corresponding file on persistent storage, the file
        ///   will be deleted right away. If the profile is later again persisted to disk,
        ///   a new, unused filename will be chosen.
        #[doc(alias = "NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY_ONLY")]
        const IN_MEMORY_ONLY = ffi::NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY_ONLY as _;
        /// This can be specified with either
        ///   [`IN_MEMORY`][Self::IN_MEMORY], [`IN_MEMORY_DETACHED`][Self::IN_MEMORY_DETACHED]
        ///   or [`IN_MEMORY_ONLY`][Self::IN_MEMORY_ONLY].
        ///   After making the connection in-memory only, the connection is marked
        ///   as volatile. That means, if the connection is currently not active
        ///   it will be deleted right away. Otherwise, it is marked to for deletion
        ///   once the connection deactivates. A volatile connection cannot autoactivate
        ///   again (because it's about to be deleted), but a manual activation will
        ///   clear the volatile flag.
        #[doc(alias = "NM_SETTINGS_UPDATE2_FLAG_VOLATILE")]
        const VOLATILE = ffi::NM_SETTINGS_UPDATE2_FLAG_VOLATILE as _;
        /// usually, when the connection
        ///   has autoconnect enabled and is modified, it becomes eligible to autoconnect
        ///   right away. Setting this flag, disables autoconnect until the connection
        ///   is manually activated.
        #[doc(alias = "NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT")]
        const BLOCK_AUTOCONNECT = ffi::NM_SETTINGS_UPDATE2_FLAG_BLOCK_AUTOCONNECT as _;
        /// when a profile gets modified that is
        ///   currently active, then these changes don't take effect for the active
        ///   device unless the profile gets reactivated or the configuration reapplied.
        ///   There are two exceptions: by default "connection.zone" and "connection.metered"
        ///   properties take effect immediately. Specify this flag to prevent these
        ///   properties to take effect, so that the change is restricted to modify
        ///   the profile. Since: 1.20.
        #[doc(alias = "NM_SETTINGS_UPDATE2_FLAG_NO_REAPPLY")]
        const NO_REAPPLY = ffi::NM_SETTINGS_UPDATE2_FLAG_NO_REAPPLY as _;
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl IntoGlib for SettingsUpdate2Flags {
    type GlibType = ffi::NMSettingsUpdate2Flags;

    #[inline]
    fn into_glib(self) -> ffi::NMSettingsUpdate2Flags {
        self.bits()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl FromGlib<ffi::NMSettingsUpdate2Flags> for SettingsUpdate2Flags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMSettingsUpdate2Flags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl StaticType for SettingsUpdate2Flags {
    #[inline]
    #[doc(alias = "nm_settings_update2_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_settings_update2_flags_get_type()) }
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::HasParamSpec for SettingsUpdate2Flags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::value::ValueType for SettingsUpdate2Flags {
    type Type = Self;
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
unsafe impl<'a> glib::value::FromValue<'a> for SettingsUpdate2Flags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl ToValue for SettingsUpdate2Flags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl From<SettingsUpdate2Flags> for glib::Value {
    #[inline]
    fn from(v: SettingsUpdate2Flags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

#[cfg(feature = "v1_12")]
bitflags! {
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMTeamLinkWatcherArpPingFlags")]
    pub struct TeamLinkWatcherArpPingFlags: u32 {
        /// the arp_ping link watcher
        ///    option 'validate_active' is enabled (set to true).
        #[doc(alias = "NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE")]
        const VALIDATE_ACTIVE = ffi::NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE as _;
        /// the arp_ping link watcher
        ///    option 'validate_inactive' is enabled (set to true).
        #[doc(alias = "NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE")]
        const VALIDATE_INACTIVE = ffi::NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE as _;
        /// the arp_ping link watcher option
        ///    'send_always' is enabled (set to true).
        #[doc(alias = "NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS")]
        const SEND_ALWAYS = ffi::NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS as _;
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl IntoGlib for TeamLinkWatcherArpPingFlags {
    type GlibType = ffi::NMTeamLinkWatcherArpPingFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMTeamLinkWatcherArpPingFlags {
        self.bits()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
#[doc(hidden)]
impl FromGlib<ffi::NMTeamLinkWatcherArpPingFlags> for TeamLinkWatcherArpPingFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMTeamLinkWatcherArpPingFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl StaticType for TeamLinkWatcherArpPingFlags {
    #[inline]
    #[doc(alias = "nm_team_link_watcher_arp_ping_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_team_link_watcher_arp_ping_flags_get_type()) }
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::HasParamSpec for TeamLinkWatcherArpPingFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl glib::value::ValueType for TeamLinkWatcherArpPingFlags {
    type Type = Self;
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
unsafe impl<'a> glib::value::FromValue<'a> for TeamLinkWatcherArpPingFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl ToValue for TeamLinkWatcherArpPingFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

#[cfg(feature = "v1_12")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))]
impl From<TeamLinkWatcherArpPingFlags> for glib::Value {
    #[inline]
    fn from(v: TeamLinkWatcherArpPingFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// #NMVlanFlags values control the behavior of the VLAN interface.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMVlanFlags")]
    pub struct VlanFlags: u32 {
        /// indicates that this interface should reorder
        ///  outgoing packet headers to look more like a non-VLAN Ethernet interface
        #[doc(alias = "NM_VLAN_FLAG_REORDER_HEADERS")]
        const REORDER_HEADERS = ffi::NM_VLAN_FLAG_REORDER_HEADERS as _;
        /// indicates that this interface should use GVRP to register
        ///  itself with its switch
        #[doc(alias = "NM_VLAN_FLAG_GVRP")]
        const GVRP = ffi::NM_VLAN_FLAG_GVRP as _;
        /// indicates that this interface's operating
        ///  state is tied to the underlying network interface but other details
        ///  (like routing) are not.
        #[doc(alias = "NM_VLAN_FLAG_LOOSE_BINDING")]
        const LOOSE_BINDING = ffi::NM_VLAN_FLAG_LOOSE_BINDING as _;
        /// indicates that this interface should use MVRP to register
        ///  itself with its switch
        #[doc(alias = "NM_VLAN_FLAG_MVRP")]
        const MVRP = ffi::NM_VLAN_FLAG_MVRP as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VlanFlags {
    type GlibType = ffi::NMVlanFlags;

    #[inline]
    fn into_glib(self) -> ffi::NMVlanFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMVlanFlags> for VlanFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::NMVlanFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for VlanFlags {
    #[inline]
    #[doc(alias = "nm_vlan_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_vlan_flags_get_type()) }
    }
}

impl glib::HasParamSpec for VlanFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for VlanFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VlanFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for VlanFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VlanFlags> for glib::Value {
    #[inline]
    fn from(v: VlanFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}

bitflags! {
    /// Flags that indicate certain capabilities of the plugin to editor programs.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "NMVpnEditorPluginCapability")]
    pub struct VpnEditorPluginCapability: u32 {
        /// Unknown or no capability.
        #[doc(alias = "NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE")]
        const NONE = ffi::NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE as _;
        /// The plugin can import new connections.
        #[doc(alias = "NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT")]
        const IMPORT = ffi::NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT as _;
        /// The plugin can export connections.
        #[doc(alias = "NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT")]
        const EXPORT = ffi::NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT as _;
        /// The plugin supports IPv6 addressing.
        #[doc(alias = "NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6")]
        const IPV6 = ffi::NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6 as _;
        /// The GUI editor plugin is not available. Since: 1.52.
        #[doc(alias = "NM_VPN_EDITOR_PLUGIN_CAPABILITY_NO_EDITOR")]
        const NO_EDITOR = ffi::NM_VPN_EDITOR_PLUGIN_CAPABILITY_NO_EDITOR as _;
    }
}

#[doc(hidden)]
impl IntoGlib for VpnEditorPluginCapability {
    type GlibType = ffi::NMVpnEditorPluginCapability;

    #[inline]
    fn into_glib(self) -> ffi::NMVpnEditorPluginCapability {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::NMVpnEditorPluginCapability> for VpnEditorPluginCapability {
    #[inline]
    unsafe fn from_glib(value: ffi::NMVpnEditorPluginCapability) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for VpnEditorPluginCapability {
    #[inline]
    #[doc(alias = "nm_vpn_editor_plugin_capability_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::nm_vpn_editor_plugin_capability_get_type()) }
    }
}

impl glib::HasParamSpec for VpnEditorPluginCapability {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for VpnEditorPluginCapability {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for VpnEditorPluginCapability {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for VpnEditorPluginCapability {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<VpnEditorPluginCapability> for glib::Value {
    #[inline]
    fn from(v: VpnEditorPluginCapability) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}