libyang 5.7.1
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
Loading...
Searching...
No Matches
tree_schema.h
Go to the documentation of this file.
1
15
16#ifndef LY_TREE_SCHEMA_H_
17#define LY_TREE_SCHEMA_H_
18
19#include <stdint.h>
20#include <stdio.h>
21
22#include "log.h"
23#include "ly_config.h"
24#include "tree.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30struct ly_ctx;
31struct ly_path;
32struct ly_set;
33struct lys_module;
34struct lysc_node;
35struct lyxp_expr;
36
117
141
149
150/* *INDENT-OFF* */
151
180#define LYSC_TREE_DFS_BEGIN(START, ELEM) \
181 { ly_bool LYSC_TREE_DFS_continue = 0; struct lysc_node *LYSC_TREE_DFS_next; \
182 for ((ELEM) = (LYSC_TREE_DFS_next) = (struct lysc_node *)(START); \
183 (ELEM); \
184 (ELEM) = (LYSC_TREE_DFS_next), LYSC_TREE_DFS_continue = 0)
185
199#define LYSC_TREE_DFS_END(START, ELEM) \
200 /* select element for the next run - children first */ \
201 if (LYSC_TREE_DFS_continue) { \
202 (LYSC_TREE_DFS_next) = NULL; \
203 } else { \
204 (LYSC_TREE_DFS_next) = (struct lysc_node *)lysc_node_child(ELEM); \
205 } \
206 if (!(LYSC_TREE_DFS_next)) { \
207 /* no children, try siblings */ \
208 _LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \
209 } \
210 while (!(LYSC_TREE_DFS_next)) { \
211 /* parent is already processed, go to its sibling */ \
212 (ELEM) = (ELEM)->parent; \
213 _LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \
214 } }
215
219#define _LYSC_TREE_DFS_NEXT(START, ELEM, NEXT) \
220 if ((ELEM) == (struct lysc_node *)(START)) { \
221 /* we are done, no next element to process */ \
222 break; \
223 } \
224 (NEXT) = (ELEM)->next;
225
226/* *INDENT-ON* */
227
228#define LY_REV_SIZE 11
229
235#define LYS_UNKNOWN 0x0000
236#define LYS_CONTAINER 0x0001
237#define LYS_CHOICE 0x0002
238#define LYS_LEAF 0x0004
239#define LYS_LEAFLIST 0x0008
240#define LYS_LIST 0x0010
241#define LYS_ANYXML 0x0020
242#define LYS_ANYDATA 0x0060
243#define LYS_CASE 0x0080
244
245#define LYS_RPC 0x0100
246#define LYS_ACTION 0x0200
247#define LYS_NOTIF 0x0400
248
249#define LYS_USES 0x0800
250#define LYS_INPUT 0x1000
251#define LYS_OUTPUT 0x2000
252#define LYS_GROUPING 0x4000
253#define LYS_AUGMENT 0x8000
254
255#define LYS_NODETYPE_MASK 0xffff
257
264 const char *name;
265 const char *prefix;
266 const char *dsc;
267 const char *ref;
269 uint16_t flags;
271};
272
279 const char *name;
280 const char *dsc;
281 const char *ref;
287};
288
292struct lysp_ext {
293 const char *name;
294 const char *argname;
295 const char *dsc;
296 const char *ref;
298 uintptr_t plugin_ref;
299 uint16_t flags;
300};
301
306 const char *name;
311 const char *dsc;
312 const char *ref;
314 uint16_t flags;
316};
317
322 uint8_t *expr;
324};
325
330 const char *str;
331 const struct lysp_module *mod;
333 uint16_t flags;
335};
336
341 const char *name;
343 const char **bases;
344 const char *dsc;
345 const char *ref;
347 uint16_t flags;
348};
349
354#define LYSP_RESTR_PATTERN_ACK 0x06
355#define LYSP_RESTR_PATTERN_NACK 0x15
359 const char *emsg;
360 const char *eapptag;
361 const char *dsc;
362 const char *ref;
364};
365
371 const char *dsc;
372 const char *ref;
374};
375
380 const char *name;
381 const char *dsc;
382 const char *ref;
383 int64_t value;
386 uint16_t flags;
388};
389
395struct lysp_type {
396 const char *name;
402 struct lyxp_expr *path;
403 const char **bases;
404 struct lysp_type *types;
406
407 const struct lysp_module *pmod;
409
412 uint16_t flags;
413};
414
418struct lysp_tpdf {
419 const char *name;
420 const char *units;
422 const char *dsc;
423 const char *ref;
426 uint16_t flags;
427};
428
432struct lysp_when {
433 const char *cond;
434 const char *dsc;
435 const char *ref;
437};
438
443 const char *nodeid;
444 const char *dsc;
445 const char *ref;
448 const char *presence;
450 uint32_t min;
451 uint32_t max;
453 uint16_t flags;
454};
455
464#define LYS_DEV_NOT_SUPPORTED 1
465#define LYS_DEV_ADD 2
466#define LYS_DEV_DELETE 3
467#define LYS_DEV_REPLACE 4
469
474 uint8_t mod;
477};
478
480 uint8_t mod;
483 const char *units;
487 uint16_t flags;
488 uint32_t min;
489 uint32_t max;
490};
491
493 uint8_t mod;
496 const char *units;
500};
501
503 uint8_t mod;
506 struct lysp_type *type;
507 const char *units;
509 uint16_t flags;
510 uint32_t min;
511 uint32_t max;
512};
513
515 const char *nodeid;
516 const char *dsc;
517 const char *ref;
520};
521
583
637
645#define LYS_CONFIG_W 0x01
646#define LYS_CONFIG_R 0x02
647#define LYS_CONFIG_MASK 0x03
648#define LYS_STATUS_CURR 0x04
649#define LYS_STATUS_DEPRC 0x08
650#define LYS_STATUS_OBSLT 0x10
651#define LYS_STATUS_MASK 0x1C
652#define LYS_MAND_TRUE 0x20
657#define LYS_MAND_FALSE 0x40
660#define LYS_MAND_MASK 0x60
661#define LYS_PRESENCE 0x80
664#define LYS_UNIQUE 0x80
665#define LYS_KEY 0x0100
666#define LYS_KEYLESS 0x0200
667#define LYS_DISABLED 0x0100
668#define LYS_FENABLED 0x20
669#define LYS_ORDBY_SYSTEM 0x80
671#define LYS_ORDBY_USER 0x40
674#define LYS_ORDBY_MASK 0xC0
675#define LYS_YINELEM_TRUE 0x80
676#define LYS_YINELEM_FALSE 0x0100
677#define LYS_YINELEM_MASK 0x0180
678#define LYS_USED_GRP 0x0400
680#define LYS_SET_VALUE 0x0200
681#define LYS_SET_MIN 0x0200
682#define LYS_SET_MAX 0x0400
683
684#define LYS_SET_BASE 0x0001
685#define LYS_SET_BIT 0x0002
686#define LYS_SET_ENUM 0x0004
687#define LYS_SET_FRDIGITS 0x0008
688#define LYS_SET_LENGTH 0x0010
689#define LYS_SET_PATH 0x0020
690#define LYS_SET_PATTERN 0x0040
691#define LYS_SET_RANGE 0x0080
692#define LYS_SET_TYPE 0x0100
693#define LYS_SET_REQINST 0x0200
694#define LYS_SET_DFLT 0x0200
699#define LYS_SET_UNITS 0x0400
700#define LYS_SET_CONFIG 0x0800
701
702#define LYS_SINGLEQUOTED 0x0100
704#define LYS_DOUBLEQUOTED 0x0200
706
707#define LYS_YIN_ATTR 0x0400
708#define LYS_YIN_ARGUMENT 0x0800
709
710#define LYS_INTERNAL 0x1000
711
712#define LYS_IS_ENUM 0x0200
713
714#define LYS_IS_INPUT 0x1000
715
716#define LYS_IS_OUTPUT 0x2000
717
718#define LYS_IS_NOTIF 0x4000
719
720#define LYS_FLAGS_COMPILED_MASK 0xff
722
726struct lysp_node {
728 uint16_t nodetype;
729 uint16_t flags;
730 struct lysp_node *next;
731 const char *name;
732 const char *dsc;
733 const char *ref;
737};
738
743 union {
744 struct lysp_node node;
745
746 struct {
747 struct lysp_node *parent;
748 uint16_t nodetype;
749 uint16_t flags;
750 struct lysp_node *next;
751 const char *name;
752 const char *dsc;
753 const char *ref;
754 struct lysp_qname *iffeatures;
755 struct lysp_ext_instance *exts;
756 };
757 };
758
759 /* container */
761 struct lysp_when *when;
762 const char *presence;
765 struct lysp_node *child;
768};
769
771 union {
772 struct lysp_node node;
773
774 struct {
775 struct lysp_node *parent;
776 uint16_t nodetype;
777 uint16_t flags;
778 struct lysp_node *next;
779 const char *name;
780 const char *dsc;
781 const char *ref;
782 struct lysp_qname *iffeatures;
783 struct lysp_ext_instance *exts;
784 };
785 };
786
787 /* leaf */
789 struct lysp_when *when;
791 const char *units;
793};
794
796 union {
797 struct lysp_node node;
798
799 struct {
800 struct lysp_node *parent;
801 uint16_t nodetype;
802 uint16_t flags;
803 struct lysp_node *next;
804 const char *name;
805 const char *dsc;
806 const char *ref;
807 struct lysp_qname *iffeatures;
808 struct lysp_ext_instance *exts;
809 };
810 };
811
812 /* leaf-list */
814 struct lysp_when *when;
816 const char *units;
819 uint32_t min;
820 uint32_t max;
821};
822
824 union {
825 struct lysp_node node;
826
827 struct {
828 struct lysp_node *parent;
829 uint16_t nodetype;
830 uint16_t flags;
831 struct lysp_node *next;
832 const char *name;
833 const char *dsc;
834 const char *ref;
835 struct lysp_qname *iffeatures;
836 struct lysp_ext_instance *exts;
837 };
838 };
839
840 /* list */
842 struct lysp_when *when;
843 const char *key;
846 struct lysp_node *child;
850 uint32_t min;
851 uint32_t max;
852};
853
855 union {
856 struct lysp_node node;
857
858 struct {
859 struct lysp_node *parent;
860 uint16_t nodetype;
861 uint16_t flags;
862 struct lysp_node *next;
863 const char *name;
864 const char *dsc;
865 const char *ref;
866 struct lysp_qname *iffeatures;
867 struct lysp_ext_instance *exts;
868 };
869 };
870
871 /* choice */
872 struct lysp_node *child;
873 struct lysp_when *when;
875};
876
878 union {
879 struct lysp_node node;
880
881 struct {
882 struct lysp_node *parent;
883 uint16_t nodetype;
884 uint16_t flags;
885 struct lysp_node *next;
886 const char *name;
887 const char *dsc;
888 const char *ref;
889 struct lysp_qname *iffeatures;
890 struct lysp_ext_instance *exts;
891 };
892 };
893
894 /* case */
895 struct lysp_node *child;
896 struct lysp_when *when;
897};
898
900 union {
901 struct lysp_node node;
902
903 struct {
904 struct lysp_node *parent;
905 uint16_t nodetype;
906 uint16_t flags;
907 struct lysp_node *next;
908 const char *name;
909 const char *dsc;
910 const char *ref;
911 struct lysp_qname *iffeatures;
912 struct lysp_ext_instance *exts;
913 };
914 };
915
916 /* anyxml/anydata */
918 struct lysp_when *when;
919};
920
922 union {
923 struct lysp_node node;
924
925 struct {
926 struct lysp_node *parent;
927 uint16_t nodetype;
928 uint16_t flags;
929 struct lysp_node *next;
930 const char *name;
931 const char *dsc;
932 const char *ref;
933 struct lysp_qname *iffeatures;
934 struct lysp_ext_instance *exts;
935 };
936 };
937
938 /* uses */
941 struct lysp_when *when;
942};
943
948 union {
949 struct lysp_node node;
950
951 struct {
952 struct lysp_node *parent;
953 uint16_t nodetype;
954 uint16_t flags;
955 struct lysp_node *next;
956 const char *name;
957 const char *dsc;
958 const char *ref;
959 struct lysp_qname *iffeatures;
960 struct lysp_ext_instance *exts;
961 };
962 };
963
964 /* inout */
968 struct lysp_node *child;
969};
970
975 union {
976 struct lysp_node node;
977
978 struct {
979 struct lysp_node *parent;
980 uint16_t nodetype;
981 uint16_t flags;
982 struct lysp_node_action *next;
983 const char *name;
984 const char *dsc;
985 const char *ref;
986 struct lysp_qname *iffeatures;
987 struct lysp_ext_instance *exts;
988 };
989 };
990
991 /* action */
994
997};
998
1003 union {
1004 struct lysp_node node;
1005
1006 struct {
1007 struct lysp_node *parent;
1008 uint16_t nodetype;
1009 uint16_t flags;
1010 struct lysp_node_notif *next;
1011 const char *name;
1012 const char *dsc;
1013 const char *ref;
1014 struct lysp_qname *iffeatures;
1015 struct lysp_ext_instance *exts;
1016 };
1017 };
1018
1019 /* notif */
1024};
1025
1030 union {
1031 struct lysp_node node;
1032
1033 struct {
1034 struct lysp_node *parent;
1035 uint16_t nodetype;
1036 uint16_t flags;
1037 struct lysp_node_grp *next;
1038 const char *name;
1039 const char *dsc;
1040 const char *ref;
1041 struct lysp_qname *iffeatures;
1042 struct lysp_ext_instance *exts;
1043 };
1044 };
1045
1046 /* grp */
1052};
1053
1058 union {
1059 struct lysp_node node;
1060
1061 struct {
1062 struct lysp_node *parent;
1063 uint16_t nodetype;
1064 uint16_t flags;
1065 struct lysp_node_augment *next;
1066 const char *nodeid;
1067 const char *dsc;
1068 const char *ref;
1069 struct lysp_qname *iffeatures;
1070 struct lysp_ext_instance *exts;
1071 };
1072 };
1073
1075 struct lysp_when *when;
1078};
1079
1088
1116
1118 struct lys_module *mod;
1119
1129 struct lysp_node *data;
1135
1136 uint8_t version;
1137 uint8_t parsing : 1;
1138 uint8_t is_submod : 1;
1139
1140 uint8_t latest_revision : 2;
1144 const char *name;
1145 const char *filepath;
1146 const char *prefix;
1147 const char *org;
1148 const char *contact;
1149 const char *dsc;
1150 const char *ref;
1151};
1152
1159#define LYSP_MODULE_NAME(PMOD) (PMOD->is_submod ? ((struct lysp_submodule *)PMOD)->name : ((struct lysp_module *)PMOD)->mod->name)
1160
1166 char *prefix;
1167 const struct lys_module *mod;
1168};
1169
1177struct lysc_ext {
1178 const char *name;
1179 const char *argname;
1181 uintptr_t plugin_ref;
1183 uint16_t flags;
1184};
1185
1190 struct lyxp_expr *cond;
1193 const char *dsc;
1194 const char *ref;
1196 uint32_t refcount;
1197 uint16_t flags;
1198};
1199
1204 const char *name;
1205 const char *dsc;
1206 const char *ref;
1211 uint16_t flags;
1212};
1213
1220#define LYS_IFF_NOT 0x00
1221#define LYS_IFF_AND 0x01
1222#define LYS_IFF_OR 0x02
1223#define LYS_IFF_F 0x03
1225
1233
1236 union {
1237 int64_t min_64;
1238 uint64_t min_u64;
1239 };
1240 union {
1241 int64_t max_64;
1242 uint64_t max_u64;
1243 };
1245 const char *dsc;
1246 const char *ref;
1247 const char *emsg;
1248 const char *eapptag;
1250};
1251
1253 const char *expr;
1254 const char *dsc;
1255 const char *ref;
1256 const char *emsg;
1257 const char *eapptag;
1259 uint32_t inverted : 1;
1260 uint32_t format : 1;
1261 uint32_t refcount : 30;
1262};
1263
1265 struct lyxp_expr *cond;
1267 const char *dsc;
1268 const char *ref;
1269 const char *emsg;
1270 const char *eapptag;
1272};
1273
1275 const char *name;
1277 uintptr_t plugin_ref;
1279 uint32_t refcount;
1281};
1282
1284 const char *name;
1286 uintptr_t plugin_ref;
1288 uint32_t refcount;
1289
1291};
1292
1303
1314
1316 const char *name;
1317 const char *dsc;
1318 const char *ref;
1320
1321 union {
1322 int32_t value;
1323 uint32_t position;
1324 };
1325 uint16_t flags;
1327};
1328
1338
1349
1351 const char *name;
1353 uintptr_t plugin_ref;
1355 uint32_t refcount;
1356
1357 struct lyxp_expr *path;
1361};
1362
1373
1383
1385 const char *name;
1387 uintptr_t plugin_ref;
1389 uint32_t refcount;
1390
1391 struct lysc_type **types;
1392};
1393
1403
1407#define LYS_NODE_HASH_COUNT 4
1408
1413 uint16_t nodetype;
1414 uint16_t flags;
1418 struct lysc_node *next;
1419 struct lysc_node *prev;
1423 const char *name;
1424 const char *dsc;
1425 const char *ref;
1427 void *priv;
1428};
1429
1431 union {
1432 struct lysc_node node;
1433
1434 struct {
1435 uint16_t nodetype;
1436 uint16_t flags;
1437 uint8_t hash[LYS_NODE_HASH_COUNT];
1438 struct lys_module *module;
1439 struct lysc_node *parent;
1440 struct lysc_node *next;
1441 struct lysc_node *prev;
1442 const char *name;
1443 const char *dsc;
1444 const char *ref;
1445 struct lysc_ext_instance *exts;
1446 void *priv;
1447 };
1448 };
1449
1452};
1453
1455 union {
1456 struct lysc_node node;
1457
1458 struct {
1459 uint16_t nodetype;
1460 uint16_t flags;
1461 uint8_t hash[LYS_NODE_HASH_COUNT];
1462 struct lys_module *module;
1463 struct lysc_node *parent;
1464 struct lysc_node_action *next;
1465 struct lysc_node_action *prev;
1469 const char *name;
1470 const char *dsc;
1471 const char *ref;
1472 struct lysc_ext_instance *exts;
1473 void *priv;
1474 };
1475 };
1476
1477 struct lysc_when **when;
1482
1483};
1484
1486 union {
1487 struct lysc_node node;
1488
1489 struct {
1490 uint16_t nodetype;
1491 uint16_t flags;
1492 uint8_t hash[LYS_NODE_HASH_COUNT];
1493 struct lys_module *module;
1494 struct lysc_node *parent;
1495 struct lysc_node_notif *next;
1496 struct lysc_node_notif *prev;
1500 const char *name;
1501 const char *dsc;
1502 const char *ref;
1503 struct lysc_ext_instance *exts;
1504 void *priv;
1505 };
1506 };
1507
1510 struct lysc_when **when;
1513};
1514
1516 union {
1517 struct lysc_node node;
1518
1519 struct {
1520 uint16_t nodetype;
1521 uint16_t flags;
1522 uint8_t hash[LYS_NODE_HASH_COUNT];
1523 struct lys_module *module;
1524 struct lysc_node *parent;
1525 struct lysc_node *next;
1526 struct lysc_node *prev;
1530 const char *name;
1531 const char *dsc;
1532 const char *ref;
1533 struct lysc_ext_instance *exts;
1534 void *priv;
1535 };
1536 };
1537
1540 struct lysc_when **when;
1543};
1544
1546 union {
1547 struct lysc_node node;
1548
1549 struct {
1550 uint16_t nodetype;
1551 uint16_t flags;
1552 uint8_t hash[LYS_NODE_HASH_COUNT];
1553 struct lys_module *module;
1554 struct lysc_node *parent;
1555 struct lysc_node *next;
1556 struct lysc_node *prev;
1560 const char *name;
1561 const char *dsc;
1562 const char *ref;
1563 struct lysc_ext_instance *exts;
1564 void *priv;
1565 };
1566 };
1567
1570 struct lysc_when **when;
1571};
1572
1574 union {
1575 struct lysc_node node;
1576
1577 struct {
1578 uint16_t nodetype;
1579 uint16_t flags;
1580 uint8_t hash[LYS_NODE_HASH_COUNT];
1581 struct lys_module *module;
1582 struct lysc_node *parent;
1583 struct lysc_node *next;
1584 struct lysc_node *prev;
1588 const char *name;
1589 const char *dsc;
1590 const char *ref;
1591 struct lysc_ext_instance *exts;
1592 void *priv;
1593 };
1594 };
1595
1597 struct lysc_when **when;
1599};
1600
1602 const char *str;
1604};
1605
1607 union {
1608 struct lysc_node node;
1609
1610 struct {
1611 uint16_t nodetype;
1612 uint16_t flags;
1613 uint8_t hash[LYS_NODE_HASH_COUNT];
1614 struct lys_module *module;
1615 struct lysc_node *parent;
1616 struct lysc_node *next;
1617 struct lysc_node *prev;
1621 const char *name;
1622 const char *dsc;
1623 const char *ref;
1624 struct lysc_ext_instance *exts;
1625 void *priv;
1626 };
1627 };
1628
1630 struct lysc_when **when;
1631 struct lysc_type *type;
1632
1633 const char *units;
1635};
1636
1638 union {
1639 struct lysc_node node;
1640
1641 struct {
1642 uint16_t nodetype;
1643 uint16_t flags;
1644 uint8_t hash[LYS_NODE_HASH_COUNT];
1645 struct lys_module *module;
1646 struct lysc_node *parent;
1647 struct lysc_node *next;
1648 struct lysc_node *prev;
1652 const char *name;
1653 const char *dsc;
1654 const char *ref;
1655 struct lysc_ext_instance *exts;
1656 void *priv;
1657 };
1658 };
1659
1661 struct lysc_when **when;
1662 struct lysc_type *type;
1663
1664 const char *units;
1667
1668 uint32_t min;
1669 uint32_t max;
1670
1671};
1672
1674 union {
1675 struct lysc_node node;
1676
1677 struct {
1678 uint16_t nodetype;
1679 uint16_t flags;
1680 uint8_t hash[LYS_NODE_HASH_COUNT];
1681 struct lys_module *module;
1682 struct lysc_node *parent;
1683 struct lysc_node *next;
1684 struct lysc_node *prev;
1688 const char *name;
1689 const char *dsc;
1690 const char *ref;
1691 struct lysc_ext_instance *exts;
1692 void *priv;
1693 };
1694 };
1695
1698 struct lysc_when **when;
1701
1703 uint32_t min;
1704 uint32_t max;
1705};
1706
1708 union {
1709 struct lysc_node node;
1710
1711 struct {
1712 uint16_t nodetype;
1713 uint16_t flags;
1714 uint8_t hash[LYS_NODE_HASH_COUNT];
1715 struct lys_module *module;
1716 struct lysc_node *parent;
1717 struct lysc_node *next;
1718 struct lysc_node *prev;
1722 const char *name;
1723 const char *dsc;
1724 const char *ref;
1725 struct lysc_ext_instance *exts;
1726 void *priv;
1727 };
1728 };
1729
1731 struct lysc_when **when;
1732};
1733
1738 const char *name;
1739 const char *revision;
1740 const char *filepath;
1741};
1742
1759
1766#define lysc_is_userordered(lysc_node) \
1767 ((!lysc_node || !(lysc_node->nodetype & (LYS_LEAFLIST | LYS_LIST)) || !(lysc_node->flags & LYS_ORDBY_USER)) ? 0 : 1)
1768
1775#define lysc_is_key(lysc_node) \
1776 ((!lysc_node || (lysc_node->nodetype != LYS_LEAF) || !(lysc_node->flags & LYS_KEY)) ? 0 : 1)
1777
1784#define lysc_is_np_cont(lysc_node) \
1785 ((!lysc_node || (lysc_node->nodetype != LYS_CONTAINER) || (lysc_node->flags & LYS_PRESENCE)) ? 0 : 1)
1786
1793#define lysc_is_dup_inst_list(lysc_node) \
1794 ((lysc_node && (((lysc_node->nodetype == LYS_LIST) && (lysc_node->flags & LYS_KEYLESS)) || \
1795 ((lysc_node->nodetype == LYS_LEAFLIST) && !(lysc_node->flags & LYS_CONFIG_W)))) ? 1 : 0)
1796
1804LIBYANG_API_DECL struct lyplg_type *lysc_get_type_plugin(uintptr_t plugin_ref);
1805
1813LIBYANG_API_DECL struct lyplg_ext *lysc_get_ext_plugin(uintptr_t plugin_ref);
1814
1821LIBYANG_API_DECL const struct lysc_node *lysc_data_node(const struct lysc_node *schema);
1822
1826#define lysc_data_parent(SCHEMA) lysc_data_node((SCHEMA) ? (SCHEMA)->parent : NULL)
1827
1838LIBYANG_API_DECL const struct lysc_when *lysc_has_when(const struct lysc_node *node);
1839
1847LIBYANG_API_DECL const struct lys_module *lysc_owner_module(const struct lysc_node *node);
1848
1855LIBYANG_API_DECL const struct lysp_node_grp *lysp_node_groupings(const struct lysp_node *node);
1856
1863LIBYANG_API_DECL const struct lysp_tpdf *lysp_node_typedefs(const struct lysp_node *node);
1864
1871LIBYANG_API_DECL const struct lysp_node_action *lysp_node_actions(const struct lysp_node *node);
1872
1879LIBYANG_API_DECL const struct lysp_node_notif *lysp_node_notifs(const struct lysp_node *node);
1880
1887LIBYANG_API_DECL const struct lysp_node *lysp_node_child(const struct lysp_node *node);
1888
1896LIBYANG_API_DECL const char *lysp_submodule_revision(const struct lysp_submodule *submod);
1897
1904LIBYANG_API_DECL const struct lysc_node_action *lysc_node_actions(const struct lysc_node *node);
1905
1912LIBYANG_API_DECL const struct lysc_node_notif *lysc_node_notifs(const struct lysc_node *node);
1913
1924LIBYANG_API_DECL const struct lysc_node *lysc_node_child(const struct lysc_node *node);
1925
1933LIBYANG_API_DECL struct lysc_must *lysc_node_musts(const struct lysc_node *node);
1934
1942LIBYANG_API_DECL struct lysc_when **lysc_node_when(const struct lysc_node *node);
1943
1951LIBYANG_API_DECL const struct lysc_node *lysc_node_lref_target(const struct lysc_node *node);
1952
1962LIBYANG_API_DECL LY_ERR lysc_node_lref_targets(const struct lysc_node *node, struct ly_set **set);
1963
1975LIBYANG_API_DECL LY_ERR lysc_node_lref_backlinks(const struct ly_ctx *ctx, const struct lysc_node *node,
1976 ly_bool match_ancestors, struct ly_set **set);
1977
1987typedef LY_ERR (*lysc_dfs_clb)(struct lysc_node *node, void *data, ly_bool *dfs_continue);
1988
2005LIBYANG_API_DECL LY_ERR lysc_tree_dfs_full(const struct lysc_node *root, lysc_dfs_clb dfs_clb, void *data);
2006
2018LIBYANG_API_DECL LY_ERR lysc_module_dfs_full(const struct lys_module *mod, lysc_dfs_clb dfs_clb, void *data);
2019
2028LIBYANG_API_DECL LY_ERR lysc_iffeature_value(const struct lysc_iffeature *iff);
2029
2041LIBYANG_API_DECL LY_ERR lys_identity_iffeature_value(const struct lysc_ident *ident);
2042
2051LIBYANG_API_DECL struct lysp_feature *lysp_feature_next(const struct lysp_feature *last, const struct lysp_module *pmod,
2052 uint32_t *idx);
2053
2066LIBYANG_API_DECL const struct lys_module *lys_find_module(const struct ly_ctx *ctx, const struct lysc_node *ctx_node,
2067 const char *prefix, uint32_t prefix_len, LY_VALUE_FORMAT format, const void *prefix_data);
2068
2076#define LYS_GETNEXT_WITHCHOICE 0x01
2077#define LYS_GETNEXT_NOCHOICE 0x02
2078#define LYS_GETNEXT_WITHCASE 0x04
2079#define LYS_GETNEXT_INTONPCONT 0x08
2081#define LYS_GETNEXT_OUTPUT 0x10
2084
2106LIBYANG_API_DECL const struct lysc_node *lys_getnext(const struct lysc_node *last, const struct lysc_node *parent,
2107 const struct lysc_module *module, uint32_t options);
2108
2124LIBYANG_API_DECL const struct lysc_node *lys_find_child(const struct ly_ctx *ctx, const struct lysc_node *parent,
2125 const struct lys_module *mod, const char *mod_name, uint32_t mod_len, const char *name, uint32_t name_len,
2126 uint32_t options);
2127
2133#define LYS_FIND_XP_SCHEMA 0x08
2134#define LYS_FIND_XP_OUTPUT 0x10
2135#define LYS_FIND_NO_MATCH_ERROR 0x40
2138
2150LIBYANG_API_DECL LY_ERR lys_find_xpath_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath,
2151 uint32_t options, struct ly_set **set);
2152
2165LIBYANG_API_DECL LY_ERR lys_find_expr_atoms(const struct lysc_node *ctx_node, const struct lys_module *cur_mod,
2166 const struct lyxp_expr *expr, const struct lysc_prefix *prefixes, uint32_t options, struct ly_set **set);
2167
2179LIBYANG_API_DECL LY_ERR lys_find_xpath(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath,
2180 uint32_t options, struct ly_set **set);
2181
2190LIBYANG_API_DECL LY_ERR lys_find_lypath_atoms(const struct ly_path *path, struct ly_set **set);
2191
2202LIBYANG_API_DECL LY_ERR lys_find_path_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *path,
2203 ly_bool output, struct ly_set **set);
2204
2214LIBYANG_API_DECL const struct lysc_node *lys_find_path(const struct ly_ctx *ctx, const struct lysc_node *ctx_node,
2215 const char *path, ly_bool output);
2216
2226
2238LIBYANG_API_DECL char *lysc_path(const struct lysc_node *node, LYSC_PATH_TYPE pathtype, char *buffer, size_t buflen);
2239
2244 struct ly_ctx *ctx;
2245 const char *name;
2246 const char *revision;
2247 const char *ns;
2248 const char *prefix;
2249 const char *filepath;
2250 const char *org;
2251 const char *contact;
2252 const char *dsc;
2253 const char *ref;
2254
2258
2268
2272
2276 uint8_t version : 2;
2277 uint8_t latest_revision : 4;
2279};
2280
2288#define LYS_MOD_LATEST_REV 0x01
2289#define LYS_MOD_LATEST_SEARCHDIRS 0x02
2290#define LYS_MOD_IMPORTED_REV 0x04
2293#define LYS_MOD_LATEST_IMPCLB 0x08
2295
2308LIBYANG_API_DECL LY_ERR lys_feature_value(const struct lys_module *module, const char *feature);
2309
2325LIBYANG_API_DECL LY_ERR lys_set_implemented(struct lys_module *mod, const char **features);
2326
2333LIBYANG_API_DECL const char *lys_nodetype2str(uint16_t nodetype);
2334
2341LIBYANG_API_DECL const char *lyxp_get_expr(const struct lyxp_expr *path);
2342
2344
2345#ifdef __cplusplus
2346}
2347#endif
2348
2349#endif /* LY_TREE_SCHEMA_H_ */
libyang context handler.
LY_ERR
libyang's error codes returned by the libyang functions.
Definition log.h:252
Structure to hold a set of (not necessary somehow connected) objects. Usually used for lyd_node,...
Definition set.h:47
Extension plugin implementing various aspects of a YANG extension.
YANG extension compiled instance.
YANG extension parsed instance.
Hold type-specific functions for various operations with the data values.
struct lysc_node * child
struct lysp_ext_instance * exts
const char * dsc
struct lysp_node_grp * groupings
struct lysp_node * data
struct lysp_restr * musts
struct lysc_when ** when
const char * ref
struct lysp_tpdf * typedefs
uint16_t flags
const char * ref
const char * cond
struct lysp_when * when
const char * name
const char * ref
struct lysp_ext_instance * exts
struct lysp_node_notif * notifs
struct lysp_tpdf * typedefs
struct lysp_node_action * actions
uint32_t refcount
struct lysc_ext_instance * exts
struct lysc_must * musts
uintptr_t plugin_ref
struct lysc_when ** when
struct lysp_feature * features
uintptr_t plugin_ref
struct lysc_node_action * rpcs
struct lysc_ext_instance * exts
char rev[11]
struct lysp_node * child
const char * name
ly_bool to_compile
struct lysp_restr * musts
struct lysc_node_action_inout output
const char * prefix
struct lysp_restr * musts
const char * ref
const char * dsc
struct lysc_range * range
struct lysp_include * includes
struct lysc_range * range
struct lysp_node_grp * groupings
struct lysp_ext_instance * exts
const char * ref
const char * units
struct lysc_when ** when
struct lysc_when ** when
struct lysp_revision * revs
struct lysc_node * child
const char * name
struct lysp_qname * dflts
uint16_t nodetype
struct lys_module ** augmented_by
uint8_t version
LY_DATA_TYPE basetype
const char * name
struct lysp_node_notif * notifs
struct lysp_restr * range
struct lysp_qname * dflts
struct lysc_ext_instance * exts
const char * ref
LY_DATA_TYPE basetype
struct lysp_deviate * next
struct lysp_qname arg
struct lysc_node_action * actions
LY_DATA_TYPE basetype
struct lysp_node * child
struct lysp_deviate * next
uintptr_t plugin_ref
const char * units
struct lysp_import * imports
struct lyxp_expr * path
struct lysp_ext_instance * exts
struct lys_module ** deviated_by
struct lysp_qname dflt
uint8_t require_instance
struct lysc_when ** when
const char * units
struct lysp_when * when
const char * eapptag
struct lysp_ext_instance * exts
struct lysp_type type
const char * units
struct lysp_node_notif * notifs
LY_DATA_TYPE basetype
LY_DATA_TYPE basetype
struct lysc_node_notif * notifs
struct lyxp_expr * cond
uint8_t hash[4]
uint32_t refcount
const char * name
const char * str
struct lysp_qname * uniques
const char * name
const char * ref
const char * dsc
const char * prefix
struct lysc_node_notif * notifs
struct lysp_node_notif * notifs
uint16_t nodetype
struct lysc_ext_instance * exts
const char * emsg
uint16_t flags
struct lysc_module * compiled
const char * contact
struct lys_module * module
uint16_t flags
struct lysp_when * when
struct lysc_must * musts
const char * presence
const char * name
const char * nodeid
struct lysp_when * when
struct lysp_tpdf * typedefs
const char * revision
uint8_t is_submod
struct lysc_type * type
const char * name
const char * dsc
struct lysp_node * next
LY_DATA_TYPE basetype
struct lysp_restr * patterns
struct lysp_ext_instance * exts
struct lysp_tpdf * typedefs
struct lysp_type type
struct lysp_node * child
struct lysc_ident * identities
struct lysc_ext_instance * exts
struct lysp_qname * iffeatures
const char * ref
const char * name
const char * name
LY_DATA_TYPE basetype
const char * name
struct lysp_node_action * actions
struct lysp_ext_instance * exts
const char * expr
struct lysp_node_augment * augments
uint32_t refcount
struct lysp_node * parent
const char * dsc
struct lysp_ext_instance * exts
const char * emsg
struct lysp_node_action * rpcs
struct lysp_node_action * actions
struct lysp_node_grp * groupings
struct lysp_qname * iffeatures
struct lysp_node_grp * groupings
uint16_t flags
struct lysc_ext * extensions
uint16_t flags
struct lysc_ext_instance * exts
struct lysp_node * data
struct lysp_feature ** depfeatures
struct lysc_type_bitenum_item * bits
struct lysp_ext * extensions
const char * presence
uintptr_t plugin_ref
struct lysp_ext_instance * exts
struct lysc_node * parent
uint8_t latest_revision
struct lys_module * module
const char * name
uint32_t refcount
uintptr_t plugin_ref
const char * dsc
uintptr_t plugin_ref
uintptr_t plugin_ref
const char * dsc
struct lysp_type_enum * bits
struct lysc_pattern ** patterns
struct lysp_node_action_inout output
struct lysp_ident * identities
struct lysp_ext_instance * exts
uint8_t * expr
struct lysp_type * types
const char * ref
struct lysc_node * child
const char * argname
struct lysp_ext_instance * exts
struct lysp_qname dflt
struct lysp_node * child
struct lysp_deviation * deviations
struct lys_module * mod
const char * org
struct lysp_qname dflt
struct lysp_node * child
const char * ref
const char * ref
uintptr_t plugin_ref
struct lysc_iffeature * iffeatures_c
const struct lysp_module * pmod
const char * dsc
struct lysp_qname * uniques
struct lysp_ext_instance * exts
struct lysp_node_augment * augments
const char * contact
ly_bool implemented
const char * key
const char * name
struct lys_module * mod
struct lysc_value dflt
uint16_t flags
struct lysc_node_case * cases
const char * ref
uint16_t flags
uint16_t flags
struct lysp_restr * musts
struct lysp_ext_instance * exts
struct lysc_value * dflts
const char * filepath
const char * ref
const char * filepath
struct lysc_node_notif * notifs
uint32_t max
const char * dsc
struct lysp_include * includes
struct lysc_must * musts
uint32_t min
struct lysp_deviate * deviates
struct lysc_ext_instance * exts
ly_bool injected
const char * units
struct lysp_qname dflt
const char * name
void * priv
const char * name
struct lysc_node_action * actions
const char * name
struct lysp_tpdf * typedefs
struct lysp_qname * uniques
struct lysp_when * when
struct lysc_range * length
const char * name
struct lysp_restr * length
struct lysc_when ** when
const char * eapptag
struct lysp_ext_instance * exts
struct lysc_type * type
struct lysp_restr * musts
struct lysp_restr * musts
struct lysp_ident * identities
const char * units
struct lyxp_expr * path
struct lysp_qname * dflts
struct lysc_node * next
const char * dsc
struct lysc_ext_instance * exts
struct lysp_restr * musts
struct lysp_node * child
struct lysp_qname * iffeatures
uint8_t latest_revision
uintptr_t plugin_ref
struct lysp_ext_instance * exts
struct lysc_ext_instance * exts
const char * dsc
struct lysp_revision * revs
struct lysc_type * compiled
struct lysc_node * child
uint16_t flags
struct lys_module * module
const char * revision
struct lysc_ext_instance * exts
struct lysp_type * type
struct lysc_node_leaf *** uniques
struct lysp_qname * iffeatures
struct lysp_when * when
const char * name
struct lysp_submodule * submodule
struct lysp_ext_instance * exts
const char * name
struct lysp_feature * features
struct lysp_qname * dflts
struct lysp_restr * musts
const char * ref
struct lysp_node_action * rpcs
struct lysp_ext_instance * exts
const char * name
const char ** bases
LY_DATA_TYPE basetype
const char * dsc
const char * name
struct lys_module * mod
struct lysc_node_action_inout input
struct lysp_when * when
const char * dsc
struct lysp_node_action * actions
uint16_t flags
struct lysp_deviation * deviations
char date[11]
uint32_t format
struct lysc_must * musts
struct lysc_ident ** derived
uint32_t refcount
const char * ref
struct lysc_prefix * prefixes
struct lysc_ext_instance * exts
const char * dsc
const char * ref
struct lysc_type_bitenum_item * enums
const char * dsc
struct lysc_submodule * submodules
struct lysc_must * musts
struct lysp_node * child
const char * dsc
const char * filepath
struct lysp_node_action_inout input
struct lysp_tpdf * typedefs
struct lysc_when ** when
struct lysp_when * when
const char * ns
const char * dsc
const char * ref
struct lysp_node_grp * groupings
struct lysc_range * length
const char * name
struct lysc_prefix * prefixes
struct lysp_tpdf * typedefs
struct lysc_when ** when
const char ** features
struct lysc_node * child
struct lysp_node_augment * augments
uint32_t refcount
uint32_t refcount
struct lysp_tpdf * typedefs
struct lysc_ext_instance * exts
struct lysp_type_enum * enums
const char * name
struct lysc_type * realtype
const char * eapptag
struct lysc_ext_instance * exts
struct lysp_node_grp * groupings
struct lysp_deviate * next
struct lysc_node * prev
struct lysp_type type
const char * ref
const char * dsc
uint32_t refcount
const char * org
struct lysc_ext_instance * exts
const char * name
const char * ref
struct lysc_node * data
const char * dsc
const char * emsg
struct lysp_module * parsed
uint32_t refcount
struct lysc_must * musts
struct lysc_ext_instance * exts
struct lyxp_expr * cond
uintptr_t plugin_ref
const char * str
const char * prefix
struct lysp_node_notif * notifs
struct lysc_ext_instance * exts
const char * eapptag
uint8_t parsing
struct lysp_qname * iffeatures
const char * ref
struct lysc_node_case * dflt
const char * units
struct lysc_ext_instance * exts
struct lysp_when * when
struct lysc_type ** types
uint16_t flags
const char * argname
const char ** bases
const char * dsc
struct lysc_ext_instance * exts
struct lysc_ext_instance * exts
struct ly_ctx * ctx
struct lys_module * module
struct lysp_ext * extensions
struct lysp_node_notif * notifs
uint16_t flags
uint32_t inverted
struct lysc_node * context
LY_DATA_TYPE basetype
struct lysp_ext_instance * exts
struct lysc_ext_instance * exts
struct lysc_ext_instance * exts
const char * units
char rev[11]
uint8_t fraction_digits
const char * ref
struct lysp_restr * musts
struct lysc_must * musts
struct lysc_when ** when
struct lysp_import * imports
struct lysp_ext_instance * exts
const struct lysp_module * mod
uint8_t version
LY_DATA_TYPE basetype
struct lysp_restr * musts
struct lysc_ident ** bases
const char * emsg
struct lysp_feature ** features
const char * dsc
const char * nodeid
struct lysp_ext_instance * exts
struct lysc_range::lysc_range_part * parts
uint16_t flags
struct lysc_prefix * prefixes
struct lysp_node_grp * groupings
struct lysp_deviate * next
struct lysp_node * child
const struct lys_module * mod
struct lysp_node_grp * groupings
struct lysc_prefix * prefixes
struct lysp_refine * refines
uint8_t fraction_digits
LIBYANG_API_DECL LY_ERR lysc_tree_dfs_full(const struct lysc_node *root, lysc_dfs_clb dfs_clb, void *data)
DFS traversal of all the schema nodes in a (sub)tree including any actions and nested notifications.
LIBYANG_API_DECL const char * lysp_submodule_revision(const struct lysp_submodule *submod)
Get the last revision of a submodule.
LIBYANG_API_DECL const struct lysc_when * lysc_has_when(const struct lysc_node *node)
Check whether the schema node data instance existence depends on any when conditions....
LIBYANG_API_DECL const struct lysp_node_action * lysp_node_actions(const struct lysp_node *node)
Get the actions/RPCs linked list of the given (parsed) schema node. Decides the node's type and in ca...
LIBYANG_API_DECL const struct lysc_node * lys_find_child(const struct ly_ctx *ctx, const struct lysc_node *parent, const struct lys_module *mod, const char *mod_name, uint32_t mod_len, const char *name, uint32_t name_len, uint32_t options)
Get a child node according to the specified criteria.
LY_ERR(* lysc_dfs_clb)(struct lysc_node *node, void *data, ly_bool *dfs_continue)
Callback to be called for every schema node in a DFS traversal.
LIBYANG_API_DECL LY_ERR lysc_iffeature_value(const struct lysc_iffeature *iff)
Get how the if-feature statement currently evaluates.
LIBYANG_API_DECL const struct lysc_node_notif * lysc_node_notifs(const struct lysc_node *node)
Get the Notifications linked list of the given (compiled) schema node. Decides the node's type and in...
LIBYANG_API_DECL struct lyplg_type * lysc_get_type_plugin(uintptr_t plugin_ref)
Get a type plugin.
LIBYANG_API_DECL LY_ERR lysc_node_lref_backlinks(const struct ly_ctx *ctx, const struct lysc_node *node, ly_bool match_ancestors, struct ly_set **set)
Get all the leafref (or union with leafrefs) nodes that target a specific node.
LIBYANG_API_DECL const struct lysc_node * lysc_node_lref_target(const struct lysc_node *node)
Get the target node of a leafref node. Function lysc_node_lref_targets() should be used instead to ge...
LIBYANG_API_DECL struct lyplg_ext * lysc_get_ext_plugin(uintptr_t plugin_ref)
Get an extension plugin.
LIBYANG_API_DECL LY_ERR lys_find_path_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *path, ly_bool output, struct ly_set **set)
Get all the schema nodes that are required for path to be evaluated (atoms).
LIBYANG_API_DECL const char * lyxp_get_expr(const struct lyxp_expr *path)
Getter for original XPath expression from a parsed expression.
LIBYANG_API_DECL LY_ERR lys_find_expr_atoms(const struct lysc_node *ctx_node, const struct lys_module *cur_mod, const struct lyxp_expr *expr, const struct lysc_prefix *prefixes, uint32_t options, struct ly_set **set)
Get all the schema nodes that are required for expr to be evaluated (atoms).
LIBYANG_API_DECL struct lysc_must * lysc_node_musts(const struct lysc_node *node)
Get the must statements list if present in the node.
LIBYANG_API_DECL const struct lysp_node_notif * lysp_node_notifs(const struct lysp_node *node)
Get the Notifications linked list of the given (parsed) schema node. Decides the node's type and in c...
LIBYANG_API_DECL const struct lysp_node_grp * lysp_node_groupings(const struct lysp_node *node)
Get the groupings linked list of the given (parsed) schema node. Decides the node's type and in case ...
LIBYANG_API_DECL const struct lys_module * lys_find_module(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *prefix, uint32_t prefix_len, LY_VALUE_FORMAT format, const void *prefix_data)
Find a module matching a prefix (or a default one).
LIBYANG_API_DECL LY_ERR lys_identity_iffeature_value(const struct lysc_ident *ident)
Get how the if-feature statement is evaluated for certain identity.
LIBYANG_API_DECL LY_ERR lys_find_xpath_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath, uint32_t options, struct ly_set **set)
Get all the schema nodes that are required for xpath to be evaluated (atoms).
LIBYANG_API_DECL const char * lys_nodetype2str(uint16_t nodetype)
Stringify schema nodetype.
LIBYANG_API_DECL LY_ERR lys_set_implemented(struct lys_module *mod, const char **features)
Make the specific module implemented.
LIBYANG_API_DECL const struct lysp_tpdf * lysp_node_typedefs(const struct lysp_node *node)
Get the typedefs sized array of the given (parsed) schema node. Decides the node's type and in case i...
LIBYANG_API_DECL const struct lysc_node * lysc_node_child(const struct lysc_node *node)
Get the children linked list of the given (compiled) schema node.
LYSC_PATH_TYPE
Types of the different schema paths.
LIBYANG_API_DECL const struct lysc_node * lys_find_path(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *path, ly_bool output)
Get a schema node based on the given data path (JSON format, see XPath Addressing).
LIBYANG_API_DECL const struct lys_module * lysc_owner_module(const struct lysc_node *node)
Get the owner module of the schema node. It is the module of the top-level node. Generally,...
LIBYANG_API_DECL LY_ERR lysc_node_lref_targets(const struct lysc_node *node, struct ly_set **set)
Get the target node(s) of a leafref node or union node with leafrefs.
#define LYS_NODE_HASH_COUNT
Maximum number of hashes stored in a schema node.
LIBYANG_API_DECL char * lysc_path(const struct lysc_node *node, LYSC_PATH_TYPE pathtype, char *buffer, size_t buflen)
Generate path of the given node in the requested format.
LIBYANG_API_DECL LY_ERR lys_feature_value(const struct lys_module *module, const char *feature)
Get the current real status of the specified feature in the module.
LIBYANG_API_DECL LY_ERR lys_find_lypath_atoms(const struct ly_path *path, struct ly_set **set)
Get all the schema nodes that are required for path to be evaluated (atoms).
LIBYANG_API_DECL LY_ERR lysc_module_dfs_full(const struct lys_module *mod, lysc_dfs_clb dfs_clb, void *data)
DFS traversal of all the schema nodes in a module including RPCs and notifications.
LIBYANG_API_DECL const struct lysc_node_action * lysc_node_actions(const struct lysc_node *node)
Get the actions/RPCs linked list of the given (compiled) schema node. Decides the node's type and in ...
LIBYANG_API_DECL const struct lysp_node * lysp_node_child(const struct lysp_node *node)
Get the children linked list of the given (parsed) schema node. Decides the node's type and in case i...
LIBYANG_API_DECL struct lysp_feature * lysp_feature_next(const struct lysp_feature *last, const struct lysp_module *pmod, uint32_t *idx)
Get the next feature in the module or submodules.
LYS_VERSION
supported YANG schema version values
LIBYANG_API_DECL const struct lysc_node * lys_getnext(const struct lysc_node *last, const struct lysc_node *parent, const struct lysc_module *module, uint32_t options)
Get next schema (sibling) node element in the schema order that can be instantiated in a data tree....
LIBYANG_API_DECL struct lysc_when ** lysc_node_when(const struct lysc_node *node)
Get the when statements list if present in the node.
LIBYANG_API_DECL const struct lysc_node * lysc_data_node(const struct lysc_node *schema)
Get nearest schema parent (including the node itself) that can be instantiated in data.
LIBYANG_API_DECL LY_ERR lys_find_xpath(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath, uint32_t options, struct ly_set **set)
Evaluate an xpath expression on schema nodes.
#define LY_REV_SIZE
@ LYSC_PATH_LOG
@ LYSC_PATH_DATA
@ LYSC_PATH_DATA_PATTERN
@ LYS_VERSION_UNDEF
@ LYS_VERSION_1_0
@ LYS_VERSION_1_1
Available YANG schema tree structures representing YANG module.
Compiled YANG extension-stmt.
YANG identity-stmt.
Compiled YANG if-feature-stmt.
Compiled YANG schema tree structure representing YANG module.
Compiled YANG data node.
Compiled prefix data pair mapping of prefixes to modules. In case the format is LY_VALUE_SCHEMA_RESOL...
Compiled YANG revision statement.
Compiled YANG submodule with only some basic metadata required for generating ietf-yang-library data.
YANG when-stmt.
Generic deviate structure to get type and cast to lysp_deviate_* structure.
YANG extension-stmt.
YANG feature-stmt.
YANG identity-stmt.
YANG import-stmt.
YANG include-stmt.
Printable YANG schema tree structure representing YANG module.
Generic YANG data node.
YANG rpc-stmt and action-stmt.
YANG input-stmt and output-stmt.
YANG uses-augment-stmt and augment-stmt (compatible with struct lysp_node ).
Extension structure of the lysp_node for YANG container.
YANG grouping-stmt.
YANG notification-stmt.
Qualified name (optional prefix followed by an identifier).
YANG refine-stmt.
Covers restrictions: range, length, pattern, must.
YANG revision-stmt.
YANG typedef-stmt.
YANG type-stmt.
Enumeration/Bit value definition.
YANG when-stmt.
LY_DATA_TYPE
YANG built-in types.
Definition tree.h:202
LY_VALUE_FORMAT
All kinds of supported value formats and prefix mappings to modules.
Definition tree.h:234
Logger manipulation routines and error definitions.
uint8_t ly_bool
Type to indicate boolean value.
Definition log.h:36
libyang generic macros and functions to work with YANG schema or data trees.