/usr/include/yuma/ncx/obj.h is in libyuma-dev 2.9-1+b2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /*
* Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef _H_obj
#define _H_obj
/* FILE: obj.h
*********************************************************************
* *
* P U R P O S E *
* *
*********************************************************************
Data Object Support
*********************************************************************
* *
* C H A N G E H I S T O R Y *
* *
*********************************************************************
date init comment
----------------------------------------------------------------------
09-dec-07 abb Begun
21jul08 abb start obj-based rewrite
*/
#include <xmlstring.h>
#include <xmlregexp.h>
#include "grp.h"
#include "ncxconst.h"
#include "ncxtypes.h"
#include "status.h"
#include "tk.h"
#include "rpc.h"
#include "typ.h"
#include "xmlns.h"
#include "xml_util.h"
#ifdef __cplusplus
extern "C" {
#endif
/********************************************************************
* *
* C O N S T A N T S *
* *
*********************************************************************/
/* default vaule for config statement */
#define OBJ_DEF_CONFIG TRUE
/* default vaule for mandatory statement */
#define OBJ_DEF_MANDATORY FALSE
/* flags field in obj_template_t */
/* object is cloned from a grouping, for a uses statement */
#define OBJ_FL_CLONE bit0
/* def is cloned flag
* == 0 : obj.def.foo is malloced, but the typdef is cloned
* == 1 : obj.def.foo: foo is cloned
*/
#define OBJ_FL_DEFCLONE bit1
/* clone source
* == 0 : cloned object from uses
* == 1 : cloned object from augment
*/
#define OBJ_FL_AUGCLONE bit2
/* object is marked for deletion */
#define OBJ_FL_DELETED bit3
/* object is conditional, via a when-stmt expression */
#define OBJ_FL_CONDITIONAL bit4
/* object is a top-level definition within a module or submodule */
#define OBJ_FL_TOP bit5
/* object was entered with a 'kw name;' format and is
* considered empty by the yangdump program
*/
#define OBJ_FL_EMPTY bit6
/* object has been visited by the yangdiff program */
#define OBJ_FL_SEEN bit7
/* object marked as changed by the yangdiff program */
#define OBJ_FL_DIFF bit8
/* object is marked as ncx:hidden */
#define OBJ_FL_HIDDEN bit9
/* object is marked as ncx:root */
#define OBJ_FL_ROOT bit10
/* object is marked as a password */
#define OBJ_FL_PASSWD bit11
/* object is marked as a CLI-only node */
#define OBJ_FL_CLI bit12
/* object is marked as an XSD list data type */
#define OBJ_FL_XSDLIST bit13
/* OBJ_TYP_LEAF object is being uses as a key */
#define OBJ_FL_KEY bit14
/* object is marked as abstract: not CLI or config data */
#define OBJ_FL_ABSTRACT bit15
/* object is marked as config set */
#define OBJ_FL_CONFSET bit16
/* object config value */
#define OBJ_FL_CONFIG bit17
/* object is marked as mandatory set */
#define OBJ_FL_MANDSET bit18
/* object mandatory value */
#define OBJ_FL_MANDATORY bit19
/* object used in a unique-stmt within a list */
#define OBJ_FL_UNIQUE bit20
/* object data type is an XPath string */
#define OBJ_FL_XPATH bit21
/* object data type is a QName string */
#define OBJ_FL_QNAME bit22
/* object data type is a schema-instance string */
#define OBJ_FL_SCHEMAINST bit23
/* object is tagged ncx:secure */
#define OBJ_FL_SECURE bit24
/* object is tagged ncx:very-secure */
#define OBJ_FL_VERY_SECURE bit25
/* object is tagged ncx:default-parm-equals-ok */
#define OBJ_FL_CLI_EQUALS_OK bit26
/* object is tagged ncx:sil-delete-children-first */
#define OBJ_FL_SIL_DELETE_CHILDREN_FIRST bit27
/* object is tagged as ncx:user-write with no create access */
#define OBJ_FL_BLOCK_CREATE bit28
/* object is tagged as ncx:user-write with no update access */
#define OBJ_FL_BLOCK_UPDATE bit29
/* object is tagged as ncx:user-write with no delete access */
#define OBJ_FL_BLOCK_DELETE bit30
/********************************************************************
* *
* T Y P E S *
* *
*********************************************************************/
/* enumeration for different YANG data def statement types
* the enum order is significant!!! do not change!!!
*/
typedef enum obj_type_t_ {
OBJ_TYP_NONE,
OBJ_TYP_ANYXML,
OBJ_TYP_CONTAINER,
OBJ_TYP_LEAF,
OBJ_TYP_LEAF_LIST,
OBJ_TYP_LIST, /* last real database object */
OBJ_TYP_CHOICE,
OBJ_TYP_CASE, /* last named database object */
OBJ_TYP_USES,
OBJ_TYP_REFINE, /* child of uses only */
OBJ_TYP_AUGMENT,
OBJ_TYP_RPC,
OBJ_TYP_RPCIO,
OBJ_TYP_NOTIF
} obj_type_t;
/* enumeration for different YANG augment statement types */
typedef enum obj_augtype_t_ {
OBJ_AUGTYP_NONE,
OBJ_AUGTYP_RPCIN,
OBJ_AUGTYP_RPCOUT,
OBJ_AUGTYP_CASE,
OBJ_AUGTYP_DATA
} obj_augtype_t;
/* One YANG list key component */
typedef struct obj_key_t_ {
dlq_hdr_t qhdr;
struct obj_template_t_ *keyobj;
boolean seen; /* used by yangdiff */
} obj_key_t;
/* One component in a YANG list unique target */
typedef struct obj_unique_comp_t_ {
dlq_hdr_t qhdr;
struct obj_template_t_ *unobj;
xmlChar *xpath; /* saved unique str for this obj */
boolean isduplicate; /* will be ignored by server */
} obj_unique_comp_t;
/* One component in a YANG list unique target */
typedef struct obj_unique_t_ {
dlq_hdr_t qhdr;
xmlChar *xpath; /* complete saved unique str */
dlq_hdr_t compQ; /* Q of obj_unique_comp_t */
boolean seen; /* needed by yangdiff */
boolean isconfig; /* constraint is on config */
ncx_error_t tkerr;
} obj_unique_t;
/* One YANG 'container' definition */
typedef struct obj_container_t_ {
xmlChar *name;
xmlChar *descr;
xmlChar *ref;
xmlChar *presence;
dlq_hdr_t *typedefQ; /* Q of typ_template_t */
dlq_hdr_t *groupingQ; /* Q of grp_template_t */
dlq_hdr_t *datadefQ; /* Q of obj_template_t */
boolean datadefclone;
ncx_status_t status;
dlq_hdr_t mustQ; /* Q of xpath_pcb_t */
struct obj_template_t_ *defaultparm;
} obj_container_t;
/* One YANG 'leaf' or 'anyxml' definition */
typedef struct obj_leaf_t_ {
xmlChar *name;
xmlChar *units;
xmlChar *defval;
xmlChar *descr;
xmlChar *ref;
typ_def_t *typdef;
ncx_status_t status;
dlq_hdr_t mustQ; /* Q of xpath_pcb_t */
struct obj_template_t_ *leafrefobj;
} obj_leaf_t;
/* One YANG 'leaf-list' definition */
typedef struct obj_leaflist_t_ {
xmlChar *name;
xmlChar *units;
xmlChar *descr;
xmlChar *ref;
typ_def_t *typdef;
boolean ordersys; /* ordered-by system or user */
boolean minset;
uint32 minelems;
boolean maxset;
uint32 maxelems;
ncx_status_t status;
dlq_hdr_t mustQ; /* Q of xpath_pcb_t */
struct obj_template_t_ *leafrefobj;
} obj_leaflist_t;
/* One YANG 'list' definition */
typedef struct obj_list_t_ {
xmlChar *name;
xmlChar *keystr;
xmlChar *descr;
xmlChar *ref;
dlq_hdr_t *typedefQ; /* Q of typ_template_t */
dlq_hdr_t *groupingQ; /* Q of grp_template_t */
dlq_hdr_t *datadefQ; /* Q of obj_template_t */
dlq_hdr_t keyQ; /* Q of obj_key_t */
dlq_hdr_t uniqueQ; /* Q of obj_unique_t */
boolean datadefclone;
boolean ordersys; /* ordered-by system or user */
boolean minset;
uint32 minelems;
boolean maxset;
uint32 maxelems;
ncx_status_t status;
dlq_hdr_t mustQ; /* Q of xpath_pcb_t */
ncx_error_t keytkerr;
} obj_list_t;
/* One YANG 'choice' definition */
typedef struct obj_choice_t_ {
xmlChar *name;
xmlChar *defval;
xmlChar *descr;
xmlChar *ref;
dlq_hdr_t *caseQ; /* Q of obj_template_t */
boolean caseQclone;
ncx_status_t status;
} obj_choice_t;
/* One YANG 'case' definition */
typedef struct obj_case_t_ {
xmlChar *name;
xmlChar *descr;
xmlChar *ref;
dlq_hdr_t *datadefQ; /* Q of obj_template_t */
boolean nameclone;
boolean datadefclone;
ncx_status_t status;
} obj_case_t;
/* YANG uses statement struct */
typedef struct obj_uses_t_ {
xmlChar *prefix;
xmlChar *name;
xmlChar *descr;
xmlChar *ref;
grp_template_t *grp; /* const back-ptr to grouping */
dlq_hdr_t *datadefQ; /* Q of obj_template_t */
ncx_status_t status;
boolean expand_done;
} obj_uses_t;
/* YANG refine statement struct */
typedef struct obj_refine_t_ {
xmlChar *target;
struct obj_template_t_ *targobj;
/* the token for each sub-clause is saved because
* when the refine-stmt is parsed, the target is not
* known yet so picking the correct variant
* such as refine-leaf-stmts or refine-list-stmts
* needs to wait until the resolve phase
*/
xmlChar *descr;
ncx_error_t descr_tkerr;
xmlChar *ref;
ncx_error_t ref_tkerr;
xmlChar *presence;
ncx_error_t presence_tkerr;
xmlChar *def;
ncx_error_t def_tkerr;
/* config and confset are in the object flags */
ncx_error_t config_tkerr;
/* mandatory and mandset are in the object flags */
ncx_error_t mandatory_tkerr;
uint32 minelems;
ncx_error_t minelems_tkerr; /* also minset */
uint32 maxelems;
ncx_error_t maxelems_tkerr; /* also maxset */
dlq_hdr_t mustQ;
} obj_refine_t;
/* YANG input-stmt or output-stmt struct */
typedef struct obj_rpcio_t_ {
xmlChar *name; /* input or output */
dlq_hdr_t typedefQ; /* Q of typ_template_t */
dlq_hdr_t groupingQ; /* Q of gtp_template_t */
dlq_hdr_t datadefQ; /* Q of obj_template_t */
struct obj_template_t_ *defaultparm;
} obj_rpcio_t;
/* YANG rpc-stmt struct; used for augment and name collision detect */
typedef struct obj_rpc_t_ {
xmlChar *name;
xmlChar *descr;
xmlChar *ref;
ncx_status_t status;
dlq_hdr_t typedefQ; /* Q of typ_template_t */
dlq_hdr_t groupingQ; /* Q of gtp_template_t */
dlq_hdr_t datadefQ; /* Q of obj_template_t */
/* internal fields for manager and agent */
xmlns_id_t nsid;
boolean supported; /* mod loaded, not implemented */
} obj_rpc_t;
/* YANG augment statement struct */
typedef struct obj_augment_t_ {
xmlChar *target;
xmlChar *descr;
xmlChar *ref;
struct obj_template_t_ *targobj;
obj_augtype_t augtype;
ncx_status_t status;
dlq_hdr_t datadefQ; /* Q of obj_template_t */
#ifdef ENABLE_DIRECT_MUST_AUGMENT_EX
dlq_hdr_t mustQ; /* Q of xpath_pcb_t */
boolean direct_must_augment_ex;
#endif
} obj_augment_t;
/* One YANG 'notification' clause definition */
typedef struct obj_notif_t_ {
xmlChar *name;
xmlChar *descr;
xmlChar *ref;
ncx_status_t status;
dlq_hdr_t typedefQ; /* Q of typ_template_t */
dlq_hdr_t groupingQ; /* Q of gtp_template_t */
dlq_hdr_t datadefQ; /* Q of obj_template_t */
} obj_notif_t;
/* back-pointer to inherited if-feature statements */
typedef struct obj_iffeature_ptr_t_ {
dlq_hdr_t qhdr;
ncx_iffeature_t *iffeature;
} obj_iffeature_ptr_t;
/* back-pointer to inherited when statements */
typedef struct obj_xpath_ptr_t_ {
dlq_hdr_t qhdr;
struct xpath_pcb_t_ *xpath;
} obj_xpath_ptr_t;
/* One YANG data-def-stmt */
typedef struct obj_template_t_ {
dlq_hdr_t qhdr;
obj_type_t objtype;
uint32 flags; /* see OBJ_FL_* definitions */
ncx_error_t tkerr;
grp_template_t *grp; /* non-NULL == in a grp.datadefQ */
/* 3 back pointers */
struct obj_template_t_ *parent;
struct obj_template_t_ *usesobj;
struct obj_template_t_ *augobj;
struct xpath_pcb_t_ *when; /* optional when clause */
dlq_hdr_t metadataQ; /* Q of obj_metadata_t */
dlq_hdr_t appinfoQ; /* Q of ncx_appinfo_t */
dlq_hdr_t iffeatureQ; /* Q of ncx_iffeature_t */
dlq_hdr_t inherited_iffeatureQ; /* Q of obj_iffeature_ptr_t */
dlq_hdr_t inherited_whenQ; /* Q of obj_xpath_ptr_t */
/* cbset is agt_rpc_cbset_t for RPC or agt_cb_fnset_t for OBJ */
void *cbset;
/* object module and namespace ID
* assigned at runtime
* this can be changed over and over as a
* uses statement is expanded. The final
* expansion into a real object will leave
* the correct value in place
*/
struct ncx_module_t_ *mod;
xmlns_id_t nsid;
union def_ {
obj_container_t *container;
obj_leaf_t *leaf;
obj_leaflist_t *leaflist;
obj_list_t *list;
obj_choice_t *choic;
obj_case_t *cas;
obj_uses_t *uses;
obj_refine_t *refine;
obj_augment_t *augment;
obj_rpc_t *rpc;
obj_rpcio_t *rpcio;
obj_notif_t *notif;
} def;
} obj_template_t;
/* One YANG metadata (XML attribute) node */
typedef struct obj_metadata_t_ {
dlq_hdr_t qhdr;
struct obj_template_t_ *parent; /* obj containing metadata */
xmlChar *name;
typ_def_t *typdef;
xmlns_id_t nsid; /* in case parent == NULL */
ncx_error_t tkerr;
} obj_metadata_t;
/* type of deviation for each deviate entry */
typedef enum obj_deviate_arg_t_ {
OBJ_DARG_NONE,
OBJ_DARG_ADD,
OBJ_DARG_DELETE,
OBJ_DARG_REPLACE,
OBJ_DARG_NOT_SUPPORTED
} obj_deviate_arg_t;
/* YANG deviate statement struct */
typedef struct obj_deviate_t_ {
dlq_hdr_t qhdr;
/* the error info for each sub-clause is saved because
* when the deviation-stmt is parsed, the target is not
* known yet so picking the correct variant
* such as type-stmt or refine-list-stmts
* needs to wait until the resolve phase
*
*/
ncx_error_t tkerr;
boolean empty;
obj_deviate_arg_t arg;
ncx_error_t arg_tkerr;
typ_def_t *typdef;
ncx_error_t type_tkerr;
xmlChar *units;
ncx_error_t units_tkerr;
xmlChar *defval;
ncx_error_t default_tkerr;
boolean config;
ncx_error_t config_tkerr;
boolean mandatory;
ncx_error_t mandatory_tkerr;
uint32 minelems;
ncx_error_t minelems_tkerr; /* also minset */
uint32 maxelems;
ncx_error_t maxelems_tkerr; /* also maxset */
dlq_hdr_t mustQ; /* Q of xpath_pcb_t */
dlq_hdr_t uniqueQ; /* Q of obj_unique_t */
dlq_hdr_t appinfoQ; /* Q of ncx_appinfo_t */
} obj_deviate_t;
/* YANG deviate statement struct */
typedef struct obj_deviation_t_ {
dlq_hdr_t qhdr;
xmlChar *target;
xmlChar *targmodname;
obj_template_t *targobj;
xmlChar *descr;
xmlChar *ref;
ncx_error_t tkerr;
xmlChar *devmodname; /* set if not the targmod */
boolean empty;
status_t res;
dlq_hdr_t deviateQ; /* Q of obj_deviate_t */
dlq_hdr_t appinfoQ; /* Q of ncx_appinfo_t */
} obj_deviation_t;
/* child or descendant node search walker function
*
* INPUTS:
* obj == object node found in descendant search
* cookie1 == cookie1 value passed to start of walk
* cookie2 == cookie2 value passed to start of walk
*
* RETURNS:
* TRUE if walk should continue
* FALSE if walk should terminate
*/
typedef boolean
(*obj_walker_fn_t) (obj_template_t *obj,
void *cookie1,
void *cookie2);
/********************************************************************
* *
* F U N C T I O N S *
* *
*********************************************************************/
/********************************************************************
* FUNCTION obj_new_template
*
* Malloc and initialize the fields in a an object template
*
* INPUTS:
* objtype == the specific object type to create
*
* RETURNS:
* pointer to the malloced and initialized struct or NULL if an error
*********************************************************************/
extern obj_template_t *
obj_new_template (obj_type_t objtype);
/********************************************************************
* FUNCTION obj_free_template
*
* Scrub the memory in a obj_template_t by freeing all
* the sub-fields and then freeing the entire struct itself
* The struct must be removed from any queue it is in before
* this function is called.
*
* INPUTS:
* obj == obj_template_t data structure to free
*********************************************************************/
extern void
obj_free_template (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_find_template
*
* Find an object with the specified name
*
* INPUTS:
* que == Q of obj_template_t to search
* modname == module name that defines the obj_template_t
* == NULL and first match will be done, and the
* module ignored (Name instead of QName)
* objname == object name to find
*
* RETURNS:
* pointer to obj_template_t or NULL if not found in 'que'
*********************************************************************/
extern obj_template_t *
obj_find_template (dlq_hdr_t *que,
const xmlChar *modname,
const xmlChar *objname);
/********************************************************************
* FUNCTION obj_find_template_con
*
* Find an object with the specified name
* Return a const pointer; used by yangdump
*
* INPUTS:
* que == Q of obj_template_t to search
* modname == module name that defines the obj_template_t
* == NULL and first match will be done, and the
* module ignored (Name instead of QName)
* objname == object name to find
*
* RETURNS:
* pointer to obj_template_t or NULL if not found in 'que'
*********************************************************************/
extern const obj_template_t *
obj_find_template_con (dlq_hdr_t *que,
const xmlChar *modname,
const xmlChar *objname);
/********************************************************************
* FUNCTION obj_find_template_test
*
* Find an object with the specified name
*
* INPUTS:
* que == Q of obj_template_t to search
* modname == module name that defines the obj_template_t
* == NULL and first match will be done, and the
* module ignored (Name instead of QName)
* objname == object name to find
*
* RETURNS:
* pointer to obj_template_t or NULL if not found in 'que'
*********************************************************************/
extern obj_template_t *
obj_find_template_test (dlq_hdr_t *que,
const xmlChar *modname,
const xmlChar *objname);
/********************************************************************
* FUNCTION obj_find_template_top
*
* Check if an obj_template_t in the mod->datadefQ or any
* of the include files visible to this module
*
* Top-level access is not tracked, so the 'test' variable
* is hard-wired to FALSE
*
* INPUTS:
* mod == ncx_module to check
* modname == module name for the object (needed for augments)
* (may be NULL to match any 'objname' instance)
* objname == object name to find
*
* RETURNS:
* pointer to struct if present, NULL otherwise
*********************************************************************/
extern obj_template_t *
obj_find_template_top (ncx_module_t *mod,
const xmlChar *modname,
const xmlChar *objname);
/********************************************************************
* FUNCTION obj_find_template_top_ex
*
* Check if an obj_template_t in the mod->datadefQ or any
* of the include files visible to this module
*
* Top-level access is not tracked, so the 'test' variable
* is hard-wired to FALSE
*
* INPUTS:
* mod == ncx_module to check
* modname == module name for the object (needed for augments)
* (may be NULL to match any 'objname' instance)
* objname == object name to find
* match_names == enum for selected match names mode
* alt_names == TRUE if alt-name should be checked in addition
* to the YANG node name
* == FALSE to check YANG names only
* dataonly == TRUE to check just data nodes
* FALSE to check all nodes
* retres == address of return status
*
* OUTPUTS:
* if retres not NULL, *retres set to return status
*
* RETURNS:
* pointer to struct if present, NULL otherwise
*********************************************************************/
extern obj_template_t *
obj_find_template_top_ex (ncx_module_t *mod,
const xmlChar *modname,
const xmlChar *objname,
ncx_name_match_t match_names,
boolean alt_names,
boolean dataonly,
status_t *retres);
/********************************************************************
* FUNCTION obj_find_template_all
*
* Check if an obj_template_t in the mod->datadefQ or any
* of the include files used within the entire main module
*
* Top-level access is not tracked, so the 'test' variable
* is hard-wired to FALSE
*
* INPUTS:
* mod == ncx_module to check
* modname == module name for the object (needed for augments)
* (may be NULL to match any 'objname' instance)
* objname == object name to find
*
* RETURNS:
* pointer to struct if present, NULL otherwise
*********************************************************************/
extern obj_template_t *
obj_find_template_all (ncx_module_t *mod,
const xmlChar *modname,
const xmlChar *objname);
/********************************************************************
* FUNCTION obj_find_child
*
* Find a child object with the specified Qname
*
* !!! This function checks for accessible names only!!!
* !!! That means child nodes of choice->case will be
* !!! present instead of the choice name or case name
*
* INPUTS:
* obj == obj_template_t to check
* modname == module name that defines the obj_template_t
* == NULL and first match will be done, and the
* module ignored (Name instead of QName)
* objname == object name to find
*
* RETURNS:
* pointer to obj_template_t or NULL if not found
*********************************************************************/
extern obj_template_t *
obj_find_child (obj_template_t *obj,
const xmlChar *modname,
const xmlChar *objname);
/********************************************************************
* FUNCTION obj_find_child_ex
*
* Find a child object with the specified Qname
* extended match modes
*
* !!! This function checks for accessible names only!!!
* !!! That means child nodes of choice->case will be
* !!! present instead of the choice name or case name
*
* INPUTS:
* obj == obj_template_t to check
* modname == module name that defines the obj_template_t
* == NULL and first match will be done, and the
* module ignored (Name instead of QName)
* objname == object name to find
* match_names == enum for selected match names mode
* alt_names == TRUE if alt-name should be checked in addition
* to the YANG node name
* == FALSE to check YANG names only
* dataonly == TRUE to check just data nodes
* FALSE to check all nodes
* retres == address of return status
*
* OUTPUTS:
* if retres not NULL, *retres set to return status
*
* RETURNS:
* pointer to obj_template_t or NULL if not found
*********************************************************************/
extern obj_template_t *
obj_find_child_ex (obj_template_t *obj,
const xmlChar *modname,
const xmlChar *objname,
ncx_name_match_t match_names,
boolean alt_names,
boolean dataonly,
status_t *retres);
/********************************************************************
* FUNCTION obj_find_child_str
*
* Find a child object with the specified Qname
*
* INPUTS:
* obj == obj_template_t to check
* modname == module name that defines the obj_template_t
* == NULL and first match will be done, and the
* module ignored (Name instead of QName)
* objname == object name to find, not Z-terminated
* objnamelen == length of objname string
*
* RETURNS:
* pointer to obj_template_t or NULL if not found
*********************************************************************/
extern obj_template_t *
obj_find_child_str (obj_template_t *obj,
const xmlChar *modname,
const xmlChar *objname,
uint32 objnamelen);
/********************************************************************
* FUNCTION obj_match_child_str
*
* Match a child object with the specified Qname
* Find first command that matches all N chars of objname
*
* !!! This function checks for accessible names only!!!
* !!! That means child nodes of choice->case will be
* !!! present instead of the choice name or case name
*
* INPUTS:
* obj == obj_template_t to check
* modname == module name that defines the obj_template_t
* == NULL and first match will be done, and the
* module ignored (Name instead of QName)
* objname == object name to find, not Z-terminated
* objnamelen == length of objname string
* matchcount == address of return parameter match count
* (may be NULL)
* OUTPUTS:
* if non-NULL:
* *matchcount == number of parameters that matched
* only the first match will be returned
*
* RETURNS:
* pointer to obj_template_t or NULL if not found
*********************************************************************/
extern obj_template_t *
obj_match_child_str (obj_template_t *obj,
const xmlChar *modname,
const xmlChar *objname,
uint32 objnamelen,
uint32 *matchcount);
/********************************************************************
* FUNCTION obj_first_child
*
* Get the first child object if the specified object
* has any children
*
* !!!! SKIPS OVER AUGMENT AND USES !!!!
*
* INPUTS:
* obj == obj_template_t to check
* RETURNS:
* pointer to first child obj_template_t or
* NULL if not found
*********************************************************************/
extern obj_template_t *
obj_first_child (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_last_child
*
* Get the last child object if the specified object
* has any children
*
* !!!! SKIPS OVER AUGMENT AND USES !!!!
*
* INPUTS:
* obj == obj_template_t to check
* RETURNS:
* pointer to first child obj_template_t or
* NULL if not found
*********************************************************************/
extern obj_template_t *
obj_last_child (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_next_child
*
* Get the next child object if the specified object
* has any children
*
* !!!! SKIPS OVER AUGMENT AND USES !!!!
*
* INPUTS:
* obj == obj_template_t to check
* RETURNS:
* pointer to next child obj_template_t or
* NULL if not found
*********************************************************************/
extern obj_template_t *
obj_next_child (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_previous_child
*
* Get the previous child object if the specified object
* has any children
*
* !!!! SKIPS OVER AUGMENT AND USES !!!!
*
* INPUTS:
* obj == obj_template_t to check
* RETURNS:
* pointer to next child obj_template_t or
* NULL if not found
*********************************************************************/
extern obj_template_t *
obj_previous_child (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_first_child_deep
*
* Get the first child object if the specified object
* has any children. Look past choices and cases to
* the real nodes within them
*
* !!!! SKIPS OVER AUGMENT AND USES AND CHOICES AND CASES !!!!
*
* INPUTS:
* obj == obj_template_t to check
* RETURNS:
* pointer to first child obj_template_t or
* NULL if not found
*********************************************************************/
extern obj_template_t *
obj_first_child_deep (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_next_child_deep
*
* Get the next child object if the specified object
* has any children. Look past choice and case nodes
* to the real nodes within them
*
* !!!! SKIPS OVER AUGMENT AND USES !!!!
*
* INPUTS:
* obj == obj_template_t to check
*
* RETURNS:
* pointer to next child obj_template_t or
* NULL if not found
*********************************************************************/
extern obj_template_t *
obj_next_child_deep (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_find_all_children
*
* Find all occurances of the specified node(s)
* within the children of the current node.
* The walker fn will be called for each match.
*
* If the walker function returns TRUE, then the
* walk will continue; If FALSE it will terminate right away
*
* This function skips choice and case nodes and
* only processes real data nodes
*
* INPUTS:
* exprmod == module containing XPath expression
* walkerfn == callback function to use
* cookie1 == cookie1 value to pass to walker fn
* cookie2 == cookie2 value to pass to walker fn
* startnode == start node to check
* modname == module name;
* only matches in this module namespace
* will be returned
* == NULL:
* namespace matching will be skipped
* childname == name of child node to find
* == NULL to match any child name
* configonly == TRUE to skip over non-config nodes
* FALSE to check all nodes
* Only used if childname == NULL
* textmode == TRUE if just testing for text() nodes
* name and modname will be ignored in this mode
* FALSE if using name and modname to filter
* useroot == TRUE is it is safe to use the toproot
* FALSE if not, use all moduleQ search instead
*
* RETURNS:
* TRUE if normal termination occurred
* FALSE if walker fn requested early termination
*********************************************************************/
extern boolean
obj_find_all_children (ncx_module_t *exprmod,
obj_walker_fn_t walkerfn,
void *cookie1,
void *cookie2,
obj_template_t *startnode,
const xmlChar *modname,
const xmlChar *childname,
boolean configonly,
boolean textmode,
boolean useroot);
/********************************************************************
* FUNCTION obj_find_all_ancestors
*
* Find all occurances of the specified node(s)
* within the ancestors of the current node.
* The walker fn will be called for each match.
*
* If the walker function returns TRUE, then the
* walk will continue; If FALSE it will terminate right away
*
* This function skips choice and case nodes and
* only processes real data nodes
*
* INPUTS:
* exprmod == module containing XPath object
* walkerfn == callback function to use
* cookie1 == cookie1 value to pass to walker fn
* cookie2 == cookie2 value to pass to walker fn
* startnode == start node to check
* modname == module name;
* only matches in this module namespace
* will be returned
* == NULL:
* namespace matching will be skipped
* name == name of ancestor node to find
* == NULL to match any ancestor name
* configonly == TRUE to skip over non-config nodes
* FALSE to check all nodes
* Only used if name == NULL
* textmode == TRUE if just testing for text() nodes
* name and modname will be ignored in this mode
* FALSE if using name and modname to filter
* useroot == TRUE is it is safe to use the toproot
* FALSE if not, use all moduleQ search instead
* orself == TRUE if axis is really ancestor-or-self
* FALSE if axis is ancestor
* fncalled == address of return function called flag
*
* OUTPUTS:
* *fncalled set to TRUE if a callback function was called
*
* RETURNS:
* TRUE if normal termination occurred
* FALSE if walker fn requested early termination
*********************************************************************/
extern boolean
obj_find_all_ancestors (ncx_module_t *exprmod,
obj_walker_fn_t walkerfn,
void *cookie1,
void *cookie2,
obj_template_t *startnode,
const xmlChar *modname,
const xmlChar *name,
boolean configonly,
boolean textmode,
boolean useroot,
boolean orself,
boolean *fncalled);
/********************************************************************
* FUNCTION obj_find_all_descendants
*
* Find all occurances of the specified node(s)
* within the descendants of the current node.
* The walker fn will be called for each match.
*
* If the walker function returns TRUE, then the
* walk will continue; If FALSE it will terminate right away
*
* This function skips choice and case nodes and
* only processes real data nodes
*
* INPUTS:
* exprmod == module containing XPath expression
* walkerfn == callback function to use
* cookie1 == cookie1 value to pass to walker fn
* cookie2 == cookie2 value to pass to walker fn
* startnode == start node to check
* modname == module name;
* only matches in this module namespace
* will be returned
* == NULL:
* namespace matching will be skipped
* name == name of descendant node to find
* == NULL to match any descendant name
* configonly == TRUE to skip over non-config nodes
* FALSE to check all nodes
* Only used if name == NULL
* textmode == TRUE if just testing for text() nodes
* name and modname will be ignored in this mode
* FALSE if using name and modname to filter
* useroot == TRUE is it is safe to use the toproot
* FALSE if not, use all moduleQ search instead
* orself == TRUE if axis is really ancestor-or-self
* FALSE if axis is ancestor
* fncalled == address of return function called flag
*
* OUTPUTS:
* *fncalled set to TRUE if a callback function was called
*
* RETURNS:
* TRUE if normal termination occurred
* FALSE if walker fn requested early termination
*********************************************************************/
extern boolean
obj_find_all_descendants (ncx_module_t *exprmod,
obj_walker_fn_t walkerfn,
void *cookie1,
void *cookie2,
obj_template_t *startnode,
const xmlChar *modname,
const xmlChar *name,
boolean configonly,
boolean textmode,
boolean useroot,
boolean orself,
boolean *fncalled);
/********************************************************************
* FUNCTION obj_find_all_pfaxis
*
* Find all occurances of the specified preceding
* or following node(s). Could also be
* within the descendants of the current node.
* The walker fn will be called for each match.
*
* If the walker function returns TRUE, then the
* walk will continue; If FALSE it will terminate right away
*
* This function skips choice and case nodes and
* only processes real data nodes
*
* INPUTS:
* exprmod == module containing object
* walkerfn == callback function to use
* cookie1 == cookie1 value to pass to walker fn
* cookie2 == cookie2 value to pass to walker fn
* startnode == starting sibling node to check
* modname == module name;
* only matches in this module namespace
* will be returned
* == NULL:
* namespace matching will be skipped
*
* name == name of preceding or following node to find
* == NULL to match any name
* configonly == TRUE to skip over non-config nodes
* FALSE to check all nodes
* Only used if name == NULL
* dblslash == TRUE if all decendents of the preceding
* or following nodes should be checked
* FALSE only 1 level is checked
* textmode == TRUE if just testing for text() nodes
* name and modname will be ignored in this mode
* FALSE if using name and modname to filter
* axis == axis enum to use
* fncalled == address of return function called flag
*
* OUTPUTS:
* *fncalled set to TRUE if a callback function was called
*
* RETURNS:
* TRUE if normal termination occurred
* FALSE if walker fn requested early termination
*********************************************************************/
extern boolean
obj_find_all_pfaxis (ncx_module_t *exprmod,
obj_walker_fn_t walkerfn,
void *cookie1,
void *cookie2,
obj_template_t *startnode,
const xmlChar *modname,
const xmlChar *name,
boolean configonly,
boolean dblslash,
boolean textmode,
boolean useroot,
ncx_xpath_axis_t axis,
boolean *fncalled);
/********************************************************************
* FUNCTION obj_find_case
*
* Find a specified case arm by name
*
* INPUTS:
* choic == choice struct to check
* modname == name of the module that added this case (may be NULL)
* casname == name of the case to find
*
* RETURNS:
* pointer to obj_case_t for requested case, NULL if not found
*********************************************************************/
extern obj_case_t *
obj_find_case (obj_choice_t *choic,
const xmlChar *modname,
const xmlChar *casname);
/********************************************************************
* FUNCTION obj_new_rpcio
*
* Malloc and initialize the fields in a an obj_rpcio_t
* Fields are setup within the new obj_template_t, based
* on the values in rpcobj
*
* INPUTS:
* rpcobj == parent OBJ_TYP_RPC template
* name == name string of the node (input or output)
*
* RETURNS:
* pointer to the malloced and initialized struct or NULL if an error
*********************************************************************/
extern obj_template_t *
obj_new_rpcio (obj_template_t *rpcobj,
const xmlChar *name);
/********************************************************************
* FUNCTION obj_clean_datadefQ
*
* Clean and free all the obj_template_t structs in the specified Q
*
* INPUTS:
* datadefQ == Q of obj_template_t to clean
*********************************************************************/
extern void
obj_clean_datadefQ (dlq_hdr_t *que);
/********************************************************************
* FUNCTION obj_find_type
*
* Check if a typ_template_t in the obj typedefQ hierarchy
*
* INPUTS:
* obj == obj_template using the typedef
* typname == type name to find
*
* RETURNS:
* pointer to struct if present, NULL otherwise
*********************************************************************/
extern typ_template_t *
obj_find_type (obj_template_t *obj,
const xmlChar *typname);
/********************************************************************
* FUNCTION obj_first_typedef
*
* Get the first local typedef for this object, if any
*
* INPUTS:
* obj == obj_template to use
*
* RETURNS:
* pointer to first typ_template_t struct if present, NULL otherwise
*********************************************************************/
extern typ_template_t *
obj_first_typedef (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_find_grouping
*
* Check if a grp_template_t in the obj groupingQ hierarchy
*
* INPUTS:
* obj == obj_template using the grouping
* grpname == grouping name to find
*
* RETURNS:
* pointer to struct if present, NULL otherwise
*********************************************************************/
extern grp_template_t *
obj_find_grouping (obj_template_t *obj,
const xmlChar *grpname);
/********************************************************************
* FUNCTION obj_first_grouping
*
* Get the first local grouping if any
*
* INPUTS:
* obj == obj_template to use
*
* RETURNS:
* pointer to struct if present, NULL otherwise
*********************************************************************/
extern grp_template_t *
obj_first_grouping (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_set_named_type
*
* Resolve type test
* Called during phase 2 of module parsing
*
* INPUTS:
* tkc == token chain
* mod == module in progress
* typname == name field from typ->name (may be NULL)
* typdef == typdef in progress
* parent == obj_template containing this typedef
* == NULL if this is the top-level, use mod->typeQ
* grp == grp_template containing this typedef
* == NULL if the typedef is not contained in a grouping
*
* RETURNS:
* status
*********************************************************************/
extern status_t
obj_set_named_type (tk_chain_t *tkc,
ncx_module_t *mod,
const xmlChar *typname,
typ_def_t *typdef,
obj_template_t *parent,
grp_template_t *grp);
/********************************************************************
* FUNCTION obj_clone_template
*
* Clone an obj_template_t
* Copy the pointers from the srcobj into the new obj
*
* If the mobj is non-NULL, then the non-NULL revisable
* fields in the mobj struct will be merged into the new object
*
* INPUTS:
* mod == module struct that is defining the new cloned data
* this may be different than the module that will
* contain the cloned data (except top-level objects)
* srcobj == obj_template to clone
* !!! This struct MUST NOT be deleted!!!
* !!! Unless all of its clones are also deleted !!!
* mobjQ == merge object Q (may be NULL)
* datadefQ to check for OBJ_TYP_REFINE nodes
* If the target of the refine node matches the
* srcobj (e.g., from same grouping), then the
* sub-clauses in that refinement-stmt that
* are allowed to be revised will be checked
*
* RETURNS:
* pointer to malloced clone obj_template_t
* NULL if malloc failer error or internal error
*********************************************************************/
extern obj_template_t *
obj_clone_template (ncx_module_t *mod,
obj_template_t *srcobj,
dlq_hdr_t *mobjQ);
/********************************************************************
* FUNCTION obj_clone_template_case
*
* Clone an obj_template_t but make sure it is wrapped
* in a OBJ_TYP_CASE layer
*
* Copy the pointers from the srcobj into the new obj
*
* Create an OBJ_TYP_CASE wrapper if needed,
* for a short-case-stmt data def
*
* If the mobj is non-NULL, then the non-NULL revisable
* fields in the mobj struct will be merged into the new object
*
* INPUTS:
* mod == module struct that is defining the new cloned data
* this may be different than the module that will
* contain the cloned data (except top-level objects)
* srcobj == obj_template to clone
* !!! This struct MUST NOT be deleted!!!
* !!! Unless all of its clones are also deleted !!!
* mobjQ == Q of obj_refine_t objects to merge (may be NULL)
* only fields allowed to be revised will be checked
* even if other fields are set in this struct
*
* RETURNS:
* pointer to malloced clone obj_template_t
* NULL if malloc failer error or internal error
*********************************************************************/
extern obj_template_t *
obj_clone_template_case (ncx_module_t *mod,
obj_template_t *srcobj,
dlq_hdr_t *mobjQ);
/******************** obj_unique_t ********************/
/********************************************************************
* FUNCTION obj_new_unique
*
* Alloc and Init a obj_unique_t struct
*
* RETURNS:
* pointer to malloced struct or NULL if memory error
*********************************************************************/
extern obj_unique_t *
obj_new_unique (void);
/********************************************************************
* FUNCTION obj_init_unique
*
* Init a obj_unique_t struct
*
* INPUTS:
* un == obj_unique_t struct to init
*********************************************************************/
extern void
obj_init_unique (obj_unique_t *un);
/********************************************************************
* FUNCTION obj_free_unique
*
* Free a obj_unique_t struct
*
* INPUTS:
* un == obj_unique_t struct to free
*********************************************************************/
extern void
obj_free_unique (obj_unique_t *un);
/********************************************************************
* FUNCTION obj_clean_unique
*
* Clean a obj_unique_t struct
*
* INPUTS:
* un == obj_unique_t struct to clean
*********************************************************************/
extern void
obj_clean_unique (obj_unique_t *un);
/********************************************************************
* FUNCTION obj_new_unique_comp
*
* Alloc and Init a obj_unique_comp_t struct
*
* RETURNS:
* pointer to malloced struct or NULL if memory error
*********************************************************************/
extern obj_unique_comp_t *
obj_new_unique_comp (void);
/********************************************************************
* FUNCTION obj_free_unique_comp
*
* Free a obj_unique_comp_t struct
*
* INPUTS:
* unc == obj_unique_comp_t struct to free
*********************************************************************/
extern void
obj_free_unique_comp (obj_unique_comp_t *unc);
/********************************************************************
* FUNCTION obj_find_unique
*
* Find a specific unique-stmt
*
* INPUTS:
* que == queue of obj_unique_t to check
* xpath == relative path expression for the
* unique node to find
*
* RETURNS:
* pointer to found entry or NULL if not found
*********************************************************************/
extern obj_unique_t *
obj_find_unique (dlq_hdr_t *que,
const xmlChar *xpath);
/********************************************************************
* FUNCTION obj_first_unique
*
* Get the first unique-stmt for a list
*
* INPUTS:
* listobj == (list) object to check for unique structs
*
* RETURNS:
* pointer to found entry or NULL if not found
*********************************************************************/
extern obj_unique_t *
obj_first_unique (obj_template_t *listobj);
/********************************************************************
* FUNCTION obj_next_unique
*
* Get the next unique-stmt for a list
*
* INPUTS:
* un == current unique node
*
* RETURNS:
* pointer to found entry or NULL if not found
*********************************************************************/
extern obj_unique_t *
obj_next_unique (obj_unique_t *un);
/********************************************************************
* FUNCTION obj_first_unique_comp
*
* Get the first identifier in a unique-stmt for a list
*
* INPUTS:
* un == unique struct to check
*
* RETURNS:
* pointer to found entry or NULL if not found
*********************************************************************/
extern obj_unique_comp_t *
obj_first_unique_comp (obj_unique_t *un);
/********************************************************************
* FUNCTION obj_next_unique_comp
*
* Get the next unique-stmt component for a list
*
* INPUTS:
* uncomp == current unique component node
*
* RETURNS:
* pointer to next entry or NULL if none
*********************************************************************/
extern obj_unique_comp_t *
obj_next_unique_comp (obj_unique_comp_t *uncomp);
/********************************************************************
* FUNCTION obj_new_key
*
* Alloc and Init a obj_key_t struct
*
* RETURNS:
* pointer to malloced struct or NULL if memory error
*********************************************************************/
extern obj_key_t *
obj_new_key (void);
/********************************************************************
* FUNCTION obj_free_key
*
* Free a obj_key_t struct
*
* INPUTS:
* key == obj_key_t struct to free
*********************************************************************/
extern void
obj_free_key (obj_key_t *key);
/********************************************************************
* FUNCTION obj_find_key
*
* Find a specific key component by key leaf identifier name
* Assumes deep keys are not supported!!!
*
* INPUTS:
* que == Q of obj_key_t to check
* keycompname == key component name to find
*
* RETURNS:
* pointer to found key component or NULL if not found
*********************************************************************/
extern obj_key_t *
obj_find_key (dlq_hdr_t *que,
const xmlChar *keycompname);
/********************************************************************
* FUNCTION obj_find_key2
*
* Find a specific key component, check for a specific node
* in case deep keys are supported, and to check for duplicates
*
* INPUTS:
* que == Q of obj_key_t to check
* keyobj == key component object to find
*
* RETURNS:
* pointer to found key component or NULL if not found
*********************************************************************/
extern obj_key_t *
obj_find_key2 (dlq_hdr_t *que,
obj_template_t *keyobj);
/********************************************************************
* FUNCTION obj_first_key
*
* Get the first key record
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to first key component or NULL if not found
*********************************************************************/
extern obj_key_t *
obj_first_key (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_first_ckey
*
* Get the first key record: Const version
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to first key component or NULL if not found
*********************************************************************/
extern const obj_key_t *
obj_first_ckey (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_next_key
*
* Get the next key record
*
* INPUTS:
* objkey == current key record
*
* RETURNS:
* pointer to next key component or NULL if not found
*********************************************************************/
extern obj_key_t *
obj_next_key (obj_key_t *objkey);
/********************************************************************
* FUNCTION obj_next_ckey
*
* Get the next key record: Const version
*
* INPUTS:
* objkey == current key record
*
* RETURNS:
* pointer to next key component or NULL if not found
*********************************************************************/
extern const obj_key_t *
obj_next_ckey (const obj_key_t *objkey);
/********************************************************************
* FUNCTION obj_key_count
*
* Get the number of keys for this object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* number of keys in the obj_key_t Q
*********************************************************************/
extern uint32
obj_key_count (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_key_count_to_root
*
* Check ancestor-or-self nodes until root reached
* Find all lists; Count the number of keys
*
* INPUTS:
* obj == object to start check from
* RETURNS:
* number of keys in ancestor-or-self nodes
*********************************************************************/
extern uint32
obj_key_count_to_root (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_traverse_keys
*
* Check ancestor-or-self nodes until root reached
* Find all lists; For each list, starting with the
* closest to root, invoke the callback function
* for each of the key objects in order
*
* INPUTS:
* obj == object to start check from
* cookie1 == cookie1 to pass to the callback function
* cookie2 == cookie2 to pass to the callback function
* walkerfn == walker callback function
* returns FALSE to terminate traversal
*
*********************************************************************/
extern void
obj_traverse_keys (obj_template_t *obj,
void *cookie1,
void *cookie2,
obj_walker_fn_t walkerfn);
/********************************************************************
* FUNCTION obj_any_rpcs
*
* Check if there are any RPC methods in the datadefQ
*
* INPUTS:
* que == Q of obj_template_t to check
*
* RETURNS:
* TRUE if any OBJ_TYP_RPC found, FALSE if not
*********************************************************************/
extern boolean
obj_any_rpcs (const dlq_hdr_t *datadefQ);
/********************************************************************
* FUNCTION obj_any_notifs
*
* Check if there are any notifications in the datadefQ
*
* INPUTS:
* que == Q of obj_template_t to check
*
* RETURNS:
* TRUE if any OBJ_TYP_NOTIF found, FALSE if not
*********************************************************************/
extern boolean
obj_any_notifs (const dlq_hdr_t *datadefQ);
/********************************************************************
* FUNCTION obj_new_deviate
*
* Malloc and initialize the fields in a an object deviate statement
*
* RETURNS:
* pointer to the malloced and initialized struct or NULL if an error
*********************************************************************/
extern obj_deviate_t *
obj_new_deviate (void);
/********************************************************************
* FUNCTION obj_free_deviate
*
* Clean and free an object deviate statement
*
* INPUTS:
* deviate == pointer to the struct to clean and free
*********************************************************************/
extern void
obj_free_deviate (obj_deviate_t *deviate);
/********************************************************************
* FUNCTION obj_get_deviate_arg
*
* Get the deviate-arg string from its enumeration
*
* INPUTS:
* devarg == enumeration to convert
* RETURNS:
* const string version of the enum
*********************************************************************/
extern const xmlChar *
obj_get_deviate_arg (obj_deviate_arg_t devarg);
/********************************************************************
* FUNCTION obj_new_deviation
*
* Malloc and initialize the fields in a an object deviation statement
*
* RETURNS:
* pointer to the malloced and initialized struct or NULL if an error
*********************************************************************/
extern obj_deviation_t *
obj_new_deviation (void);
/********************************************************************
* FUNCTION obj_free_deviation
*
* Clean and free an object deviation statement
*
* INPUTS:
* deviation == pointer to the struct to clean and free
*********************************************************************/
extern void
obj_free_deviation (obj_deviation_t *deviation);
/********************************************************************
* FUNCTION obj_clean_deviationQ
*
* Clean and free an Q of object deviation statements
*
* INPUTS:
* deviationQ == pointer to Q of the structs to clean and free
*********************************************************************/
extern void
obj_clean_deviationQ (dlq_hdr_t *deviationQ);
/********************************************************************
* FUNCTION obj_gen_object_id
*
* Malloc and Generate the object ID for an object node
*
* INPUTS:
* obj == node to generate the instance ID for
* buff == pointer to address of buffer to use
*
* OUTPUTS
* *buff == malloced buffer with the instance ID
*
* RETURNS:
* status
*********************************************************************/
extern status_t
obj_gen_object_id (const obj_template_t *obj,
xmlChar **buff);
/********************************************************************
* Malloc and Generate the object ID for an object node
* Remove all conceptual OBJ_TYP_CHOICE and OBJ_TYP_CASE nodes
* so the resulting string will represent the structure of the
* value tree for XPath searching
*
* \param obj the node to generate the instance ID for
* \param buff the pointer to address of buffer to use
* \return status
*********************************************************************/
extern status_t
obj_gen_object_id_xpath (const obj_template_t *obj,
xmlChar **buff);
/********************************************************************
* Malloc and Generate the object ID for a unique-stmt test
*
* \param obj the node to generate the instance ID for
* \param stopobj the ancestor node to stop at
* \param buff the pointer to address of buffer to use
* \return status
*********************************************************************/
extern status_t obj_gen_object_id_unique (const obj_template_t *obj,
const obj_template_t *stopobj,
xmlChar **buff);
/********************************************************************
* FUNCTION obj_gen_object_id_code
*
* Malloc and Generate the object ID for an object node
* for C code usage
* generate a unique name for C code; handles augments
*
* INPUTS:
* mod == current module in progress
* obj == node to generate the instance ID for
* buff == pointer to address of buffer to use
*
* OUTPUTS
* *buff == malloced buffer with the instance ID
*
* RETURNS:
* status
*********************************************************************/
extern status_t
obj_gen_object_id_code (ncx_module_t *mod,
const obj_template_t *obj,
xmlChar **buff);
/********************************************************************
* FUNCTION obj_copy_object_id
*
* Generate the object ID for an object node and copy to the buffer
* copy an object ID to a buffer
*
* INPUTS:
* obj == node to generate the instance ID for
* buff == buffer to use
* bufflen == size of buff
* reallen == address of return length of actual identifier
* (may be NULL)
*
* OUTPUTS
* buff == filled in with the object ID
* if reallen not NULL:
* *reallen == length of identifier, even if error occurred
*
* RETURNS:
* status
*********************************************************************/
extern status_t
obj_copy_object_id (const obj_template_t *obj,
xmlChar *buff,
uint32 bufflen,
uint32 *reallen);
/********************************************************************
* FUNCTION obj_copy_object_id_mod
*
* Generate the object ID for an object node and copy to the buffer
* copy an object ID to a buffer; Use modname in object identifier
*
* INPUTS:
* obj == node to generate the instance ID for
* buff == buffer to use
* bufflen == size of buff
* reallen == address of return length of actual identifier
* (may be NULL)
*
* OUTPUTS
* buff == filled in with the object ID
* if reallen not NULL:
* *reallen == length of identifier, even if error occurred
*
* RETURNS:
* status
*********************************************************************/
extern status_t
obj_copy_object_id_mod (const obj_template_t *obj,
xmlChar *buff,
uint32 bufflen,
uint32 *reallen);
/********************************************************************
* FUNCTION obj_gen_aughook_id
*
* Malloc and Generate the augment hook element name for
* the specified object. This will be a child node of the
* specified object.
*
* INPUTS:
* obj == node to generate the augment hook ID for
* buff == pointer to address of buffer to use
*
* OUTPUTS
* *buff == malloced buffer with the instance ID
*
* RETURNS:
* status
*********************************************************************/
extern status_t
obj_gen_aughook_id (const obj_template_t *obj,
xmlChar **buff);
/********************************************************************
* FUNCTION obj_get_name
*
* Get the name field for this obj
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* pointer to the name field, NULL if some error or unnamed
*********************************************************************/
extern const xmlChar *
obj_get_name (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_set_name
*
* Set the name field for this obj
*
* INPUTS:
* obj == the specific object to set or change the name
* objname == new name string to use
*
* RETURNS:
* status
*********************************************************************/
extern status_t
obj_set_name (obj_template_t *obj,
const xmlChar *objname);
/********************************************************************
* FUNCTION obj_has_name
*
* Check if the specified object type has a name
*
* this function is used throughout the code to
* filter out uses and augment nodes from the
* real nodes. Those are the only YANG nodes that
* do not have a name assigned to them
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* TRUE if obj has a name
* FALSE otherwise
*********************************************************************/
extern boolean
obj_has_name (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_has_text_content
*
* Check if the specified object type has a text content
* for XPath purposes
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* TRUE if obj has text content
* FALSE otherwise
*********************************************************************/
extern boolean
obj_has_text_content (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_status
*
* Get the status field for this obj
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* YANG status clause for this object
*********************************************************************/
extern ncx_status_t
obj_get_status (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_description
*
* Get the description field for this obj
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* YANG description string for this object
*********************************************************************/
extern const xmlChar *
obj_get_description (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_alt_description
*
* Get the alternate description field for this obj
* Check if any 'info', then 'help' appinfo nodes present
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* YANG description string for this object
*********************************************************************/
extern const xmlChar *
obj_get_alt_description (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_description_addr
*
* Get the address of the description field for this obj
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* YANG description string for this object
*********************************************************************/
extern const void *
obj_get_description_addr (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_reference
*
* Get the reference field for this obj
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* YANG reference string for this object
*********************************************************************/
extern const xmlChar *
obj_get_reference (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_reference_addr
*
* Get the reference field for this obj
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* YANG reference string for this object
*********************************************************************/
extern const void *
obj_get_reference_addr (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_config
*
* Get the config flag for an obj_template_t
* Return the explicit value or the inherited value
* Also return if the config-stmt is really set or not
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if config set to TRUE
* FALSE if config set to FALSE
*
*********************************************************************/
#define obj_is_config obj_get_config_flag_deep
/********************************************************************
* FUNCTION obj_get_config_flag
*
* Get the config flag for an obj_template_t
* Return the explicit value or the inherited value
* Also return if the config-stmt is really set or not
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if config set to TRUE
* FALSE if config set to FALSE
*
*********************************************************************/
extern boolean
obj_get_config_flag (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_config_flag2
*
* Get the config flag for an obj_template_t
* Return the explicit value or the inherited value
* Also return if the config-stmt is really set or not
*
* INPUTS:
* obj == obj_template to check
* setflag == address of return config-stmt set flag
*
* OUTPUTS:
* *setflag == TRUE if the config-stmt is set in this
* node, or if it is a top-level object
* == FALSE if the config-stmt is inherited from its parent
*
* RETURNS:
* TRUE if config set to TRUE
* FALSE if config set to FALSE
*
*********************************************************************/
extern boolean
obj_get_config_flag2 (const obj_template_t *obj,
boolean *setflag);
/********************************************************************
* FUNCTION obj_get_max_access
*
* Get the NCX max-access enum for an obj_template_t
* Return the explicit value or the inherited value
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* ncx_access_t enumeration
*********************************************************************/
extern ncx_access_t
obj_get_max_access (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_appinfoQ
*
* Get the appinfoQ for this obj
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* pointer to the appinfoQ for this object
*********************************************************************/
extern dlq_hdr_t *
obj_get_appinfoQ (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_mustQ
*
* Get the mustQ for this obj
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* pointer to the mustQ for this object
*********************************************************************/
extern dlq_hdr_t *
obj_get_mustQ (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_typestr
*
* Get the name of the object type
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* name string for this object type
*********************************************************************/
extern const xmlChar *
obj_get_typestr (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_datadefQ
*
* Get the datadefQ (or caseQ) if this object has one
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to Q of obj_template, or NULL if none
*********************************************************************/
extern dlq_hdr_t *
obj_get_datadefQ (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_cdatadefQ
*
* Get a const pointer to the datadefQ (or caseQ) if this object has one
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to Q of obj_template, or NULL if none
*********************************************************************/
extern const dlq_hdr_t *
obj_get_cdatadefQ (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_default
*
* Get the default value for the specified object
* Only OBJ_TYP_LEAF objtype is supported
* If the leaf has nodefault, then the type is checked
* Choice defaults are ignored.
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to default value string or NULL if none
*********************************************************************/
extern const xmlChar *
obj_get_default (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_default_case
*
* Get the default case for the specified OBJ_TYP_CHOICE object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to default case object template OBJ_TYP_CASE
*********************************************************************/
extern obj_template_t *
obj_get_default_case (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_level
*
* Get the nest level for the specified object
* Top-level is '1'
* Does not count groupings as a level
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* level that this object is located, by checking the parent chain
*********************************************************************/
extern uint32
obj_get_level (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_has_typedefs
*
* Check if the object has any nested typedefs in it
* This will obly be called if the object is defined in a
* grouping.
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if any nested typedefs, FALSE otherwise
*********************************************************************/
extern boolean
obj_has_typedefs (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_typdef
*
* Get the typdef for the leaf or leaf-list
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to the typdef or NULL if this object type does not
* have a typdef
*********************************************************************/
extern typ_def_t *
obj_get_typdef (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_ctypdef
*
* Get the typdef for the leaf or leaf-list : Const version
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to the typdef or NULL if this object type does not
* have a typdef
*********************************************************************/
extern const typ_def_t *
obj_get_ctypdef (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_basetype
*
* Get the NCX base type enum for the object type
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* base type enumeration
*********************************************************************/
extern ncx_btype_t
obj_get_basetype (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_mod_prefix
*
* Get the module prefix for this object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* const pointer to mod prefix
*********************************************************************/
extern const xmlChar *
obj_get_mod_prefix (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_mod_xmlprefix
*
* Get the module prefix for this object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* const pointer to mod XML prefix
*********************************************************************/
extern const xmlChar *
obj_get_mod_xmlprefix (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_mod_name
*
* Get the module name for this object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* const pointer to mod prefix
*********************************************************************/
extern const xmlChar *
obj_get_mod_name (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_mod
*
* Get the module pointer for this object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to module
*********************************************************************/
extern ncx_module_t *
obj_get_mod (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_mod_version
*
* Get the module version for this object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* const pointer to mod version or NULL if none
*********************************************************************/
extern const xmlChar *
obj_get_mod_version (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_type_name
*
* Get the typename for an object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* const pointer to type name string
*********************************************************************/
extern const xmlChar *
obj_get_type_name (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_nsid
*
* Get the namespace ID for this object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* namespace ID
*********************************************************************/
extern xmlns_id_t
obj_get_nsid (const obj_template_t *);
/********************************************************************
* FUNCTION obj_get_iqualval
*
* Get the instance qualifier for this object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* instance qualifier enumeration
*********************************************************************/
extern ncx_iqual_t
obj_get_iqualval (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_iqualval_ex
*
* Get the instance qualifier for this object
*
* INPUTS:
* obj == object to check
* required == value to use for 'is_mandatory()' logic
*
* RETURNS:
* instance qualifier enumeration
*********************************************************************/
extern ncx_iqual_t
obj_get_iqualval_ex (obj_template_t *obj,
boolean required);
/********************************************************************
* FUNCTION obj_get_min_elements
*
* Get the min-elements clause for this object, if any
*
* INPUTS:
* obj == object to check
* minelems == address of return min-elements value
*
* OUTPUTS:
* *minelems == min-elements value if it is set for this object
*
* RETURNS:
* TRUE if min-elements is set, FALSE if not or N/A
*********************************************************************/
extern boolean
obj_get_min_elements (obj_template_t *obj,
uint32 *minelems);
/********************************************************************
* FUNCTION obj_get_max_elements
*
* Get the max-elements clause for this object, if any
*
* INPUTS:
* obj == object to check
* maxelems == address of return max-elements value
*
* OUTPUTS:
* *maxelems == max-elements value if it is set for this object
*
* RETURNS:
* TRUE if max-elements is set, FALSE if not or N/A
*********************************************************************/
extern boolean
obj_get_max_elements (obj_template_t *obj,
uint32 *maxelems);
/********************************************************************
* FUNCTION obj_get_units
*
* Get the units clause for this object, if any
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to units clause, or NULL if none
*********************************************************************/
extern const xmlChar *
obj_get_units (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_parent
*
* Get the parent of the current object
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to the parent of this object or NULL if none
*********************************************************************/
extern obj_template_t *
obj_get_parent (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_cparent
*
* Get the parent of the current object
* CONST POINTER VERSION
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to the parent of this object or NULL if none
*********************************************************************/
extern const obj_template_t *
obj_get_cparent (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_real_parent
*
* Get the parent of the current object;
* skip OBJ_TYP_CHOICE and OBJ_TYP_CASE
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to the parent of this object or NULL if none
*********************************************************************/
extern obj_template_t *
obj_get_real_parent (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_presence_string
*
* Get the present-stmt value, if any
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* pointer to string
* NULL if none
*********************************************************************/
extern const xmlChar *
obj_get_presence_string (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_presence_string_field
*
* Get the address ot the presence-stmt value, if any
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* pointer to address of presence string
* NULL if none
*********************************************************************/
extern void *
obj_get_presence_string_field (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_child_node
*
* Get the correct child node for the specified parent and
* current XML node
* complex logic for finding the right module namespace
* and child node, given the current context
*
*
* INPUTS:
* obj == parent object template
* chobj == current child node (may be NULL if the
* xmlorder param is FALSE
* xmlorder == TRUE if should follow strict XML element order
* == FALSE if sibling node order errors should be
* ignored; find child nodes out of order
* and check too-many-instances later
* curnode == current XML start or empty node to check
* force_modQ == Q of ncx_module_t to check, if set
* == NULL and the xmlns registry of module pointers
* will be used instead (except netconf.yang)
* rettop == address of return topchild object
* retobj == address of return object to use
*
* OUTPUTS:
* *rettop set to top-level found object if return OK
* and currently within a choice
* *retobj set to found object if return OK
*
* RETURNS:
* status
*********************************************************************/
extern status_t
obj_get_child_node (obj_template_t *obj,
obj_template_t *chobj,
const xml_node_t *curnode,
boolean xmlorder,
dlq_hdr_t *force_modQ,
obj_template_t **rettop,
obj_template_t **retobj);
/********************************************************************
* FUNCTION obj_get_child_count
*
* Get the number of child nodes the object has
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* number of child nodes
*********************************************************************/
extern uint32
obj_get_child_count (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_default_parm
*
* Get the ncx:default-parm object for this object
* Only supported for OBJ_TYP_CONTAINER and OBJ_TYP_RPCIO (input)
*
* INPUTS:
* obj == the specific object to check
*
* RETURNS:
* pointer to the name field, NULL if some error or unnamed
*********************************************************************/
extern obj_template_t *
obj_get_default_parm (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_config_flag_deep
*
* get config flag during augment expand
* Get the config flag for an obj_template_t
* Go all the way up the tree until an explicit
* set node or the root is found
*
* Used by get_list_key because the config flag
* of the parent is not set yet when a key leaf is expanded
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if config set to TRUE
* FALSE if config set to FALSE
*********************************************************************/
extern boolean
obj_get_config_flag_deep (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_config_flag_check
*
* get config flag during YANG module checking
* Used by yang_obj.c to make sure ncx:root objects
* are not treated as 'config', like obj_get_config_deep
*
* INPUTS:
* obj == obj_template to check
* ingrp == address if in grouping flag
*
* OUTPUTS:
* *ingrp == TRUE if hit grouping top without finding
* a definitive answer
* RETURNS:
* TRUE if config set to TRUE
* FALSE if config set to FALSE
* !!! ignore if *ingrp == TRUE
*********************************************************************/
extern boolean
obj_get_config_flag_check (const obj_template_t *obj,
boolean *ingrp);
/********************************************************************
* FUNCTION obj_get_fraction_digits
*
* Get the fraction-digits field from the object typdef
*
* INPUTS:
* obj == object template to check
*
* RETURNS:
* number of fixed decimal digits expected (1..18)
* 0 if some error
*********************************************************************/
extern uint8
obj_get_fraction_digits (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_first_iffeature
*
* Get the first if-feature clause (if any) for the specified object
*
* INPUTS:
* obj == object template to check
*
* RETURNS:
* pointer to first if-feature struct
* NULL if none available
*********************************************************************/
extern const ncx_iffeature_t *
obj_get_first_iffeature (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_next_iffeature
*
* Get the next if-feature clause (if any)
*
* INPUTS:
* iffeature == current iffeature struct
*
* RETURNS:
* pointer to next if-feature struct
* NULL if none available
*********************************************************************/
extern const ncx_iffeature_t *
obj_get_next_iffeature (const ncx_iffeature_t *iffeature);
/********************************************************************
* FUNCTION obj_is_leaf
*
* Check if object is a proper leaf
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if proper leaf
* FALSE if not
*********************************************************************/
extern boolean
obj_is_leaf (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_leafy
*
* Check if object is a proper leaf or leaflist
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if proper leaf or leaf-list
* FALSE if not
*********************************************************************/
extern boolean
obj_is_leafy (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_mandatory
*
* Figure out if the obj is YANG mandatory or not
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is mandatory
* FALSE if object is not mandatory
*********************************************************************/
extern boolean
obj_is_mandatory (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_mandatory_when_ex
*
* Figure out if the obj is YANG mandatory or not
* Check the when-stmts, not just mandatory-stmt
*
* INPUTS:
* obj == obj_template to check
* config_only == TRUE to check config only and ignore non-config
* == FALSE to check mandatory confoig or non-config
* RETURNS:
* TRUE if object is mandatory
* FALSE if object is not mandatory
*********************************************************************/
extern boolean
obj_is_mandatory_when_ex (obj_template_t *obj,
boolean config_only);
/********************************************************************
* FUNCTION obj_is_mandatory_when
*
* Figure out if the obj is YANG mandatory or not
* Check the when-stmts, not just mandatory-stmt
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is mandatory
* FALSE if object is not mandatory
*********************************************************************/
extern boolean
obj_is_mandatory_when (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_cloned
*
* Figure out if the obj is a cloned object, inserted via uses
* or augment statements
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is cloned
* FALSE if object is not cloned
*********************************************************************/
extern boolean
obj_is_cloned (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_augclone
*
* Figure out if the obj is a cloned object, inserted via an
* augment statement
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is sourced from an augment
* FALSE if object is not sourced from an augment
*********************************************************************/
extern boolean
obj_is_augclone (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_refine
*
* Figure out if the obj is a refinement object, within a uses-stmt
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is a refinement
* FALSE if object is not a refinement
*********************************************************************/
extern boolean
obj_is_refine (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_data
*
* Check if the object is defined within data or within a
* notification or RPC instead
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if data object (could be in a grouping or real data)
* FALSE if defined within notification or RPC (or some error)
*********************************************************************/
extern boolean
obj_is_data (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_data_db
*
* Check if the object is some sort of data
* Constrained to only check the config DB objects,
* not any notification or RPC objects
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if data object (could be in a grouping or real data)
* FALSE if defined within notification or RPC (or some error)
*********************************************************************/
extern boolean
obj_is_data_db (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_in_rpc
*
* Check if the object is in an rpc/input section
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if /rpc/input object
* FALSE otherwise
*********************************************************************/
extern boolean
obj_in_rpc (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_in_rpc_reply
*
* Check if the object is in an rpc-reply/output section
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if /rpc-reply/output object
* FALSE otherwise
*********************************************************************/
extern boolean
obj_in_rpc_reply (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_in_notif
*
* Check if the object is in a notification
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if /notification object
* FALSE otherwise
*********************************************************************/
extern boolean
obj_in_notif (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_rpc
*
* Check if the object is an RPC method
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if RPC method
* FALSE if not an RPC method
*********************************************************************/
extern boolean
obj_is_rpc (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_notif
*
* Check if the object is a notification
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* TRUE if notification
* FALSE if not
*********************************************************************/
extern boolean
obj_is_notif (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_empty
*
* Check if object was entered in empty fashion:
* list foo;
* uses grpx;
*
** INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is empty of subclauses
* FALSE if object is not empty of subclauses
*********************************************************************/
extern boolean
obj_is_empty (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_match
*
* Check if one object is a match in identity with another one
*
* INPUTS:
* obj1 == first object to match
* obj2 == second object to match
*
* RETURNS:
* TRUE is a match, FALSE otherwise
*********************************************************************/
extern boolean
obj_is_match (const obj_template_t *obj1,
const obj_template_t *obj2);
/********************************************************************
* FUNCTION obj_is_hidden
*
* Check if object is marked as a hidden object
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:hidden
* FALSE if not
*********************************************************************/
extern boolean
obj_is_hidden (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_root
*
* Check if object is marked as a root object
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:root
* FALSE if not
*********************************************************************/
extern boolean
obj_is_root (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_password
*
* Check if object is marked as a password object
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:password
* FALSE if not
*********************************************************************/
extern boolean
obj_is_password (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_xsdlist
*
* Check if object is marked as an XSD list
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:xsdlist
* FALSE if not
*********************************************************************/
extern boolean
obj_is_xsdlist (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_cli
*
* Check if object is marked as a CLI object
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:cli
* FALSE if not
*********************************************************************/
extern boolean
obj_is_cli (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_key
*
* Check if object is being used as a key leaf within a list
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is a key leaf
* FALSE if not
*********************************************************************/
extern boolean
obj_is_key (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_abstract
*
* Check if object is being used as an object identifier or error-info
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:abstract
* FALSE if not
*********************************************************************/
extern boolean
obj_is_abstract (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_xpath_string
*
* Check if object is an XPath string
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:xpath
* FALSE if not
*********************************************************************/
extern boolean
obj_is_xpath_string (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_schema_instance_string
*
* Check if object is a schema-instance string
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:schema-instance
* FALSE if not
*********************************************************************/
extern boolean
obj_is_schema_instance_string (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_secure
*
* Check if object is tagged ncx:secure
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:secure
* FALSE if not
*********************************************************************/
extern boolean
obj_is_secure (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_very_secure
*
* Check if object is tagged ncx:very-secure
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:very-secure
* FALSE if not
*********************************************************************/
extern boolean
obj_is_very_secure (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_system_ordered
*
* Check if the object is system or user-ordered
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is system ordered
* FALSE if object is user-ordered
*********************************************************************/
extern boolean
obj_is_system_ordered (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_np_container
*
* Check if the object is an NP-container
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is an NP-container
* FALSE if object is not an NP-container
*********************************************************************/
extern boolean
obj_is_np_container (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_enabled
*
* Check any if-feature statement that may
* cause the specified object to be invisible
*
* INPUTS:
* obj == obj_template_t to check
* RETURNS:
* TRUE if object is enabled
* FALSE if any if-features are present and FALSE
*********************************************************************/
extern boolean
obj_is_enabled (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_single_instance
*
* Check if the object is a single instance of if it
* allows multiple instances; check all of the
* ancestors if needed
*
* INPUTS:
* obj == object template to check
* RETURNS:
* TRUE if object is a single instance object
* FALSE if multiple instances are allowed
*********************************************************************/
extern boolean
obj_is_single_instance (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_short_case
*
* Check if the object is a short case statement
*
* INPUTS:
* obj == object template to check
*
* RETURNS:
* TRUE if object is a 1 object case statement
* FALSE otherwise
*********************************************************************/
extern boolean
obj_is_short_case (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_top
*
* Check if the object is top-level object within
* the YANG module that defines it
*
* INPUTS:
* obj == object template to check
*
* RETURNS:
* TRUE if obj is a top-level object
* FALSE otherwise
*********************************************************************/
extern boolean
obj_is_top (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_ok_for_cli
*
* Figure out if the obj is OK for current CLI implementation
* Top object must be a container
* Child objects must be only choices of leafs,
* plain leafs, or leaf lists are allowed
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is OK for CLI
* FALSE if object is not OK for CLI
*********************************************************************/
extern boolean
obj_ok_for_cli (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_has_children
*
* Check if there are any accessible nodes within the object
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if there are any accessible children
* FALSE if no datadb child nodes found
*********************************************************************/
extern boolean
obj_has_children (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_has_ro_children
*
* Check if there are any accessible read-only nodes within the object
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if there are any accessible read-only children
* FALSE if no datadb read-only child nodes found
*********************************************************************/
extern boolean
obj_has_ro_children (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_rpc_has_input
*
* Check if the RPC object has any real input children
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if there are any input children
* FALSE otherwise
*********************************************************************/
extern boolean
obj_rpc_has_input (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_rpc_has_output
*
* Check if the RPC object has any real output children
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if there are any output children
* FALSE otherwise
*********************************************************************/
extern boolean
obj_rpc_has_output (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_has_when_stmts
*
* Check if any when-stmts apply to this object
* Does not check if they are true, just any when-stmts present
*
* INPUTS:
* obj == object template to check
*
* RETURNS:
* TRUE if object has any when-stmts associated with it
* FALSE otherwise
*********************************************************************/
extern boolean
obj_has_when_stmts (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_new_metadata
*
* Malloc and initialize the fields in a an obj_metadata_t
*
* INPUTS:
* isreal == TRUE if this is for a real object
* == FALSE if this is a cloned object
*
* RETURNS:
* pointer to the malloced and initialized struct or NULL if an error
*********************************************************************/
extern obj_metadata_t *
obj_new_metadata (void);
/********************************************************************
* FUNCTION obj_free_metadata
*
* Scrub the memory in a obj_metadata_t by freeing all
* the sub-fields and then freeing the entire struct itself
* The struct must be removed from any queue it is in before
* this function is called.
*
* INPUTS:
* meta == obj_metadata_t data structure to free
*********************************************************************/
extern void
obj_free_metadata (obj_metadata_t *meta);
/********************************************************************
* FUNCTION obj_add_metadata
*
* Add the filled out object metadata definition to the object
*
* INPUTS:
* meta == obj_metadata_t data structure to add
* obj == object template to add meta to
*
* RETURNS:
* status
*********************************************************************/
extern status_t
obj_add_metadata (obj_metadata_t *meta,
obj_template_t *obj);
/********************************************************************
* FUNCTION obj_find_metadata
*
* Find the object metadata definition in the object
*
* INPUTS:
* obj == object template to check
* name == name of obj_metadata_t data structure to find
*
* RETURNS:
* pointer to found entry, NULL if not found
*********************************************************************/
extern obj_metadata_t *
obj_find_metadata (const obj_template_t *obj,
const xmlChar *name);
/********************************************************************
* FUNCTION obj_first_metadata
*
* Get the first object metadata definition in the object
*
* INPUTS:
* obj == object template to check
*
* RETURNS:
* pointer to first entry, NULL if none
*********************************************************************/
extern obj_metadata_t *
obj_first_metadata (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_next_metadata
*
* Get the next object metadata definition in the object
*
* INPUTS:
* meta == current meta object template
*
* RETURNS:
* pointer to next entry, NULL if none
*********************************************************************/
extern obj_metadata_t *
obj_next_metadata (const obj_metadata_t *meta);
/********************************************************************
* FUNCTION obj_sort_children
*
* Check all the child nodes of the specified object
* and rearrange them into alphabetical order,
* based on the element local-name.
*
* ONLY SAFE TO USE FOR ncx:cli CONTAINERS
* YANG DATA CONTENT ORDER NEEDS TO BE PRESERVED
*
* INPUTS:
* obj == object template to reorder
*********************************************************************/
extern void
obj_sort_children (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_set_ncx_flags
*
* Check the NCX appinfo extensions and set flags as needed
*
** INPUTS:
* obj == obj_template to check
*
* OUTPUTS:
* may set additional bits in the obj->flags field
*
*********************************************************************/
extern void
obj_set_ncx_flags (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_enabled_child_count
*
* Get the count of the number of enabled child nodes
* for the object template
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* number of enabled child nodes
*********************************************************************/
extern uint32
obj_enabled_child_count (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_dump_child_list
*
* Dump the object names in a datadefQ -- just child level
* uses log_debug for writing
*
* INPUTS:
* datadefQ == Q of obj_template_t to dump
* startindent == start-indent columns
* indent == indent amount
*********************************************************************/
extern void
obj_dump_child_list (dlq_hdr_t *datadefQ,
uint32 startindent,
uint32 indent);
/********************************************************************
* FUNCTION obj_get_keystr
*
* Get the key string for this list object
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* pointer to key string or NULL if none or not a list
*********************************************************************/
extern const xmlChar *
obj_get_keystr (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_delete_obsolete
*
* Delete any obsolete child nodes within the specified object subtree
*
* INPUTS:
* objQ == Q of obj_template to check
*
*********************************************************************/
extern void
obj_delete_obsolete (dlq_hdr_t *objQ);
/********************************************************************
* FUNCTION obj_get_altname
*
* Get the alt-name for this object, if any
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* pointer to alt-name of NULL if none
*********************************************************************/
extern const xmlChar *
obj_get_altname (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_get_leafref_targobj
*
* Get the target object for a leafref leaf or leaf-list
*
* INPUTS:
* obj == object to check
*
* RETURNS:
* pointer to the target object or NULL if this object type does not
* have a leafref target object
*********************************************************************/
extern obj_template_t *
obj_get_leafref_targobj (obj_template_t *obj);
/********************************************************************
* Get the target object for an augments object
* \param obj the object to check
* \return pointer to the augment context target object
* or NULL if this object type does not have an augment target object
*********************************************************************/
extern obj_template_t *
obj_get_augment_targobj (obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_cli_equals_ok
*
* Check if object is marked as ncx:default-parm-equals-ok
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:default-parm-equals-ok
* FALSE if not
*********************************************************************/
extern boolean
obj_is_cli_equals_ok (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_sil_delete_children_first
*
* Check if object is marked as ncx:sil-delete-children-first
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked as ncx:sil-delete-children-first
* FALSE if not
*********************************************************************/
extern boolean
obj_is_sil_delete_children_first (const obj_template_t *obj);
/********************************************************************
* Add a child object to the specified complex node
*
* \param child the obj_template to add
* \param parent the obj_template of the parent
*********************************************************************/
extern void
obj_add_child (obj_template_t *child, obj_template_t *parent);
/********************************************************************
* FUNCTION obj_is_block_user_create
*
* Check if object is marked as ncx:user-write with create
* access disabled
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked to block user create access
* FALSE if not
*********************************************************************/
extern boolean
obj_is_block_user_create (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_block_user_update
*
* Check if object is marked as ncx:user-write with update
* access disabled
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked to block user update access
* FALSE if not
*********************************************************************/
extern boolean
obj_is_block_user_update (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_is_block_user_delete
*
* Check if object is marked as ncx:user-write with delete
* access disabled
*
* INPUTS:
* obj == obj_template to check
*
* RETURNS:
* TRUE if object is marked to block user delete access
* FALSE if not
*********************************************************************/
extern boolean
obj_is_block_user_delete (const obj_template_t *obj);
/********************************************************************
* FUNCTION obj_new_iffeature_ptr
*
* Malloc and initialize a new obj_iffeature_ptr_t struct
*
* INPUTS:
* iff == iffeature to point at
* RETURNS:
* malloced struct or NULL if memory error
*********************************************************************/
extern obj_iffeature_ptr_t *
obj_new_iffeature_ptr (ncx_iffeature_t *iff);
/********************************************************************
* FUNCTION obj_free_iffeature_ptr
*
* Free an obj_iffeature_ptr_t struct
*
* INPUTS:
* iffptr == struct to free
*********************************************************************/
extern void obj_free_iffeature_ptr (obj_iffeature_ptr_t *iffptr);
/********************************************************************
* Get first if-feature pointer
*
* \param obj the obj_template to check
* \return pointer to first entry or NULL if none
*********************************************************************/
extern obj_iffeature_ptr_t *
obj_first_iffeature_ptr (obj_template_t *obj);
/********************************************************************
* Get the next if-feature pointer
*
* \param iffptr the current iffeature ptr struct
* \return pointer to next entry or NULL if none
*********************************************************************/
extern obj_iffeature_ptr_t *
obj_next_iffeature_ptr (obj_iffeature_ptr_t *iffptr);
/********************************************************************
* FUNCTION obj_new_xpath_ptr
*
* Malloc and initialize a new obj_xpath_ptr_t struct
*
* INPUTS:
* xpath == Xpath PCB to point at
* RETURNS:
* malloced struct or NULL if memory error
*********************************************************************/
extern obj_xpath_ptr_t *
obj_new_xpath_ptr (struct xpath_pcb_t_ *xpath);
/********************************************************************
* FUNCTION obj_free_xpath_ptr
*
* Free an obj_xpath_ptr_t struct
*
* INPUTS:
* xptr == struct to free
*********************************************************************/
extern void obj_free_xpath_ptr (obj_xpath_ptr_t *xptr);
/********************************************************************
* Get first xpath pointer struct
*
* \param obj the obj_template to check
* \return pointer to first entry or NULL if none
*********************************************************************/
extern obj_xpath_ptr_t *
obj_first_xpath_ptr (obj_template_t *obj);
/********************************************************************
* Get the next xpath pointer struct
*
* \param xptr the current xpath ptr struct
* \return pointer to next entry or NULL if none
*********************************************************************/
extern obj_xpath_ptr_t *
obj_next_xpath_ptr (obj_xpath_ptr_t *xptr);
#ifdef __cplusplus
} /* end extern 'C' */
#endif
#endif /* _H_obj */
|