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
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
|
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Note we build a native version of libscf.so.1 out of tools/svc.
#
include ../Makefile.lib
# Hammerhead: amd64-only
SUBDIRS = $(MACH64)
all : TARGET= all
clean : TARGET= clean
clobber : TARGET= clobber
install : TARGET= install
HDRDIR = inc
HDRS = libscf.h libscf_priv.h
#
# only error descriptions are internationalized, but they aren't directly
# surrounded by gettext(), so we use '-a' to grab all strings.
#
MSGFILES = common/error.c
POFILE = libscf.po
XGETFLAGS += -a
.KEEP_STATE:
all clean clobber install: $(SUBDIRS)
$(POFILE): pofile_MSGFILES
install_h: $(ROOTHDRS)
check: $(CHECKHDRS)
_msg: $(MSGDOMAINPOFILE)
$(SUBDIRS): FRC
@cd $@; pwd; $(MAKE) $(TARGET)
FRC:
include ../Makefile.targ
include ../../Makefile.msg.targ
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
#
# Copyright (c) 2018, Joyent, Inc.
include $(SRC)/lib/Makefile.lib
include ../Makefile.shared.com
include $(SRC)/lib/Makefile.rootfs
LDLIBS += -lc
SRCDIR = ../common
COMDIR = ../../../common/svc
CPPFLAGS += -I$(SRC)/lib/libscf/inc -I$(SRC)/lib/libscf/common/inc \
-I$(COMDIR) -I$(ROOTHDRDIR)
.KEEP_STATE:
all:
include $(SRC)/lib/Makefile.targ
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#
LIBRARY = libscf.a
VERS = .1
OBJECTS = \
error.o \
libscf-stub.o
include $(SRC)/lib/Makefile.lib
LIBS = $(DYNLIB)
CERRWARN += -Wno-switch
CERRWARN += -Wno-char-subscripts
CERRWARN += -Wno-parentheses
CERRWARN += $(CNOWARN_UNINIT)
# Hammerhead: Ensure PIC is used for shared library objects
# (Target-specific variable in Makefile.lib may not work correctly with GNU Make)
CFLAGS += -fpic
CFLAGS64 += -fpic
# not linted
SMATCH=off
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
include ../Makefile.com
include ../../Makefile.lib.64
all: $(LIBS)
install: all $(ROOTLIBS64) $(ROOTLINKS64) $(ROOTCOMPATLINKS64)
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright 2013 Joyent, Inc. All rights reserved.
* Copyright 2017 OmniOS Community Edition (OmniOSce) Association.
*/
#include "libscf_impl.h"
#include <assert.h>
#include <dlfcn.h>
#include <libintl.h>
#include <pthread.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/machelf.h>
#include <thread.h>
#include <ucontext.h>
extern int ndebug;
static struct scf_error_info {
scf_error_t ei_code;
const char *ei_desc;
} scf_errors[] = {
{SCF_ERROR_NONE, "no error"},
{SCF_ERROR_NOT_BOUND, "handle not bound"},
{SCF_ERROR_NOT_SET, "cannot use unset argument"},
{SCF_ERROR_NOT_FOUND, "entity not found"},
{SCF_ERROR_TYPE_MISMATCH, "type does not match value"},
{SCF_ERROR_IN_USE, "cannot modify while in-use"},
{SCF_ERROR_CONNECTION_BROKEN, "connection to repository broken"},
{SCF_ERROR_INVALID_ARGUMENT, "invalid argument"},
{SCF_ERROR_NO_MEMORY, "no memory available"},
{SCF_ERROR_CONSTRAINT_VIOLATED, "required constraint not met"},
{SCF_ERROR_EXISTS, "object already exists"},
{SCF_ERROR_NO_SERVER, "repository server unavailable"},
{SCF_ERROR_NO_RESOURCES, "server has insufficient resources"},
{SCF_ERROR_PERMISSION_DENIED, "insufficient privileges for action"},
{SCF_ERROR_BACKEND_ACCESS, "backend refused access"},
{SCF_ERROR_BACKEND_READONLY, "backend is read-only"},
{SCF_ERROR_HANDLE_MISMATCH, "mismatched SCF handles"},
{SCF_ERROR_HANDLE_DESTROYED, "object bound to destroyed handle"},
{SCF_ERROR_VERSION_MISMATCH, "incompatible SCF version"},
{SCF_ERROR_DELETED, "object has been deleted"},
{SCF_ERROR_TEMPLATE_INVALID, "template data is invalid"},
{SCF_ERROR_CALLBACK_FAILED, "user callback function failed"},
{SCF_ERROR_INTERNAL, "internal error"}
};
#define SCF_NUM_ERRORS (sizeof (scf_errors) / sizeof (*scf_errors))
/* a SWAG just in case things get out of sync, we can notice */
#define LOOKS_VALID(e) \
((e) >= scf_errors[0].ei_code && \
(e) < scf_errors[SCF_NUM_ERRORS - 1].ei_code + 10)
static scf_error_t _scf_fallback_error = SCF_ERROR_NONE;
#if defined(PTHREAD_ONCE_KEY_NP)
static pthread_key_t scf_error_key = PTHREAD_ONCE_KEY_NP;
int
scf_setup_error(void)
{
return (pthread_key_create_once_np(&scf_error_key, NULL) == 0);
}
#else /* PTHREAD_ONCE_KEY_NP */
/*
* This old code is here to enable the building of a native version
* of libscf.so when the build machine has not yet been upgraded
* to a version of libc that provides pthread_key_create_once_np().
* It should be deleted when solaris_nevada ships.
* This code is not MT-safe in a relaxed memory model.
*/
static pthread_key_t scf_error_key = 0;
int
scf_setup_error(void)
{
static pthread_mutex_t scf_key_lock = PTHREAD_MUTEX_INITIALIZER;
static volatile int scf_error_key_setup = 0;
if (scf_error_key_setup == 0) {
(void) pthread_mutex_lock(&scf_key_lock);
if (scf_error_key_setup == 0) {
if (pthread_key_create(&scf_error_key, NULL) == 0)
scf_error_key_setup = 1;
}
(void) pthread_mutex_unlock(&scf_key_lock);
}
return (scf_error_key_setup == 1);
}
#endif /* PTHREAD_ONCE_KEY_NP */
int
scf_set_error(scf_error_t code)
{
assert(LOOKS_VALID(code));
if (scf_setup_error())
(void) pthread_setspecific(scf_error_key, (void *)code);
else
_scf_fallback_error = code;
return (-1);
}
scf_error_t
scf_error(void)
{
scf_error_t ret;
ret = (scf_error_t)pthread_getspecific(scf_error_key);
if (ret == 0)
return (_scf_fallback_error);
assert(LOOKS_VALID(ret));
return (ret);
}
const char *
scf_strerror(scf_error_t code)
{
struct scf_error_info *cur, *end;
cur = scf_errors;
end = cur + SCF_NUM_ERRORS;
for (; cur < end; cur++)
if (code == cur->ei_code)
return (dgettext(TEXT_DOMAIN, cur->ei_desc));
return (dgettext(TEXT_DOMAIN, "unknown error"));
}
const char *
scf_get_msg(scf_msg_t msg)
{
switch (msg) {
case SCF_MSG_ARGTOOLONG:
return (dgettext(TEXT_DOMAIN,
"Argument '%s' is too long, ignoring\n"));
case SCF_MSG_PATTERN_NOINSTANCE:
return (dgettext(TEXT_DOMAIN,
"Pattern '%s' doesn't match any instances\n"));
case SCF_MSG_PATTERN_NOINSTSVC:
return (dgettext(TEXT_DOMAIN,
"Pattern '%s' doesn't match any instances or services\n"));
case SCF_MSG_PATTERN_NOSERVICE:
return (dgettext(TEXT_DOMAIN,
"Pattern '%s' doesn't match any services\n"));
case SCF_MSG_PATTERN_NOENTITY:
return (dgettext(TEXT_DOMAIN,
"Pattern '%s' doesn't match any entities\n"));
case SCF_MSG_PATTERN_MULTIMATCH:
return (dgettext(TEXT_DOMAIN,
"Pattern '%s' matches multiple instances:\n"));
case SCF_MSG_PATTERN_POSSIBLE:
return (dgettext(TEXT_DOMAIN, " %s\n"));
case SCF_MSG_PATTERN_LEGACY:
return (dgettext(TEXT_DOMAIN,
"Operation not supported for legacy service '%s'\n"));
case SCF_MSG_PATTERN_MULTIPARTIAL:
return (dgettext(TEXT_DOMAIN,
"Partial FMRI '%s' matches multiple instances:\n"));
default:
abort();
/* NOTREACHED */
}
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2026 Hammerhead / Zygaena project.
*/
/*
* libscf-stub.c -- SMF-removed stub of libscf for Hammerhead.
*
* Hammerhead has removed the Service Management Framework (Phases A/B/C):
* svc.startd, svc.configd, svccfg, svcadm, svcs, svcprop, manifest installs
* and the librestart layer are gone. libscf is the SMF *client* library that
* many existing illumos binaries still link against (`-lscf`). To preserve
* the link-time ABI without dragging in a 21k-line repository client, this
* file replaces the original lowlevel/midlevel/highlevel/notify_params/
* scf_tmpl/scf_type implementation with no-op stubs.
*
* All 285 versioned symbols from common/mapfile-vers remain resolvable.
* scf_error and scf_strerror live in error.c (which keeps thread-local error
* storage so callers see a stable errno-like value); the remaining 283
* symbols are stubbed here. Runtime calls return SCF_ERROR_NO_SERVER
* ("repository server unavailable" -- the truthful state now that configd
* is gone) so consumers degrade gracefully:
*
* - pointer returners : scf_set_error + return NULL
* - int returners : return scf_set_error() (which is -1)
* - ssize_t returners : scf_set_error + return -1
* - void returners : no-op
* - scf_type_t returners : return SCF_TYPE_INVALID
* - scf_walk_fmri (scf_error_t) : return SCF_ERROR_NO_SERVER
* - ismember : real implementation (stateless)
*
* This file MUST stay synchronised with mapfile-vers; symbols are grouped
* here in mapfile section order (ILLUMOS_0.1, SUNW_1.2, SUNW_1.1,
* SUNWprivate_1.1) and alphabetised within each section so symbol-version
* review is mechanical.
*
* Reference: docs/roadmap/SMF_PHASE_D_PLAN.md
*/
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <libscf.h>
#include <libscf_priv.h>
#include "libscf_impl.h"
/* Provided by error.c */
extern int scf_set_error(scf_error_t);
/* ===== ILLUMOS_0.1 ===== */
int
smf_disable_instance_with_comment(const char *, int, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
/* ===== SUNW_1.2 ===== */
void
scf_count_ranges_destroy(scf_count_ranges_t *)
{
}
void
scf_int_ranges_destroy(scf_int_ranges_t *)
{
}
scf_type_t
scf_string_to_type(const char *)
{
return (SCF_TYPE_INVALID);
}
int
scf_tmpl_error_pg(const scf_tmpl_error_t *, char **, char **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_error_pg_tmpl(const scf_tmpl_error_t *, char **, char **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_error_prop(const scf_tmpl_error_t *, char **, char **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_error_prop_tmpl(const scf_tmpl_error_t *, char **, char **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_error_type(const scf_tmpl_error_t *, scf_tmpl_error_type_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_error_value(const scf_tmpl_error_t *, char **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_tmpl_errors_destroy(scf_tmpl_errors_t *)
{
}
int
scf_tmpl_get_by_pg(scf_propertygroup_t *, scf_pg_tmpl_t *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_get_by_pg_name(const char *, const char *, const char *, const char *, scf_pg_tmpl_t *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_get_by_prop(scf_pg_tmpl_t *, const char *, scf_prop_tmpl_t *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_iter_pgs(scf_pg_tmpl_t *, const char *, const char *, const char *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_iter_props(scf_pg_tmpl_t *, scf_prop_tmpl_t *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_tmpl_error_t *
scf_tmpl_next_error(scf_tmpl_errors_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
ssize_t
scf_tmpl_pg_common_name(const scf_pg_tmpl_t *, const char *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
scf_pg_tmpl_t *
scf_tmpl_pg_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
ssize_t
scf_tmpl_pg_description(const scf_pg_tmpl_t *, const char *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
void
scf_tmpl_pg_destroy(scf_pg_tmpl_t *)
{
}
ssize_t
scf_tmpl_pg_name(const scf_pg_tmpl_t *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_tmpl_pg_required(const scf_pg_tmpl_t *, uint8_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_tmpl_pg_reset(scf_pg_tmpl_t *)
{
}
ssize_t
scf_tmpl_pg_target(const scf_pg_tmpl_t *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
ssize_t
scf_tmpl_pg_type(const scf_pg_tmpl_t *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_tmpl_prop_cardinality(const scf_prop_tmpl_t *, uint64_t *, uint64_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_tmpl_prop_common_name(const scf_prop_tmpl_t *, const char *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
scf_prop_tmpl_t *
scf_tmpl_prop_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
ssize_t
scf_tmpl_prop_description(const scf_prop_tmpl_t *, const char *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
void
scf_tmpl_prop_destroy(scf_prop_tmpl_t *)
{
}
int
scf_tmpl_prop_internal_seps(const scf_prop_tmpl_t *, scf_values_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_tmpl_prop_name(const scf_prop_tmpl_t *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_tmpl_prop_required(const scf_prop_tmpl_t *, uint8_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_tmpl_prop_reset(scf_prop_tmpl_t *)
{
}
int
scf_tmpl_prop_type(const scf_prop_tmpl_t *, scf_type_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_tmpl_prop_units(const scf_prop_tmpl_t *, const char *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_tmpl_prop_visibility(const scf_prop_tmpl_t *, uint8_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_tmpl_reset_errors(scf_tmpl_errors_t *)
{
}
int
scf_tmpl_strerror(scf_tmpl_error_t *, char *, size_t, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_validate_fmri(scf_handle_t *, const char *, const char *, scf_tmpl_errors_t **, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_tmpl_value_common_name(const scf_prop_tmpl_t *, const char *, const char *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_tmpl_value_count_range_choices(const scf_prop_tmpl_t *, scf_count_ranges_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_value_count_range_constraints(const scf_prop_tmpl_t *, scf_count_ranges_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_tmpl_value_description(const scf_prop_tmpl_t *, const char *, const char *, char **)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_tmpl_value_in_constraint(const scf_prop_tmpl_t *, scf_value_t *, scf_tmpl_errors_t **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_value_int_range_choices(const scf_prop_tmpl_t *, scf_int_ranges_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_value_int_range_constraints(const scf_prop_tmpl_t *, scf_int_ranges_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_value_name_choices(const scf_prop_tmpl_t *, scf_values_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_tmpl_value_name_constraints(const scf_prop_tmpl_t *, scf_values_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
const char *
scf_tmpl_visibility_to_string(uint8_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
const char *
scf_type_to_string(scf_type_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_values_destroy(scf_values_t *)
{
}
int
smf_notify_del_params(const char *, const char *, int32_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
smf_notify_get_params(nvlist_t **, nvlist_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
smf_notify_set_params(const char *, nvlist_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int32_t
smf_state_from_string(const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
const char *
smf_state_to_string(int32_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
/* ===== SUNW_1.1 ===== */
int
scf_entry_add_value(scf_transaction_entry_t *, scf_value_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_transaction_entry_t *
scf_entry_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_entry_destroy(scf_transaction_entry_t *)
{
}
void
scf_entry_destroy_children(scf_transaction_entry_t *)
{
}
scf_handle_t *
scf_entry_handle(const scf_transaction_entry_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_entry_reset(scf_transaction_entry_t *)
{
}
int
scf_handle_bind(scf_handle_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_handle_t *
scf_handle_create(scf_version_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
scf_handle_decode_fmri(scf_handle_t *, const char *, scf_scope_t *, scf_service_t *, scf_instance_t *, scf_propertygroup_t *, scf_property_t *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_handle_decorate(scf_handle_t *, const char *, scf_value_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_handle_destroy(scf_handle_t *)
{
}
int
scf_handle_get_scope(scf_handle_t *, const char *, scf_scope_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_handle_unbind(scf_handle_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_instance_add_pg(const scf_instance_t *, const char *, const char *, uint32_t, scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_instance_t *
scf_instance_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
scf_instance_delete(scf_instance_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_instance_destroy(scf_instance_t *)
{
}
ssize_t
scf_instance_get_name(const scf_instance_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_instance_get_parent(const scf_instance_t *, scf_service_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_instance_get_pg(const scf_instance_t *, const char *, scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_instance_get_pg_composed(const scf_instance_t *, const scf_snapshot_t *, const char *, scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_instance_get_snapshot(const scf_instance_t *, const char *, scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_handle_t *
scf_instance_handle(const scf_instance_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
ssize_t
scf_instance_to_fmri(const scf_instance_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
scf_iter_t *
scf_iter_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_iter_destroy(scf_iter_t *)
{
}
scf_handle_t *
scf_iter_handle(const scf_iter_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
scf_iter_handle_scopes(scf_iter_t *, const scf_handle_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_instance_pgs(scf_iter_t *, const scf_instance_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_instance_pgs_composed(scf_iter_t *, const scf_instance_t *, const scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_instance_pgs_typed(scf_iter_t *, const scf_instance_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_instance_pgs_typed_composed(scf_iter_t *, const scf_instance_t *, const scf_snapshot_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_instance_snapshots(scf_iter_t *, const scf_instance_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_next_instance(scf_iter_t *, scf_instance_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_next_pg(scf_iter_t *, scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_next_property(scf_iter_t *, scf_property_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_next_scope(scf_iter_t *, scf_scope_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_next_service(scf_iter_t *, scf_service_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_next_snapshot(scf_iter_t *, scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_next_value(scf_iter_t *, scf_value_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_pg_properties(scf_iter_t *, const scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_property_values(scf_iter_t *, const scf_property_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_iter_reset(scf_iter_t *)
{
}
int
scf_iter_scope_services(scf_iter_t *, const scf_scope_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_service_instances(scf_iter_t *, const scf_service_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_service_pgs(scf_iter_t *, const scf_service_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_service_pgs_typed(scf_iter_t *, const scf_service_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_snaplevel_pgs(scf_iter_t *, const scf_snaplevel_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_iter_snaplevel_pgs_typed(scf_iter_t *, const scf_snaplevel_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_limit(uint32_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
ssize_t
scf_myname(scf_handle_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
scf_propertygroup_t *
scf_pg_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
scf_pg_delete(scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_pg_destroy(scf_propertygroup_t *)
{
}
int
scf_pg_get_flags(const scf_propertygroup_t *, uint32_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_pg_get_name(const scf_propertygroup_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_pg_get_parent_instance(const scf_propertygroup_t *, scf_instance_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_pg_get_parent_service(const scf_propertygroup_t *, scf_service_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_pg_get_parent_snaplevel(const scf_propertygroup_t *, scf_snaplevel_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_pg_get_property(const scf_propertygroup_t *, const char *, scf_property_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_pg_get_type(const scf_propertygroup_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_pg_get_underlying_pg(const scf_propertygroup_t *, scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_handle_t *
scf_pg_handle(const scf_propertygroup_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
ssize_t
scf_pg_to_fmri(const scf_propertygroup_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_pg_update(scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_property_t *
scf_property_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_property_destroy(scf_property_t *)
{
}
ssize_t
scf_property_get_name(const scf_property_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_property_get_value(const scf_property_t *, scf_value_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_handle_t *
scf_property_handle(const scf_property_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
scf_property_is_type(const scf_property_t *, scf_type_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_property_to_fmri(const scf_property_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_property_type(const scf_property_t *, scf_type_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_scope_add_service(const scf_scope_t *, const char *, scf_service_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_scope_t *
scf_scope_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_scope_destroy(scf_scope_t *)
{
}
ssize_t
scf_scope_get_name(const scf_scope_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_scope_get_parent(const scf_scope_t *, scf_scope_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_scope_get_service(const scf_scope_t *, const char *, scf_service_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_handle_t *
scf_scope_handle(const scf_scope_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
ssize_t
scf_scope_to_fmri(const scf_scope_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_service_add_instance(const scf_service_t *, const char *, scf_instance_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_service_add_pg(const scf_service_t *, const char *, const char *, uint32_t, scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_service_t *
scf_service_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
scf_service_delete(scf_service_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_service_destroy(scf_service_t *)
{
}
int
scf_service_get_instance(const scf_service_t *, const char *, scf_instance_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_service_get_name(const scf_service_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_service_get_parent(const scf_service_t *, scf_scope_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_service_get_pg(const scf_service_t *, const char *, scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_handle_t *
scf_service_handle(const scf_service_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
ssize_t
scf_service_to_fmri(const scf_service_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
void
scf_simple_app_props_free(scf_simple_app_props_t *)
{
}
scf_simple_app_props_t *
scf_simple_app_props_get(scf_handle_t *, const char *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
const scf_simple_prop_t *
scf_simple_app_props_next(const scf_simple_app_props_t *, scf_simple_prop_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
const scf_simple_prop_t *
scf_simple_app_props_search(const scf_simple_app_props_t *, const char *, const char *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_simple_prop_free(scf_simple_prop_t *)
{
}
scf_simple_prop_t *
scf_simple_prop_get(scf_handle_t *, const char *, const char *, const char *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
char *
scf_simple_prop_name(const scf_simple_prop_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
char *
scf_simple_prop_next_astring(scf_simple_prop_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
uint8_t *
scf_simple_prop_next_boolean(scf_simple_prop_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
uint64_t *
scf_simple_prop_next_count(scf_simple_prop_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int64_t *
scf_simple_prop_next_integer(scf_simple_prop_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void *
scf_simple_prop_next_opaque(scf_simple_prop_t *, size_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_simple_prop_next_reset(scf_simple_prop_t *)
{
}
int64_t *
scf_simple_prop_next_time(scf_simple_prop_t *, int32_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
char *
scf_simple_prop_next_ustring(scf_simple_prop_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
ssize_t
scf_simple_prop_numvalues(const scf_simple_prop_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
char *
scf_simple_prop_pgname(const scf_simple_prop_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
scf_type_t
scf_simple_prop_type(const scf_simple_prop_t *)
{
return (SCF_TYPE_INVALID);
}
int
scf_simple_walk_instances(uint_t, void *, int (*)(scf_handle_t *, scf_instance_t *, void *))
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_snaplevel_t *
scf_snaplevel_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_snaplevel_destroy(scf_snaplevel_t *)
{
}
ssize_t
scf_snaplevel_get_instance_name(const scf_snaplevel_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_snaplevel_get_next_snaplevel(const scf_snaplevel_t *, scf_snaplevel_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_snaplevel_get_parent(const scf_snaplevel_t *, scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_snaplevel_get_pg(const scf_snaplevel_t *, const char *, scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_snaplevel_get_scope_name(const scf_snaplevel_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
ssize_t
scf_snaplevel_get_service_name(const scf_snaplevel_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
scf_handle_t *
scf_snaplevel_handle(const scf_snaplevel_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
scf_snapshot_t *
scf_snapshot_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_snapshot_destroy(scf_snapshot_t *)
{
}
int
scf_snapshot_get_base_snaplevel(const scf_snapshot_t *, scf_snaplevel_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_snapshot_get_name(const scf_snapshot_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_snapshot_get_parent(const scf_snapshot_t *, scf_instance_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_handle_t *
scf_snapshot_handle(const scf_snapshot_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
scf_snapshot_update(scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_transaction_commit(scf_transaction_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_transaction_t *
scf_transaction_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_transaction_destroy(scf_transaction_t *)
{
}
void
scf_transaction_destroy_children(scf_transaction_t *)
{
}
scf_handle_t *
scf_transaction_handle(const scf_transaction_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
scf_transaction_property_change(scf_transaction_t *, scf_transaction_entry_t *, const char *, scf_type_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_transaction_property_change_type(scf_transaction_t *, scf_transaction_entry_t *, const char *, scf_type_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_transaction_property_delete(scf_transaction_t *, scf_transaction_entry_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_transaction_property_new(scf_transaction_t *, scf_transaction_entry_t *, const char *, scf_type_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_transaction_reset(scf_transaction_t *)
{
}
void
scf_transaction_reset_all(scf_transaction_t *)
{
}
int
scf_transaction_start(scf_transaction_t *, scf_propertygroup_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_type_base_type(scf_type_t, scf_type_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_type_t
scf_value_base_type(const scf_value_t *)
{
return (SCF_TYPE_INVALID);
}
scf_value_t *
scf_value_create(scf_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_value_destroy(scf_value_t *)
{
}
ssize_t
scf_value_get_as_string(const scf_value_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
ssize_t
scf_value_get_as_string_typed(const scf_value_t *, scf_type_t, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
ssize_t
scf_value_get_astring(const scf_value_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_value_get_boolean(const scf_value_t *, uint8_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_value_get_count(const scf_value_t *, uint64_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_value_get_integer(const scf_value_t *, int64_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_value_get_opaque(const scf_value_t *, void *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
int
scf_value_get_time(const scf_value_t *, int64_t *, int32_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
ssize_t
scf_value_get_ustring(const scf_value_t *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
scf_handle_t *
scf_value_handle(const scf_value_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
scf_value_is_type(const scf_value_t *, scf_type_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_value_reset(scf_value_t *)
{
}
int
scf_value_set_astring(scf_value_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_value_set_boolean(scf_value_t *, uint8_t)
{
}
void
scf_value_set_count(scf_value_t *, uint64_t)
{
}
int
scf_value_set_from_string(scf_value_t *, scf_type_t, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_value_set_integer(scf_value_t *, int64_t)
{
}
int
scf_value_set_opaque(scf_value_t *, const void *, size_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_value_set_time(scf_value_t *, int64_t, int32_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_value_set_ustring(scf_value_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_type_t
scf_value_type(const scf_value_t *)
{
return (SCF_TYPE_INVALID);
}
int
smf_degrade_instance(const char *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
smf_disable_instance(const char *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
smf_enable_instance(const char *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
char *
smf_get_state(const char *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
smf_maintain_instance(const char *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
smf_refresh_instance(const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
smf_restart_instance(const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
smf_restore_instance(const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
/* ===== SUNWprivate_1.1 ===== */
void
_check_services(char **)
{
}
scf_tmpl_errors_t *
_scf_create_errors(const char *, int)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
_scf_get_fma_notify_params(const char *, nvlist_t *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_get_svc_notify_params(const char *, nvlist_t *, int32_t, int, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_handle_t *
_scf_handle_create_and_bind(scf_version_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
_scf_handle_decorations(scf_handle_t *, scf_decoration_func *, scf_value_t *, void *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_notify_add_pgname(scf_handle_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_notify_add_pgtype(scf_handle_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_notify_get_params(scf_propertygroup_t *, nvlist_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_notify_wait(scf_propertygroup_t *, char *, size_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_pg_is_read_protected(const scf_propertygroup_t *, boolean_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_pg_wait(scf_propertygroup_t *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
char *
_scf_read_single_astring_from_pg(scf_propertygroup_t *, const char *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
char *
_scf_read_tmpl_prop_type_as_string(const scf_prop_tmpl_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
int
_scf_repository_switch(scf_handle_t *, int)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_request_backup(scf_handle_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
_scf_sanitize_locale(char *)
{
}
int
_scf_set_annotation(scf_handle_t *, const char *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_snapshot_attach(scf_snapshot_t *, scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_snapshot_delete(scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_snapshot_take_attach(scf_instance_t *, scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_snapshot_take_new(scf_instance_t *, const char *, scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_snapshot_take_new_named(scf_instance_t *, const char *, const char *, const char *, scf_snapshot_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_tmpl_add_error(scf_tmpl_errors_t *, scf_tmpl_error_type_t, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_scf_tmpl_error_set_prefix(scf_tmpl_errors_t *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_smf_refresh_all_instances(scf_service_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
_smf_refresh_instance_i(scf_instance_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
gen_filenms_from_fmri(const char *, const char *, char *, char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
ismember(const scf_error_t e, const scf_error_t arr[])
{
int i;
for (i = 0; arr[i] != 0; i++) {
if (arr[i] == e)
return (1);
}
return (0);
}
ssize_t
scf_canonify_fmri(const char *, char *, size_t)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return ((ssize_t)-1);
}
void
scf_clean_propvec(scf_propvec_t *)
{
}
int
scf_cmp_pattern(char *, scf_pattern_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_decode32(const char *, size_t, char *, size_t, size_t *, char)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
#if !defined(NATIVE_BUILD)
int
scf_default_secflags(scf_handle_t *, scf_secflags_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
#endif
int
scf_encode32(const char *, size_t, char *, size_t, size_t *, char)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_fastreboot_default_set_transient(boolean_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_simple_handle_t *
scf_general_pg_setup(const char *, const char *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
void
scf_get_boot_config(uint8_t *)
{
}
void
scf_get_boot_config_ovr(uint8_t *)
{
}
int
scf_instance_delete_prop(scf_instance_t *, const char *, const char *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_is_compatible_type(scf_type_t, scf_type_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_is_fastboot_default(void)
{
return (0);
}
int
scf_parse_file_fmri(char *, const char **, const char **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_parse_fmri(char *, int *, const char **, const char **, const char **, const char **, const char **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_parse_svc_fmri(char *, const char **, const char **, const char **, const char **, const char **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_read_count_property(scf_simple_handle_t *, char *, uint64_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_read_propvec(const char *, const char *, boolean_t, scf_propvec_t *, scf_propvec_t **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
int
scf_set_count_property(scf_transaction_t *, char *, uint64_t, boolean_t)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
void
scf_simple_handle_destroy(scf_simple_handle_t *)
{
}
int
scf_transaction_restart(scf_simple_handle_t *, scf_transaction_t *)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
scf_transaction_t *
scf_transaction_setup(scf_simple_handle_t *)
{
(void) scf_set_error(SCF_ERROR_NO_SERVER);
return (NULL);
}
scf_error_t
scf_walk_fmri(scf_handle_t *, int, char **, int, scf_walk_callback, void *, int *, void (*)(const char *, ...))
{
return (SCF_ERROR_NO_SERVER);
}
int
scf_write_propvec(const char *, const char *, scf_propvec_t *, scf_propvec_t **)
{
return (scf_set_error(SCF_ERROR_NO_SERVER));
}
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBSCF_IMPL_H
#define _LIBSCF_IMPL_H
#include <libscf.h>
#include <libscf_priv.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* This macro must be extended if additional FMRI prefixes are defined
*/
#define SCF_FMRI_PREFIX_MAX_LEN (sizeof (SCF_FMRI_SVC_PREFIX) > \
sizeof (SCF_FMRI_FILE_PREFIX) ? \
sizeof (SCF_FMRI_SVC_PREFIX) - 1 : \
sizeof (SCF_FMRI_FILE_PREFIX) - 1)
int scf_setup_error(void);
int scf_set_error(scf_error_t); /* returns -1 */
typedef enum {
SCF_MSG_ARGTOOLONG,
SCF_MSG_PATTERN_NOINSTANCE,
SCF_MSG_PATTERN_NOINSTSVC,
SCF_MSG_PATTERN_NOSERVICE,
SCF_MSG_PATTERN_NOENTITY,
SCF_MSG_PATTERN_MULTIMATCH,
SCF_MSG_PATTERN_POSSIBLE,
SCF_MSG_PATTERN_LEGACY,
SCF_MSG_PATTERN_MULTIPARTIAL
} scf_msg_t;
scf_type_t scf_true_base_type(scf_type_t);
const char *scf_get_msg(scf_msg_t);
int ismember(const scf_error_t, const scf_error_t[]);
int32_t state_from_string(const char *, size_t);
#ifdef __cplusplus
}
#endif
#endif /* _LIBSCF_IMPL_H */
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LOWLEVEL_IMPL_H
#define _LOWLEVEL_IMPL_H
#include "libscf_impl.h"
#include <door.h>
#include <libuutil.h>
#include <limits.h>
#include <pthread.h>
#include <stddef.h>
#include <sys/zone.h>
#include "repcache_protocol.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct scf_datael {
scf_handle_t *rd_handle;
uint32_t rd_entity;
uint32_t rd_type;
uint32_t rd_reset;
uu_list_node_t rd_node;
} scf_datael_t;
#define DATAEL_VALID 0x0001
/*
* Handle structure.
*
* Access to handles is serialized -- access to and modification of a handle
* and all of its children is protected by rh_lock.
*
* Different handles don't interfere with each other.
*/
struct scf_handle {
pthread_mutex_t rh_lock;
pthread_cond_t rh_cv;
uint32_t rh_nextiter;
uint32_t rh_nextentity;
uint32_t rh_nextchangeid;
int rh_doorfd;
int rh_doorfd_old; /* fd to close once rh_fd_users == 0 */
door_id_t rh_doorid;
pid_t rh_doorpid; /* pid at bind time */
uid_t rh_uid;
uint32_t rh_debug;
uint32_t rh_flags; /* HANDLE_*, below */
uint32_t rh_fd_users; /* non-locked users of rh_doorfd */
uu_list_t *rh_dataels;
uu_list_t *rh_iters;
long rh_entries;
long rh_values;
long rh_extrefs; /* user-created subhandle count */
long rh_intrefs; /* handle-internal subhandle count */
char rh_doorpath[PATH_MAX + 1];
zoneid_t rh_zoneid; /* expected zone ID for door server */
pthread_t rh_holder; /* thread using subhandles */
uint32_t rh_hold_flags; /* which are in use */
scf_iter_t *rh_iter;
scf_scope_t *rh_scope;
scf_service_t *rh_service;
scf_instance_t *rh_instance;
scf_snapshot_t *rh_snapshot;
scf_snaplevel_t *rh_snaplvl;
scf_propertygroup_t *rh_pg;
scf_property_t *rh_property;
scf_value_t *rh_value;
};
#define HANDLE_DEAD 0x0001
#define HANDLE_UNREFED 0x0002
#define HANDLE_WRAPPED_ENTITY 0x0004
#define HANDLE_WRAPPED_ITER 0x0008
#define RH_HOLD_ITER 0x0001
#define RH_HOLD_SCOPE 0x0002
#define RH_HOLD_SERVICE 0x0004
#define RH_HOLD_INSTANCE 0x0008
#define RH_HOLD_SNAPSHOT 0x0010
#define RH_HOLD_SNAPLVL 0x0020
#define RH_HOLD_PG 0x0040
#define RH_HOLD_PROPERTY 0x0080
#define RH_HOLD_VALUE 0x0100
#define RH_HOLD_ALL 0x01ff
struct scf_scope {
scf_datael_t rd_d;
};
struct scf_service {
scf_datael_t rd_d;
};
struct scf_instance {
scf_datael_t rd_d;
};
struct scf_snapshot {
scf_datael_t rd_d;
};
/*
* note: be careful of adding more state here -- snaplevel_next() relies on
* the fact that the entityid is the only library-level state.
*/
struct scf_snaplevel {
scf_datael_t rd_d;
};
struct scf_propertygroup {
scf_datael_t rd_d;
};
struct scf_property {
scf_datael_t rd_d;
};
struct scf_value {
scf_handle_t *value_handle;
scf_value_t *value_next;
scf_transaction_entry_t *value_tx;
rep_protocol_value_type_t value_type;
size_t value_size; /* only for opaque values */
char value_value[REP_PROTOCOL_VALUE_LEN];
};
enum scf_entry_state {
ENTRY_STATE_INVALID,
ENTRY_STATE_IN_TX_ACTION
};
struct scf_transaction_entry {
const char *entry_property;
scf_handle_t *entry_handle;
scf_transaction_t *entry_tx;
enum scf_entry_state entry_state;
uu_list_node_t entry_link; /* for property name list */
scf_value_t *entry_head;
scf_value_t *entry_tail; /* for linked values */
enum rep_protocol_transaction_action entry_action;
rep_protocol_value_type_t entry_type;
char entry_namebuf[REP_PROTOCOL_NAME_LEN];
};
enum scf_tx_state {
TRAN_STATE_NEW,
TRAN_STATE_SETUP,
TRAN_STATE_COMMITTED
};
struct scf_transaction {
enum scf_tx_state tran_state;
scf_propertygroup_t tran_pg;
int tran_invalid;
uu_list_t *tran_props;
};
struct scf_iter {
scf_handle_t *iter_handle;
int iter_type;
uint32_t iter_id;
uint32_t iter_sequence;
uu_list_node_t iter_node;
};
#ifdef __cplusplus
}
#endif
#endif /* _LOWLEVEL_IMPL_H */
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright 2020 Joyent, Inc.
#
#
# MAPFILE HEADER START
#
# WARNING: STOP NOW. DO NOT MODIFY THIS FILE.
# Object versioning must comply with the rules detailed in
#
# usr/src/lib/README.mapfiles
#
# You should not be making modifications here until you've read the most current
# copy of that file. If you need help, contact a gatekeeper for guidance.
#
# MAPFILE HEADER END
#
$mapfile_version 2
SYMBOL_VERSION ILLUMOS_0.2 {
global:
smf_refresh_all_instances;
smf_enable_instance_by_instance;
smf_disable_instance_by_instance;
smf_refresh_instance_by_instance;
smf_restart_instance_by_instance;
smf_maintain_instance_by_instance;
smf_degrade_instance_by_instance;
smf_restore_instance_by_instance;
smf_get_state_by_instance;
} ILLUMOS_0.1;
SYMBOL_VERSION ILLUMOS_0.1 {
global:
smf_disable_instance_with_comment;
} SUNW_1.2;
SYMBOL_VERSION SUNW_1.2 {
global:
scf_count_ranges_destroy;
scf_int_ranges_destroy;
scf_string_to_type;
scf_tmpl_error_pg;
scf_tmpl_error_pg_tmpl;
scf_tmpl_error_prop;
scf_tmpl_error_prop_tmpl;
scf_tmpl_error_type;
scf_tmpl_error_value;
scf_tmpl_errors_destroy;
scf_tmpl_get_by_pg;
scf_tmpl_get_by_prop;
scf_tmpl_get_by_pg_name;
scf_tmpl_iter_pgs;
scf_tmpl_iter_props;
scf_tmpl_next_error;
scf_tmpl_pg_common_name;
scf_tmpl_pg_create;
scf_tmpl_pg_description;
scf_tmpl_pg_destroy;
scf_tmpl_pg_name;
scf_tmpl_pg_required;
scf_tmpl_pg_reset;
scf_tmpl_pg_target;
scf_tmpl_pg_type;
scf_tmpl_prop_cardinality;
scf_tmpl_prop_common_name;
scf_tmpl_prop_create;
scf_tmpl_prop_description;
scf_tmpl_prop_destroy;
scf_tmpl_prop_internal_seps;
scf_tmpl_prop_name;
scf_tmpl_prop_required;
scf_tmpl_prop_reset;
scf_tmpl_prop_type;
scf_tmpl_prop_units;
scf_tmpl_prop_visibility;
scf_tmpl_reset_errors;
scf_tmpl_strerror;
scf_tmpl_validate_fmri;
scf_tmpl_value_common_name;
scf_tmpl_value_count_range_choices;
scf_tmpl_value_count_range_constraints;
scf_tmpl_value_description;
scf_tmpl_value_in_constraint;
scf_tmpl_value_int_range_constraints;
scf_tmpl_value_name_choices;
scf_tmpl_value_name_constraints;
scf_tmpl_value_int_range_choices;
scf_tmpl_visibility_to_string;
scf_type_to_string;
scf_values_destroy;
smf_notify_del_params;
smf_notify_get_params;
smf_notify_set_params;
smf_state_from_string;
smf_state_to_string;
} SUNW_1.1;
SYMBOL_VERSION SUNW_1.1 {
global:
scf_entry_add_value;
scf_entry_create;
scf_entry_destroy;
scf_entry_destroy_children;
scf_entry_handle;
scf_entry_reset;
scf_error;
scf_handle_bind;
scf_handle_create;
scf_handle_decode_fmri;
scf_handle_decorate;
scf_handle_destroy;
scf_handle_get_scope;
scf_handle_unbind;
scf_instance_add_pg;
scf_instance_create;
scf_instance_delete;
scf_instance_destroy;
scf_instance_get_name;
scf_instance_get_parent;
scf_instance_get_pg;
scf_instance_get_pg_composed;
scf_instance_get_snapshot;
scf_instance_handle;
scf_instance_to_fmri;
scf_iter_create;
scf_iter_destroy;
scf_iter_handle;
scf_iter_handle_scopes;
scf_iter_instance_pgs;
scf_iter_instance_pgs_composed;
scf_iter_instance_pgs_typed;
scf_iter_instance_pgs_typed_composed;
scf_iter_instance_snapshots;
scf_iter_next_instance;
scf_iter_next_pg;
scf_iter_next_property;
scf_iter_next_scope;
scf_iter_next_service;
scf_iter_next_snapshot;
scf_iter_next_value;
scf_iter_pg_properties;
scf_iter_property_values;
scf_iter_reset;
scf_iter_scope_services;
scf_iter_service_instances;
scf_iter_service_pgs;
scf_iter_service_pgs_typed;
scf_iter_snaplevel_pgs;
scf_iter_snaplevel_pgs_typed;
scf_limit;
scf_myname;
scf_pg_create;
scf_pg_delete;
scf_pg_destroy;
scf_pg_get_flags;
scf_pg_get_name;
scf_pg_get_parent_instance;
scf_pg_get_parent_service;
scf_pg_get_parent_snaplevel;
scf_pg_get_property;
scf_pg_get_type;
scf_pg_get_underlying_pg;
scf_pg_handle;
scf_pg_to_fmri;
scf_pg_update;
scf_property_create;
scf_property_destroy;
scf_property_get_name;
scf_property_get_value;
scf_property_handle;
scf_property_is_type;
scf_property_to_fmri;
scf_property_type;
scf_scope_add_service;
scf_scope_create;
scf_scope_destroy;
scf_scope_get_name;
scf_scope_get_parent;
scf_scope_get_service;
scf_scope_handle;
scf_scope_to_fmri;
scf_service_add_instance;
scf_service_add_pg;
scf_service_create;
scf_service_delete;
scf_service_destroy;
scf_service_get_instance;
scf_service_get_name;
scf_service_get_parent;
scf_service_get_pg;
scf_service_handle;
scf_service_to_fmri;
scf_simple_app_props_free;
scf_simple_app_props_get;
scf_simple_app_props_next;
scf_simple_app_props_search;
scf_simple_prop_free;
scf_simple_prop_get;
scf_simple_prop_name;
scf_simple_prop_next_astring;
scf_simple_prop_next_boolean;
scf_simple_prop_next_count;
scf_simple_prop_next_integer;
scf_simple_prop_next_opaque;
scf_simple_prop_next_reset;
scf_simple_prop_next_time;
scf_simple_prop_next_ustring;
scf_simple_prop_numvalues;
scf_simple_prop_pgname;
scf_simple_prop_type;
scf_simple_walk_instances;
scf_snaplevel_create;
scf_snaplevel_destroy;
scf_snaplevel_get_instance_name;
scf_snaplevel_get_next_snaplevel;
scf_snaplevel_get_parent;
scf_snaplevel_get_pg;
scf_snaplevel_get_scope_name;
scf_snaplevel_get_service_name;
scf_snaplevel_handle;
scf_snapshot_create;
scf_snapshot_destroy;
scf_snapshot_get_base_snaplevel;
scf_snapshot_get_name;
scf_snapshot_get_parent;
scf_snapshot_handle;
scf_snapshot_update;
scf_strerror;
scf_transaction_commit;
scf_transaction_create;
scf_transaction_destroy;
scf_transaction_destroy_children;
scf_transaction_handle;
scf_transaction_property_change;
scf_transaction_property_change_type;
scf_transaction_property_delete;
scf_transaction_property_new;
scf_transaction_reset;
scf_transaction_reset_all;
scf_transaction_start;
scf_type_base_type;
scf_value_base_type;
scf_value_create;
scf_value_destroy;
scf_value_get_as_string;
scf_value_get_as_string_typed;
scf_value_get_astring;
scf_value_get_boolean;
scf_value_get_count;
scf_value_get_integer;
scf_value_get_opaque;
scf_value_get_time;
scf_value_get_ustring;
scf_value_handle;
scf_value_is_type;
scf_value_reset;
scf_value_set_astring;
scf_value_set_boolean;
scf_value_set_count;
scf_value_set_from_string;
scf_value_set_integer;
scf_value_set_opaque;
scf_value_set_time;
scf_value_set_ustring;
scf_value_type;
smf_degrade_instance;
smf_disable_instance;
smf_enable_instance;
smf_get_state;
smf_maintain_instance;
smf_refresh_instance;
smf_restart_instance;
smf_restore_instance;
};
SYMBOL_VERSION SUNWprivate_1.1 {
global:
gen_filenms_from_fmri;
ismember;
scf_canonify_fmri;
scf_cmp_pattern;
_scf_create_errors;
scf_decode32;
scf_encode32;
scf_general_pg_setup;
_scf_get_fma_notify_params;
_scf_get_svc_notify_params;
_scf_handle_decorations;
scf_is_compatible_type;
_scf_notify_add_pgname;
_scf_notify_add_pgtype;
_scf_notify_get_params;
_scf_notify_wait;
scf_parse_file_fmri;
scf_parse_fmri;
scf_parse_svc_fmri;
_scf_pg_is_read_protected;
_scf_pg_wait;
scf_read_count_property;
_scf_read_single_astring_from_pg;
_scf_read_tmpl_prop_type_as_string;
_scf_repository_switch;
_scf_request_backup;
_scf_sanitize_locale;
_scf_set_annotation;
scf_set_count_property;
scf_simple_handle_destroy;
_scf_snapshot_attach;
_scf_snapshot_delete;
_scf_snapshot_take_attach;
_scf_snapshot_take_new;
_scf_snapshot_take_new_named;
_scf_tmpl_add_error;
_scf_tmpl_error_set_prefix;
scf_transaction_setup;
scf_transaction_restart;
scf_walk_fmri;
_smf_refresh_instance_i;
scf_read_propvec;
scf_write_propvec;
scf_clean_propvec;
scf_instance_delete_prop;
scf_get_boot_config;
scf_get_boot_config_ovr;
scf_is_fastboot_default;
scf_fastreboot_default_set_transient;
scf_default_secflags;
_check_services;
_scf_handle_create_and_bind;
local:
*;
};
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _MIDLEVEL_IMPL_H
#define _MIDLEVEL_IMPL_H
#include "libscf_impl.h"
#ifdef __cplusplus
extern "C" {
#endif
union scf_simple_prop_val {
uint8_t pv_bool;
uint64_t pv_uint;
int64_t pv_int;
char *pv_str;
struct pv_time {
int64_t t_sec;
int32_t t_nsec;
} pv_time;
struct pv_opaque {
void *o_value;
size_t o_size;
} pv_opaque;
};
struct scf_simple_prop {
uint32_t pr_numvalues;
uint32_t pr_iter;
scf_type_t pr_type;
char *pr_propname;
char *pr_pgname;
union scf_simple_prop_val *pr_vallist;
scf_simple_prop_t *pr_next;
struct scf_simple_pg *pr_pg;
};
struct scf_simple_pg {
char *pg_name;
scf_simple_prop_t *pg_proplist;
struct scf_simple_pg *pg_next;
};
struct scf_simple_app_props {
char *ap_fmri;
struct scf_simple_pg *ap_pglist;
};
#ifdef __cplusplus
}
#endif
#endif /* _MIDLEVEL_IMPL_H */
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SCF_TYPE_H
#define _SCF_TYPE_H
#include <repcache_protocol.h>
#ifdef __cplusplus
extern "C" {
#endif
int scf_validate_encoded_value(rep_protocol_value_type_t, const char *);
rep_protocol_value_type_t scf_proto_underlying_type(rep_protocol_value_type_t);
int scf_is_compatible_protocol_type(rep_protocol_value_type_t,
rep_protocol_value_type_t);
#ifdef __cplusplus
}
#endif
#endif /* _SCF_TYPE_H */
#!/bin/sh
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
find_files "s.*" usr/src/common/svc
find_files "s.*" usr/src/lib/libuutil
exec_file usr/src/lib/libuutil/inc.flg
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2016 RackTop Systems.
* Copyright 2020 Joyent, Inc.
* Copyright 2026 Oxide Computer Company
*/
#ifndef _LIBSCF_H
#define _LIBSCF_H
#include <stddef.h>
#include <libnvpair.h>
#ifndef NATIVE_BUILD
#include <sys/secflags.h>
#endif /* NATIVE_BUILD */
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef unsigned long scf_version_t;
#define SCF_VERSION 1UL
/*
* Opaque structures
*/
typedef struct scf_handle scf_handle_t;
typedef struct scf_scope scf_scope_t;
typedef struct scf_service scf_service_t;
typedef struct scf_instance scf_instance_t;
typedef struct scf_propertygroup scf_propertygroup_t;
typedef struct scf_property scf_property_t;
typedef struct scf_snapshot scf_snapshot_t;
typedef struct scf_snaplevel scf_snaplevel_t;
typedef struct scf_transaction scf_transaction_t;
typedef struct scf_transaction_entry scf_transaction_entry_t;
typedef struct scf_value scf_value_t;
typedef struct scf_iter scf_iter_t;
typedef struct scf_pg_tmpl scf_pg_tmpl_t;
typedef struct scf_prop_tmpl scf_prop_tmpl_t;
typedef struct scf_tmpl_errors scf_tmpl_errors_t;
typedef struct scf_simple_app_props scf_simple_app_props_t;
typedef struct scf_simple_prop scf_simple_prop_t;
/*
* Types
*/
typedef enum {
SCF_TYPE_INVALID = 0,
SCF_TYPE_BOOLEAN,
SCF_TYPE_COUNT,
SCF_TYPE_INTEGER,
SCF_TYPE_TIME,
SCF_TYPE_ASTRING,
SCF_TYPE_OPAQUE,
SCF_TYPE_USTRING = 100,
SCF_TYPE_URI = 200,
SCF_TYPE_FMRI,
SCF_TYPE_HOST = 300,
SCF_TYPE_HOSTNAME,
SCF_TYPE_NET_ADDR_V4,
SCF_TYPE_NET_ADDR_V6,
SCF_TYPE_NET_ADDR
} scf_type_t;
/*
* Values returned by scf_type_to_string
*/
#define SCF_TYPE_STRING_BOOLEAN "boolean"
#define SCF_TYPE_STRING_COUNT "count"
#define SCF_TYPE_STRING_INTEGER "integer"
#define SCF_TYPE_STRING_TIME "time"
#define SCF_TYPE_STRING_ASTRING "astring"
#define SCF_TYPE_STRING_OPAQUE "opaque"
#define SCF_TYPE_STRING_USTRING "ustring"
#define SCF_TYPE_STRING_URI "uri"
#define SCF_TYPE_STRING_FMRI "fmri"
#define SCF_TYPE_STRING_HOST "host"
#define SCF_TYPE_STRING_HOSTNAME "hostname"
#define SCF_TYPE_STRING_NET_ADDR "net_address"
#define SCF_TYPE_STRING_NET_ADDR_V4 "net_address_v4"
#define SCF_TYPE_STRING_NET_ADDR_V6 "net_address_v6"
typedef struct scf_time {
int64_t t_seconds;
int32_t t_ns;
} scf_time_t;
/*
* There is no explicit initializer for this structure. Functions
* which set or populate this structure assume that it is either
* uninitialized or destroyed.
*/
typedef struct scf_values {
scf_type_t value_type;
void *reserved; /* reserved for future use */
int value_count;
char **values_as_strings;
union {
uint64_t *v_count;
uint8_t *v_boolean;
int64_t *v_integer;
char **v_astring;
char **v_ustring;
char **v_opaque;
scf_time_t *v_time;
} values;
} scf_values_t;
typedef struct scf_count_ranges {
int scr_num_ranges;
uint64_t *scr_min;
uint64_t *scr_max;
} scf_count_ranges_t;
typedef struct scf_int_ranges {
int sir_num_ranges;
int64_t *sir_min;
int64_t *sir_max;
} scf_int_ranges_t;
/*
* Return codes
*/
#define SCF_SUCCESS 0
#define SCF_COMPLETE 1
#define SCF_FAILED -1
typedef enum scf_error {
SCF_ERROR_NONE = 1000, /* no error */
SCF_ERROR_NOT_BOUND, /* handle not bound */
SCF_ERROR_NOT_SET, /* cannot use unset argument */
SCF_ERROR_NOT_FOUND, /* nothing of that name found */
SCF_ERROR_TYPE_MISMATCH, /* type does not match value */
SCF_ERROR_IN_USE, /* cannot modify while in-use */
SCF_ERROR_CONNECTION_BROKEN, /* repository connection gone */
SCF_ERROR_INVALID_ARGUMENT, /* bad argument */
SCF_ERROR_NO_MEMORY, /* no memory available */
SCF_ERROR_CONSTRAINT_VIOLATED, /* required constraint not met */
SCF_ERROR_EXISTS, /* object already exists */
SCF_ERROR_NO_SERVER, /* repository server unavailable */
SCF_ERROR_NO_RESOURCES, /* server has insufficient resources */
SCF_ERROR_PERMISSION_DENIED, /* insufficient privileges for action */
SCF_ERROR_BACKEND_ACCESS, /* backend refused access */
SCF_ERROR_HANDLE_MISMATCH, /* mismatched SCF handles */
SCF_ERROR_HANDLE_DESTROYED, /* object bound to destroyed handle */
SCF_ERROR_VERSION_MISMATCH, /* incompatible SCF version */
SCF_ERROR_BACKEND_READONLY, /* backend is read-only */
SCF_ERROR_DELETED, /* object has been deleted */
SCF_ERROR_TEMPLATE_INVALID, /* template data is invalid */
SCF_ERROR_CALLBACK_FAILED = 1080, /* user callback function failed */
SCF_ERROR_INTERNAL = 1101 /* internal error */
} scf_error_t;
/*
* This enum MUST be kept in sync with
* struct _scf_tmpl_error_desc em_desc() in scf_tmpl.c
*/
typedef enum scf_tmpl_error_type {
SCF_TERR_MISSING_PG, /* property group missing */
SCF_TERR_WRONG_PG_TYPE, /* property group type incorrect */
SCF_TERR_MISSING_PROP, /* missing required property */
SCF_TERR_WRONG_PROP_TYPE, /* property type incorrect */
SCF_TERR_CARDINALITY_VIOLATION, /* wrong number of values */
SCF_TERR_VALUE_CONSTRAINT_VIOLATED, /* constraint violated for value */
SCF_TERR_RANGE_VIOLATION, /* value violated specified range */
SCF_TERR_PG_REDEFINE, /* global or restarter pg_pattern */
/* redefined by the instance */
SCF_TERR_PROP_TYPE_MISMATCH, /* property and value type mismatch */
SCF_TERR_VALUE_OUT_OF_RANGE, /* value is out of range in template */
SCF_TERR_INVALID_VALUE, /* value is not valid for the */
/* template */
SCF_TERR_PG_PATTERN_CONFLICT, /* pg_pattern conflicts with higher */
/* level definition */
SCF_TERR_PROP_PATTERN_CONFLICT, /* prop_pattern conflicts with higher */
/* level definition */
SCF_TERR_GENERAL_REDEFINE, /* global or restarter template */
/* redefined */
SCF_TERR_INCLUDE_VALUES, /* No supporting constraints or */
/* values for include_values */
SCF_TERR_PG_PATTERN_INCOMPLETE, /* Required pg_pattern is missing */
/* name or type attribute. */
SCF_TERR_PROP_PATTERN_INCOMPLETE /* Required prop_pattern is */
/* missing a type attribute. */
} scf_tmpl_error_type_t;
typedef struct scf_tmpl_error scf_tmpl_error_t;
/*
* This unfortunately needs to be public, because consumers of librestart must
* deal with it
*/
typedef struct {
#ifndef NATIVE_BUILD
secflagdelta_t ss_default;
secflagdelta_t ss_lower;
secflagdelta_t ss_upper;
#else
/*
* This is never used, but is necessary for bootstrapping.
* Not even the size matters.
*/
void *ss_default;
void *ss_lower;
void *ss_upper;
#endif /* NATIVE_BUILD */
} scf_secflags_t;
/*
* scf_tmpl_strerror() human readable flag
*/
#define SCF_TMPL_STRERROR_HUMAN 0x1
/*
* Standard services
*/
#define SCF_SERVICE_CONFIGD "svc:/system/svc/repository:default"
#define SCF_INSTANCE_GLOBAL "svc:/system/svc/global:default"
#define SCF_SERVICE_GLOBAL "svc:/system/svc/global"
#define SCF_SERVICE_STARTD "svc:/system/svc/restarter:default"
#define SCF_INSTANCE_EMI "svc:/system/early-manifest-import:default"
#define SCF_INSTANCE_FS_MINIMAL "svc:/system/filesystem/minimal:default"
#define SCF_INSTANCE_MI "svc:/system/manifest-import:default"
/*
* Major milestones
*/
#define SCF_MILESTONE_SINGLE_USER "svc:/milestone/single-user:default"
#define SCF_MILESTONE_MULTI_USER "svc:/milestone/multi-user:default"
#define SCF_MILESTONE_MULTI_USER_SERVER \
"svc:/milestone/multi-user-server:default"
/*
* standard scope names
*/
#define SCF_SCOPE_LOCAL "localhost"
/*
* Property group types
*/
#define SCF_GROUP_APPLICATION "application"
#define SCF_GROUP_FRAMEWORK "framework"
#define SCF_GROUP_DEPENDENCY "dependency"
#define SCF_GROUP_METHOD "method"
#define SCF_GROUP_TEMPLATE "template"
#define SCF_GROUP_TEMPLATE_PG_PATTERN "template_pg_pattern"
#define SCF_GROUP_TEMPLATE_PROP_PATTERN "template_prop_pattern"
/*
* Dependency types
*/
#define SCF_DEP_REQUIRE_ALL "require_all"
#define SCF_DEP_REQUIRE_ANY "require_any"
#define SCF_DEP_EXCLUDE_ALL "exclude_all"
#define SCF_DEP_OPTIONAL_ALL "optional_all"
#define SCF_DEP_RESET_ON_ERROR "error"
#define SCF_DEP_RESET_ON_RESTART "restart"
#define SCF_DEP_RESET_ON_REFRESH "refresh"
#define SCF_DEP_RESET_ON_NONE "none"
/*
* Standard property group names
*/
#define SCF_PG_GENERAL "general"
#define SCF_PG_GENERAL_OVR "general_ovr"
#define SCF_PG_RESTARTER "restarter"
#define SCF_PG_RESTARTER_ACTIONS "restarter_actions"
#define SCF_PG_METHOD_CONTEXT "method_context"
#define SCF_PG_APP_DEFAULT "application"
#define SCF_PG_DEPENDENTS "dependents"
#define SCF_PG_OPTIONS "options"
#define SCF_PG_OPTIONS_OVR "options_ovr"
#define SCF_PG_STARTD "startd"
#define SCF_PG_STARTD_PRIVATE "svc-startd-private"
#define SCF_PG_DEATHROW "deathrow"
#define SCF_PG_MANIFESTFILES "manifestfiles"
/*
* Template property group names and prefixes
*/
#define SCF_PG_TM_COMMON_NAME "tm_common_name"
#define SCF_PG_TM_DESCRIPTION "tm_description"
#define SCF_PG_TM_MAN_PREFIX "tm_man_"
#define SCF_PG_TM_DOC_PREFIX "tm_doc_"
/*
* Standard property names
*/
#define SCF_PROPERTY_ACTIVE_POSTFIX "active"
#define SCF_PROPERTY_AUX_STATE "auxiliary_state"
#define SCF_PROPERTY_AUX_FMRI "auxiliary_fmri"
#define SCF_PROPERTY_AUX_TTY "auxiliary_tty"
#define SCF_PROPERTY_COMMENT "comment"
#define SCF_PROPERTY_CONTRACT "contract"
#define SCF_PROPERTY_COREFILE_PATTERN "corefile_pattern"
#define SCF_PROPERTY_DEGRADED "degraded"
#define SCF_PROPERTY_DEGRADE_IMMEDIATE "degrade_immediate"
#define SCF_PROPERTY_DODUMP "do_dump"
#define SCF_PROPERTY_DURATION "duration"
#define SCF_PROPERTY_ENABLED "enabled"
#define SCF_PROPERTY_DEATHROW "deathrow"
#define SCF_PROPERTY_ENTITY_STABILITY "entity_stability"
#define SCF_PROPERTY_ENTITIES "entities"
#define SCF_PROPERTY_EXEC "exec"
#define SCF_PROPERTY_GROUP "group"
#define SCF_PROPERTY_GROUPING "grouping"
#define SCF_PROPERTY_IGNORE "ignore_error"
#define SCF_PROPERTY_INTERNAL_SEPARATORS "internal_separators"
#define SCF_PROPERTY_LIMIT_PRIVILEGES "limit_privileges"
#define SCF_PROPERTY_MAINT_OFF "maint_off"
#define SCF_PROPERTY_MAINT_ON "maint_on"
#define SCF_PROPERTY_MAINT_ON_IMMEDIATE "maint_on_immediate"
#define SCF_PROPERTY_MAINT_ON_IMMTEMP "maint_on_immtemp"
#define SCF_PROPERTY_MAINT_ON_TEMPORARY "maint_on_temporary"
#define SCF_PROPERTY_METHOD_PID "method_pid"
#define SCF_PROPERTY_MILESTONE "milestone"
#define SCF_PROPERTY_NEED_SESSION "need_session"
#define SCF_PROPERTY_NEXT_STATE "next_state"
#define SCF_PROPERTY_PACKAGE "package"
#define SCF_PROPERTY_PRIVILEGES "privileges"
#define SCF_PROPERTY_PROFILE "profile"
#define SCF_PROPERTY_PROJECT "project"
#define SCF_PROPERTY_REFRESH "refresh"
#define SCF_PROPERTY_RESOURCE_POOL "resource_pool"
#define SCF_PROPERTY_ENVIRONMENT "environment"
#define SCF_PROPERTY_RESTART "restart"
#define SCF_PROPERTY_RESTARTER "restarter"
#define SCF_PROPERTY_RESTART_INTERVAL "restart_interval"
#define SCF_PROPERTY_RESTART_ON "restart_on"
#define SCF_PROPERTY_RESTORE "restore"
#define SCF_PROPERTY_SECFLAGS "security_flags"
#define SCF_PROPERTY_SINGLE_INSTANCE "single_instance"
#define SCF_PROPERTY_START_METHOD_TIMESTAMP "start_method_timestamp"
#define SCF_PROPERTY_START_METHOD_WAITSTATUS "start_method_waitstatus"
#define SCF_PROPERTY_START_PID "start_pid"
#define SCF_PROPERTY_STATE "state"
#define SCF_PROPERTY_STABILITY "stability"
#define SCF_PROPERTY_STATE_TIMESTAMP "state_timestamp"
#define SCF_PROPERTY_SUPP_GROUPS "supp_groups"
#define SCF_PROPERTY_TIMEOUT "timeout_seconds"
#define SCF_PROPERTY_TIMEOUT_RETRY "timeout_retry"
#define SCF_PROPERTY_TRANSIENT_CONTRACT "transient_contract"
#define SCF_PROPERTY_TYPE "type"
#define SCF_PROPERTY_USE_PROFILE "use_profile"
#define SCF_PROPERTY_USER "user"
#define SCF_PROPERTY_UTMPX_PREFIX "utmpx_prefix"
#define SCF_PROPERTY_WORKING_DIRECTORY "working_directory"
/*
* Template property names
*/
#define SCF_PROPERTY_TM_CARDINALITY_MIN "cardinality_min"
#define SCF_PROPERTY_TM_CARDINALITY_MAX "cardinality_max"
#define SCF_PROPERTY_TM_CHOICES_INCLUDE_VALUES "choices_include_values"
#define SCF_PROPERTY_TM_CHOICES_NAME "choices_name"
#define SCF_PROPERTY_TM_CHOICES_RANGE "choices_range"
#define SCF_PROPERTY_TM_CONSTRAINT_NAME "constraint_name"
#define SCF_PROPERTY_TM_CONSTRAINT_RANGE "constraint_range"
#define SCF_PROPERTY_TM_MANPATH "manpath"
#define SCF_PROPERTY_TM_NAME "name"
#define SCF_PROPERTY_TM_PG_PATTERN "pg_pattern"
#define SCF_PROPERTY_TM_REQUIRED "required"
#define SCF_PROPERTY_TM_SECTION "section"
#define SCF_PROPERTY_TM_TARGET "target"
#define SCF_PROPERTY_TM_TITLE "title"
#define SCF_PROPERTY_TM_TYPE "type"
#define SCF_PROPERTY_TM_URI "uri"
#define SCF_PROPERTY_TM_VALUE_PREFIX "value_"
#define SCF_PROPERTY_TM_VALUES_NAME "values_name"
#define SCF_PROPERTY_TM_VISIBILITY "visibility"
#define SCF_PROPERTY_TM_COMMON_NAME_PREFIX "common_name_"
#define SCF_PROPERTY_TM_DESCRIPTION_PREFIX "description_"
#define SCF_PROPERTY_TM_UNITS_PREFIX "units_"
/*
* Templates wildcard string
*/
#define SCF_TMPL_WILDCARD "*"
/*
* Strings used by restarters for state and next_state properties.
* MAX_SCF_STATE_STRING holds the max length of a state string, including the
* terminating null.
*/
#define MAX_SCF_STATE_STRING_SZ 14
#define SCF_STATE_STRING_NONE "none"
#define SCF_STATE_STRING_UNINIT "uninitialized"
#define SCF_STATE_STRING_MAINT "maintenance"
#define SCF_STATE_STRING_OFFLINE "offline"
#define SCF_STATE_STRING_DISABLED "disabled"
#define SCF_STATE_STRING_ONLINE "online"
#define SCF_STATE_STRING_DEGRADED "degraded"
#define SCF_STATE_STRING_LEGACY "legacy_run"
#define SCF_STATE_UNINIT 0x00000001
#define SCF_STATE_MAINT 0x00000002
#define SCF_STATE_OFFLINE 0x00000004
#define SCF_STATE_DISABLED 0x00000008
#define SCF_STATE_ONLINE 0x00000010
#define SCF_STATE_DEGRADED 0x00000020
#define SCF_STATE_ALL 0x0000003F
/*
* software fma svc-transition class
*/
#define SCF_NOTIFY_PARAMS_VERSION 0X0
#define SCF_NOTIFY_NAME_FMRI "fmri"
#define SCF_NOTIFY_NAME_VERSION "version"
#define SCF_NOTIFY_NAME_TSET "tset"
#define SCF_NOTIFY_PG_POSTFIX "fmnotify"
#define SCF_NOTIFY_PARAMS "notify-params"
#define SCF_NOTIFY_PARAMS_INST "svc:/system/fm/notify-params:default"
#define SCF_SVC_TRANSITION_CLASS "ireport.os.smf.state-transition"
#define SCF_NOTIFY_PARAMS_PG_TYPE "notify_params"
/*
* Useful transition macros
*/
#define SCF_TRANS_SHIFT_INITIAL_STATE(s) ((s) << 16)
#define SCF_TRANSITION_ALL \
(SCF_TRANS_SHIFT_INITIAL_STATE(SCF_STATE_ALL) | SCF_STATE_ALL)
#define SCF_TRANS(f, t) (SCF_TRANS_SHIFT_INITIAL_STATE(f) | (t))
#define SCF_TRANS_VALID(t) (!((t) & ~SCF_TRANSITION_ALL))
#define SCF_TRANS_INITIAL_STATE(t) ((t) >> 16 & SCF_STATE_ALL)
#define SCF_TRANS_FINAL_STATE(t) ((t) & SCF_STATE_ALL)
/*
* Prefixes for states in state transition notification
*/
#define SCF_STN_PREFIX_FROM "from-"
#define SCF_STN_PREFIX_TO "to-"
#define SCF_PG_FLAG_NONPERSISTENT 0x1
#define SCF_TRACE_LIBRARY 0x1
#define SCF_TRACE_DAEMON 0x2
#define SMF_IMMEDIATE 0x1
#define SMF_TEMPORARY 0x2
#define SMF_AT_NEXT_BOOT 0x4
scf_error_t scf_error(void);
const char *scf_strerror(scf_error_t);
ssize_t scf_limit(uint32_t code);
#define SCF_LIMIT_MAX_NAME_LENGTH -2000U
#define SCF_LIMIT_MAX_VALUE_LENGTH -2001U
#define SCF_LIMIT_MAX_PG_TYPE_LENGTH -2002U
#define SCF_LIMIT_MAX_FMRI_LENGTH -2003U
#define SCF_COMMENT_MAX_LENGTH (1024)
scf_handle_t *scf_handle_create(scf_version_t);
int scf_handle_decorate(scf_handle_t *, const char *, scf_value_t *);
#define SCF_DECORATE_CLEAR ((scf_value_t *)0)
int scf_handle_bind(scf_handle_t *);
int scf_handle_unbind(scf_handle_t *);
void scf_handle_destroy(scf_handle_t *);
int scf_type_base_type(scf_type_t type, scf_type_t *out);
const char *scf_type_to_string(scf_type_t);
scf_type_t scf_string_to_type(const char *);
/* values */
scf_value_t *scf_value_create(scf_handle_t *);
scf_handle_t *scf_value_handle(const scf_value_t *);
void scf_value_destroy(scf_value_t *);
scf_type_t scf_value_base_type(const scf_value_t *);
scf_type_t scf_value_type(const scf_value_t *);
int scf_value_is_type(const scf_value_t *, scf_type_t);
void scf_value_reset(scf_value_t *);
int scf_value_get_boolean(const scf_value_t *, uint8_t *);
int scf_value_get_count(const scf_value_t *, uint64_t *);
int scf_value_get_integer(const scf_value_t *, int64_t *);
int scf_value_get_time(const scf_value_t *, int64_t *, int32_t *);
ssize_t scf_value_get_astring(const scf_value_t *, char *, size_t);
ssize_t scf_value_get_ustring(const scf_value_t *, char *, size_t);
ssize_t scf_value_get_opaque(const scf_value_t *, void *, size_t);
void scf_value_set_boolean(scf_value_t *, uint8_t);
void scf_value_set_count(scf_value_t *, uint64_t);
void scf_value_set_integer(scf_value_t *, int64_t);
int scf_value_set_time(scf_value_t *, int64_t, int32_t);
int scf_value_set_astring(scf_value_t *, const char *);
int scf_value_set_ustring(scf_value_t *, const char *);
int scf_value_set_opaque(scf_value_t *, const void *, size_t);
ssize_t scf_value_get_as_string(const scf_value_t *, char *, size_t);
ssize_t scf_value_get_as_string_typed(const scf_value_t *, scf_type_t,
char *, size_t);
int scf_value_set_from_string(scf_value_t *, scf_type_t, const char *);
scf_iter_t *scf_iter_create(scf_handle_t *);
scf_handle_t *scf_iter_handle(const scf_iter_t *);
void scf_iter_reset(scf_iter_t *);
void scf_iter_destroy(scf_iter_t *);
int scf_iter_handle_scopes(scf_iter_t *, const scf_handle_t *);
int scf_iter_scope_services(scf_iter_t *, const scf_scope_t *);
int scf_iter_service_instances(scf_iter_t *, const scf_service_t *);
int scf_iter_service_pgs(scf_iter_t *, const scf_service_t *);
int scf_iter_instance_pgs(scf_iter_t *, const scf_instance_t *);
int scf_iter_instance_pgs_composed(scf_iter_t *, const scf_instance_t *,
const scf_snapshot_t *);
int scf_iter_service_pgs_typed(scf_iter_t *, const scf_service_t *,
const char *);
int scf_iter_instance_pgs_typed(scf_iter_t *, const scf_instance_t *,
const char *);
int scf_iter_instance_pgs_typed_composed(scf_iter_t *, const scf_instance_t *,
const scf_snapshot_t *, const char *);
int scf_iter_snaplevel_pgs(scf_iter_t *, const scf_snaplevel_t *);
int scf_iter_snaplevel_pgs_typed(scf_iter_t *, const scf_snaplevel_t *,
const char *);
int scf_iter_instance_snapshots(scf_iter_t *, const scf_instance_t *);
int scf_iter_pg_properties(scf_iter_t *, const scf_propertygroup_t *);
int scf_iter_property_values(scf_iter_t *, const scf_property_t *);
int scf_iter_next_scope(scf_iter_t *, scf_scope_t *);
int scf_iter_next_service(scf_iter_t *, scf_service_t *);
int scf_iter_next_instance(scf_iter_t *, scf_instance_t *);
int scf_iter_next_pg(scf_iter_t *, scf_propertygroup_t *);
int scf_iter_next_property(scf_iter_t *, scf_property_t *);
int scf_iter_next_snapshot(scf_iter_t *, scf_snapshot_t *);
int scf_iter_next_value(scf_iter_t *, scf_value_t *);
scf_scope_t *scf_scope_create(scf_handle_t *);
scf_handle_t *scf_scope_handle(const scf_scope_t *);
/* XXX eventually remove this */
#define scf_handle_get_local_scope(h, s) \
scf_handle_get_scope((h), SCF_SCOPE_LOCAL, (s))
int scf_handle_get_scope(scf_handle_t *, const char *, scf_scope_t *);
void scf_scope_destroy(scf_scope_t *);
ssize_t scf_scope_get_name(const scf_scope_t *, char *, size_t);
ssize_t scf_scope_to_fmri(const scf_scope_t *, char *, size_t);
scf_service_t *scf_service_create(scf_handle_t *);
scf_handle_t *scf_service_handle(const scf_service_t *);
void scf_service_destroy(scf_service_t *);
int scf_scope_get_parent(const scf_scope_t *, scf_scope_t *);
ssize_t scf_service_get_name(const scf_service_t *, char *, size_t);
ssize_t scf_service_to_fmri(const scf_service_t *, char *, size_t);
int scf_service_get_parent(const scf_service_t *, scf_scope_t *);
int scf_scope_get_service(const scf_scope_t *, const char *, scf_service_t *);
int scf_scope_add_service(const scf_scope_t *, const char *, scf_service_t *);
int scf_service_delete(scf_service_t *);
scf_instance_t *scf_instance_create(scf_handle_t *);
scf_handle_t *scf_instance_handle(const scf_instance_t *);
void scf_instance_destroy(scf_instance_t *);
ssize_t scf_instance_get_name(const scf_instance_t *, char *, size_t);
ssize_t scf_instance_to_fmri(const scf_instance_t *, char *, size_t);
int scf_service_get_instance(const scf_service_t *, const char *,
scf_instance_t *);
int scf_service_add_instance(const scf_service_t *, const char *,
scf_instance_t *);
int scf_instance_delete(scf_instance_t *);
scf_snapshot_t *scf_snapshot_create(scf_handle_t *);
scf_handle_t *scf_snapshot_handle(const scf_snapshot_t *);
void scf_snapshot_destroy(scf_snapshot_t *);
ssize_t scf_snapshot_get_name(const scf_snapshot_t *, char *, size_t);
int scf_snapshot_get_parent(const scf_snapshot_t *, scf_instance_t *);
int scf_instance_get_snapshot(const scf_instance_t *, const char *,
scf_snapshot_t *);
int scf_snapshot_update(scf_snapshot_t *);
scf_snaplevel_t *scf_snaplevel_create(scf_handle_t *);
scf_handle_t *scf_snaplevel_handle(const scf_snaplevel_t *);
void scf_snaplevel_destroy(scf_snaplevel_t *);
int scf_snaplevel_get_parent(const scf_snaplevel_t *, scf_snapshot_t *);
ssize_t scf_snaplevel_get_scope_name(const scf_snaplevel_t *, char *, size_t);
ssize_t scf_snaplevel_get_service_name(const scf_snaplevel_t *, char *, size_t);
ssize_t scf_snaplevel_get_instance_name(const scf_snaplevel_t *, char *,
size_t);
int scf_snaplevel_get_pg(const scf_snaplevel_t *, const char *,
scf_propertygroup_t *pg);
int scf_snapshot_get_base_snaplevel(const scf_snapshot_t *, scf_snaplevel_t *);
int scf_snaplevel_get_next_snaplevel(const scf_snaplevel_t *,
scf_snaplevel_t *);
scf_propertygroup_t *scf_pg_create(scf_handle_t *);
scf_handle_t *scf_pg_handle(const scf_propertygroup_t *);
void scf_pg_destroy(scf_propertygroup_t *);
ssize_t scf_pg_to_fmri(const scf_propertygroup_t *, char *, size_t);
ssize_t scf_pg_get_name(const scf_propertygroup_t *, char *, size_t);
ssize_t scf_pg_get_type(const scf_propertygroup_t *, char *, size_t);
int scf_pg_get_flags(const scf_propertygroup_t *, uint32_t *);
int scf_pg_get_parent_service(const scf_propertygroup_t *, scf_service_t *);
int scf_pg_get_parent_instance(const scf_propertygroup_t *, scf_instance_t *);
int scf_pg_get_parent_snaplevel(const scf_propertygroup_t *, scf_snaplevel_t *);
int scf_service_get_pg(const scf_service_t *, const char *,
scf_propertygroup_t *);
int scf_instance_get_pg(const scf_instance_t *, const char *,
scf_propertygroup_t *);
int scf_instance_get_pg_composed(const scf_instance_t *, const scf_snapshot_t *,
const char *, scf_propertygroup_t *);
int scf_service_add_pg(const scf_service_t *, const char *, const char *,
uint32_t, scf_propertygroup_t *);
int scf_instance_add_pg(const scf_instance_t *, const char *, const char *,
uint32_t, scf_propertygroup_t *);
int scf_pg_delete(scf_propertygroup_t *);
int scf_pg_get_underlying_pg(const scf_propertygroup_t *,
scf_propertygroup_t *);
int scf_instance_get_parent(const scf_instance_t *, scf_service_t *);
int scf_pg_update(scf_propertygroup_t *);
scf_property_t *scf_property_create(scf_handle_t *);
scf_handle_t *scf_property_handle(const scf_property_t *);
void scf_property_destroy(scf_property_t *);
int scf_property_is_type(const scf_property_t *, scf_type_t);
int scf_property_type(const scf_property_t *, scf_type_t *);
ssize_t scf_property_get_name(const scf_property_t *, char *, size_t);
int scf_property_get_value(const scf_property_t *, scf_value_t *);
ssize_t scf_property_to_fmri(const scf_property_t *, char *, size_t);
int scf_pg_get_property(const scf_propertygroup_t *, const char *,
scf_property_t *);
scf_transaction_t *scf_transaction_create(scf_handle_t *);
scf_handle_t *scf_transaction_handle(const scf_transaction_t *);
int scf_transaction_start(scf_transaction_t *, scf_propertygroup_t *);
void scf_transaction_destroy(scf_transaction_t *);
void scf_transaction_destroy_children(scf_transaction_t *);
void scf_transaction_reset(scf_transaction_t *);
void scf_transaction_reset_all(scf_transaction_t *);
int scf_transaction_commit(scf_transaction_t *);
scf_transaction_entry_t *scf_entry_create(scf_handle_t *);
scf_handle_t *scf_entry_handle(const scf_transaction_entry_t *);
void scf_entry_reset(scf_transaction_entry_t *);
void scf_entry_destroy(scf_transaction_entry_t *);
void scf_entry_destroy_children(scf_transaction_entry_t *);
int scf_transaction_property_change(scf_transaction_t *,
scf_transaction_entry_t *, const char *, scf_type_t);
int scf_transaction_property_delete(scf_transaction_t *,
scf_transaction_entry_t *, const char *);
int scf_transaction_property_new(scf_transaction_t *,
scf_transaction_entry_t *, const char *, scf_type_t);
int scf_transaction_property_change_type(scf_transaction_t *,
scf_transaction_entry_t *, const char *, scf_type_t);
int scf_entry_add_value(scf_transaction_entry_t *, scf_value_t *);
int scf_handle_decode_fmri(scf_handle_t *, const char *, scf_scope_t *,
scf_service_t *, scf_instance_t *, scf_propertygroup_t *, scf_property_t *,
int);
#define SCF_DECODE_FMRI_EXACT 0x00000001
#define SCF_DECODE_FMRI_TRUNCATE 0x00000002
#define SCF_DECODE_FMRI_REQUIRE_INSTANCE 0x00000004
#define SCF_DECODE_FMRI_REQUIRE_NO_INSTANCE 0x00000008
ssize_t scf_myname(scf_handle_t *, char *, size_t);
/*
* Property group template interfaces.
*/
scf_pg_tmpl_t *scf_tmpl_pg_create(scf_handle_t *);
void scf_tmpl_pg_destroy(scf_pg_tmpl_t *);
void scf_tmpl_pg_reset(scf_pg_tmpl_t *);
int scf_tmpl_get_by_pg(scf_propertygroup_t *, scf_pg_tmpl_t *, int);
int scf_tmpl_get_by_pg_name(const char *, const char *,
const char *, const char *, scf_pg_tmpl_t *, int);
int scf_tmpl_iter_pgs(scf_pg_tmpl_t *, const char *, const char *,
const char *, int);
#define SCF_PG_TMPL_FLAG_REQUIRED 0x1
#define SCF_PG_TMPL_FLAG_EXACT 0x2
#define SCF_PG_TMPL_FLAG_CURRENT 0x4
ssize_t scf_tmpl_pg_name(const scf_pg_tmpl_t *, char **);
ssize_t scf_tmpl_pg_common_name(const scf_pg_tmpl_t *, const char *, char **);
ssize_t scf_tmpl_pg_description(const scf_pg_tmpl_t *, const char *, char **);
ssize_t scf_tmpl_pg_type(const scf_pg_tmpl_t *, char **);
ssize_t scf_tmpl_pg_target(const scf_pg_tmpl_t *, char **);
#define SCF_TM_TARGET_ALL ((const char *)"all")
#define SCF_TM_TARGET_DELEGATE ((const char *)"delegate")
#define SCF_TM_TARGET_INSTANCE ((const char *)"instance")
#define SCF_TM_TARGET_THIS ((const char *)"this")
int scf_tmpl_pg_required(const scf_pg_tmpl_t *, uint8_t *);
/*
* Property template interfaces.
*/
scf_prop_tmpl_t *scf_tmpl_prop_create(scf_handle_t *);
void scf_tmpl_prop_destroy(scf_prop_tmpl_t *);
void scf_tmpl_prop_reset(scf_prop_tmpl_t *);
int scf_tmpl_get_by_prop(scf_pg_tmpl_t *, const char *,
scf_prop_tmpl_t *, int);
int scf_tmpl_iter_props(scf_pg_tmpl_t *, scf_prop_tmpl_t *, int);
#define SCF_PROP_TMPL_FLAG_REQUIRED 0x1
ssize_t scf_tmpl_prop_name(const scf_prop_tmpl_t *, char **);
int scf_tmpl_prop_type(const scf_prop_tmpl_t *, scf_type_t *);
int scf_tmpl_prop_required(const scf_prop_tmpl_t *, uint8_t *);
ssize_t scf_tmpl_prop_common_name(const scf_prop_tmpl_t *, const char *,
char **);
ssize_t scf_tmpl_prop_description(const scf_prop_tmpl_t *, const char *,
char **);
ssize_t scf_tmpl_prop_units(const scf_prop_tmpl_t *, const char *, char **);
int scf_tmpl_prop_cardinality(const scf_prop_tmpl_t *prop, uint64_t *,
uint64_t *);
int scf_tmpl_prop_internal_seps(const scf_prop_tmpl_t *, scf_values_t *);
int scf_tmpl_prop_visibility(const scf_prop_tmpl_t *, uint8_t *);
#define SCF_TMPL_VISIBILITY_HIDDEN 1
#define SCF_TMPL_VISIBILITY_READONLY 2
#define SCF_TMPL_VISIBILITY_READWRITE 3
const char *scf_tmpl_visibility_to_string(uint8_t);
#define SCF_TM_VISIBILITY_HIDDEN ((const char *)"hidden")
#define SCF_TM_VISIBILITY_READONLY ((const char *)"readonly")
#define SCF_TM_VISIBILITY_READWRITE ((const char *)"readwrite")
int scf_tmpl_value_name_constraints(const scf_prop_tmpl_t *prop,
scf_values_t *vals);
void scf_count_ranges_destroy(scf_count_ranges_t *);
void scf_int_ranges_destroy(scf_int_ranges_t *);
int scf_tmpl_value_count_range_constraints(const scf_prop_tmpl_t *,
scf_count_ranges_t *);
int scf_tmpl_value_int_range_constraints(const scf_prop_tmpl_t *,
scf_int_ranges_t *);
int scf_tmpl_value_count_range_choices(const scf_prop_tmpl_t *,
scf_count_ranges_t *);
int scf_tmpl_value_int_range_choices(const scf_prop_tmpl_t *,
scf_int_ranges_t *);
int scf_tmpl_value_name_choices(const scf_prop_tmpl_t *prop,
scf_values_t *vals);
void scf_values_destroy(scf_values_t *);
ssize_t scf_tmpl_value_common_name(const scf_prop_tmpl_t *, const char *,
const char *, char **);
ssize_t scf_tmpl_value_description(const scf_prop_tmpl_t *, const char *,
const char *, char **);
int scf_tmpl_value_in_constraint(const scf_prop_tmpl_t *pt, scf_value_t *value,
scf_tmpl_errors_t **errs);
/*
* Template validation interfaces
*/
int scf_tmpl_validate_fmri(scf_handle_t *, const char *,
const char *, scf_tmpl_errors_t **, int);
#define SCF_TMPL_VALIDATE_FLAG_CURRENT 0x1
void scf_tmpl_errors_destroy(scf_tmpl_errors_t *errs);
scf_tmpl_error_t *scf_tmpl_next_error(scf_tmpl_errors_t *);
void scf_tmpl_reset_errors(scf_tmpl_errors_t *errs);
int scf_tmpl_strerror(scf_tmpl_error_t *err, char *s, size_t n, int flag);
int scf_tmpl_error_source_fmri(const scf_tmpl_error_t *, char **);
int scf_tmpl_error_type(const scf_tmpl_error_t *, scf_tmpl_error_type_t *);
int scf_tmpl_error_pg_tmpl(const scf_tmpl_error_t *, char **, char **);
int scf_tmpl_error_pg(const scf_tmpl_error_t *, char **, char **);
int scf_tmpl_error_prop_tmpl(const scf_tmpl_error_t *, char **, char **);
int scf_tmpl_error_prop(const scf_tmpl_error_t *, char **, char **);
int scf_tmpl_error_value(const scf_tmpl_error_t *, char **);
/*
* Simplified calls that operate on the service and instance.
*/
int smf_refresh_all_instances(scf_service_t *);
int smf_enable_instance_by_instance(scf_instance_t *, int, const char *);
int smf_disable_instance_by_instance(scf_instance_t *, int, const char *);
int smf_refresh_instance_by_instance(scf_instance_t *);
int smf_restart_instance_by_instance(scf_instance_t *);
int smf_maintain_instance_by_instance(scf_instance_t *, int);
int smf_degrade_instance_by_instance(scf_instance_t *, int);
int smf_restore_instance_by_instance(scf_instance_t *);
char *smf_get_state_by_instance(scf_instance_t *);
/*
* Simplified calls
*/
int smf_enable_instance(const char *, int);
int smf_disable_instance_with_comment(const char *, int, const char *);
int smf_disable_instance(const char *, int);
int smf_refresh_instance(const char *);
int smf_restart_instance(const char *);
int smf_maintain_instance(const char *, int);
int smf_degrade_instance(const char *, int);
int smf_restore_instance(const char *);
char *smf_get_state(const char *);
int scf_simple_walk_instances(uint_t, void *,
int (*inst_callback)(scf_handle_t *, scf_instance_t *, void *));
scf_simple_prop_t *scf_simple_prop_get(scf_handle_t *, const char *,
const char *, const char *);
void scf_simple_prop_free(scf_simple_prop_t *);
scf_simple_app_props_t *scf_simple_app_props_get(scf_handle_t *, const char *);
void scf_simple_app_props_free(scf_simple_app_props_t *);
const scf_simple_prop_t *scf_simple_app_props_next(
const scf_simple_app_props_t *, scf_simple_prop_t *);
const scf_simple_prop_t *scf_simple_app_props_search(
const scf_simple_app_props_t *, const char *, const char *);
ssize_t scf_simple_prop_numvalues(const scf_simple_prop_t *);
scf_type_t scf_simple_prop_type(const scf_simple_prop_t *);
char *scf_simple_prop_name(const scf_simple_prop_t *);
char *scf_simple_prop_pgname(const scf_simple_prop_t *);
uint8_t *scf_simple_prop_next_boolean(scf_simple_prop_t *);
uint64_t *scf_simple_prop_next_count(scf_simple_prop_t *);
int64_t *scf_simple_prop_next_integer(scf_simple_prop_t *);
int64_t *scf_simple_prop_next_time(scf_simple_prop_t *, int32_t *);
char *scf_simple_prop_next_astring(scf_simple_prop_t *);
char *scf_simple_prop_next_ustring(scf_simple_prop_t *);
void *scf_simple_prop_next_opaque(scf_simple_prop_t *, size_t *);
void scf_simple_prop_next_reset(scf_simple_prop_t *);
/*
* smf_state_from_string()
* return SCF_STATE_* value for the input
* -1 on error. String "all" maps to SCF_STATE_ALL macro
*/
int32_t smf_state_from_string(const char *);
/*
* smf_state_to_string()
* return SCF_STATE_STRING* value for the input
* NULL on error.
*/
const char *smf_state_to_string(int32_t);
/*
* Notification interfaces
*/
int smf_notify_set_params(const char *, nvlist_t *);
int smf_notify_get_params(nvlist_t **, nvlist_t *);
int smf_notify_del_params(const char *, const char *, int32_t);
/*
* SMF exit status definitions
*
* The SMF_EXIT_NODAEMON exit status should be used when a method does not
* need to run any persistent process. This indicates success, abandons the
* contract, and allows dependencies to be met.
*/
#define SMF_EXIT_OK 0
#define SMF_EXIT_NODAEMON 94
#define SMF_EXIT_ERR_FATAL 95
#define SMF_EXIT_ERR_CONFIG 96
#define SMF_EXIT_MON_DEGRADE 97
#define SMF_EXIT_MON_OFFLINE 98
#define SMF_EXIT_ERR_NOSMF 99
#define SMF_EXIT_ERR_PERM 100
#ifdef __cplusplus
}
#endif
#endif /* _LIBSCF_H */
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013, Joyent, Inc. All rights reserved.
*/
#ifndef _LIBSCF_PRIV_H
#define _LIBSCF_PRIV_H
#include <libscf.h>
#include <unistd.h>
#if !defined(NATIVE_BUILD)
#include <sys/secflags.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* NOTE
*
* The contents of this file are private to the implementation of Solaris
* and are subject to change at any time without notice.
*/
#define SCF_PG_GENERAL_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_GENERAL_FLAGS 0
#define SCF_PG_GENERAL_OVR_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_GENERAL_OVR_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PG_DEATHROW_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_DEATHROW_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PG_OPTIONS_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_OPTIONS_FLAGS 0
#define SCF_PG_OPTIONS_OVR_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_OPTIONS_OVR_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PG_RESTARTER_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_RESTARTER_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PG_RESTARTER_ACTIONS_TYPE SCF_GROUP_FRAMEWORK
#define SCF_PG_RESTARTER_ACTIONS_FLAGS SCF_PG_FLAG_NONPERSISTENT
#define SCF_PROPERTY_CLEAR ((const char *)"maint_off")
#define SCF_PROPERTY_MAINTENANCE ((const char *)"maint_on")
#define SCF_PROPERTY_LOGFILE ((const char *)"logfile")
#define SCF_PROPERTY_ALT_LOGFILE ((const char *)"alt_logfile")
#define SCF_LEGACY_SERVICE ((const char *)"smf/legacy_run")
#define SCF_LEGACY_PROPERTY_NAME ((const char *)"name")
#define SCF_LEGACY_PROPERTY_INODE ((const char *)"inode")
#define SCF_LEGACY_PROPERTY_SUFFIX ((const char *)"suffix")
#define SCF_FMRI_TYPE_SVC 0x1
#define SCF_FMRI_TYPE_FILE 0x2
/*
* Strings for use in constructing FMRIs
*/
#define SCF_FMRI_SVC_PREFIX "svc:"
#define SCF_FMRI_FILE_PREFIX "file:"
#define SCF_FMRI_SCOPE_PREFIX "//"
#define SCF_FMRI_LOCAL_SCOPE "localhost"
#define SCF_FMRI_SCOPE_SUFFIX "@localhost"
#define SCF_FMRI_SERVICE_PREFIX "/"
#define SCF_FMRI_INSTANCE_PREFIX ":"
#define SCF_FMRI_PROPERTYGRP_PREFIX "/:properties/"
#define SCF_FMRI_PROPERTY_PREFIX "/"
#define SCF_FMRI_LEGACY_PREFIX "lrc:"
/*
* sulogin Service FMRI
*/
#define SVC_SULOGIN_FMRI ((const char *)"svc:/system/sulogin")
typedef struct scf_decoration_info {
const char *sdi_name;
scf_type_t sdi_type;
scf_value_t *sdi_value; /* can be SCF_DECORATE_CLEAR */
} scf_decoration_info_t;
typedef int (*scf_decoration_func)(const scf_decoration_info_t *, void *);
/*
* calls a callback function for each decoration on the handle. If the
* callback returns 0, the iteration stops and returns 0. If the callback
* returns a non-zero value, the iteration continues. After full completion,
* 1 is returned. On error, -1 is returned.
*/
int _scf_handle_decorations(scf_handle_t *, scf_decoration_func *,
scf_value_t *, void *);
/*
* wait for a change to the propertygroup -- may return early.
* For now, only one of these can be outstanding at a time.
*
* The second argument is how long, in seconds, to wait for a response.
*
* Returns SCF_COMPLETE on timeout, -1 on error, and SCF_SUCCESS in every
* other case. You must call scf_pg_update() to see if the object has
* actually changed.
*/
int _scf_pg_wait(scf_propertygroup_t *, int);
/*
* set up notifications for changes to a class of property groups (by name
* and type)
*
* Only one thread can be sleeping in _scf_notify_wait() -- others will
* fail. Deletions give an fmri in the output path.
*
* These do not survive unbind()->bind() -- in fact, that is currently the
* only way to clear them.
*/
int _scf_notify_add_pgname(scf_handle_t *, const char *);
int _scf_notify_add_pgtype(scf_handle_t *, const char *);
int _scf_notify_wait(scf_propertygroup_t *, char *, size_t);
/*
* Internal interfaces for snapshot creation:
* _scf_snapshot_take_new(), _scf_snapshot_take_new_named(), and
* _scf_snapshot_take_attach() create a set of snaplevels
* containing frozen versions of both the instance's property groups and
* its parent service's property groups. _scf_snapshot_take_new() and
* _scf_snapshot_take_new_named() create a new snapshot to which the
* new snaplevels are attached, while _scf_snapshot_take_attach()
* attaches the new snaplevels to a pre-existing snapshot.
*
* _scf_snapshot_take_new_named() records the passed in names into the
* snaplevel instead of the instance and service name. This creates
* an inconsistency, which should be resolved by using
* _scf_snapshot_attach() to attach the new snaplevels to a snapshot
* underneath the appropriate instance. The first snapshot can
* then be deleted.
*
* _scf_snapshot_attach(snap1, snap2) points snap2 at the snaplevels
* pointed to by snap1. After a call to either
* _scf_snapshot_take_attach(snap1, snap2) or
* _scf_snapshot_attach(inst, snap), scf_snapshot_update() will be
* required for any open references to snap or snap2 to see the new
* snaplevels.
*
* _scf_snapshot_delete() deletes the snapshot object. While
* snaplevels, being only loosely connected to snapshots, stay
* around until they are no longer referenced, any references *through
* this snapshot object* will be invalidated.
*
* _scf_snapshot_take_new() can fail with at least _HANDLE_MISMATCH,
* _CONNECTION_BROKEN, _INVALID_ARGUMENT, _NO_RESOURCES, _PERMISSION_DENIED,
* _NOT_SET, _EXISTS.
*
* _scf_snapshot_take_new_named() can fail with at least _HANDLE_MISMATCH,
* _CONNECTION_BROKEN, _INVALID_ARGUMENT, _NO_RESOURCES, _PERMISSION_DENIED,
* _NOT_SET, _EXISTS.
*
* _scf_snapshot_take_attach() can fail with _CONNECTION_BROKEN, _NOT_SET,
* _PERMISSION_DENIED, _NO_RESOURCES, _INVALID_ARGUMENT.
*
* _scf_snapshot_attach() can fail with _HANDLE_MISMATCH, _CONNECTION_BROKEN,
* _NOT_SET, _NO_RESOURCES, _PERMISSION_DENIED.
*/
int _scf_snapshot_take_new(scf_instance_t *, const char *, scf_snapshot_t *);
int _scf_snapshot_take_new_named(scf_instance_t *,
const char *, const char *, const char *, scf_snapshot_t *);
int _scf_snapshot_take_attach(scf_instance_t *, scf_snapshot_t *);
int _scf_snapshot_attach(scf_snapshot_t *, scf_snapshot_t *);
int _scf_snapshot_delete(scf_snapshot_t *);
/*
* Destructively portions up the first argument into the different portions
* of a svc: fmri, and returns pointers to the applicable portions. Omitted
* portions are set to NULL, except for the scope, which is set to the
* default local scope if not specified.
*
* Parsing is attempted in the order of: svc:, file:. The identified type
* of the service is returned in the second argument and may take a value
* of: SCF_FMRI_TYPE_SVC or SCF_FMRI_TYPE_FILE.
*
* Note that some of the returned pointers (in particular the scope) may not
* point into the passed buffer.
*/
int scf_parse_fmri(char *, int *, const char **, const char **, const char **,
const char **, const char **);
int scf_parse_svc_fmri(char *, const char **, const char **, const char **,
const char **, const char **);
int scf_parse_file_fmri(char *fmri, const char **scope, const char **path);
ssize_t scf_canonify_fmri(const char *, char *, size_t);
int _smf_refresh_instance_i(scf_instance_t *);
typedef struct scf_simple_handle {
scf_handle_t *h;
scf_snapshot_t *snap;
scf_instance_t *inst;
scf_propertygroup_t *running_pg;
scf_propertygroup_t *editing_pg;
} scf_simple_handle_t;
void scf_simple_handle_destroy(scf_simple_handle_t *);
scf_simple_handle_t *scf_general_pg_setup(const char *, const char *);
scf_transaction_t *scf_transaction_setup(scf_simple_handle_t *);
int scf_transaction_restart(scf_simple_handle_t *, scf_transaction_t *);
int scf_read_count_property(scf_simple_handle_t *, char *, uint64_t *);
int scf_set_count_property(scf_transaction_t *, char *, uint64_t, boolean_t);
/*
* Walks all the instances matching a given fmri list. Each fmri in the array
* can be one of the following:
*
* - Full instance name
* - Full service name
* - Full property group or property name
* - Partial service or instance name
* - A globbed pattern
*
* The matching rules for partial fmris are a slightly more complex. We allow
* for any substring anchored at the end of the instance or service name,
* provided it begins with a complete element in the fmri. For example, given
* the fmri "svc:/system/filesystem/local:default", any of the following would
* be acceptable matches: 'default', 'local', 'local:default',
* 'filesystem/local'. The following would not be acceptable:
* 'system/filesystem', 'filesystem/loc', 'system/local'. Possible flag values:
*
* SCF_WALK_MULTIPLE Allow individual arguments to correspond to
* multiple instances.
*
* SCF_WALK_LEGACY Walk legacy services (indicated by a non-NULL
* propery group).
*
* SCF_WALK_SERVICE If the user specifies a service, pass the
* service to the callback without iterating over
* its instances.
*
* SCF_WALK_PROPERTY Allow FMRIs which match property groups or
* individual properties. Incompatible with
* SCF_WALK_LEGACY.
*
* SCF_WALK_NOINSTANCE Walk only services. Must be used in
* conjunction with SCF_WALK_SERVICE.
*
* SCF_WALK_EXPLICIT Walk only services if the match is exact
* else return instances. Must be used in
* conjunction with SCF_WALK_SERVICE.
*
* SCF_WALK_UNIPARTIAL Can be combined with SCF_WALK_MULTIPLE
* so that an error is returned if a partial
* fmri matches multiple instances, unless
* a wildcard match is also used.
*
* If no arguments are given, then all instances in the service graph are
* walked.
*
* The second to last parameter is set to UU_EXIT_FATAL if one of the arguments
* is an invalid FMRI or matches multiple FMRIs when SCF_WALK_MULTIPLE is not
* set.
*
* The last parameter is a user-supplied error function that is called when
* reporting invalid arguments.
*/
#define SCF_WALK_MULTIPLE 0x01
#define SCF_WALK_LEGACY 0x02
#define SCF_WALK_SERVICE 0x04
#define SCF_WALK_PROPERTY 0x08
#define SCF_WALK_NOINSTANCE 0x10
#define SCF_WALK_EXPLICIT 0x20
#define SCF_WALK_UNIPARTIAL 0x40
/*
* The default locations of the repository dbs
*/
#define REPOSITORY_DB "/etc/svc/repository.db"
#define NONPERSIST_DB "/etc/svc/volatile/svc_nonpersist.db"
#define FAST_REPOSITORY_DB "/etc/svc/volatile/fast_repository.db"
#define REPOSITORY_CHECKPOINT "/etc/svc/volatile/checkpoint_repository.db"
typedef struct scf_walkinfo {
const char *fmri;
scf_scope_t *scope;
scf_service_t *svc;
scf_instance_t *inst;
scf_propertygroup_t *pg;
scf_property_t *prop;
int count; /* svcprop special */
} scf_walkinfo_t;
typedef int (*scf_walk_callback)(void *, scf_walkinfo_t *);
scf_error_t scf_walk_fmri(scf_handle_t *, int, char **, int,
scf_walk_callback, void *, int *, void (*)(const char *, ...));
/*
* Requests a backup of the repository with a particular name, which
* can be any alphabetic string. Only privileged users can do this.
*
* Can fail with:
* _NOT_BOUND, _CONNECTION_BROKEN, _PERMISSION_DENIED, _INVALID_ARGUMENT,
* _INTERNAL (path too long, or the backup failed for an odd reason),
* _BACKEND_READONLY (filesystem is still read-only)
*/
int _scf_request_backup(scf_handle_t *, const char *);
/*
* Repository switch client
*/
int _scf_repository_switch(scf_handle_t *, int);
/*
* Determines whether a property group requires authorization to read; this
* does not in any way reflect whether the caller has that authorization.
* To determine that, the caller must attempt to read the value of one of the
* group's properties.
*
* Can fail with:
* _NOT_BOUND, _CONNECTION_BROKEN, _INVALID_ARGUMENT, _INTERNAL,
* _NO_RESOURCES, _CONSTRAINT_VIOLATED, _DELETED.
*/
int _scf_pg_is_read_protected(const scf_propertygroup_t *, boolean_t *);
/*
* Sets annotation data for SMF audit logging. Once this function has been
* set, the next audit record will be preceded by an ADT_smf_annotation
* with the information provided in this function. This function is used
* to mark operations which comprise multiple primitive operations such as
* svccfg import.
*/
int _scf_set_annotation(scf_handle_t *h, const char *operation,
const char *file);
/*
* scf_pattern_t
*/
typedef struct scf_pattern {
enum {
PATTERN_INVALID, /* Uninitialized state */
PATTERN_EXACT,
PATTERN_GLOB,
PATTERN_PARTIAL
} sp_type;
char *sp_arg; /* Original argument */
struct scf_match *sp_matches; /* List of matches */
int sp_matchcount; /* # of matches */
} scf_pattern_t;
int scf_cmp_pattern(char *, scf_pattern_t *);
int gen_filenms_from_fmri(const char *, const char *, char *, char *);
/*
* Interfaces for bulk access to SMF-stored configuration.
*
* Each scf_propvec_t represents a single property to be read (with
* scf_read_propvec) or written (with scf_write_propvec).
*
* The fields of a scf_propvec_t have the following meanings:
*
* pv_prop - the name of the property
* pv_desc - a description string (optional; to be consumed by the caller)
* pv_type - the type of the property
* pv_ptr - where to store the data read, or a pointer to the data to
* be written
* pv_aux - additional data influencing the interpretation of pv_ptr
*
* The meaning of pv_ptr and pv_aux depends on the type of property. For:
*
* boolean - if pv_aux is 0, pv_ptr is a pointer to a boolean_t
* if pv_aux is non-0, pv_ptr is a pointer to a uint64_t,
* where pv_aux indicates the bit holding the truth value.
* count - pv_ptr is a pointer to a uint64_t; pv_aux is unused
* integer - pv_ptr is a pointer to an int64_t; pv_aux is unused
* time - pv_ptr is a pointer to an scf_time_t; pv_aux is unused
* opaque - pv_ptr is a pointer to an scf_opaque_t; pv_aux is unused
* strings - (scf_read_propvec) pv_ptr is a pointer to a char *
* (scf_write_propvec) pv_ptr is a pointer to an array of char
* (both) pv_aux is unused
*/
typedef struct {
void *so_addr;
size_t so_size;
} scf_opaque_t;
typedef struct {
const char *pv_prop;
const char *pv_desc;
scf_type_t pv_type;
void *pv_ptr;
uint64_t pv_aux;
} scf_propvec_t;
void scf_clean_propvec(scf_propvec_t *);
int scf_read_propvec(const char *, const char *, boolean_t, scf_propvec_t *,
scf_propvec_t **);
int scf_write_propvec(const char *, const char *, scf_propvec_t *,
scf_propvec_t **);
scf_tmpl_errors_t *_scf_create_errors(const char *, int);
int _scf_tmpl_add_error(scf_tmpl_errors_t *errs, scf_tmpl_error_type_t type,
const char *pg_name, const char *prop_name,
const char *ev1, const char *ev2, const char *actual,
const char *tmpl_fmri, const char *tmpl_pg_name, const char *tmpl_pg_type,
const char *tmpl_prop_name, const char *tmpl_prop_type);
int _scf_tmpl_error_set_prefix(scf_tmpl_errors_t *, const char *);
/*
* Templates definitions
*/
/*
* For CARDINALITY_VIOLATION and RANGE_VIOLATION, te_ev1 holds
* the min value and te_ev2 holds the max value
*
* For MISSING_PG te_ev1 should hold the expected pg_name and
* expected2 holds the expected pg_type.
*
* For SCF_TERR_PG_PATTERN_CONFLICT and SCF_TERR_GENERAL_REDEFINE te_ev1 is
* the FMRI holding the conflicting pg_pattern. te_ev2 is the name of the
* conflicting pg_pattern, and actual is the type of the conflicting
* pg_pattern.
*
* SCF_TERR_PROP_PATTERN_CONFLICT te_ev1 is the FMRI holding the
* conflicting prop_pattern. te_ev2 is the name of the conflicting
* prop_pattern, and actual is the type of the conflicting prop_pattern.
*
* For SCF_TERR_INCLUDE_VALUES te_ev1 is the type specified for the
* include_values element.
*
* For all other errors, te_ev1 should hold the expected value and
* te_ev2 is ignored
*
* te_actual holds the current value of the property
*/
struct scf_tmpl_error {
scf_tmpl_errors_t *te_errs;
scf_tmpl_error_type_t te_type;
const char *te_pg_name;
const char *te_prop_name;
const char *te_ev1;
const char *te_ev2;
const char *te_actual;
const char *te_tmpl_fmri;
const char *te_tmpl_pg_name;
const char *te_tmpl_pg_type;
const char *te_tmpl_prop_name;
const char *te_tmpl_prop_type;
};
/*
* The pg_pattern element has two optional attributes that play a part in
* selecting the appropriate prefix for the name of the pg_pattern property
* group. The two attributes are name and type. The appropriate prefix
* encodes the presence are absence of these attributes.
*
* SCF_PG_TM_PG_PATTERN_PREFIX neither attribute
* SCF_PG_TM_PG_PATTERN_N_PREFIX name only
* SCF_PG_TM_PG_PATTERN_T_PREFIX type only
* SCF_PG_TM_PG_PATTERN_NT_PREFIX both name and type
*/
#define SCF_PG_TM_PG_PAT_BASE "tm_pgpat"
#define SCF_PG_TM_PG_PATTERN_PREFIX ((const char *)SCF_PG_TM_PG_PAT_BASE \
"_")
#define SCF_PG_TM_PG_PATTERN_N_PREFIX ((const char *)SCF_PG_TM_PG_PAT_BASE \
"n_")
#define SCF_PG_TM_PG_PATTERN_T_PREFIX ((const char *)SCF_PG_TM_PG_PAT_BASE \
"t_")
#define SCF_PG_TM_PG_PATTERN_NT_PREFIX ((const char *)SCF_PG_TM_PG_PAT_BASE \
"nt_")
#define SCF_PG_TM_PROP_PATTERN_PREFIX ((const char *)"tm_proppat_")
/*
* Pad character to use when encoding strings for property names.
*/
#define SCF_ENCODE32_PAD ('-')
/*
* Functions for base 32 encoding/decoding
*/
int scf_decode32(const char *, size_t, char *, size_t, size_t *, char);
int scf_encode32(const char *, size_t, char *, size_t, size_t *, char);
/*
* handy functions
*/
/*
* _scf_sanitize_locale
* Make sure a locale string has only alpha-numeric or '_' characters
*/
void _scf_sanitize_locale(char *);
/*
* _scf_read_tmpl_prop_type_as_string()
* Handy function to get template property type as a string
*/
char *_scf_read_tmpl_prop_type_as_string(const scf_prop_tmpl_t *);
/*
* _scf_read_single_astring_from_pg()
* Given a property group (pg) and a property name (pn), this function
* retrives an astring value from pg/pn.
*/
char *_scf_read_single_astring_from_pg(scf_propertygroup_t *, const char *);
/*
* scf_instance_delete_prop()
* Given instance, property group, and property, delete the property.
*/
int
scf_instance_delete_prop(scf_instance_t *, const char *, const char *);
/*
* Functions to extract boot config information from FMRI_BOOT_CONFIG
*/
void scf_get_boot_config(uint8_t *);
void scf_get_boot_config_ovr(uint8_t *);
int scf_is_fastboot_default(void);
/*
* Set value of "config_ovr/fastreboot_default".
*/
int scf_fastreboot_default_set_transient(boolean_t);
/*
* scf_is_compatible_type()
* Return true if the second type is the same type, or a subtype of the
* first.
*/
int scf_is_compatible_type(scf_type_t, scf_type_t);
/*
* Check an array of services and enable any that don't have the
* "application/auto_enable" property set to "false", which is
* the interface to turn off this behaviour (see PSARC 2004/739).
*/
void _check_services(char **);
/*
* _scf_handle_create_and_bind()
* convenience function that creates and binds a handle
*/
scf_handle_t *_scf_handle_create_and_bind(scf_version_t);
/*
* _scf_get_fma_notify_params()
* Specialized fuction to get fma notifitation parameters
*/
int _scf_get_fma_notify_params(const char *, nvlist_t *, int);
/*
* _scf_get_svc_notify_params()
* Specialized function to get SMF state transition notification parameters
*/
int _scf_get_svc_notify_params(const char *, nvlist_t *, int32_t, int, int);
/*
* _scf_notify_get_params()
* Specialized function to get notification parametes from a pg into an
* nvlist_t
*/
int _scf_notify_get_params(scf_propertygroup_t *, nvlist_t *);
#if !defined(NATIVE_BUILD)
int scf_default_secflags(scf_handle_t *, scf_secflags_t *);
#endif
#define SCF_NOTIFY_PARAMS_SOURCE_NAME ((const char *)"preference_source")
#ifdef __cplusplus
}
#endif
#endif /* _LIBSCF_PRIV_H */
|