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
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
|
{
File: OT/OpenTransportProtocol.h
Contains: Definitions likely to be used by low-level protocol stack implementation.
Version: OpenTransport-110~114
Copyright: © 1993-2008 by Apple Computer, Inc. and Mentat Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://www.freepascal.org/bugs.html
}
{ Pascal Translation Updated: Peter N Lewis, <peter@stairways.com.au>, November 2005 }
{ Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
{
Modified for use with Free Pascal
Version 308
Please report any bugs to <gpc@microbizz.nl>
}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
{$mode macpas}
{$packenum 1}
{$macro on}
{$inline on}
{$calling mwpascal}
unit OpenTransportProtocol;
interface
{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
{$setc GAP_INTERFACES_VERSION := $0308}
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
{$endc}
{$ifc defined CPUPOWERPC and defined CPUI386}
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
{$endc}
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
{$endc}
{$ifc not defined __ppc__ and defined CPUPOWERPC32}
{$setc __ppc__ := 1}
{$elsec}
{$setc __ppc__ := 0}
{$endc}
{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
{$setc __ppc64__ := 1}
{$elsec}
{$setc __ppc64__ := 0}
{$endc}
{$ifc not defined __i386__ and defined CPUI386}
{$setc __i386__ := 1}
{$elsec}
{$setc __i386__ := 0}
{$endc}
{$ifc not defined __x86_64__ and defined CPUX86_64}
{$setc __x86_64__ := 1}
{$elsec}
{$setc __x86_64__ := 0}
{$endc}
{$ifc not defined __arm__ and defined CPUARM}
{$setc __arm__ := 1}
{$elsec}
{$setc __arm__ := 0}
{$endc}
{$ifc defined cpu64}
{$setc __LP64__ := 1}
{$elsec}
{$setc __LP64__ := 0}
{$endc}
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
{$error Conflicting definitions for __ppc__ and __i386__}
{$endc}
{$ifc defined __ppc__ and __ppc__}
{$setc TARGET_CPU_PPC := TRUE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __ppc64__ and __ppc64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := TRUE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __i386__ and __i386__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := TRUE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$ifc defined(iphonesim)}
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := TRUE}
{$elsec}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$endc}
{$elifc defined __x86_64__ and __x86_64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := TRUE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __arm__ and __arm__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := TRUE}
{ will require compiler define when/if other Apple devices with ARM cpus ship }
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elsec}
{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
{$endc}
{$ifc defined __LP64__ and __LP64__ }
{$setc TARGET_CPU_64 := TRUE}
{$elsec}
{$setc TARGET_CPU_64 := FALSE}
{$endc}
{$ifc defined FPC_BIG_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
{$elifc defined FPC_LITTLE_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
{$elsec}
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
{$endc}
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
{$setc CALL_NOT_IN_CARBON := FALSE}
{$setc OLDROUTINENAMES := FALSE}
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
{$setc OPAQUE_UPP_TYPES := TRUE}
{$setc OTCARBONAPPLICATION := TRUE}
{$setc OTKERNEL := FALSE}
{$setc PM_USE_SESSION_APIS := TRUE}
{$setc TARGET_API_MAC_CARBON := TRUE}
{$setc TARGET_API_MAC_OS8 := FALSE}
{$setc TARGET_API_MAC_OSX := TRUE}
{$setc TARGET_CARBON := TRUE}
{$setc TARGET_CPU_68K := FALSE}
{$setc TARGET_CPU_MIPS := FALSE}
{$setc TARGET_CPU_SPARC := FALSE}
{$setc TARGET_OS_UNIX := FALSE}
{$setc TARGET_OS_WIN32 := FALSE}
{$setc TARGET_RT_MAC_68881 := FALSE}
{$setc TARGET_RT_MAC_CFM := FALSE}
{$setc TARGET_RT_MAC_MACHO := TRUE}
{$setc TYPED_FUNCTION_POINTERS := TRUE}
{$setc TYPE_BOOL := FALSE}
{$setc TYPE_EXTENDED := FALSE}
{$setc TYPE_LONGLONG := TRUE}
uses MacTypes,ConditionalMacros,Files,CodeFragments,OpenTransport;
{$endc} {not MACOSALLINCLUDE}
{ this header is only supported on Mac OS X < 10.4, and Mac OS X < 10.4 does
not support i386
}
{$ifc TARGET_OS_MAC and TARGET_CPU_PPC}
{$ALIGN MAC68K}
{ ***** Setup Default Compiler Variables *****}
{
OTKERNEL is used to indicate whether the code is being built
for the kernel environment. It defaults to 0. If you include
"OpenTransportKernel.h" before including this file,
it will be 1 and you will only be able to see stuff available
to kernel code.
As we've included "OpenTransport.h" and it defaults this variable
to 0 if it's not already been defined, it should always be defined
by the time we get here. So we just assert that. Assertions in
header files! Cool (-:
}
{$ifc undefined OTKERNEL}
{$setc OTKERNEL := 0}
{$endc}
{ ***** Shared Client Memory *****}
{$ifc NOT OTKERNEL}
{
These allocators allocate memory in the shared client pool,
which is shared between all clients and is not disposed when
a particular client goes away. See DTS Technote ¥¥¥
"Understanding Open Transport Memory Management" for details.
}
{
* OTAllocSharedClientMem()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTFreeSharedClientMem()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{$endc} { !OTKERNEL }
{ ***** UNIX Types *****}
{$ifc CALL_NOT_IN_CARBON}
{
On UNIX, uid_t and gid_t are defined to be big enough
to hold a user ID and group ID respectively. As Mac OS
has no such concepts, we just define them as UInt32 place
holders.
}
type
uid_t = UInt32;
gid_t = UInt32;
{ Similarly, dev_t is a UNIX type for denoting a device number.}
type
dev_t = UInt32;
{ ***** From the Mentat "strstat.h" *****}
{ module statistics structure }
type
module_statPtr = ^module_stat;
module_stat = record
ms_pcnt: SIGNEDLONG; { count of calls to put proc }
ms_scnt: SIGNEDLONG; { count of calls to service proc }
ms_ocnt: SIGNEDLONG; { count of calls to open proc }
ms_ccnt: SIGNEDLONG; { count of calls to close proc }
ms_acnt: SIGNEDLONG; { count of calls to admin proc }
ms_xptr: UnivPtr; { pointer to private statistics }
ms_xsize: SInt16; { length of private statistics buffer }
end;
{ ***** From the Mentat "cred.h" *****}
type
credPtr = ^cred;
cred = record
cr_ref: UInt16; { reference count on processes using cred structures }
cr_ngroups: UInt16; { number of groups in cr_groups }
cr_uid: uid_t; { effective user id }
cr_gid: gid_t; { effective group id }
cr_ruid: uid_t; { real user id }
cr_rgid: gid_t; { real group id }
cr_suid: uid_t; { user id saved by exec }
cr_sgid: gid_t; { group id saved by exec }
cr_groups: array [0..0] of gid_t; { supplementary groups list }
end;
type
cred_t = cred;
{ Free return structure for esballoc }
type
FreeFuncType = procedure( var arg: char );
free_rtnPtr = ^free_rtn;
free_rtn = record
free_func: FreeFuncType; { Routine to call to free buffer }
free_arg: UnivPtr; { Parameter to free_func }
end;
type
frtn_t = free_rtn;
frtn_tPtr = ^frtn_t;
{ data descriptor }
type
databPtr = ^datab;
datab_db_f = record
case SInt16 of
0: (
freep: databPtr;
);
1: (
frtnp: free_rtnPtr;
);
end;
datab_db_fPtr = ^datab_db_f;
datab = record
db_f: datab_db_f;
db_base: UInt8Ptr; { first byte of buffer }
db_lim: UInt8Ptr; { last byte+1 of buffer }
db_ref: UInt8; { count of messages pointing to block}
db_type: UInt8; { message type }
db_iswhat: UInt8; { message status }
db_filler2: UInt8; { for spacing }
db_size: UInt32; { used internally }
db_msgaddr: UInt8Ptr; { used internally }
db_filler: SInt32;
end;
type
dblk_t = datab;
dblk_tPtr = ^dblk_t;
{ message block }
type
msgbPtr = ^msgb;
msgb = record
b_next: struct msgb *; { next message on queue }
b_prev: struct msgb *; { previous message on queue }
b_cont: struct msgb *; { next message block of message }
b_rptr: UInt8Ptr; { first unread data byte in buffer }
b_wptr: UInt8Ptr; { first unwritten data byte }
b_datap: databPtr; { data block }
b_band: UInt8; { message priority }
b_pad1: UInt8;
b_flag: UInt16;
end;
type
mblk_t = msgb;
mblk_tPtr = ^mblk_t;
{ mblk flags }
const
MSGMARK = $01; { last byte of message is tagged }
MSGNOLOOP = $02; { don't pass message to write-side of stream }
MSGDELIM = $04; { message is delimited }
MSGNOGET = $08;
{ STREAMS environments are expected to define these constants in a public header file.}
const
STRCTLSZ = 256; { Maximum Control buffer size for messages }
STRMSGSZ = 8192; { Maximum # data bytes for messages }
{ Message types }
const
QNORM = 0;
M_DATA = 0; { Ordinary data }
M_PROTO = 1; { Internal control info and data }
M_BREAK = $08; { Request a driver to send a break }
M_PASSFP = $09; { Used to pass a file pointer }
M_SIG = $0B; { Requests a signal to be sent }
M_DELAY = $0C; { Request a real-time delay }
M_CTL = $0D; { For inter-module communication }
M_IOCTL = $0E; { Used internally for I_STR requests }
M_SETOPTS = $10; { Alters characteristics of Stream head }
M_RSE = $11; { Reserved for internal use }
{ MPS private type }
const
M_MI = $40;
M_MI_READ_RESET = 1;
M_MI_READ_SEEK = 2;
M_MI_READ_END = 4;
{ Priority messages types }
const
QPCTL = $80;
M_IOCACK = $81; { Positive ack of previous M_IOCTL }
M_IOCNAK = $82; { Previous M_IOCTL failed }
M_PCPROTO = $83; { Same as M_PROTO except for priority }
M_PCSIG = $84; { Priority signal }
M_FLUSH = $86; { Requests modules to flush queues }
M_STOP = $87; { Request drivers to stop output }
M_START = $88; { Request drivers to start output }
M_HANGUP = $89; { Driver can no longer produce data }
M_ERROR = $8A; { Reports downstream error condition }
M_READ = $8B; { Reports client read at Stream head }
M_COPYIN = $8C; { Requests the Stream to copy data in for a module }
M_COPYOUT = $8D; { Requests the Stream to copy data out for a module }
M_IOCDATA = $8E; { Status from M_COPYIN/M_COPYOUT message }
M_PCRSE = $90; { Reserved for internal use }
M_STOPI = $91; { Request drivers to stop input }
M_STARTI = $92; { Request drivers to start input }
M_HPDATA = $93; { MPS-private type; high priority data }
{ Defines for flush messages }
const
FLUSHALL = 1;
FLUSHDATA = 0;
const
NOERROR = -1; { used in M_ERROR messages }
type
sth_sPtr = ^sth_s;
sth_s = record
dummy: UInt32;
end;
sqh_sPtr = ^sqh_s;
sqh_s = record
dummy: UInt32;
end;
q_xtraPtr = ^q_xtra;
q_xtra = record
dummy: UInt32;
end;
{$ifc OTKERNEL}
{
module_info is aligned differently on 68K than
on PowerPC. Yucky. I can't defined a conditionalised
pad field because a) you can't conditionalise specific
fields in the interface definition language used to
create Universal Interfaces, and b) lots of code
assigns C structured constants to global variables
of this type, and these assignments break if you
add an extra field to the type. Instead, I
set the alignment appropriately before defining the
structure. The problem with doing that is that
the interface definition language doesn't allow
my to set the alignment in the middle of a file,
so I have to do this via "pass throughs". This
works fine for the well known languages (C, Pascal),
but may cause problems for other languages (Java,
Asm).
}
{$ifc TARGET_CPU_PPC}
{$ALIGN POWER}
{$endc} {TARGET_CPU_PPC}
type
module_info = record
mi_idnum: UInt16; { module ID number }
mi_idname: UnivPtr; { module name }
mi_minpsz: SIGNEDLONG; { min pkt size, for developer use }
mi_maxpsz: SIGNEDLONG; { max pkt size, for developer use }
mi_hiwat: UNSIGNEDLONG; { hi-water mark, for flow control }
mi_lowat: UNSIGNEDLONG; { lo-water mark, for flow control }
end;
module_infoPtr = ^module_info;
{$ifc TARGET_CPU_PPC}
{$ALIGN MAC68K}
{$endc} {TARGET_CPU_PPC}
type
queuePtr = ^queue;
admin_t = function: OTInt32;
bufcall_t = procedure( size: SIGNEDLONG );
bufcallp_t = procedure( size: SIGNEDLONG );
closep_t = function( q: queuePtr; foo: OTInt32; var cred: cred_t ): OTInt32;
old_closep_t = function( q: queuePtr ): OTInt32;
openp_t = function( q: queuePtr; var dev: dev_t; foo: OTInt32; bar: OTInt32; var cred: cred_t ): OTInt32;
openOld_t = function( q: queuePtr; dev: dev_t; foo: OTInt32; bar: OTInt32 ): OTInt32;
old_openp_t = function( q: queuePtr; dev: dev_t; foo: OTInt32; bar: OTInt32 ): OTInt32;
closeOld_t = function( q: queuePtr ): OTInt32;
putp_t = function( q: queuePtr; var mp: msgb ): OTInt32;
srvp_t = function( q: queuePtr ): OTInt32;
qinitPtr = ^qinit;
qinit = record
qi_putp: putp_t; { put procedure }
qi_srvp: srvp_t; { service procedure }
qi_qopen: openp_t; { called on each open or a push }
qi_qclose: closep_t; { called on last close or a pop }
qi_qadmin: admin_t; { reserved for future use }
qi_minfo: module_infoPtr; { information structure }
qi_mstat: module_statPtr; { statistics structure - optional }
end;
{ defines module or driver }
streamtabPtr = ^streamtab;
streamtab = record
st_rdinit: qinitPtr; { defines read QUEUE }
st_wrinit: qinitPtr; { defines write QUEUE }
st_muxrinit: qinitPtr; { for multiplexing drivers only }
st_muxwinit: qinitPtr; { ditto }
end;
qbandPtr = ^qband;
qband = record
qb_next: struct qband *; { next band for this queue }
qb_count: UNSIGNEDLONG; { weighted count of characters in this band }
qb_first: msgbPtr; { head of message queue }
qb_last: msgbPtr; { tail of message queue }
qb_hiwat: UNSIGNEDLONG; { high water mark }
qb_lowat: UNSIGNEDLONG; { low water mark }
qb_flag: UInt16; { ¥¥¥Êstate }
qb_pad1: SInt16; { ¥¥¥ reserved }
end;
qband_t = qband;
qband_tPtr = ^qband_t;
queue_q_uPtr = ^queue_q_u;
queue_q_u = record
case SInt16 of
0: (
q_u_link: queuePtr; { link to scheduling queue }
);
1: (
q_u_sqh_parent: sqh_sPtr;
);
end;
queue = record
q_qinfo: qinitPtr; { procedures and limits for queue }
q_first: msgbPtr; { head of message queue }
q_last: msgbPtr; { tail of message queue }
q_next: queuePtr; { next queue in Stream }
q_u: queue_q_u;
q_ptr: UnivPtr; { to private data structure }
q_count: UNSIGNEDLONG; { weighted count of characters on q }
q_minpsz: SIGNEDLONG; { min packet size accepted }
q_maxpsz: SIGNEDLONG; { max packet size accepted }
q_hiwat: UNSIGNEDLONG; { high water mark, for flow control }
q_lowat: UNSIGNEDLONG; { low water mark }
q_bandp: qbandPtr; { band information }
q_flag: UInt16; { ¥¥¥ queue state }
q_nband: UInt8; { ¥¥¥ number of bands }
q_pad1: SInt8; { ¥¥¥ reserved }
q_osx: q_xtraPtr; { Pointer to OS-dependent extra stuff }
q_ffcp: queuePtr; { Forward flow control pointer }
q_bfcp: queuePtr; { Backward flow control pointer }
end;
queue_t = queue;
queue_tPtr = ^queue_t;
{ queue_t flag defines }
const
QREADR = $01; { This queue is a read queue }
QNOENB = $02; { Don't enable in putq }
QFULL = $04; { The queue is full }
QWANTR = $08; { The queue should be scheduled in the next putq }
QWANTW = $10; { The stream should be back enabled when this queue drains }
QUSE = $20; { The queue is allocated and ready for use }
QENAB = $40; { The queue is scheduled (on the run queue) }
QBACK = $80; { The queue has been back enabled }
QOLD = $0100; { Module supports old style opens and closes }
QHLIST = $0200; { The Stream head is doing something with this queue (Not supported by MPS) }
QWELDED = $0400; { Mentat flag for welded queues }
QUNWELDING = $0800; { Queue is scheduled to be unwelded }
QPROTECTED = $1000; { Mentat flag for unsafe q access }
QEXCOPENCLOSE = $2000; { Queue wants exclusive open/close calls }
{ qband_t flag defines }
const
QB_FULL = $01; { The band is full }
QB_WANTW = $02; { The stream should be back enabled when this band/queue drains }
QB_BACK = $04; { The queue has been back enabled }
{$elsec}
{
Client code views a queue_t as a simple cookie.
The real definition lives above and is only available
to kernel code.
}
type
queue_t = SInt32;
queue_tPtr = ^queue_t;
{$endc} {OTKERNEL}
{ structure contained in M_COPYIN/M_COPYOUT messages }
type
caddr_t = ^char;
copyreqPtr = ^copyreq;
copyreq = record
cq_cmd: SInt32; { ioctl command (from ioc_cmd) }
cq_cr: credPtr; { pointer to full credentials }
cq_id: UInt32; { ioctl id (from ioc_id) }
cq_addr: caddr_t; { address to copy data to/from }
cq_size: UInt32; { number of bytes to copy }
cq_flag: SInt32; { state }
cq_private: mblk_tPtr; { private state information }
cq_filler: array [0..3] of SInt32;
end;
{ copyreq defines }
const
STRCANON = $01; { b_cont data block contains canonical format specifier }
RECOPY = $02; { perform I_STR copyin again this time using canonical format specifier }
{ structure contained in M_IOCDATA message block }
type
copyrespPtr = ^copyresp;
copyresp = record
cp_cmd: SInt32; { ioctl command (from ioc_cmd) }
cp_cr: credPtr; { pointer to full credentials }
cp_id: UInt32; { ioctl id (from ioc_id) }
cp_rval: caddr_t; { status of request; 0 for success; error value for failure }
cp_pad1: UInt32;
cp_pad2: SInt32;
cp_private: mblk_tPtr; { private state information }
cp_filler: array [0..3] of SInt32;
end;
{ structure contained in an M_IOCTL message block }
type
iocblkPtr = ^iocblk;
iocblk = record
ioc_cmd: SInt32; { ioctl command type }
ioc_cr: credPtr; { pointer to full credentials }
ioc_id: UInt32; { ioctl id }
ioc_count: UInt32; { count of bytes in data field }
ioc_error: SInt32; { error code }
ioc_rval: SInt32; { return value }
ioc_filler: array [0..3] of SInt32;
end;
const
TRANSPARENT = $FFFFFFFF;
{ Used in M_IOCTL mblks to muxes (ioc_cmd I_LINK) }
type
linkblkPtr = ^linkblk;
linkblk = record
l_qtop: queue_tPtr; { lowest level write queue of upper stream }
l_qbot: queue_tPtr; { highest level write queue of lower stream }
l_index: SInt32; { system-unique index for lower stream }
l_pad: array [0..4] of SIGNEDLONG;
end;
{ structure contained in an M_PASSFP message block }
type
strpfp = record
pass_file_cookie: UNSIGNEDLONG; { file 'pointer' }
pass_uid: UInt16; { user id of sending stream }
pass_gid: UInt16;
pass_sth: sth_sPtr; { Stream head pointer of passed stream }
end;
{ structure contained in an M_SETOPTS message block }
type
stroptions = packed record
so_flags: UNSIGNEDLONG; { options to set }
so_readopt: SInt16; { read option }
so_wroff: UInt16; { write offset }
so_minpsz: SIGNEDLONG; { minimum read packet size }
so_maxpsz: SIGNEDLONG; { maximum read packet size }
so_hiwat: UNSIGNEDLONG; { read queue high-water mark }
so_lowat: UNSIGNEDLONG; { read queue low-water mark }
so_band: UInt8; { band for water marks }
so_filler: packed array [0..2] of UInt8; { added for alignment }
so_poll_set: UNSIGNEDLONG; { poll events to set }
so_poll_clr: UNSIGNEDLONG; { poll events to clear }
end;
{ definitions for so_flags field }
const
SO_ALL = $7FFF; { Update all options }
SO_READOPT = $0001; { Set the read mode }
SO_WROFF = $0002; { Insert an offset in write M_DATA mblks }
SO_MINPSZ = $0004; { Change the min packet size on sth rq }
SO_MAXPSZ = $0008; { Change the max packet size on sth rq }
SO_HIWAT = $0010; { Change the high water mark on sth rq }
SO_LOWAT = $0020; { Change the low water mark }
SO_MREADON = $0040; { Request M_READ messages }
SO_MREADOFF = $0080; { Don't gen M_READ messages }
SO_NDELON = $0100; { old TTY semantics for O_NDELAY reads and writes }
SO_NDELOFF = $0200; { STREAMS semantics for O_NDELAY reads and writes }
SO_ISTTY = $0400; { Become a controlling tty }
SO_ISNTTY = $0800; { No longer a controlling tty }
SO_TOSTOP = $1000; { Stop on background writes }
SO_TONSTOP = $2000; { Don't stop on background writes }
SO_BAND = $4000; { Water marks are for a band }
SO_POLL_SET = $8000; { Set events to poll }
SO_POLL_CLR = $00010000; { Clear events to poll }
{ Buffer Allocation Priority }
const
BPRI_LO = 1;
BPRI_MED = 2;
BPRI_HI = 3;
const
INFPSZ = -1;
{* Test whether message is a data message }
// #define datamsg(type) ((type) == M_DATA || (type) == M_PROTO || (type) == M_PCPROTO || (type) == M_DELAY)
const
CLONEOPEN = $02;
MODOPEN = $01;
OPENFAIL = -1;
{ Enumeration values for strqget and strqset }
type
qfields = SInt32;
const
QHIWAT = 0;
QLOWAT = 1;
QMAXPSZ = 2;
QMINPSZ = 3;
QCOUNT = 4;
QFIRST = 5;
QLAST = 6;
QFLAG = 7;
QBAD = 8;
type
qfields_t = qfields;
{$endc} { CALL_NOT_IN_CARBON }
{ ***** From the Mentat "stropts.h" *****}
const
I_NREAD = $4101; { return the number of bytes in 1st msg }
I_PUSH = $4102; { push module just below stream head }
I_POP = $4103; { pop module below stream head }
I_LOOK = $4104; { retrieve name of first stream module }
I_FLUSH = $4105; { flush all input and/or output queues }
I_SRDOPT = $4106; { set the read mode }
I_GRDOPT = $4107; { get the current read mode }
I_STR = $4108; { create an internal ioctl message }
I_SETSIG = $4109; { request SIGPOLL signal on events }
I_GETSIG = $410A; { query the registered events }
I_FIND = $410B; { check for module in stream }
I_LINK = $410C; { connect stream under mux fd }
I_UNLINK = $410D; { disconnect two streams }
I_PEEK = $410F; { peek at data on read queue }
I_FDINSERT = $4110; { create a message and send downstream }
I_SENDFD = $4111; { send an fd to a connected pipe stream }
I_RECVFD = $4112; { retrieve a file descriptor }
I_FLUSHBAND = $4113; { flush a particular input and/or output band }
I_SWROPT = $4114; { set the write mode }
I_GWROPT = $4115; { get the current write mode }
I_LIST = $4116; { get a list of all modules on a stream }
I_ATMARK = $4117; { check to see if the next message is "marked" }
I_CKBAND = $4118; { check for a message of a particular band }
I_GETBAND = $4119; { get the band of the next message to be read }
I_CANPUT = $411A; { check to see if a message may be passed on a stream }
I_SETCLTIME = $411B; { set the close timeout wait }
I_GETCLTIME = $411C; { get the current close timeout wait }
I_PLINK = $411D; { permanently connect a stream under a mux }
I_PUNLINK = $411E; { disconnect a permanent link }
I_GETMSG = $4128; { getmsg() system call }
I_PUTMSG = $4129; { putmsg() system call }
I_POLL = $412A; { poll() system call }
I_SETDELAY = $412B; { set blocking status }
I_GETDELAY = $412C; { get blocking status }
I_RUN_QUEUES = $412D; { sacrifice for the greater good }
I_GETPMSG = $412E; { getpmsg() system call }
I_PUTPMSG = $412F; { putpmsg() system call }
I_AUTOPUSH = $4130; { for systems that cannot do the autopush in open }
I_PIPE = $4131; { for pipe library call }
I_HEAP_REPORT = $4132; { get heap statistics }
I_FIFO = $4133; { for fifo library call }
{ priority message request on putmsg() or strpeek }
const
RS_HIPRI = $01;
{ flags for getpmsg and putpmsg }
const
MSG_HIPRI = $01;
MSG_BAND = $02; { Retrieve a message from a particular band }
MSG_ANY = $04; { Retrieve a message from any band }
{ return values from getmsg(), 0 indicates all ok }
const
MORECTL = $01; { more control info available }
MOREDATA = $02; { more data available }
const
FMNAMESZ = 31; { maximum length of a module or device name }
{ Infinite poll wait time }
const
INFTIM = $FFFFFFFF;
{ flush requests }
const
FLUSHR = $01; { Flush the read queue }
FLUSHW = $02; { Flush the write queue }
FLUSHRW = FLUSHW or FLUSHR; { Flush both }
const
FLUSHBAND = $40; { Flush a particular band }
{
Mentat's code does an #ifdef on this symbol, so we have to #define
it as well as declare it as an enum. But only for Apple builds because
we don't want internal weirdness to propagate to developers.
}
// #define FLUSHBAND FLUSHBAND
{ I_FLUSHBAND }
type
bandinfoPtr = ^bandinfo;
bandinfo = record
bi_pri: UInt8; { Band to flush }
pad1: SInt8;
bi_flag: SInt32; { One of the above flush requests }
end;
{ flags for I_ATMARK }
const
ANYMARK = $01; { Check if message is marked }
LASTMARK = $02; { Check if this is the only message marked }
{ signal event masks }
const
S_INPUT = $01; { A non-M_PCPROTO message has arrived }
S_HIPRI = $02; { A priority (M_PCPROTO) message is available }
S_OUTPUT = $04; { The write queue is no longer full }
S_MSG = $08; { A signal message has reached the front of read queue }
S_RDNORM = $10; { A non-priority message is available }
S_RDBAND = $20; { A banded messsage is available }
S_WRNORM = $40; { Same as S_OUTPUT }
S_WRBAND = $80; { A priority band exists and is writable }
S_ERROR = $0100; { Error message has arrived }
S_HANGUP = $0200; { Hangup message has arrived }
S_BANDURG = $0400; { Use SIGURG instead of SIGPOLL on S_RDBAND signals }
{ read mode bits for I_S|GRDOPT; choose one of the following }
const
RNORM = $01; { byte-stream mode, default }
RMSGD = $02; { message-discard mode }
RMSGN = $04; { message-nondiscard mode }
RFILL = $08; { fill read buffer mode (PSE private) }
{ More read modes, these are bitwise or'ed with the modes above }
const
RPROTNORM = $10; { Normal handling of M_PROTO/M_PCPROTO messages, default }
RPROTDIS = $20; { Discard M_PROTO/M_PCPROTO message blocks }
RPROTDAT = $40; { Convert M_PROTO/M_PCPROTO message blocks into M_DATA }
{ write modes for I_S|GWROPT }
const
SNDZERO = $01; { Send a zero-length message downstream on a write of zero bytes }
const
MUXID_ALL = -1; { Unlink all lower streams for I_UNLINK and I_PUNLINK }
{
strbuf is moved to "OpenTransport.h" because that header file
exports provider routines that take it as a parameter.
}
{ structure of ioctl data on I_FDINSERT }
type
strfdinsertPtr = ^strfdinsert;
strfdinsert = record
ctlbuf: strbuf;
databuf: strbuf;
flags: SIGNEDLONG; { type of message, 0 or RS_HIPRI }
fildes: SIGNEDLONG; { fd of other stream (FDCELL) }
offset: SInt32; { where to put other stream read qp }
end;
{ I_LIST structures }
type
str_mlistPtr = ^str_mlist;
str_mlist = record
l_name: packed array [0..31] of char;
end;
type
str_listPtr = ^str_list;
str_list = record
sl_nmods: SInt32; { number of modules in sl_modlist array }
sl_modlist: str_mlistPtr;
end;
{ I_PEEK structure }
type
strpeekPtr = ^strpeek;
strpeek = record
ctlbuf: strbuf;
databuf: strbuf;
flags: SIGNEDLONG; { if RS_HIPRI, get priority messages only }
end;
{ structure for getpmsg and putpmsg }
type
strpmsgPtr = ^strpmsg;
strpmsg = record
ctlbuf: strbuf;
databuf: strbuf;
band: SInt32;
flags: SIGNEDLONG;
end;
{ structure of ioctl data on I_RECVFD }
type
strrecvfdPtr = ^strrecvfd;
strrecvfd = record
fd: SIGNEDLONG; { new file descriptor (FDCELL) }
uid: UInt16; { user id of sending stream }
gid: UInt16;
fill: packed array [0..7] of char;
end;
{ structure of ioctl data on I_STR }
type
strioctlPtr = ^strioctl;
strioctl = record
ic_cmd: SInt32; { downstream command }
ic_timout: SInt32; { ACK/NAK timeout }
ic_len: SInt32; { length of data arg }
ic_dp: UnivPtr; { ptr to data arg }
end;
{ ***** From the Mentat "strlog.h" *****}
type
log_ctlPtr = ^log_ctl;
log_ctl = record
mid: SInt16;
sid: SInt16;
level: SInt8;
pad1: SInt8;
flags: SInt16;
ltime: SIGNEDLONG;
ttime: SIGNEDLONG;
seq_no: SInt32;
end;
const
SL_FATAL = $01; { Fatal error }
SL_NOTIFY = $02; { Notify the system administrator }
SL_ERROR = $04; { Pass message to error logger }
SL_TRACE = $08; { Pass message to tracer }
SL_CONSOLE = $00; { Console messages are disabled }
SL_WARN = $20; { Warning }
SL_NOTE = $40; { Notice this message }
type
trace_idsPtr = ^trace_ids;
trace_ids = record
ti_mid: SInt16;
ti_sid: SInt16;
ti_level: char;
end;
const
I_TRCLOG = $6201;
I_ERRLOG = $6202;
const
LOGMSGSZ = 128;
{ ***** From the Mentat "tihdr.h" *****}
{$ifc CALL_NOT_IN_CARBON}
{ TPI Primitives}
const
T_BIND_REQ = 101;
T_CONN_REQ = 102; { connection request }
T_CONN_RES = 103; { respond to connection indication }
T_DATA_REQ = 104;
T_DISCON_REQ = 105;
T_EXDATA_REQ = 106;
T_INFO_REQ = 107;
T_OPTMGMT_REQ = 108;
T_ORDREL_REQ = 109;
T_UNBIND_REQ = 110;
T_UNITDATA_REQ = 111;
T_ADDR_REQ = 112; { Get address request }
T_UREQUEST_REQ = 113; { UnitRequest (transaction) req }
T_REQUEST_REQ = 114; { Request (CO transaction) req }
T_UREPLY_REQ = 115; { UnitRequest (transaction) req }
T_REPLY_REQ = 116; { REPLY (CO transaction) req }
T_CANCELREQUEST_REQ = 117; { Cancel outgoing request }
T_CANCELREPLY_REQ = 118; { Cancel incoming request }
T_REGNAME_REQ = 119; { Request name registration }
T_DELNAME_REQ = 120; { Request delete name registration }
T_LKUPNAME_REQ = 121; { Request name lookup }
T_BIND_ACK = 122;
T_CONN_CON = 123; { connection confirmation }
T_CONN_IND = 124; { incoming connection indication }
T_DATA_IND = 125;
T_DISCON_IND = 126;
T_ERROR_ACK = 127;
T_EXDATA_IND = 128;
T_INFO_ACK = 129;
T_OK_ACK = 130;
T_OPTMGMT_ACK = 131;
T_ORDREL_IND = 132;
T_UNITDATA_IND = 133;
T_UDERROR_IND = 134;
T_ADDR_ACK = 135; { Get address ack }
T_UREQUEST_IND = 136; { UnitRequest (transaction) ind }
T_REQUEST_IND = 137; { Request (CO transaction) ind }
T_UREPLY_IND = 138; { Incoming unit reply }
T_REPLY_IND = 139; { Incoming reply }
T_UREPLY_ACK = 140; { outgoing Unit Reply is complete }
T_REPLY_ACK = 141; { outgoing Reply is complete }
T_RESOLVEADDR_REQ = 142;
T_RESOLVEADDR_ACK = 143;
T_LKUPNAME_CON = 146; { Results of name lookup }
T_LKUPNAME_RES = 147; { Partial results of name lookup }
T_REGNAME_ACK = 148; { Request name registration }
T_SEQUENCED_ACK = 149; { Sequenced version of OK or ERROR ACK }
T_EVENT_IND = 160; { Miscellaneous event Indication }
{ State values }
const
TS_UNBND = 1;
TS_WACK_BREQ = 2;
TS_WACK_UREQ = 3;
TS_IDLE = 4;
TS_WACK_OPTREQ = 5;
TS_WACK_CREQ = 6;
TS_WCON_CREQ = 7;
TS_WRES_CIND = 8;
TS_WACK_CRES = 9;
TS_DATA_XFER = 10;
TS_WIND_ORDREL = 11;
TS_WREQ_ORDREL = 12;
TS_WACK_DREQ6 = 13;
TS_WACK_DREQ7 = 14;
TS_WACK_DREQ9 = 15;
TS_WACK_DREQ10 = 16;
TS_WACK_DREQ11 = 17;
TS_WACK_ORDREL = 18;
TS_NOSTATES = 19;
TS_BAD_STATE = 19;
{ Transport events }
const
TE_OPENED = 1;
TE_BIND = 2;
TE_OPTMGMT = 3;
TE_UNBIND = 4;
TE_CLOSED = 5;
TE_CONNECT1 = 6;
TE_CONNECT2 = 7;
TE_ACCEPT1 = 8;
TE_ACCEPT2 = 9;
TE_ACCEPT3 = 10;
TE_SND = 11;
TE_SNDDIS1 = 12;
TE_SNDDIS2 = 13;
TE_SNDREL = 14;
TE_SNDUDATA = 15;
TE_LISTEN = 16;
TE_RCVCONNECT = 17;
TE_RCV = 18;
TE_RCVDIS1 = 19;
TE_RCVDIS2 = 20;
TE_RCVDIS3 = 21;
TE_RCVREL = 22;
TE_RCVUDATA = 23;
TE_RCVUDERR = 24;
TE_PASS_CONN = 25;
TE_BAD_EVENT = 26;
type
T_addr_ackPtr = ^T_addr_ack;
T_addr_ack = record
PRIM_type: SIGNEDLONG; { Always T_ADDR_ACK }
LOCADDR_length: SIGNEDLONG;
LOCADDR_offset: SIGNEDLONG;
REMADDR_length: SIGNEDLONG;
REMADDR_offset: SIGNEDLONG;
end;
type
T_addr_reqPtr = ^T_addr_req;
T_addr_req = record
PRIM_type: SIGNEDLONG; { Always T_ADDR_REQ }
end;
type
T_bind_ackPtr = ^T_bind_ack;
T_bind_ack = record
PRIM_type: SIGNEDLONG; { always T_BIND_ACK }
ADDR_length: SIGNEDLONG;
ADDR_offset: SIGNEDLONG;
CONIND_number: UNSIGNEDLONG;
end;
type
T_bind_reqPtr = ^T_bind_req;
T_bind_req = record
PRIM_type: SIGNEDLONG; { always T_BIND_REQ }
ADDR_length: SIGNEDLONG;
ADDR_offset: SIGNEDLONG;
CONIND_number: UNSIGNEDLONG;
end;
type
T_conn_conPtr = ^T_conn_con;
T_conn_con = record
PRIM_type: SIGNEDLONG; { always T_CONN_CON }
RES_length: SIGNEDLONG; { responding address length }
RES_offset: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
end;
type
T_conn_indPtr = ^T_conn_ind;
T_conn_ind = record
PRIM_type: SIGNEDLONG; { always T_CONN_IND }
SRC_length: SIGNEDLONG;
SRC_offset: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
SEQ_number: SIGNEDLONG;
end;
type
T_conn_reqPtr = ^T_conn_req;
T_conn_req = record
PRIM_type: SIGNEDLONG; { always T_CONN_REQ }
DEST_length: SIGNEDLONG;
DEST_offset: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
end;
type
T_conn_resPtr = ^T_conn_res;
T_conn_res = record
PRIM_type: SIGNEDLONG; { always T_CONN_RES }
QUEUE_ptr: queue_tPtr;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
SEQ_number: SIGNEDLONG;
end;
type
T_data_indPtr = ^T_data_ind;
T_data_ind = record
PRIM_type: SIGNEDLONG; { always T_DATA_IND }
MORE_flag: SIGNEDLONG;
end;
type
T_data_reqPtr = ^T_data_req;
T_data_req = record
PRIM_type: SIGNEDLONG; { always T_DATA_REQ }
MORE_flag: SIGNEDLONG;
end;
type
T_discon_indPtr = ^T_discon_ind;
T_discon_ind = record
PRIM_type: SIGNEDLONG; { always T_DISCON_IND }
DISCON_reason: SIGNEDLONG;
SEQ_number: SIGNEDLONG;
end;
type
T_discon_reqPtr = ^T_discon_req;
T_discon_req = record
PRIM_type: SIGNEDLONG; { always T_DISCON_REQ }
SEQ_number: SIGNEDLONG;
end;
type
T_exdata_indPtr = ^T_exdata_ind;
T_exdata_ind = record
PRIM_type: SIGNEDLONG; { always T_EXDATA_IND }
MORE_flag: SIGNEDLONG;
end;
type
T_exdata_reqPtr = ^T_exdata_req;
T_exdata_req = record
PRIM_type: SIGNEDLONG; { always T_EXDATA_REQ }
MORE_flag: SIGNEDLONG;
end;
type
T_error_ackPtr = ^T_error_ack;
T_error_ack = record
PRIM_type: SIGNEDLONG; { always T_ERROR_ACK }
ERROR_prim: SIGNEDLONG; { primitive in error }
TLI_error: SIGNEDLONG;
UNIX_error: SIGNEDLONG;
end;
type
T_info_ackPtr = ^T_info_ack;
T_info_ack = record
PRIM_type: SIGNEDLONG; { always T_INFO_ACK }
TSDU_size: SIGNEDLONG; { max TSDU size }
ETSDU_size: SIGNEDLONG; { max ETSDU size }
CDATA_size: SIGNEDLONG; { connect data size }
DDATA_size: SIGNEDLONG; { disconnect data size }
ADDR_size: SIGNEDLONG; { TSAP size }
OPT_size: SIGNEDLONG; { options size }
TIDU_size: SIGNEDLONG; { TIDU size }
SERV_type: SIGNEDLONG; { service type }
CURRENT_state: SIGNEDLONG; { current state }
PROVIDER_flag: SIGNEDLONG; { provider flags (see xti.h for defines) }
end;
{ Provider flags }
const
SENDZERO = $0001; { supports 0-length TSDU's }
XPG4_1 = $0002; { provider supports recent stuff }
type
T_info_reqPtr = ^T_info_req;
T_info_req = record
PRIM_type: SIGNEDLONG; { always T_INFO_REQ }
end;
type
T_ok_ackPtr = ^T_ok_ack;
T_ok_ack = record
PRIM_type: SIGNEDLONG; { always T_OK_ACK }
CORRECT_prim: SIGNEDLONG;
end;
type
T_optmgmt_ackPtr = ^T_optmgmt_ack;
T_optmgmt_ack = record
PRIM_type: SIGNEDLONG; { always T_OPTMGMT_ACK }
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
MGMT_flags: SIGNEDLONG;
end;
type
T_optmgmt_reqPtr = ^T_optmgmt_req;
T_optmgmt_req = record
PRIM_type: SIGNEDLONG; { always T_OPTMGMT_REQ }
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
MGMT_flags: SIGNEDLONG;
end;
type
T_ordrel_indPtr = ^T_ordrel_ind;
T_ordrel_ind = record
PRIM_type: SIGNEDLONG; { always T_ORDREL_IND }
end;
type
T_ordrel_reqPtr = ^T_ordrel_req;
T_ordrel_req = record
PRIM_type: SIGNEDLONG; { always T_ORDREL_REQ }
end;
type
T_unbind_reqPtr = ^T_unbind_req;
T_unbind_req = record
PRIM_type: SIGNEDLONG; { always T_UNBIND_REQ }
end;
type
T_uderror_indPtr = ^T_uderror_ind;
T_uderror_ind = record
PRIM_type: SIGNEDLONG; { always T_UDERROR_IND }
DEST_length: SIGNEDLONG;
DEST_offset: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
ERROR_type: SIGNEDLONG;
end;
type
T_unitdata_indPtr = ^T_unitdata_ind;
T_unitdata_ind = record
PRIM_type: SIGNEDLONG; { always T_UNITDATA_IND }
SRC_length: SIGNEDLONG;
SRC_offset: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
end;
type
T_unitdata_reqPtr = ^T_unitdata_req;
T_unitdata_req = record
PRIM_type: SIGNEDLONG; { always T_UNITDATA_REQ }
DEST_length: SIGNEDLONG;
DEST_offset: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
end;
type
T_resolveaddr_ackPtr = ^T_resolveaddr_ack;
T_resolveaddr_ack = record
PRIM_type: SIGNEDLONG; { always T_RESOLVEADDR_ACK }
SEQ_number: SIGNEDLONG;
ADDR_length: SIGNEDLONG;
ADDR_offset: SIGNEDLONG;
ORIG_client: SIGNEDLONG;
ORIG_data: SIGNEDLONG;
TLI_error: SIGNEDLONG;
UNIX_error: SIGNEDLONG;
end;
type
T_resolveaddr_reqPtr = ^T_resolveaddr_req;
T_resolveaddr_req = record
PRIM_type: SIGNEDLONG; { always T_RESOLVEADDR_REQ }
SEQ_number: SIGNEDLONG;
ADDR_length: SIGNEDLONG;
ADDR_offset: SIGNEDLONG;
ORIG_client: SIGNEDLONG;
ORIG_data: SIGNEDLONG;
MAX_milliseconds: SIGNEDLONG;
end;
type
T_unitreply_indPtr = ^T_unitreply_ind;
T_unitreply_ind = record
PRIM_type: SIGNEDLONG; { Always T_UREPLY_IND }
SEQ_number: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
REP_flags: SIGNEDLONG;
TLI_error: SIGNEDLONG;
UNIX_error: SIGNEDLONG;
end;
type
T_unitrequest_indPtr = ^T_unitrequest_ind;
T_unitrequest_ind = record
PRIM_type: SIGNEDLONG; { Always T_UREQUEST_IND }
SEQ_number: SIGNEDLONG;
SRC_length: SIGNEDLONG;
SRC_offset: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
REQ_flags: SIGNEDLONG;
end;
type
T_unitrequest_reqPtr = ^T_unitrequest_req;
T_unitrequest_req = record
PRIM_type: SIGNEDLONG; { Always T_UREQUEST_REQ }
SEQ_number: SIGNEDLONG;
DEST_length: SIGNEDLONG;
DEST_offset: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
REQ_flags: SIGNEDLONG;
end;
type
T_unitreply_reqPtr = ^T_unitreply_req;
T_unitreply_req = record
PRIM_type: SIGNEDLONG; { Always T_UREPLY_REQ }
SEQ_number: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
REP_flags: SIGNEDLONG;
end;
type
T_unitreply_ackPtr = ^T_unitreply_ack;
T_unitreply_ack = record
PRIM_type: SIGNEDLONG; { Always T_UREPLY_ACK }
SEQ_number: SIGNEDLONG;
TLI_error: SIGNEDLONG;
UNIX_error: SIGNEDLONG;
end;
type
T_cancelrequest_reqPtr = ^T_cancelrequest_req;
T_cancelrequest_req = record
PRIM_type: SIGNEDLONG; { Always T_CANCELREQUEST_REQ }
SEQ_number: SIGNEDLONG;
end;
type
T_cancelreply_reqPtr = ^T_cancelreply_req;
T_cancelreply_req = record
PRIM_type: SIGNEDLONG; { Always T_CANCELREPLY_REQ }
SEQ_number: SIGNEDLONG;
end;
type
T_reply_indPtr = ^T_reply_ind;
T_reply_ind = record
PRIM_type: SIGNEDLONG; { Always T_REPLY_IND }
SEQ_number: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
REP_flags: SIGNEDLONG;
TLI_error: SIGNEDLONG;
UNIX_error: SIGNEDLONG;
end;
type
T_request_indPtr = ^T_request_ind;
T_request_ind = record
PRIM_type: SIGNEDLONG; { Always T_REQUEST_IND }
SEQ_number: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
REQ_flags: SIGNEDLONG;
end;
type
T_request_reqPtr = ^T_request_req;
T_request_req = record
PRIM_type: SIGNEDLONG; { Always T_REQUEST_REQ }
SEQ_number: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
REQ_flags: SIGNEDLONG;
end;
type
T_reply_reqPtr = ^T_reply_req;
T_reply_req = record
PRIM_type: SIGNEDLONG; { Always T_REPLY_REQ }
SEQ_number: SIGNEDLONG;
OPT_length: SIGNEDLONG;
OPT_offset: SIGNEDLONG;
REP_flags: SIGNEDLONG;
end;
type
T_reply_ackPtr = ^T_reply_ack;
T_reply_ack = record
PRIM_type: SIGNEDLONG; { Always T_REPLY_ACK }
SEQ_number: SIGNEDLONG;
TLI_error: SIGNEDLONG;
UNIX_error: SIGNEDLONG;
end;
type
T_regname_reqPtr = ^T_regname_req;
T_regname_req = record
PRIM_type: SIGNEDLONG; { Always T_REGNAME_REQ }
SEQ_number: SIGNEDLONG; { Reply is sequence ack }
NAME_length: SIGNEDLONG;
NAME_offset: SIGNEDLONG;
ADDR_length: SIGNEDLONG;
ADDR_offset: SIGNEDLONG;
REQ_flags: SIGNEDLONG;
end;
type
T_regname_ackPtr = ^T_regname_ack;
T_regname_ack = record
PRIM_type: SIGNEDLONG; { always T_REGNAME_ACK }
SEQ_number: SIGNEDLONG;
REG_id: SIGNEDLONG;
ADDR_length: SIGNEDLONG;
ADDR_offset: SIGNEDLONG;
end;
type
T_delname_reqPtr = ^T_delname_req;
T_delname_req = record
PRIM_type: SIGNEDLONG; { Always T_DELNAME_REQ }
SEQ_number: SIGNEDLONG; { Reply is sequence ack }
NAME_length: SIGNEDLONG;
NAME_offset: SIGNEDLONG;
end;
type
T_lkupname_reqPtr = ^T_lkupname_req;
T_lkupname_req = record
PRIM_type: SIGNEDLONG; { Always T_LKUPNAME_REQ }
SEQ_number: SIGNEDLONG; { Reply is sequence ack }
NAME_length: SIGNEDLONG; { ... or T_LKUPNAME_CON }
NAME_offset: SIGNEDLONG;
ADDR_length: SIGNEDLONG;
ADDR_offset: SIGNEDLONG;
MAX_number: SIGNEDLONG;
MAX_milliseconds: SIGNEDLONG;
REQ_flags: SIGNEDLONG;
end;
type
T_lkupname_conPtr = ^T_lkupname_con;
T_lkupname_con = record
PRIM_type: SIGNEDLONG; { Either T_LKUPNAME_CON }
SEQ_number: SIGNEDLONG; { Or T_LKUPNAME_RES }
NAME_length: SIGNEDLONG;
NAME_offset: SIGNEDLONG;
RSP_count: SIGNEDLONG;
RSP_cumcount: SIGNEDLONG;
end;
type
T_sequence_ackPtr = ^T_sequence_ack;
T_sequence_ack = record
PRIM_type: SIGNEDLONG; { always T_SEQUENCED_ACK }
ORIG_prim: SIGNEDLONG; { original primitive }
SEQ_number: SIGNEDLONG;
TLI_error: SIGNEDLONG;
UNIX_error: SIGNEDLONG;
end;
type
T_event_indPtr = ^T_event_ind;
T_event_ind = record
PRIM_type: SIGNEDLONG; { always T_EVENT_IND }
EVENT_code: SIGNEDLONG;
EVENT_cookie: SIGNEDLONG;
end;
T_primitivesPtr = ^T_primitives;
T_primitives = record
case SInt16 of
0: (
primType: SIGNEDLONG;
);
1: (
taddrack: T_addr_ack;
);
2: (
tbindack: T_bind_ack;
);
3: (
tbindreq: T_bind_req;
);
4: (
tconncon: T_conn_con;
);
5: (
tconnind: T_conn_ind;
);
6: (
tconnreq: T_conn_req;
);
7: (
tconnres: T_conn_res;
);
8: (
tdataind: T_data_ind;
);
9: (
tdatareq: T_data_req;
);
10: (
tdisconind: T_discon_ind;
);
11: (
tdisconreq: T_discon_req;
);
12: (
texdataind: T_exdata_ind;
);
13: (
texdatareq: T_exdata_req;
);
14: (
terrorack: T_error_ack;
);
15: (
tinfoack: T_info_ack;
);
16: (
tinforeq: T_info_req;
);
17: (
tokack: T_ok_ack;
);
18: (
toptmgmtack: T_optmgmt_ack;
);
19: (
toptmgmtreq: T_optmgmt_req;
);
20: (
tordrelind: T_ordrel_ind;
);
21: (
tordrelreq: T_ordrel_req;
);
22: (
tunbindreq: T_unbind_req;
);
23: (
tuderrorind: T_uderror_ind;
);
24: (
tunitdataind: T_unitdata_ind;
);
25: (
tunitdatareq: T_unitdata_req;
);
26: (
tunitreplyind: T_unitreply_ind;
);
27: (
tunitrequestind: T_unitrequest_ind;
);
28: (
tunitrequestreq: T_unitrequest_req;
);
29: (
tunitreplyreq: T_unitreply_req;
);
30: (
tunitreplyack: T_unitreply_ack;
);
31: (
treplyind: T_reply_ind;
);
32: (
trequestind: T_request_ind;
);
33: (
trequestreq: T_request_req;
);
34: (
treplyreq: T_reply_req;
);
35: (
treplyack: T_reply_ack;
);
36: (
tcancelreqreq: T_cancelrequest_req;
);
37: (
tresolvereq: T_resolveaddr_req;
);
38: (
tresolveack: T_resolveaddr_ack;
);
39: (
tregnamereq: T_regname_req;
);
40: (
tregnameack: T_regname_ack;
);
41: (
tdelnamereq: T_delname_req;
);
42: (
tlkupnamereq: T_lkupname_req;
);
43: (
tlkupnamecon: T_lkupname_con;
);
44: (
tsequenceack: T_sequence_ack;
);
45: (
teventind: T_event_ind;
);
end;
{ ***** From the Mentat "dlpi.h" *****}
{
This header file has encoded the values so an existing driver
or user which was written with the Logical Link Interface(LLI)
can migrate to the DLPI interface in a binary compatible manner.
Any fields which require a specific format or value are flagged
with a comment containing the message LLI compatibility.
}
{ DLPI revision definition history}
const
DL_CURRENT_VERSION = $02; { current version of dlpi }
DL_VERSION_2 = $02; { version of dlpi March 12,1991 }
const
DL_INFO_REQ = $00; { Information Req, LLI compatibility }
DL_INFO_ACK = $03; { Information Ack, LLI compatibility }
DL_ATTACH_REQ = $0B; { Attach a PPA }
DL_DETACH_REQ = $0C; { Detach a PPA }
DL_BIND_REQ = $01; { Bind dlsap address, LLI compatibility }
DL_BIND_ACK = $04; { Dlsap address bound, LLI compatibility }
DL_UNBIND_REQ = $02; { Unbind dlsap address, LLI compatibility }
DL_OK_ACK = $06; { Success acknowledgment, LLI compatibility }
DL_ERROR_ACK = $05; { Error acknowledgment, LLI compatibility }
DL_SUBS_BIND_REQ = $1B; { Bind Subsequent DLSAP address }
DL_SUBS_BIND_ACK = $1C; { Subsequent DLSAP address bound }
DL_SUBS_UNBIND_REQ = $15; { Subsequent unbind }
DL_ENABMULTI_REQ = $1D; { Enable multicast addresses }
DL_DISABMULTI_REQ = $1E; { Disable multicast addresses }
DL_PROMISCON_REQ = $1F; { Turn on promiscuous mode }
DL_PROMISCOFF_REQ = $20; { Turn off promiscuous mode }
DL_UNITDATA_REQ = $07; { datagram send request, LLI compatibility }
DL_UNITDATA_IND = $08; { datagram receive indication, LLI compatibility }
DL_UDERROR_IND = $09; { datagram error indication, LLI compatibility }
DL_UDQOS_REQ = $0A; { set QOS for subsequent datagram transmissions }
DL_CONNECT_REQ = $0D; { Connect request }
DL_CONNECT_IND = $0E; { Incoming connect indication }
DL_CONNECT_RES = $0F; { Accept previous connect indication }
DL_CONNECT_CON = $10; { Connection established }
DL_TOKEN_REQ = $11; { Passoff token request }
DL_TOKEN_ACK = $12; { Passoff token ack }
DL_DISCONNECT_REQ = $13; { Disconnect request }
DL_DISCONNECT_IND = $14; { Disconnect indication }
DL_RESET_REQ = $17; { Reset service request }
DL_RESET_IND = $18; { Incoming reset indication }
DL_RESET_RES = $19; { Complete reset processing }
DL_RESET_CON = $1A; { Reset processing complete }
DL_DATA_ACK_REQ = $21; { data unit transmission request }
DL_DATA_ACK_IND = $22; { Arrival of a command PDU }
DL_DATA_ACK_STATUS_IND = $23; { Status indication of DATA_ACK_REQ}
DL_REPLY_REQ = $24; { Request a DLSDU from the remote }
DL_REPLY_IND = $25; { Arrival of a command PDU }
DL_REPLY_STATUS_IND = $26; { Status indication of REPLY_REQ }
DL_REPLY_UPDATE_REQ = $27; { Hold a DLSDU for transmission }
DL_REPLY_UPDATE_STATUS_IND = $28; { Status of REPLY_UPDATE req }
DL_XID_REQ = $29; { Request to send an XID PDU }
DL_XID_IND = $2A; { Arrival of an XID PDU }
DL_XID_RES = $2B; { request to send a response XID PDU}
DL_XID_CON = $2C; { Arrival of a response XID PDU }
DL_TEST_REQ = $2D; { TEST command request }
DL_TEST_IND = $2E; { TEST response indication }
DL_TEST_RES = $2F; { TEST response }
DL_TEST_CON = $30; { TEST Confirmation }
DL_PHYS_ADDR_REQ = $31; { Request to get physical addr }
DL_PHYS_ADDR_ACK = $32; { Return physical addr }
DL_SET_PHYS_ADDR_REQ = $33; { set physical addr }
DL_GET_STATISTICS_REQ = $34; { Request to get statistics }
DL_GET_STATISTICS_ACK = $35; { Return statistics }
{ DLPI interface states}
const
DL_UNATTACHED = $04; { PPA not attached }
DL_ATTACH_PENDING = $05; { Waiting ack of DL_ATTACH_REQ }
DL_DETACH_PENDING = $06; { Waiting ack of DL_DETACH_REQ }
DL_UNBOUND = $00; { PPA attached, LLI compatibility }
DL_BIND_PENDING = $01; { Waiting ack of DL_BIND_REQ, LLI compatibility }
DL_UNBIND_PENDING = $02; { Waiting ack of DL_UNBIND_REQ, LLI compatibility }
DL_IDLE = $03; { dlsap bound, awaiting use, LLI compatibility }
DL_UDQOS_PENDING = $07; { Waiting ack of DL_UDQOS_REQ }
DL_OUTCON_PENDING = $08; { outgoing connection, awaiting DL_CONN_CON }
DL_INCON_PENDING = $09; { incoming connection, awaiting DL_CONN_RES }
DL_CONN_RES_PENDING = $0A; { Waiting ack of DL_CONNECT_RES }
DL_DATAXFER = $0B; { connection-oriented data transfer }
DL_USER_RESET_PENDING = $0C; { user initiated reset, awaiting DL_RESET_CON }
DL_PROV_RESET_PENDING = $0D; { provider initiated reset, awaiting DL_RESET_RES }
DL_RESET_RES_PENDING = $0E; { Waiting ack of DL_RESET_RES }
DL_DISCON8_PENDING = $0F; { Waiting ack of DL_DISC_REQ when in DL_OUTCON_PENDING }
DL_DISCON9_PENDING = $10; { Waiting ack of DL_DISC_REQ when in DL_INCON_PENDING }
DL_DISCON11_PENDING = $11; { Waiting ack of DL_DISC_REQ when in DL_DATAXFER }
DL_DISCON12_PENDING = $12; { Waiting ack of DL_DISC_REQ when in DL_USER_RESET_PENDING }
DL_DISCON13_PENDING = $13; { Waiting ack of DL_DISC_REQ when in DL_DL_PROV_RESET_PENDING }
DL_SUBS_BIND_PND = $14; { Waiting ack of DL_SUBS_BIND_REQ }
DL_SUBS_UNBIND_PND = $15; { Waiting ack of DL_SUBS_UNBIND_REQ }
{ DL_ERROR_ACK error return values}
const
DL_ACCESS = $02; { Improper permissions for request, LLI compatibility }
DL_BADADDR = $01; { DLSAP address in improper format or invalid }
DL_BADCORR = $05; { Sequence number not from outstanding DL_CONN_IND }
DL_BADDATA = $06; { User data exceeded provider limit }
DL_BADPPA = $08; { Specified PPA was invalid }
DL_BADPRIM = $09; { Primitive received is not known by DLS provider }
DL_BADQOSPARAM = $0A; { QOS parameters contained invalid values }
DL_BADQOSTYPE = $0B; { QOS structure type is unknown or unsupported }
DL_BADSAP = $00; { Bad LSAP selector, LLI compatibility }
DL_BADTOKEN = $0C; { Token used not associated with an active stream }
DL_BOUND = $0D; { Attempted second bind with dl_max_conind or }
{ dl_conn_mgmt > 0 on same DLSAP or PPA }
DL_INITFAILED = $0E; { Physical Link initialization failed }
DL_NOADDR = $0F; { Provider couldn't allocate alternate address }
DL_NOTINIT = $10; { Physical Link not initialized }
DL_OUTSTATE = $03; { Primitive issued in improper state, LLI compatibility }
DL_SYSERR = $04; { UNIX system error occurred, LLI compatibility }
DL_UNSUPPORTED = $07; { Requested service not supplied by provider }
DL_UNDELIVERABLE = $11; { Previous data unit could not be delivered }
DL_NOTSUPPORTED = $12; { Primitive is known but not supported by DLS provider }
DL_TOOMANY = $13; { limit exceeded }
DL_NOTENAB = $14; { Promiscuous mode not enabled }
DL_BUSY = $15; { Other streams for a particular PPA in the post-attached state }
DL_NOAUTO = $16; { Automatic handling of XID & TEST responses not supported }
DL_NOXIDAUTO = $17; { Automatic handling of XID not supported }
DL_NOTESTAUTO = $18; { Automatic handling of TEST not supported }
DL_XIDAUTO = $19; { Automatic handling of XID response }
DL_TESTAUTO = $1A; { AUtomatic handling of TEST response}
DL_PENDING = $1B; { pending outstanding connect indications }
{ DLPI media types supported}
const
DL_CSMACD = $00; { IEEE 802.3 CSMA/CD network, LLI Compatibility }
DL_TPB = $01; { IEEE 802.4 Token Passing Bus, LLI Compatibility }
DL_TPR = $02; { IEEE 802.5 Token Passing Ring, LLI Compatibility }
DL_METRO = $03; { IEEE 802.6 Metro Net, LLI Compatibility }
DL_ETHER = $04; { Ethernet Bus, LLI Compatibility }
DL_HDLC = $05; { ISO HDLC protocol support, bit synchronous }
DL_CHAR = $06; { Character Synchronous protocol support, eg BISYNC }
DL_CTCA = $07; { IBM Channel-to-Channel Adapter }
DL_FDDI = $08; { Fiber Distributed data interface }
DL_OTHER = $09; { Any other medium not listed above }
{
DLPI provider service supported.
These must be allowed to be bitwise-OR for dl_service_mode in
DL_INFO_ACK.
}
const
DL_CODLS = $01; { support connection-oriented service }
DL_CLDLS = $02; { support connectionless data link service }
DL_ACLDLS = $04; { support acknowledged connectionless service}
{
DLPI provider style.
The DLPI provider style which determines whether a provider
requires a DL_ATTACH_REQ to inform the provider which PPA
user messages should be sent/received on.
}
const
DL_STYLE1 = $0500; { PPA is implicitly bound by open(2) }
DL_STYLE2 = $0501; { PPA must be explicitly bound via DL_ATTACH_REQ }
{ DLPI Originator for Disconnect and Resets}
const
DL_PROVIDER = $0700;
DL_USER = $0701;
{ DLPI Disconnect Reasons}
const
DL_CONREJ_DEST_UNKNOWN = $0800;
DL_CONREJ_DEST_UNREACH_PERMANENT = $0801;
DL_CONREJ_DEST_UNREACH_TRANSIENT = $0802;
DL_CONREJ_QOS_UNAVAIL_PERMANENT = $0803;
DL_CONREJ_QOS_UNAVAIL_TRANSIENT = $0804;
DL_CONREJ_PERMANENT_COND = $0805;
DL_CONREJ_TRANSIENT_COND = $0806;
DL_DISC_ABNORMAL_CONDITION = $0807;
DL_DISC_NORMAL_CONDITION = $0808;
DL_DISC_PERMANENT_CONDITION = $0809;
DL_DISC_TRANSIENT_CONDITION = $080A;
DL_DISC_UNSPECIFIED = $080B;
{ DLPI Reset Reasons}
const
DL_RESET_FLOW_CONTROL = $0900;
DL_RESET_LINK_ERROR = $0901;
DL_RESET_RESYNCH = $0902;
{ DLPI status values for acknowledged connectionless data transfer}
const
DL_CMD_MASK = $0F; { mask for command portion of status }
DL_CMD_OK = $00; { Command Accepted }
DL_CMD_RS = $01; { Unimplemented or inactivated service }
DL_CMD_UE = $05; { Data Link User interface error }
DL_CMD_PE = $06; { Protocol error }
DL_CMD_IP = $07; { Permanent implementation dependent error}
DL_CMD_UN = $09; { Resources temporarily unavailable }
DL_CMD_IT = $0F; { Temporary implementation dependent error }
DL_RSP_MASK = $F0; { mask for response portion of status }
DL_RSP_OK = $00; { Response DLSDU present }
DL_RSP_RS = $10; { Unimplemented or inactivated service }
DL_RSP_NE = $30; { Response DLSDU never submitted }
DL_RSP_NR = $40; { Response DLSDU not requested }
DL_RSP_UE = $50; { Data Link User interface error }
DL_RSP_IP = $70; { Permanent implementation dependent error }
DL_RSP_UN = $90; { Resources temporarily unavailable }
DL_RSP_IT = $F0; { Temporary implementation dependent error }
{ Service Class values for acknowledged connectionless data transfer}
const
DL_RQST_RSP = $01; { Use acknowledge capability in MAC sublayer}
DL_RQST_NORSP = $02; { No acknowledgement service requested }
{ DLPI address type definition}
const
DL_FACT_PHYS_ADDR = $01; { factory physical address }
DL_CURR_PHYS_ADDR = $02; { current physical address }
{ DLPI flag definitions}
const
DL_POLL_FINAL = $01; { if set,indicates poll/final bit set}
{ XID and TEST responses supported by the provider}
const
DL_AUTO_XID = $01; { provider will respond to XID }
DL_AUTO_TEST = $02; { provider will respond to TEST }
{ Subsequent bind type}
const
DL_PEER_BIND = $01; { subsequent bind on a peer addr }
DL_HIERARCHICAL_BIND = $02; { subs_bind on a hierarchical addr}
{ DLPI promiscuous mode definitions}
const
DL_PROMISC_PHYS = $01; { promiscuous mode at phys level }
DL_PROMISC_SAP = $02; { promiscous mode at sap level }
DL_PROMISC_MULTI = $03; { promiscuous mode for multicast }
{ M_DATA "raw" mode }
// #define DLIOCRAW MIOC_CMD(MIOC_DLPI,1)
{
DLPI Quality Of Service definition for use in QOS structure definitions.
The QOS structures are used in connection establishment, DL_INFO_ACK,
and setting connectionless QOS values.
}
{
Throughput
This parameter is specified for both directions.
}
type
dl_through_t = record
dl_target_value: SInt32; { desired bits/second desired }
dl_accept_value: SInt32; { min. acceptable bits/second }
end;
{
transit delay specification
This parameter is specified for both directions.
expressed in milliseconds assuming a DLSDU size of 128 octets.
The scaling of the value to the current DLSDU size is provider dependent.
}
type
dl_transdelay_tPtr = ^dl_transdelay_t;
dl_transdelay_t = record
dl_target_value: SInt32; { desired value of service }
dl_accept_value: SInt32; { min. acceptable value of service }
end;
{
priority specification
priority range is 0-100, with 0 being highest value.
}
type
dl_priority_tPtr = ^dl_priority_t;
dl_priority_t = record
dl_min: SInt32;
dl_max: SInt32;
end;
{ protection specification}
const
DL_NONE = $0B01; { no protection supplied }
DL_MONITOR = $0B02; { protection against passive monitoring }
DL_MAXIMUM = $0B03; { protection against modification, replay, addition, or deletion }
type
dl_protect_tPtr = ^dl_protect_t;
dl_protect_t = record
dl_min: SInt32;
dl_max: SInt32;
end;
{
Resilience specification
probabilities are scaled by a factor of 10,000 with a time interval
of 10,000 seconds.
}
type
dl_resilience_tPtr = ^dl_resilience_t;
dl_resilience_t = record
dl_disc_prob: SInt32; { probability of provider init DISC }
dl_reset_prob: SInt32; { probability of provider init RESET }
end;
{
QOS type definition to be used for negotiation with the
remote end of a connection, or a connectionless unitdata request.
There are two type definitions to handle the negotiation
process at connection establishment. The typedef dl_qos_range_t
is used to present a range for parameters. This is used
in the DL_CONNECT_REQ and DL_CONNECT_IND messages. The typedef
dl_qos_sel_t is used to select a specific value for the QOS
parameters. This is used in the DL_CONNECT_RES, DL_CONNECT_CON,
and DL_INFO_ACK messages to define the selected QOS parameters
for a connection.
NOTE
A DataLink provider which has unknown values for any of the fields
will use a value of DL_UNKNOWN for all values in the fields.
NOTE
A QOS parameter value of DL_QOS_DONT_CARE informs the DLS
provider the user requesting this value doesn't care
what the QOS parameter is set to. This value becomes the
least possible value in the range of QOS parameters.
The order of the QOS parameter range is then:
DL_QOS_DONT_CARE < 0 < MAXIMUM QOS VALUE
}
const
DL_UNKNOWN = -1;
DL_QOS_DONT_CARE = -2;
{
Every QOS structure has the first 4 bytes containing a type
field, denoting the definition of the rest of the structure.
This is used in the same manner has the dl_primitive variable
is in messages.
The following list is the defined QOS structure type values and structures.
}
const
DL_QOS_CO_RANGE1 = $0101; { QOS range struct. for Connection modeservice }
DL_QOS_CO_SEL1 = $0102; { QOS selection structure }
DL_QOS_CL_RANGE1 = $0103; { QOS range struct. for connectionless}
DL_QOS_CL_SEL1 = $0104; { QOS selection for connectionless mode}
type
dl_qos_co_range1_tPtr = ^dl_qos_co_range1_t;
dl_qos_co_range1_t = record
dl_qos_type: UInt32;
dl_rcv_throughput: dl_through_t; { desired and acceptable}
dl_rcv_trans_delay: dl_transdelay_t; { desired and acceptable}
dl_xmt_throughput: dl_through_t;
dl_xmt_trans_delay: dl_transdelay_t;
dl_priority: dl_priority_t; { min and max values }
dl_protection: dl_protect_t; { min and max values }
dl_residual_error: SInt32;
dl_resilience: dl_resilience_t;
end;
type
dl_qos_co_sel1_tPtr = ^dl_qos_co_sel1_t;
dl_qos_co_sel1_t = record
dl_qos_type: UInt32;
dl_rcv_throughput: SInt32;
dl_rcv_trans_delay: SInt32;
dl_xmt_throughput: SInt32;
dl_xmt_trans_delay: SInt32;
dl_priority: SInt32;
dl_protection: SInt32;
dl_residual_error: SInt32;
dl_resilience: dl_resilience_t;
end;
type
dl_qos_cl_range1_tPtr = ^dl_qos_cl_range1_t;
dl_qos_cl_range1_t = record
dl_qos_type: UInt32;
dl_trans_delay: dl_transdelay_t;
dl_priority: dl_priority_t;
dl_protection: dl_protect_t;
dl_residual_error: SInt32;
end;
type
dl_qos_cl_sel1_tPtr = ^dl_qos_cl_sel1_t;
dl_qos_cl_sel1_t = record
dl_qos_type: UInt32;
dl_trans_delay: SInt32;
dl_priority: SInt32;
dl_protection: SInt32;
dl_residual_error: SInt32;
end;
{
DLPI interface primitive definitions.
Each primitive is sent as a stream message. It is possible that
the messages may be viewed as a sequence of bytes that have the
following form without any padding. The structure definition
of the following messages may have to change depending on the
underlying hardware architecture and crossing of a hardware
boundary with a different hardware architecture.
Fields in the primitives having a name of the form
dl_reserved cannot be used and have the value of
binary zero, no bits turned on.
Each message has the name defined followed by the
stream message type (M_PROTO, M_PCPROTO, M_DATA)
}
{ LOCAL MANAGEMENT SERVICE PRIMITIVES}
{ DL_INFO_REQ, M_PCPROTO type}
type
dl_info_req_tPtr = ^dl_info_req_t;
dl_info_req_t = record
dl_primitive: UInt32; { set to DL_INFO_REQ }
end;
{ DL_INFO_ACK, M_PCPROTO type}
type
dl_info_ack_tPtr = ^dl_info_ack_t;
dl_info_ack_t = record
dl_primitive: UInt32; { set to DL_INFO_ACK }
dl_max_sdu: UInt32; { Max bytes in a DLSDU }
dl_min_sdu: UInt32; { Min bytes in a DLSDU }
dl_addr_length: UInt32; { length of DLSAP address }
dl_mac_type: UInt32; { type of medium supported}
dl_reserved: UInt32; { value set to zero }
dl_current_state: UInt32; { state of DLPI interface }
dl_sap_length: SInt32; { current length of SAP part of dlsap address }
dl_service_mode: UInt32; { CO, CL or ACL }
dl_qos_length: UInt32; { length of qos values }
dl_qos_offset: UInt32; { offset from beg. of block}
dl_qos_range_length: UInt32; { available range of qos }
dl_qos_range_offset: UInt32; { offset from beg. of block}
dl_provider_style: UInt32; { style1 or style2 }
dl_addr_offset: UInt32; { offset of the dlsap addr }
dl_version: UInt32; { version number }
dl_brdcst_addr_length: UInt32; { length of broadcast addr }
dl_brdcst_addr_offset: UInt32; { offset from beg. of block}
dl_growth: UInt32; { set to zero }
end;
{ DL_ATTACH_REQ, M_PROTO type}
type
dl_attach_req_tPtr = ^dl_attach_req_t;
dl_attach_req_t = record
dl_primitive: UInt32; { set to DL_ATTACH_REQ}
dl_ppa: UInt32; { id of the PPA }
end;
{ DL_DETACH_REQ, M_PROTO type}
type
dl_detach_req_tPtr = ^dl_detach_req_t;
dl_detach_req_t = record
dl_primitive: UInt32; { set to DL_DETACH_REQ }
end;
{ DL_BIND_REQ, M_PROTO type}
type
dl_bind_req_tPtr = ^dl_bind_req_t;
dl_bind_req_t = record
dl_primitive: UInt32; { set to DL_BIND_REQ }
dl_sap: UInt32; { info to identify dlsap addr}
dl_max_conind: UInt32; { max # of outstanding con_ind}
dl_service_mode: UInt16; { CO, CL or ACL }
dl_conn_mgmt: UInt16; { if non-zero, is con-mgmt stream}
dl_xidtest_flg: UInt32; { if set to 1 indicates automatic initiation of test and xid frames }
end;
{ DL_BIND_ACK, M_PCPROTO type}
type
dl_bind_ack_tPtr = ^dl_bind_ack_t;
dl_bind_ack_t = record
dl_primitive: UInt32; { DL_BIND_ACK }
dl_sap: UInt32; { DLSAP addr info }
dl_addr_length: UInt32; { length of complete DLSAP addr }
dl_addr_offset: UInt32; { offset from beginning of M_PCPROTO}
dl_max_conind: UInt32; { allowed max. # of con-ind }
dl_xidtest_flg: UInt32; { responses supported by provider}
end;
{ DL_SUBS_BIND_REQ, M_PROTO type}
type
dl_subs_bind_req_tPtr = ^dl_subs_bind_req_t;
dl_subs_bind_req_t = record
dl_primitive: UInt32; { DL_SUBS_BIND_REQ }
dl_subs_sap_offset: UInt32; { offset of subs_sap }
dl_subs_sap_length: UInt32; { length of subs_sap }
dl_subs_bind_class: UInt32; { peer or hierarchical }
end;
{ DL_SUBS_BIND_ACK, M_PCPROTO type}
type
dl_subs_bind_ack_tPtr = ^dl_subs_bind_ack_t;
dl_subs_bind_ack_t = record
dl_primitive: UInt32; { DL_SUBS_BIND_ACK }
dl_subs_sap_offset: UInt32; { offset of subs_sap }
dl_subs_sap_length: UInt32; { length of subs_sap }
end;
{ DL_UNBIND_REQ, M_PROTO type}
type
dl_unbind_req_tPtr = ^dl_unbind_req_t;
dl_unbind_req_t = record
dl_primitive: UInt32; { DL_UNBIND_REQ }
end;
{ DL_SUBS_UNBIND_REQ, M_PROTO type}
type
dl_subs_unbind_req_tPtr = ^dl_subs_unbind_req_t;
dl_subs_unbind_req_t = record
dl_primitive: UInt32; { DL_SUBS_UNBIND_REQ }
dl_subs_sap_offset: UInt32; { offset of subs_sap }
dl_subs_sap_length: UInt32; { length of subs_sap }
end;
{ DL_OK_ACK, M_PCPROTO type}
type
dl_ok_ack_tPtr = ^dl_ok_ack_t;
dl_ok_ack_t = record
dl_primitive: UInt32; { DL_OK_ACK }
dl_correct_primitive: UInt32; { primitive being acknowledged }
end;
{ DL_ERROR_ACK, M_PCPROTO type}
type
dl_error_ack_tPtr = ^dl_error_ack_t;
dl_error_ack_t = record
dl_primitive: UInt32; { DL_ERROR_ACK }
dl_error_primitive: UInt32; { primitive in error }
dl_errno: UInt32; { DLPI error code }
dl_unix_errno: UInt32; { UNIX system error code }
end;
{ DL_ENABMULTI_REQ, M_PROTO type}
type
dl_enabmulti_req_tPtr = ^dl_enabmulti_req_t;
dl_enabmulti_req_t = record
dl_primitive: UInt32; { DL_ENABMULTI_REQ }
dl_addr_length: UInt32; { length of multicast address }
dl_addr_offset: UInt32; { offset from beg. of M_PROTO block}
end;
{ DL_DISABMULTI_REQ, M_PROTO type}
type
dl_disabmulti_req_tPtr = ^dl_disabmulti_req_t;
dl_disabmulti_req_t = record
dl_primitive: UInt32; { DL_DISABMULTI_REQ }
dl_addr_length: UInt32; { length of multicast address }
dl_addr_offset: UInt32; { offset from beg. of M_PROTO block}
end;
{ DL_PROMISCON_REQ, M_PROTO type}
type
dl_promiscon_req_tPtr = ^dl_promiscon_req_t;
dl_promiscon_req_t = record
dl_primitive: UInt32; { DL_PROMISCON_REQ }
dl_level: UInt32; { physical,SAP level or ALL multicast}
end;
{ DL_PROMISCOFF_REQ, M_PROTO type}
type
dl_promiscoff_req_tPtr = ^dl_promiscoff_req_t;
dl_promiscoff_req_t = record
dl_primitive: UInt32; { DL_PROMISCOFF_REQ }
dl_level: UInt32; { Physical,SAP level or ALL multicast}
end;
{ Primitives to get and set the Physical address}
{ DL_PHYS_ADDR_REQ, M_PROTO type}
type
dl_phys_addr_req_tPtr = ^dl_phys_addr_req_t;
dl_phys_addr_req_t = record
dl_primitive: UInt32; { DL_PHYS_ADDR_REQ }
dl_addr_type: UInt32; { factory or current physical addr }
end;
{ DL_PHYS_ADDR_ACK, M_PCPROTO type}
type
dl_phys_addr_ack_tPtr = ^dl_phys_addr_ack_t;
dl_phys_addr_ack_t = record
dl_primitive: UInt32; { DL_PHYS_ADDR_ACK }
dl_addr_length: UInt32; { length of the physical addr }
dl_addr_offset: UInt32; { offset from beg. of block }
end;
{ DL_SET_PHYS_ADDR_REQ, M_PROTO type}
type
dl_set_phys_addr_req_tPtr = ^dl_set_phys_addr_req_t;
dl_set_phys_addr_req_t = record
dl_primitive: UInt32; { DL_SET_PHYS_ADDR_REQ }
dl_addr_length: UInt32; { length of physical addr }
dl_addr_offset: UInt32; { offset from beg. of block }
end;
{ Primitives to get statistics}
{ DL_GET_STATISTICS_REQ, M_PROTO type}
type
dl_get_statistics_req_tPtr = ^dl_get_statistics_req_t;
dl_get_statistics_req_t = record
dl_primitive: UInt32; { DL_GET_STATISTICS_REQ }
end;
{ DL_GET_STATISTICS_ACK, M_PCPROTO type}
type
dl_get_statistics_ack_tPtr = ^dl_get_statistics_ack_t;
dl_get_statistics_ack_t = record
dl_primitive: UInt32; { DL_GET_STATISTICS_ACK }
dl_stat_length: UInt32; { length of statistics structure}
dl_stat_offset: UInt32; { offset from beg. of block }
end;
{ CONNECTION-ORIENTED SERVICE PRIMITIVES}
{ DL_CONNECT_REQ, M_PROTO type}
type
dl_connect_req_tPtr = ^dl_connect_req_t;
dl_connect_req_t = record
dl_primitive: UInt32; { DL_CONNECT_REQ }
dl_dest_addr_length: UInt32; { len. of dlsap addr}
dl_dest_addr_offset: UInt32; { offset }
dl_qos_length: UInt32; { len. of QOS parm val}
dl_qos_offset: UInt32; { offset }
dl_growth: UInt32; { set to zero }
end;
{ DL_CONNECT_IND, M_PROTO type}
type
dl_connect_ind_tPtr = ^dl_connect_ind_t;
dl_connect_ind_t = record
dl_primitive: UInt32; { DL_CONNECT_IND }
dl_correlation: UInt32; { provider's correlation token}
dl_called_addr_length: UInt32; { length of called address }
dl_called_addr_offset: UInt32; { offset from beginning of block }
dl_calling_addr_length: UInt32; { length of calling address }
dl_calling_addr_offset: UInt32; { offset from beginning of block }
dl_qos_length: UInt32; { length of qos structure }
dl_qos_offset: UInt32; { offset from beginning of block }
dl_growth: UInt32; { set to zero }
end;
{ DL_CONNECT_RES, M_PROTO type}
type
dl_connect_res_tPtr = ^dl_connect_res_t;
dl_connect_res_t = record
dl_primitive: UInt32; { DL_CONNECT_RES }
dl_correlation: UInt32; { provider's correlation token }
dl_resp_token: UInt32; { token associated with responding stream }
dl_qos_length: UInt32; { length of qos structure }
dl_qos_offset: UInt32; { offset from beginning of block }
dl_growth: UInt32; { set to zero }
end;
{ DL_CONNECT_CON, M_PROTO type}
type
dl_connect_con_tPtr = ^dl_connect_con_t;
dl_connect_con_t = record
dl_primitive: UInt32; { DL_CONNECT_CON}
dl_resp_addr_length: UInt32; { length of responder's address }
dl_resp_addr_offset: UInt32; { offset from beginning of block}
dl_qos_length: UInt32; { length of qos structure }
dl_qos_offset: UInt32; { offset from beginning of block}
dl_growth: UInt32; { set to zero }
end;
{ DL_TOKEN_REQ, M_PCPROTO type}
type
dl_token_req_tPtr = ^dl_token_req_t;
dl_token_req_t = record
dl_primitive: UInt32; { DL_TOKEN_REQ }
end;
{ DL_TOKEN_ACK, M_PCPROTO type}
type
dl_token_ack_tPtr = ^dl_token_ack_t;
dl_token_ack_t = record
dl_primitive: UInt32; { DL_TOKEN_ACK }
dl_token: UInt32; { Connection response token associated with the stream }
end;
{ DL_DISCONNECT_REQ, M_PROTO type}
type
dl_disconnect_req_tPtr = ^dl_disconnect_req_t;
dl_disconnect_req_t = record
dl_primitive: UInt32; { DL_DISCONNECT_REQ }
dl_reason: UInt32; {normal, abnormal, perm. or transient}
dl_correlation: UInt32; { association with connect_ind }
end;
{ DL_DISCONNECT_IND, M_PROTO type}
type
dl_disconnect_ind_tPtr = ^dl_disconnect_ind_t;
dl_disconnect_ind_t = record
dl_primitive: UInt32; { DL_DISCONNECT_IND }
dl_originator: UInt32; { USER or PROVIDER }
dl_reason: UInt32; { permanent or transient }
dl_correlation: UInt32; { association with connect_ind }
end;
{ DL_RESET_REQ, M_PROTO type}
type
dl_reset_req_tPtr = ^dl_reset_req_t;
dl_reset_req_t = record
dl_primitive: UInt32; { DL_RESET_REQ }
end;
{ DL_RESET_IND, M_PROTO type}
type
dl_reset_ind_tPtr = ^dl_reset_ind_t;
dl_reset_ind_t = record
dl_primitive: UInt32; { DL_RESET_IND }
dl_originator: UInt32; { Provider or User }
dl_reason: UInt32; { flow control, link error or resynch}
end;
{ DL_RESET_RES, M_PROTO type}
type
dl_reset_res_tPtr = ^dl_reset_res_t;
dl_reset_res_t = record
dl_primitive: UInt32; { DL_RESET_RES }
end;
{ DL_RESET_CON, M_PROTO type}
type
dl_reset_con_tPtr = ^dl_reset_con_t;
dl_reset_con_t = record
dl_primitive: UInt32; { DL_RESET_CON }
end;
{ CONNECTIONLESS SERVICE PRIMITIVES}
{ DL_UNITDATA_REQ, M_PROTO type, with M_DATA block(s)}
type
dl_unitdata_req_tPtr = ^dl_unitdata_req_t;
dl_unitdata_req_t = record
dl_primitive: UInt32; { DL_UNITDATA_REQ }
dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
dl_priority: dl_priority_t; { priority value }
end;
{ DL_UNITDATA_IND, M_PROTO type, with M_DATA block(s)}
type
dl_unitdata_ind_tPtr = ^dl_unitdata_ind_t;
dl_unitdata_ind_t = record
dl_primitive: UInt32; { DL_UNITDATA_IND }
dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
dl_src_addr_length: UInt32; { DLSAP addr length of sending user}
dl_src_addr_offset: UInt32; { offset from beg. of block }
dl_group_address: UInt32; { set to one if multicast/broadcast}
end;
{
DL_UDERROR_IND, M_PROTO type
(or M_PCPROTO type if LLI-based provider)
}
type
dl_uderror_ind_tPtr = ^dl_uderror_ind_t;
dl_uderror_ind_t = record
dl_primitive: UInt32; { DL_UDERROR_IND }
dl_dest_addr_length: UInt32; { Destination DLSAP }
dl_dest_addr_offset: UInt32; { Offset from beg. of block }
dl_unix_errno: UInt32; { unix system error code}
dl_errno: UInt32; { DLPI error code }
end;
{ DL_UDQOS_REQ, M_PROTO type}
type
dl_udqos_req_tPtr = ^dl_udqos_req_t;
dl_udqos_req_t = record
dl_primitive: UInt32; { DL_UDQOS_REQ }
dl_qos_length: UInt32; { length in bytes of requested qos}
dl_qos_offset: UInt32; { offset from beg. of block }
end;
{ Primitives to handle XID and TEST operations}
{ DL_TEST_REQ, M_PROTO type}
type
dl_test_req_tPtr = ^dl_test_req_t;
dl_test_req_t = record
dl_primitive: UInt32; { DL_TEST_REQ }
dl_flag: UInt32; { poll/final }
dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
end;
{ DL_TEST_IND, M_PROTO type}
type
dl_test_ind_tPtr = ^dl_test_ind_t;
dl_test_ind_t = record
dl_primitive: UInt32; { DL_TEST_IND }
dl_flag: UInt32; { poll/final }
dl_dest_addr_length: UInt32; { dlsap length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
dl_src_addr_length: UInt32; { dlsap length of source user }
dl_src_addr_offset: UInt32; { offset from beg. of block }
end;
{ DL_TEST_RES, M_PROTO type}
type
dl_test_res_tPtr = ^dl_test_res_t;
dl_test_res_t = record
dl_primitive: UInt32; { DL_TEST_RES }
dl_flag: UInt32; { poll/final }
dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
end;
{ DL_TEST_CON, M_PROTO type}
type
dl_test_con_tPtr = ^dl_test_con_t;
dl_test_con_t = record
dl_primitive: UInt32; { DL_TEST_CON }
dl_flag: UInt32; { poll/final }
dl_dest_addr_length: UInt32; { dlsap length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
dl_src_addr_length: UInt32; { dlsap length of source user }
dl_src_addr_offset: UInt32; { offset from beg. of block }
end;
{ DL_XID_REQ, M_PROTO type}
type
dl_xid_req_tPtr = ^dl_xid_req_t;
dl_xid_req_t = record
dl_primitive: UInt32; { DL_XID_REQ }
dl_flag: UInt32; { poll/final }
dl_dest_addr_length: UInt32; { dlsap length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
end;
{ DL_XID_IND, M_PROTO type}
type
dl_xid_ind_tPtr = ^dl_xid_ind_t;
dl_xid_ind_t = record
dl_primitive: UInt32; { DL_XID_IND }
dl_flag: UInt32; { poll/final }
dl_dest_addr_length: UInt32; { dlsap length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
dl_src_addr_length: UInt32; { dlsap length of source user }
dl_src_addr_offset: UInt32; { offset from beg. of block }
end;
{ DL_XID_RES, M_PROTO type}
type
dl_xid_res_tPtr = ^dl_xid_res_t;
dl_xid_res_t = record
dl_primitive: UInt32; { DL_XID_RES }
dl_flag: UInt32; { poll/final }
dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
end;
{ DL_XID_CON, M_PROTO type}
type
dl_xid_con_tPtr = ^dl_xid_con_t;
dl_xid_con_t = record
dl_primitive: UInt32; { DL_XID_CON }
dl_flag: UInt32; { poll/final }
dl_dest_addr_length: UInt32; { dlsap length of dest. user }
dl_dest_addr_offset: UInt32; { offset from beg. of block }
dl_src_addr_length: UInt32; { dlsap length of source user }
dl_src_addr_offset: UInt32; { offset from beg. of block }
end;
{ ACKNOWLEDGED CONNECTIONLESS SERVICE PRIMITIVES}
{ DL_DATA_ACK_REQ, M_PROTO type}
type
dl_data_ack_req_tPtr = ^dl_data_ack_req_t;
dl_data_ack_req_t = record
dl_primitive: UInt32; { DL_DATA_ACK_REQ }
dl_correlation: UInt32; { User's correlation token }
dl_dest_addr_length: UInt32; { length of destination addr }
dl_dest_addr_offset: UInt32; { offset from beginning of block }
dl_src_addr_length: UInt32; { length of source address }
dl_src_addr_offset: UInt32; { offset from beginning of block }
dl_priority: UInt32; { priority }
dl_service_class: UInt32; { DL_RQST_RSP or DL_RQST_NORSP }
end;
{ DL_DATA_ACK_IND, M_PROTO type}
type
dl_data_ack_ind_tPtr = ^dl_data_ack_ind_t;
dl_data_ack_ind_t = record
dl_primitive: UInt32; { DL_DATA_ACK_IND }
dl_dest_addr_length: UInt32; { length of destination addr }
dl_dest_addr_offset: UInt32; { offset from beginning of block }
dl_src_addr_length: UInt32; { length of source address }
dl_src_addr_offset: UInt32; { offset from beginning of block }
dl_priority: UInt32; { priority for data unit transm. }
dl_service_class: UInt32; { DL_RQST_RSP or DL_RQST_NORSP }
end;
{ DL_DATA_ACK_STATUS_IND, M_PROTO type}
type
dl_data_ack_status_ind_tPtr = ^dl_data_ack_status_ind_t;
dl_data_ack_status_ind_t = record
dl_primitive: UInt32; { DL_DATA_ACK_STATUS_IND }
dl_correlation: UInt32; { User's correlation token }
dl_status: UInt32; { success or failure of previous req}
end;
{ DL_REPLY_REQ, M_PROTO type}
type
dl_reply_req_tPtr = ^dl_reply_req_t;
dl_reply_req_t = record
dl_primitive: UInt32; { DL_REPLY_REQ }
dl_correlation: UInt32; { User's correlation token }
dl_dest_addr_length: UInt32; { length of destination address }
dl_dest_addr_offset: UInt32; { offset from beginning of block }
dl_src_addr_length: UInt32; { source address length }
dl_src_addr_offset: UInt32; { offset from beginning of block }
dl_priority: UInt32; { priority for data unit transmission}
dl_service_class: UInt32;
end;
{ DL_REPLY_IND, M_PROTO type}
type
dl_reply_ind_tPtr = ^dl_reply_ind_t;
dl_reply_ind_t = record
dl_primitive: UInt32; { DL_REPLY_IND }
dl_dest_addr_length: UInt32; { length of destination address }
dl_dest_addr_offset: UInt32; { offset from beginning of block}
dl_src_addr_length: UInt32; { length of source address }
dl_src_addr_offset: UInt32; { offset from beginning of block }
dl_priority: UInt32; { priority for data unit transmission}
dl_service_class: UInt32; { DL_RQST_RSP or DL_RQST_NORSP }
end;
{ DL_REPLY_STATUS_IND, M_PROTO type}
type
dl_reply_status_ind_tPtr = ^dl_reply_status_ind_t;
dl_reply_status_ind_t = record
dl_primitive: UInt32; { DL_REPLY_STATUS_IND }
dl_correlation: UInt32; { User's correlation token }
dl_status: UInt32; { success or failure of previous req}
end;
{ DL_REPLY_UPDATE_REQ, M_PROTO type}
type
dl_reply_update_req_tPtr = ^dl_reply_update_req_t;
dl_reply_update_req_t = record
dl_primitive: UInt32; { DL_REPLY_UPDATE_REQ }
dl_correlation: UInt32; { user's correlation token }
dl_src_addr_length: UInt32; { length of source address }
dl_src_addr_offset: UInt32; { offset from beginning of block }
end;
{ DL_REPLY_UPDATE_STATUS_IND, M_PROTO type}
type
dl_reply_update_status_ind_tPtr = ^dl_reply_update_status_ind_t;
dl_reply_update_status_ind_t = record
dl_primitive: UInt32; { DL_REPLY_UPDATE_STATUS_IND }
dl_correlation: UInt32; { User's correlation token }
dl_status: UInt32; { success or failure of previous req}
end;
DL_primitivesPtr = ^DL_primitives;
DL_primitives = record
case SInt16 of
0: (
dl_primitive: UInt32;
);
1: (
info_req: dl_info_req_t;
);
2: (
info_ack: dl_info_ack_t;
);
3: (
attach_req: dl_attach_req_t;
);
4: (
detach_req: dl_detach_req_t;
);
5: (
bind_req: dl_bind_req_t;
);
6: (
bind_ack: dl_bind_ack_t;
);
7: (
unbind_req: dl_unbind_req_t;
);
8: (
subs_bind_req: dl_subs_bind_req_t;
);
9: (
subs_bind_ack: dl_subs_bind_ack_t;
);
10: (
subs_unbind_req: dl_subs_unbind_req_t;
);
11: (
ok_ack: dl_ok_ack_t;
);
12: (
error_ack: dl_error_ack_t;
);
13: (
connect_req: dl_connect_req_t;
);
14: (
connect_ind: dl_connect_ind_t;
);
15: (
connect_res: dl_connect_res_t;
);
16: (
connect_con: dl_connect_con_t;
);
17: (
token_req: dl_token_req_t;
);
18: (
token_ack: dl_token_ack_t;
);
19: (
disconnect_req: dl_disconnect_req_t;
);
20: (
disconnect_ind: dl_disconnect_ind_t;
);
21: (
reset_req: dl_reset_req_t;
);
22: (
reset_ind: dl_reset_ind_t;
);
23: (
reset_res: dl_reset_res_t;
);
24: (
reset_con: dl_reset_con_t;
);
25: (
unitdata_req: dl_unitdata_req_t;
);
26: (
unitdata_ind: dl_unitdata_ind_t;
);
27: (
uderror_ind: dl_uderror_ind_t;
);
28: (
udqos_req: dl_udqos_req_t;
);
29: (
enabmulti_req: dl_enabmulti_req_t;
);
30: (
disabmulti_req: dl_disabmulti_req_t;
);
31: (
promiscon_req: dl_promiscon_req_t;
);
32: (
promiscoff_req: dl_promiscoff_req_t;
);
33: (
physaddr_req: dl_phys_addr_req_t;
);
34: (
physaddr_ack: dl_phys_addr_ack_t;
);
35: (
set_physaddr_req: dl_set_phys_addr_req_t;
);
36: (
get_statistics_req: dl_get_statistics_req_t;
);
37: (
get_statistics_ack: dl_get_statistics_ack_t;
);
38: (
test_req: dl_test_req_t;
);
39: (
test_ind: dl_test_ind_t;
);
40: (
test_res: dl_test_res_t;
);
41: (
test_con: dl_test_con_t;
);
42: (
xid_req: dl_xid_req_t;
);
43: (
xid_ind: dl_xid_ind_t;
);
44: (
xid_res: dl_xid_res_t;
);
45: (
xid_con: dl_xid_con_t;
);
46: (
data_ack_req: dl_data_ack_req_t;
);
47: (
data_ack_ind: dl_data_ack_ind_t;
);
48: (
data_ack_status_ind: dl_data_ack_status_ind_t;
);
49: (
reply_req: dl_reply_req_t;
);
50: (
reply_ind: dl_reply_ind_t;
);
51: (
reply_status_ind: dl_reply_status_ind_t;
);
52: (
reply_update_req: dl_reply_update_req_t;
);
53: (
reply_update_status_ind: dl_reply_update_status_ind_t;
);
end;
const
DL_INFO_REQ_SIZE = SizeOf(dl_info_req_t);
DL_INFO_ACK_SIZE = SizeOf(dl_info_ack_t);
DL_ATTACH_REQ_SIZE = SizeOf(dl_attach_req_t);
DL_DETACH_REQ_SIZE = SizeOf(dl_detach_req_t);
DL_BIND_REQ_SIZE = SizeOf(dl_bind_req_t);
DL_BIND_ACK_SIZE = SizeOf(dl_bind_ack_t);
DL_UNBIND_REQ_SIZE = SizeOf(dl_unbind_req_t);
DL_SUBS_BIND_REQ_SIZE = SizeOf(dl_subs_bind_req_t);
DL_SUBS_BIND_ACK_SIZE = SizeOf(dl_subs_bind_ack_t);
DL_SUBS_UNBIND_REQ_SIZE = SizeOf(dl_subs_unbind_req_t);
DL_OK_ACK_SIZE = SizeOf(dl_ok_ack_t);
DL_ERROR_ACK_SIZE = SizeOf(dl_error_ack_t);
DL_CONNECT_REQ_SIZE = SizeOf(dl_connect_req_t);
DL_CONNECT_IND_SIZE = SizeOf(dl_connect_ind_t);
DL_CONNECT_RES_SIZE = SizeOf(dl_connect_res_t);
DL_CONNECT_CON_SIZE = SizeOf(dl_connect_con_t);
DL_TOKEN_REQ_SIZE = SizeOf(dl_token_req_t);
DL_TOKEN_ACK_SIZE = SizeOf(dl_token_ack_t);
DL_DISCONNECT_REQ_SIZE = SizeOf(dl_disconnect_req_t);
DL_DISCONNECT_IND_SIZE = SizeOf(dl_disconnect_ind_t);
DL_RESET_REQ_SIZE = SizeOf(dl_reset_req_t);
DL_RESET_IND_SIZE = SizeOf(dl_reset_ind_t);
DL_RESET_RES_SIZE = SizeOf(dl_reset_res_t);
DL_RESET_CON_SIZE = SizeOf(dl_reset_con_t);
DL_UNITDATA_REQ_SIZE = SizeOf(dl_unitdata_req_t);
DL_UNITDATA_IND_SIZE = SizeOf(dl_unitdata_ind_t);
DL_UDERROR_IND_SIZE = SizeOf(dl_uderror_ind_t);
DL_UDQOS_REQ_SIZE = SizeOf(dl_udqos_req_t);
DL_ENABMULTI_REQ_SIZE = SizeOf(dl_enabmulti_req_t);
DL_DISABMULTI_REQ_SIZE = SizeOf(dl_disabmulti_req_t);
DL_PROMISCON_REQ_SIZE = SizeOf(dl_promiscon_req_t);
DL_PROMISCOFF_REQ_SIZE = SizeOf(dl_promiscoff_req_t);
DL_PHYS_ADDR_REQ_SIZE = SizeOf(dl_phys_addr_req_t);
DL_PHYS_ADDR_ACK_SIZE = SizeOf(dl_phys_addr_ack_t);
DL_SET_PHYS_ADDR_REQ_SIZE = SizeOf(dl_set_phys_addr_req_t);
DL_GET_STATISTICS_REQ_SIZE = SizeOf(dl_get_statistics_req_t);
DL_GET_STATISTICS_ACK_SIZE = SizeOf(dl_get_statistics_ack_t);
DL_XID_REQ_SIZE = SizeOf(dl_xid_req_t);
DL_XID_IND_SIZE = SizeOf(dl_xid_ind_t);
DL_XID_RES_SIZE = SizeOf(dl_xid_res_t);
DL_XID_CON_SIZE = SizeOf(dl_xid_con_t);
DL_TEST_REQ_SIZE = SizeOf(dl_test_req_t);
DL_TEST_IND_SIZE = SizeOf(dl_test_ind_t);
DL_TEST_RES_SIZE = SizeOf(dl_test_res_t);
DL_TEST_CON_SIZE = SizeOf(dl_test_con_t);
DL_DATA_ACK_REQ_SIZE = SizeOf(dl_data_ack_req_t);
DL_DATA_ACK_IND_SIZE = SizeOf(dl_data_ack_ind_t);
DL_DATA_ACK_STATUS_IND_SIZE = SizeOf(dl_data_ack_status_ind_t);
DL_REPLY_REQ_SIZE = SizeOf(dl_reply_req_t);
DL_REPLY_IND_SIZE = SizeOf(dl_reply_ind_t);
DL_REPLY_STATUS_IND_SIZE = SizeOf(dl_reply_status_ind_t);
DL_REPLY_UPDATE_REQ_SIZE = SizeOf(dl_reply_update_req_t);
DL_REPLY_UPDATE_STATUS_IND_SIZE = SizeOf(dl_reply_update_status_ind_t);
const
DL_IOC_HDR_INFO = $6C0A; { Fast path request }
{ ***** From the Mentat "modnames.h" *****}
const
MI_AFU_NAME = 'afu';
const
MI_AHARP_NAME = 'ahar';
const
MI_AHENET_NAME = 'ahen';
const
MI_ARP_NAME = 'arp';
const
MI_ARPM_NAME = 'arpm';
const
MI_COURMUX_NAME = 'courmux';
const
MI_CLONE_NAME = 'clone';
const
MI_DLB_NAME = 'dlb';
const
MI_DLM_NAME = 'dlm';
const
MI_DMODD_NAME = 'disdlpi';
const
MI_DMODT_NAME = 'distpi';
const
MI_DN_NAME = 'dn';
const
MI_DNF_NAME = 'dnf';
const
MI_DRVE_NAME = 'drve';
const
MI_ECHO_NAME = 'echo';
const
MI_ENXR_NAME = 'enxr';
const
MI_RAWIP_NAME = 'rawip';
const
MI_RAWIPM_NAME = 'rawipm';
const
MI_HAVOC_NAME = 'havoc';
const
MI_HAVOCM_NAME = 'havocm';
const
MI_IP_NAME = 'ip';
const
MI_IPM_NAME = 'ipm';
const
MI_IPX_NAME = 'ipx';
const
MI_LOG_NAME = 'log';
const
MI_MODE_NAME = 'mode';
const
MI_MUX_NAME = 'mux';
const
MI_NECHO_NAME = 'necho';
const
MI_NPEP_NAME = 'npep';
const
MI_NULS_NAME = 'nuls';
const
MI_NULZ_NAME = 'nulz';
const
MI_PASS_NAME = 'pass';
const
MI_PIPEMOD_NAME = 'pipemod';
const
MI_SAD_NAME = 'sad';
const
MI_SC_NAME = 'sc';
const
MI_SOCKMOD_NAME = 'sockmod';
const
MI_SPASS_NAME = 'spass';
const
MI_SPX_NAME = 'spx';
const
MI_STH_NAME = 'mi_sth';
const
MI_TCP_NAME = 'tcp';
const
MI_TCPM_NAME = 'tcpm';
const
MI_TIMOD_NAME = 'timod';
const
MI_TIRDWR_NAME = 'tirdwr';
const
MI_TMOD_NAME = 'tmod';
const
MI_TMUX_NAME = 'tmux';
const
MI_TPIT_NAME = 'tpit';
const
MI_TRSR_NAME = 'trsr';
const
MI_TRXR_NAME = 'trxr';
const
MI_UDP_NAME = 'udp';
const
MI_UDPM_NAME = 'udpm';
const
MI_WELD_NAME = 'mi_weld';
const
MI_XDG_NAME = 'xdg';
const
MI_XECHO_NAME = 'xecho';
const
MI_XF_NAME = 'xf';
const
MI_XFIPX_NAME = 'xfipx';
const
MI_XFXNS_NAME = 'xfxns';
const
MI_XPE_NAME = 'xpe';
const
MI_XS_NAME = 'xs';
const
MI_XTINDG_NAME = 'xtindg';
const
MI_XTINVC_NAME = 'xtinvc';
const
MI_XTM_NAME = 'xtm';
const
MI_XTMIP_NAME = 'xtmip';
const
MI_AFU_DEVICE = '/dev/afu';
const
MI_ARP_DEVICE = '/dev/arp';
const
MI_COURMUX_DEVICE = '/dev/courmux';
const
MI_CLONE_DEVICE = '/dev/clone';
const
MI_DLB_DEVICE = '/dev/dlb';
const
MI_DN_DEVICE = '/dev/dn';
const
MI_DNF_DEVICE = '/dev/dnf';
const
MI_DRVE_DEVICE = '/dev/drve';
const
MI_ECHO_DEVICE = '/dev/echo';
const
MI_RAWIP_DEVICE = '/dev/rawip';
const
MI_HAVOC_DEVICE = '/dev/havoc';
const
MI_IP_DEVICE = '/dev/ip';
const
MI_IPX_DEVICE = '/dev/ipx';
const
MI_LOG_DEVICE = '/dev/log';
const
MI_MODE_DEVICE = '/dev/mode';
const
MI_MUX_DEVICE = '/dev/mux';
const
MI_NECHO_DEVICE = '/dev/necho';
const
MI_NPEP_DEVICE = '/dev/npep';
const
MI_NULS_DEVICE = '/dev/nuls';
const
MI_NULZ_DEVICE = '/dev/nulz';
const
MI_SAD_DEVICE = '/dev/sad';
const
MI_SPX_DEVICE = '/dev/spx';
const
MI_TCP_DEVICE = '/dev/tcp';
const
MI_TMUX_DEVICE = '/dev/tmux';
const
MI_TMUX0_DEVICE = '/dev/tmux#0';
const
MI_TMUX1_DEVICE = '/dev/tmux#1';
const
MI_TPIT_DEVICE = '/dev/tpit';
const
MI_UDP_DEVICE = '/dev/udp';
const
MI_XDG_DEVICE = '/dev/xdg';
const
MI_XECHO_DEVICE = '/dev/xecho';
const
MI_XF_DEVICE = '/dev/xf';
const
MI_XPE_DEVICE = '/dev/xpe';
const
MI_XS_DEVICE = '/dev/xs';
const
MI_XTINDG_DEVICE = '/dev/xtindg';
const
MI_XTINVC_DEVICE = '/dev/xtinvc';
{ Streamtab entries }
// #define MI_AFU_STREAMTAB afuinfo
// #define MI_AHARP_STREAMTAB aharinfo
// #define MI_AHENET_STREAMTAB aheninfo
// #define MI_ARP_STREAMTAB arpinfo
// #define MI_ARPM_STREAMTAB arpminfo
// #define MI_COURMUX_STREAMTAB courmuxinfo
// #define MI_CLONE_STREAMTAB cloneinfo
// #define MI_DLB_STREAMTAB dlbinfo
// #define MI_DLM_STREAMTAB dlminfo
// #define MI_DMODD_STREAMTAB dmoddinfo
// #define MI_DMODT_STREAMTAB dmodtinfo
// #define MI_DN_STREAMTAB dninfo
// #define MI_DNF_STREAMTAB dnfinfo
// #define MI_DRVE_STREAMTAB drveinfo
// #define MI_ECHO_STREAMTAB echoinfo
// #define MI_ENXR_STREAMTAB enxrinfo
// #define MI_HAVOC_STREAMTAB hvcinfo
// #define MI_HAVOCM_STREAMTAB hvcminfo
// #define MI_IP_STREAMTAB ipinfo
// #define MI_IPM_STREAMTAB ipminfo
// #define MI_IPX_STREAMTAB ipxinfo
// #define MI_LOG_STREAMTAB loginfo
// #define MI_MODE_STREAMTAB modeinfo
// #define MI_MUX_STREAMTAB muxinfo
// #define MI_NECHO_STREAMTAB nechoinfo
// #define MI_NPEP_STREAMTAB npepinfo
// #define MI_NULS_STREAMTAB nulsinfo
// #define MI_NULZ_STREAMTAB nulzinfo
// #define MI_PASS_STREAMTAB passinfo
// #define MI_PIPEMOD_STREAMTAB pmodinfo
// #define MI_RAWIP_STREAMTAB rawipinfo
// #define MI_RAWIPM_STREAMTAB rawipminfo
// #define MI_SAD_STREAMTAB sadinfo
// #define MI_SC_STREAMTAB scinfo
// #define MI_SOCKMOD_STREAMTAB sockmodinfo
// #define MI_SPASS_STREAMTAB spassinfo
// #define MI_SPX_STREAMTAB spxinfo
// #define MI_STH_STREAMTAB mi_sthinfo
// #define MI_TCP_STREAMTAB tcpinfo
// #define MI_TCPM_STREAMTAB tcpminfo
// #define MI_TIMOD_STREAMTAB timodinfo
// #define MI_TIRDWR_STREAMTAB tirdwrinfo
// #define MI_TMOD_STREAMTAB tmodinfo
// #define MI_TMUX_STREAMTAB tmuxinfo
// #define MI_TPIT_STREAMTAB tpitinfo
// #define MI_TRSR_STREAMTAB trsrinfo
// #define MI_TRXR_STREAMTAB trxrinfo
// #define MI_UDP_STREAMTAB udpinfo
// #define MI_UDPM_STREAMTAB udpminfo
// #define MI_WELD_STREAMTAB mi_weldinfo
// #define MI_XDG_STREAMTAB xdginfo
// #define MI_XECHO_STREAMTAB xechoinfo
// #define MI_XF_STREAMTAB xfinfo
// #define MI_XFIPX_STREAMTAB xfipxinfo
// #define MI_XFXNS_STREAMTAB xfxnsinfo
// #define MI_XPE_STREAMTAB xpeinfo
// #define MI_XS_STREAMTAB xsinfo
// #define MI_XTINDG_STREAMTAB xtindginfo
// #define MI_XTINVC_STREAMTAB xtinvcinfo
// #define MI_XTM_STREAMTAB xtminfo
// #define MI_XTMIP_STREAMTAB xtmipinfo
// #define MI_AFU_DEVFLAG afudevflag
// #define MI_AHARP_DEVFLAG ahardevflag
// #define MI_AHENET_DEVFLAG ahendevflag
// #define MI_ARP_DEVFLAG arpdevflag
// #define MI_ARPM_DEVFLAG arpmdevflag
// #define MI_COURMUX_DEVFLAG courmuxdevflag
// #define MI_CLONE_DEVFLAG clonedevflag
// #define MI_DLB_DEVFLAG dlbdevflag
// #define MI_DLM_DEVFLAG dlmdevflag
// #define MI_DMODD_DEVFLAG dmodddevflag
// #define MI_DMODT_DEVFLAG dmodtdevflag
// #define MI_DN_DEVFLAG dndevflag
// #define MI_DNF_DEVFLAG dnfdevflag
// #define MI_DRVE_DEVFLAG drvedevflag
// #define MI_ECHO_DEVFLAG echodevflag
// #define MI_ENXR_DEVFLAG enxrdevflag
// #define MI_HAVOC_DEVFLAG hvcdevflag
// #define MI_HAVOCM_DEVFLAG hvcmdevflag
// #define MI_IP_DEVFLAG ipdevflag
// #define MI_IPM_DEVFLAG ipmdevflag
// #define MI_IPX_DEVFLAG ipxdevflag
// #define MI_LOG_DEVFLAG logdevflag
// #define MI_MODE_DEVFLAG modedevflag
// #define MI_MUX_DEVFLAG muxdevflag
// #define MI_NECHO_DEVFLAG nechodevflag
// #define MI_NPEP_DEVFLAG npepdevflag
// #define MI_NULS_DEVFLAG nulsdevflag
// #define MI_NULZ_DEVFLAG nulzdevflag
// #define MI_PASS_DEVFLAG passdevflag
// #define MI_PIPEMOD_DEVFLAG pipemoddevflag
// #define MI_RAWIP_DEVFLAG rawipdevflag
// #define MI_RAWIPM_DEVFLAG rawipmdevflag
// #define MI_SAD_DEVFLAG saddevflag
// #define MI_SC_DEVFLAG scdevflag
// #define MI_SOCKMOD_DEVFLAG sockmoddevflag
// #define MI_SPASS_DEVFLAG spassdevflag
// #define MI_SPX_DEVFLAG spxdevflag
// #define MI_TCP_DEVFLAG tcpdevflag
// #define MI_TCPM_DEVFLAG tcpmdevflag
// #define MI_TIMOD_DEVFLAG timoddevflag
// #define MI_TIRDWR_DEVFLAG tirdwrdevflag
// #define MI_TMOD_DEVFLAG tmoddevflag
// #define MI_TMUX_DEVFLAG tmuxdevflag
// #define MI_TPIT_DEVFLAG tpitdevflag
// #define MI_TRSR_DEVFLAG trsrdevflag
// #define MI_TRXR_DEVFLAG trxrdevflag
// #define MI_UDP_DEVFLAG udpdevflag
// #define MI_UDPM_DEVFLAG udpmdevflag
// #define MI_XDG_DEVFLAG xdgdevflag
// #define MI_XECHO_DEVFLAG xechodevflag
// #define MI_XF_DEVFLAG xfdevflag
// #define MI_XFIPX_DEVFLAG xfipxdevflag
// #define MI_XFXNS_DEVFLAG xfxnsdevflag
// #define MI_XPE_DEVFLAG xpedevflag
// #define MI_XS_DEVFLAG xsdevflag
// #define MI_XTINDG_DEVFLAG xtindgdevflag
// #define MI_XTINVC_DEVFLAG xtinvcdevflag
// #define MI_XTM_DEVFLAG xtmdevflag
// #define MI_XTMIP_DEVFLAG xtmipdevflag
// #define MI_AFU_SQLVL SQLVL_QUEUEPAIR
// #define MI_AHARP_SQLVL SQLVL_QUEUE
// #define MI_AHENET_SQLVL SQLVL_QUEUE
// #define MI_ARP_SQLVL SQLVL_MODULE
// #define MI_ARPM_SQLVL SQLVL_MODULE
// #define MI_COURMUX_SQLVL SQLVL_MODULE
// #define MI_CLONE_SQLVL SQLVL_MODULE
// #define MI_DLB_SQLVL SQLVL_QUEUE
// #define MI_DLM_SQLVL SQLVL_QUEUE
// #define MI_DMODD_SQLVL SQLVL_QUEUE
// #define MI_DMODT_SQLVL SQLVL_QUEUE
// #define MI_DN_SQLVL SQLVL_QUEUE
// #define MI_DNF_SQLVL SQLVL_QUEUE
// #define MI_DRVE_SQLVL SQLVL_QUEUEPAIR
// #define MI_ECHO_SQLVL SQLVL_QUEUE
// #define MI_ENXR_SQLVL SQLVL_QUEUE
// #define MI_RAWIP_SQLVL SQLVL_QUEUE
// #define MI_RAWIPM_SQLVL SQLVL_QUEUE
// #define MI_HAVOC_SQLVL SQLVL_QUEUE
// #define MI_HAVOCM_SQLVL SQLVL_QUEUE
// #define MI_IP_SQLVL SQLVL_QUEUEPAIR
// #define MI_IPM_SQLVL SQLVL_QUEUEPAIR
// #define MI_IPX_SQLVL SQLVL_QUEUE
// #define MI_LOG_SQLVL SQLVL_MODULE
// #define MI_MODE_SQLVL SQLVL_QUEUEPAIR
// #define MI_MUX_SQLVL SQLVL_MODULE
// #define MI_NECHO_SQLVL SQLVL_QUEUE
// #define MI_NPEP_SQLVL SQLVL_QUEUE
// #define MI_NULS_SQLVL SQLVL_QUEUE
// #define MI_NULZ_SQLVL SQLVL_QUEUE
// #define MI_PASS_SQLVL SQLVL_QUEUE
// #define MI_PIPEMOD_SQLVL SQLVL_QUEUE
// #define MI_SAD_SQLVL SQLVL_MODULE
// #define MI_SC_SQLVL SQLVL_QUEUE
// #define MI_SOCKMOD_SQLVL SQLVL_QUEUEPAIR
// #define MI_SPASS_SQLVL SQLVL_QUEUE
// #define MI_SPX_SQLVL SQLVL_QUEUE
// #define MI_TCP_SQLVL SQLVL_QUEUEPAIR
// #define MI_TCPM_SQLVL SQLVL_QUEUEPAIR
// #define MI_TIMOD_SQLVL SQLVL_QUEUEPAIR
// #define MI_TIRDWR_SQLVL SQLVL_QUEUE
// #define MI_TMOD_SQLVL SQLVL_QUEUEPAIR
// #define MI_TMUX_SQLVL SQLVL_MODULE
// #define MI_TPIT_SQLVL SQLVL_MODULE
// #define MI_TRSR_SQLVL SQLVL_MODULE
// #define MI_TRXR_SQLVL SQLVL_QUEUE
// #define MI_UDP_SQLVL SQLVL_QUEUE
// #define MI_UDPM_SQLVL SQLVL_QUEUE
// #define MI_XDG_SQLVL SQLVL_QUEUE
// #define MI_XECHO_SQLVL SQLVL_QUEUE
// #define MI_XF_SQLVL SQLVL_MODULE
// #define MI_XFIPX_SQLVL SQLVL_MODULE
// #define MI_XFXNS_SQLVL SQLVL_MODULE
// #define MI_XPE_SQLVL SQLVL_QUEUE
// #define MI_XS_SQLVL SQLVL_QUEUEPAIR
// #define MI_XTINDG_SQLVL SQLVL_QUEUEPAIR
// #define MI_XTINVC_SQLVL SQLVL_QUEUEPAIR
// #define MI_XTM_SQLVL SQLVL_QUEUEPAIR
// #define MI_XTMIP_SQLVL SQLVL_QUEUEPAIR
{ ***** Raw Streams *****}
{
Flags used in the fType field of OTReadInfo for functions.
I've removed the terse and confusing comments in this header
file. For a full description, read "Open Transport Advanced
Client Programming".
}
const
kOTNoMessagesAvailable = $FFFFFFFF;
kOTAnyMsgType = $FFFFFFFE;
kOTDataMsgTypes = $FFFFFFFC;
kOTMProtoMsgTypes = $FFFFFFFB;
kOTOnlyMProtoMsgTypes = $FFFFFFFA;
{
OTPutCommand, OTPutData, and OTPutWriteData flags.
These equates must not conflict with any of the other putmsg flags,
ie MSG_ANY, MSG_BAND, MSG_HIPRI, or RS_HIPRI.
¥¥¥ These should probably move into whereever their
corresponding functions end up but, seeing as this
is APPLE_ONLY, I'm not too concerned ¥¥¥
}
const
RS_EXDATA = $20;
RS_ALLOWAGAIN = $40;
RS_DELIMITMSG = $80;
{$ifc NOT OTKERNEL}
{ StreamRef is an opaque reference to a raw stream.}
type
StreamRef = UnivPtr;
const
kOTInvalidStreamRef = nil;
{ PollRef structure is used with the OTStreamPoll function.}
type
PollRefPtr = ^PollRef;
PollRef = record
filler: SInt32; { holds a file descriptor an a UNIX system, replaced by ref (at end of structure) under OT}
events: SInt16;
revents: SInt16;
ref: StreamRef;
end;
{ Poll masks for use with OTStreamPoll: }
const
POLLIN = $001; { A non-priority message is available }
POLLPRI = $002; { A high priority message is available }
POLLOUT = $004; { The stream is writable for non-priority messages }
POLLERR = $008; { A error message has arrived }
POLLHUP = $010; { A hangup has occurred }
POLLNVAL = $020; { This fd is bogus }
POLLRDNORM = $040; { A non-priority message is available }
POLLRDBAND = $080; { A priority message (band > 0) message is available }
POLLWRNORM = $100; { Same as POLLOUT }
POLLWRBAND = $200; { A priority band exists and is writable }
POLLMSG = $400; { A signal message has reached the front of the queue }
{ OTReadInfo structure is used with the various functions that read and peek at the stream head.}
type
OTReadInfoPtr = ^OTReadInfo;
OTReadInfo = record
fType: UInt32;
fCommand: OTCommand;
fFiller: UInt32; { For compatibility with OT 1.0 and 1.1 }
fBytes: ByteCount;
fError: OSStatus;
end;
{ Opening and closing raw streams}
{
* OTStreamOpen()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTAsyncStreamOpen()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCreateStream()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTAsyncCreateStream()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamClose()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Polling a stream for activity}
{
* OTStreamPoll()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTAsyncStreamPoll()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Classic UNIX file descriptor operations}
{
* OTStreamRead()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamWrite()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamIoctl()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamPipe()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ there can be only 2!}
{ Notifiers and modes of operation}
{
* OTStreamInstallNotifier()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamRemoveNotifier()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamUseSyncIdleEvents()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamSetBlocking()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamSetNonBlocking()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamIsBlocking()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamSetSynchronous()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamSetAsynchronous()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamIsSynchronous()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ STREAMS primitives}
{
* OTStreamGetMessage()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamGetPriorityMessage()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamPutMessage()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTStreamPutPriorityMessage()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Miscellaneous stuff}
{
* OTStreamSetControlMask()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
Opening endpoints and mappers on a Stream - these calls are synchronous, and may
only be used at System Task time. Once the stream has been installed into a provider
or endpoint, you should not continue to use STREAMS APIs on it
}
{
* OTOpenProviderOnStream()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTOpenEndpointOnStream()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
To quote an earlier version of this header file:
Some functions that should only be used if
you really know what you're doing.
}
{
* OTRemoveStreamFromProvider()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTPeekMessage()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTReadMessage()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTPutBackBuffer()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTPutBackPartialBuffer()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{$endc} { !OTKERNEL }
{$endc} { CALL_NOT_IN_CARBON }
{ ***** Port Utilities *****}
{$ifc NOT OTKERNEL}
{
These types and routines are used during sophisticated
port management. High-level clients may get involved
for things like request a port to be yielding, but typically
this stuff is used by protocol infrastructure.
}
{
OTPortCloseStruct is used when processing the kOTClosePortRequest
and kOTYieldPortRequest events.
}
type
OTPortCloseStructPtr = ^OTPortCloseStruct;
OTPortCloseStruct = record
fPortRef: OTPortRef; { The port requested to be closed.}
fTheProvider: ProviderRef; { The provider using the port.}
fDenyReason: OSStatus; { Set to a negative number to deny the request}
end;
{ OTClientList structure is used with the OTYieldPortRequest function.}
type
OTClientListPtr = ^OTClientList;
OTClientList = record
fNumClients: ItemCount;
fBuffer: packed array [0..3] of UInt8;
end;
{
Returns a buffer containing all of the clients that refused to yield the port.
"size" is the total number of bytes @ buffer, including the fNumClients field.
}
{
* OTYieldPortRequest()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Send a notification to all Open Transport registered clients}
{
* OTNotifyAllClients()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Determine if "child" is a child port of "parent"}
{
* OTIsDependentPort()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{$endc} { !OTKERNEL }
{ ***** Timers ***** }
{
STREAMS plug-ins code should not use these timers, instead
they should use timer messages, ie mi_timer etc.
}
{$ifc NOT OTKERNEL}
type
OTTimerTask = SIGNEDLONG;
{
Under Carbon, OTCreateTimerTask takes a client context pointer. Applications may pass NULL
after calling InitOpenTransport(kInitOTForApplicationMask, ...). Non-applications must always pass a
valid client context.
}
{$ifc not TARGET_CPU_64}
{
* OTCreateTimerTaskInContext() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: not available
}
function OTCreateTimerTaskInContext( upp: OTProcessUPP; arg: UnivPtr; clientContext: OTClientContextPtr ): SIGNEDLONG; external name '_OTCreateTimerTaskInContext';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{$endc} {not TARGET_CPU_64}
{
* OTCreateTimerTask()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{$ifc not TARGET_CPU_64}
{
* OTCancelTimerTask() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: not available
}
function OTCancelTimerTask( timerTask: OTTimerTask ): Boolean; external name '_OTCancelTimerTask';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* OTDestroyTimerTask() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: not available
}
procedure OTDestroyTimerTask( timerTask: OTTimerTask ); external name '_OTDestroyTimerTask';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* OTScheduleTimerTask() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: not available
}
function OTScheduleTimerTask( timerTask: OTTimerTask; milliSeconds: OTTimeout ): Boolean; external name '_OTScheduleTimerTask';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{$endc} {not TARGET_CPU_64}
{ The following macro may be used by applications only.}
// #define OTCreateTimerTask(upp, arg) OTCreateTimerTaskInContext(upp, arg, NULL)
{$endc} { !OTKERNEL }
{ ***** Miscellaneous Helpful Functions *****}
{$ifc NOT OTKERNEL}
{
These routines allow you to manipulate OT's buffer structures.
If you use no-copy receives (described in "OpenTransport.h")
you will need some of these routines, and may choose to use others.
See "Open Tranport Advanced Client Programming" for documentation.
}
{$ifc not TARGET_CPU_64}
{
* OTBufferDataSize() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
function OTBufferDataSize( var buffer: OTBuffer ): OTByteCount; external name '_OTBufferDataSize';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* OTReadBuffer() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
function OTReadBuffer( var buffer: OTBufferInfo; dest: UnivPtr; var len: OTByteCount ): Boolean; external name '_OTReadBuffer';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* OTReleaseBuffer() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
procedure OTReleaseBuffer( var buffer: OTBuffer ); external name '_OTReleaseBuffer';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* StoreIntoNetbuf()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* StoreMsgIntoNetbuf()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{$endc} { !OTKERNEL }
{ ***** OTConfiguration *****}
{$ifc CALL_NOT_IN_CARBON}
{$ifc NOT OTKERNEL}
{
As promised in "OpenTransport.h", here are the routines
for advanced operations on configurations.
}
{ Manipulating a configuration}
{
* OTCfigNewConfiguration()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigDeleteConfiguration()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigCloneConfiguration()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigPushNewSingleChild()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigPushParent()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigPushChild()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigPopChild()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigGetChild()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigSetPath()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigNewChild()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigAddChild()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigRemoveChild()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigSetPortRef()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigChangeProviderName()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Query a configuration}
{
* OTCfigNumberOfChildren()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigGetParent()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigGetOptionNetbuf()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigGetPortRef()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigGetInstallFlags()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigGetProviderName()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCfigIsPort()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{$endc} { !OTKERNEL }
{ ***** Configurators *****}
{
The kOTConfiguratorInterfaceID define is what you need to add to your
export file for the "interfaceID = " clause to export a configurator
for ASLM. Similarly, kOTConfiguratorCFMTag is used for CFM-based
configurators.
}
// #define kOTConfiguratorInterfaceID kOTClientPrefix "cfigMkr"
// #define kOTConfiguratorCFMTag kOTClientPrefix "cfigMkr"
{$ifc NOT OTKERNEL}
type
TOTConfiguratorRef = ^SInt32; { an opaque 32-bit type }
TOTConfiguratorRefPtr = ^TOTConfiguratorRef;
{
Typedef for the OTCanConfigure function, and the enum for which pass we're doing.
The first (kOTSpecificConfigPass) is to give configurators a shot at the configuration
before we start allowing the generic configurators to get into the act.
}
const
kOTSpecificConfigPass = 0;
kOTGenericConfigPass = 1;
type
OTCanConfigureProcPtr = function( cfig: OTConfigurationRef; pass: UInt32 ): Boolean;
{ Typedef for the function to create and return a configurator object}
type
OTCreateConfiguratorProcPtr = function( var cfigor: TOTConfiguratorRef ): OSStatus;
{
Typedef for the "OTSetupConfigurator" function that your configurator library must export.
The enum is for the type of configurator that it is.
}
const
kOTSetupConfiguratorID = 'OTSetupConfigurator';
const
kOTDefaultConfigurator = 0;
kOTProtocolFamilyConfigurator = 1;
kOTLinkDriverConfigurator = 2;
type
OTSetupConfiguratorProcPtr = function( var canConfigure: OTCanConfigureProcPtr; var createConfigurator: OTCreateConfiguratorProcPtr; var configuratorType: UInt8 ): OSStatus;
{
Procedure pointer definitions for the three key callbacks associated
with a configurator, as established by OTNewConfigurator.
}
type
OTCFConfigureProcPtr = function( cfigor: TOTConfiguratorRef; cfig: OTConfigurationRef ): OSStatus;
OTCFCreateStreamProcPtr = function( cfigor: TOTConfiguratorRef; cfig: OTConfigurationRef; oFlags: OTOpenFlags; proc: OTNotifyUPP; contextPtr: UnivPtr ): OSStatus;
OTCFHandleSystemEventProcPtr = procedure( cfigor: TOTConfiguratorRef; code: OTEventCode; result: OTResult; cookie: UnivPtr );
{
Determine if this instance of your configurator is the "master"
(the one that can create and destroy control streams)
}
{
* OTIsMasterConfigurator()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Get back the userData you passed in to OTNewConfigurator}
{
* OTGetConfiguratorUserData()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Create a configurator object for use by Open Transport}
{
* OTNewConfigurator()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Delete a configurator object created by OTNewConfigurator}
{
* OTDeleteConfigurator()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
A utility function to send notifications to the user - it takes care of calls
from deferred tasks
}
{
* OTNotifyUser()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Call when the configurator unloads from memory}
{
* OTConfiguratorUnloaded()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
Call to create your control stream if you're not the master
configurator. You can also use the state machine function
OTSMCreateControlStream(OTStateMachine*, OTConfigurationRef, TOTConfiguratorRef cfigor).
}
{
* OTCreateControlStream()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
A helpful function for the configurators to
be able to recursively configure the children.
}
{
* OTConfigureChildren()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Allocate a bit in the system-wide control mask for streams.}
{
* OTNewControlMask()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Warning: These 2 APIs is going away}
{
* OTCloseProvidersByUseCount()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCloseProvidersByPortRef()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ These are the "real" APIs}
{
* OTCloseProviderByStream()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTCloseMatchingProviders()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ The following defines are for use in building an 'epcf' resource: }
{ Defines for fFlags field: }
const
kIsReliable = $00000001;
kIsNotReliable = $00000002;
kSupportsOrderlyRelease = $00000004;
{ Defines for fProtocolType field: }
kStream = $0001;
kUStream = $0002;
kTransaction = $0004;
kUTransaction = $0008;
kMapper = $0010;
kGenericProtocol = $0020;
{ Defines for optionType field: }
const
kBooleanOption = 0;
const
kUnsignedValueOption = 1;
const
kSignedValueOption = 2;
const
kHexValueOption = 3;
const
kPrintableStringOption = 4;
const
kOctetStringOption = 5;
{ Defines for fUpperInterface and fLowerInterface: }
const
kTPIInterface = FourCharCode('TPI ');
kDLPIInterface = FourCharCode('DLPI');
kMapperInterface = FourCharCode('MAPR');
kPrivateInterface = -1;
const
kNoInterface = 0;
{$endc} { !OTKERNEL }
{$endc} { CALL_NOT_IN_CARBON }
{ ***** OTStateMachine *****}
{$ifc CALL_NOT_IN_CARBON}
{
This utility set allows you to write an asynchronous chain of code that looks
somewhat like it is synchronous. This is primarily used for plumbing
streams asynchronously, especially in configurators
}
{$ifc NOT OTKERNEL}
{ Alas, the state machine is only available to client code. Sorry.}
{
There are 12 or 8 bytes of reserved space at the front of
the OTStateMachine structure, depending on whether you're
building PowerPC or 68K code.. The OTStateMachineDataPad
type compensates for this.
}
{$ifc TARGET_CPU_PPC}
type
OTStateMachineDataPad = packed array [0..11] of UInt8;
{$elsec}
type
OTStateMachineDataPad = packed array [0..7] of UInt8;
{$endc} {TARGET_CPU_PPC}
{
Forward define OTStateMachine so that OTStateProcPtr has
access to it.
}
type
OTStateMachinePtr = ^OTStateMachine;
{
This type is is the required prototype of a state machine
entry point.
}
OTStateProcPtr = procedure( var sm: OTStateMachine );
{
This type defines a routine that the state machine will
call when the top level completes.
}
OTSMCompleteProcPtr = procedure( contextPtr: UnivPtr );
{ And now for the state machine structure itself.}
OTStateMachine = record
fData: OTStateMachineDataPad;
fCookie: UnivPtr;
fCode: OTEventCode;
fResult: OTResult;
end;
// #define kOTSMBufferSize(callDepth) (80 + (callDepth * 8))
{
For structSize, pass the size of your structure that you want associated with
the state machine. It can later be obtained by calling OTSMGetClientData.
For bufSize, use the kOTSMBufferSize macro, plus the size of your structure
to create a buffer on the stack. For synchronous calls, the stack buffer will
be used (unless you pass in NULL). The callDepth is the depth level of nested
calls using OTSMCallStateProc.
}
{
* OTCreateStateMachine()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTDestroyStateMachine()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
OTSMCallStateProc used to take a parameter of type UInt16_p,
which was defined to be the same as UInt32. In an attempt
to reduce the number of wacky types defined by the OT
interfaces, we've changed these routines to just take a
straight UInt32. You should be warned that the current
implementation does not support values outside of the
range 0..32767. The same applies to OTSMSetState.
}
{
* OTSMCallStateProc()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMGetState()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMSetState()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Fill out the fCookie, fCode, and fResult fields before calling!}
{
* OTSMComplete()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMPopCallback()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMWaitForComplete()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMCreateStream()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMOpenStream()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMIoctl()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMPutMessage()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMGetMessage()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMReturnToCaller()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMGetClientData()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMInstallCompletionProc()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
* OTSMCreateControlStream()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{$endc} { !OTKERNEL }
{ ***** Autopush Definitions *****}
{
The autopush functionality for Open Transport is based on the names of
devices and modules, rather than on the major number information like
SVR4. This is so that autopush information can be set up for modules
that are not yet loaded.
}
{ The name of the STREAMS driver you open and send the ioctls to.}
const
kSADModuleName = 'sad';
{ Autopush ioctls.}
const
I_SAD_SAP = $6701; { Set autopush information }
I_SAD_GAP = $6702; { Get autopush information }
I_SAD_VML = $6703; { Validate a list of modules (uses str_list structure) }
{ Maximum number of modules autopushed on a driver.}
const
kOTAutopushMax = 8;
{ ioctl structure used for SAD_SAP and SAD_GAP commands.}
type
OTAutopushInfoPtr = ^OTAutopushInfo;
OTAutopushInfo = record
sap_cmd: UInt32;
sap_device_name: packed array [0..31] of char;
sap_minor: SInt32;
sap_lastminor: SInt32;
sap_npush: SInt32;
sap_list: packed array [0..7,0..31] of char;
end;
{ Command values for sap_cmd field of the above.}
const
kSAP_ONE = 1; { Configure a single minor device }
kSAP_RANGE = 2; { Configure a range of minor devices }
kSAP_ALL = 3; { Configure all minor devices }
kSAP_CLEAR = 4; { Clear autopush information }
{ ***** Configuration Helpers *****}
{
These definitions are used by device driver and port scanner
developers to provide a library giving client-side information about
the registered ports, such as a user-visible name or an icon.
}
{ Configuration helper library prefix}
{
This prefix is prepended to the string found in the "fResourceInfo"
field of the OTPortRecord to build the actual library name of the
configuration helper library.
}
const
kPortConfigLibPrefix = 'OTPortCfg$';
{ Get user visible port name entry point.}
{
This entry point returns the user visible name of the port. If includeSlot
is true, a slot distinguishing suffix (eg "slot X") should be added. If
includePort is true, a port distinguishing suffix (eg " port X") should be added for
multiport cards.
}
const
kOTGetUserPortNameID = 'OTGetUserPortName';
type
OTGetPortNameProcPtr = procedure( var port: OTPortRecord; includeSlot: OTBooleanParam; includePort: OTBooleanParam; var userVisibleName: Str255 );
{ Get icon entry point.}
{
This entry point returns the location of the icon for the port. Return false if no
icon is provided.
}
const
kOTGetPortIconID = 'OTGetPortIcon';
type
OTResourceLocatorPtr = ^OTResourceLocator;
OTResourceLocator = record
fFile: FSSpec;
fResID: UInt16;
end;
type
OTGetPortIconProcPtr = function( var port: OTPortRecord; var iconLocation: OTResourceLocator ): Boolean;
{ ***** Application Access to Configuration Helpers *****}
{$ifc NOT OTKERNEL}
{
These routines are used by clients to get information about ports.
The canonical user of these routines is the OT control panel(s),
but applications may want to use them as well (to display the list
of available Ethernet cards, for example).
}
{ Returns a user friendly name for a port.}
{
* OTGetUserPortNameFromPortRef()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
Returns the location for the icon familly representing the port.
Returns false if the port has no icon.
}
{
* OTGetPortIconFromPortRef()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
Gets the slot and other value for the default port of the given device type
Returns false if there is no default port of that device type
}
{
* OTGetDefaultPort()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Returns true if the port can be used with the specified protocol.}
{
* OTIsPortCompatibleWith()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{$endc} { !OTKERNEL }
{$endc} { CALL_NOT_IN_CARBON }
{ ***** Common Utilities *****}
{
The utilities defined in this section are available to both client
and kernel code. Cool huh? These utilities differ from those
provided in "OpenTransport.h" in that they are only available to native
architecture clients.
}
{ Bitmap functions}
{ These functions atomically deal with a bitmap that is multiple-bytes long}
{
Set the first clear bit in "bitMap", starting with bit "startBit",
giving up after "numBits". Returns the bit # that was set, or
a kOTNotFoundErr if there was no clear bit available
}
{
* OTSetFirstClearBit() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
function OTSetFirstClearBit( bitMap: UInt8Ptr; startBit: OTByteCount; numBits: OTByteCount ): OTResult; external name '_OTSetFirstClearBit';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{ Standard clear, set and test bit functions}
{
* OTClearBit() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
function OTClearBit( bitMap: UInt8Ptr; bitNo: OTByteCount ): Boolean; external name '_OTClearBit';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* OTSetBit() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
function OTSetBit( bitMap: UInt8Ptr; bitNo: OTByteCount ): Boolean; external name '_OTSetBit';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* OTTestBit() *** DEPRECATED ***
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
function OTTestBit( bitMap: UInt8Ptr; bitNo: OTByteCount ): Boolean; external name '_OTTestBit';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{ OTHashList}
{
This implements a simple, but efficient hash list. It is not
thread-safe.
}
{$endc} {not TARGET_CPU_64}
type
OTHashProcPtr = function( var linkToHash: OTLink ): UInt32;
OTHashSearchProcPtr = function( ref: {const} UnivPtr; var linkToCheck: OTLink ): Boolean;
OTHashListPtr = ^OTHashList;
OTHashList = record
fHashProc: OTHashProcPtr;
fHashTableSize: ByteCount;
fHashBuckets: ^OTLinkPtr;
end;
{
Return the number of bytes of memory needed to create a hash list
of at least "numEntries" entries.
}
{
* OTCalculateHashListMemoryNeeds()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{
Create an OTHashList from "memory". Return an error if it
couldn't be done.
}
{
* OTInitHashList()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{
* OTAddToHashList()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{
* OTRemoveLinkFromHashList()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{
* OTIsInHashList()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{
* OTFindInHashList()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{
* OTRemoveFromHashList()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{ Random functions}
{
These implement a very simple random number generator, suitable
for protocol implementations but not "cryptographically" random.
}
{
* OTGetRandomSeed()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{
* OTGetRandomNumber()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{ Concurrency Control}
{
OTGate implements a cool concurrency control primitive.
You're not going to understand it without reading the documentation!
See "Open Transport Advanced Client Programming" for details.
WARNING:
This structure must be on a 4-byte boundary.
}
type
OTGateProcPtr = function( var thisLink: OTLink ): Boolean;
CFMLibraryInfoPtr = ^CFMLibraryInfo;
CFMLibraryInfo = record
fLIFO: OTLIFO;
fList: OTList;
fProc: OTGateProcPtr;
fNumQueued: SInt32;
fInside: SInt32;
end;
{
* OTInitGate()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{
* OTEnterGate()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{
* OTLeaveGate()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: in OTUtilityLib 1.0 and later
}
{ ***** Shared Library Bonus Extras *****}
{$ifc CALL_NOT_IN_CARBON}
{
These routines provide addition shared library support beyond
that provided by the base shared library mechanism.
}
{
Some flags which can be passed to the "loadFlags" parameter of the
various CFM routines. Not all flags can be used with all routines.
See "Open Transport Advanced Client Programming" for details.
}
const
kOTGetDataSymbol = 0;
kOTGetCodeSymbol = 1;
kOTLoadNewCopy = 2;
kOTLoadACopy = 4;
kOTFindACopy = 8;
kOTLibMask = kOTLoadNewCopy or kOTLoadACopy or kOTFindACopy;
kOTLoadLibResident = $20;
{ Finding all matching CFM libraries.}
{
The routine OTFindCFMLibraries allows you to find all CFM libraries
that match specific criteria. The result is placed in a list
of CFMLibraryInfo structures. OT allocates those structures using
a routine of type OTAllocMemProcPtr that you pass to OTFindCFMLibraries.
}
{
A list of CFMLibraryInfo structures is returned by the OTFindCFMLibraries routine.
The list is created out of the data that is passed to the function.
IMPORTANT:
Only the first 3 fields are valid when using OT 1.2 and older.
}
type
CFMLibraryInfoPtr = ^CFMLibraryInfo;
CFMLibraryInfo = record
link: OTLink; { To link them all up on a list }
libName: UnivPtr; { "C" String which is fragment name }
intlName: StringPtr; { Pascal String which is internationalized name }
fileSpec: FSSpecPtr; { location of fragment's file }
pstring2: StringPtr; { Secondary string from extended cfrg }
pstring3: StringPtr; { Extra info from extended cfrg }
end;
{
You must pass a routine of type OTAllocMemProcPtr to OTFindCFMLibraries
which it calls to allocate memory for the CFMLibraryInfo structures.
}
type
OTAllocMemProcPtr = function( size: OTByteCount ): UnivPtr;
{ Find CFM libraries of the specified kind and type}
{
* OTFindCFMLibraries()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Loading libraries and connecting to symbols.}
{ Load a CFM library by name}
{
* OTLoadCFMLibrary()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Load a CFM library and get a named pointer from it}
{
* OTGetCFMPointer()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Get a named pointer from a CFM library that's already loaded}
{
* OTGetCFMSymbol()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Release a connection to a CFM library}
{
* OTReleaseCFMConnection()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
You can call these routines in your CFM initialisation and termination
routines to hold or unhold your libraries sections.
}
{
Used in a CFM InitProc, will hold the executable code, if applicable.
This can also be the InitProc of the library
}
{
* OTHoldThisCFMLibrary()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
Used in a CFM terminate proc, will unhold the executable code, if applicable.
This can also be the terminate proc of the library
}
{
* OTUnholdThisCFMLibrary()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ ASLM Utilities}
{ Load an ASLM library}
{
* OTLoadASLMLibrary()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{ Unload an ASLM library}
{
* OTUnloadASLMLibrary()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{
This is an ASLM utility routine. You can get it by including
"LibraryManagerUtilities.h", but since we only use a few ASLM utilities,
we put the prototype here for convenience.
}
{
* UnloadUnusedLibraries()
*
* Availability:
* Mac OS X: not available
* CarbonLib: not available
* Non-Carbon CFM: not available
}
{$ifc NOT OTKERNEL}
{******************************************************************************
** A few C++ objects for C++ fans
*******************************************************************************}
{$ifc CALL_NOT_IN_CARBON}
{$endc} { CALL_NOT_IN_CARBON }
{$endc} { !OTKERNEL }
{$endc} { CALL_NOT_IN_CARBON }
{$endc} {TARGET_OS_MAC and TARGET_CPU_PPC}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
end.
{$endc} {not MACOSALLINCLUDE}
|