libyang 4.3.4
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#define PCRE2_CODE_UNIT_WIDTH 8
20
21#include <pcre2.h>
22
23#include <stdint.h>
24#include <stdio.h>
25
26#include "log.h"
27#include "ly_config.h"
28#include "tree.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34struct ly_ctx;
35struct ly_path;
36struct ly_set;
37struct lys_module;
38struct lysc_node;
39struct lyxp_expr;
40
121
145
153
154/* *INDENT-OFF* */
155
184#define LYSC_TREE_DFS_BEGIN(START, ELEM) \
185 { ly_bool LYSC_TREE_DFS_continue = 0; struct lysc_node *LYSC_TREE_DFS_next; \
186 for ((ELEM) = (LYSC_TREE_DFS_next) = (struct lysc_node *)(START); \
187 (ELEM); \
188 (ELEM) = (LYSC_TREE_DFS_next), LYSC_TREE_DFS_continue = 0)
189
203#define LYSC_TREE_DFS_END(START, ELEM) \
204 /* select element for the next run - children first */ \
205 if (LYSC_TREE_DFS_continue) { \
206 (LYSC_TREE_DFS_next) = NULL; \
207 } else { \
208 (LYSC_TREE_DFS_next) = (struct lysc_node *)lysc_node_child(ELEM); \
209 } \
210 if (!(LYSC_TREE_DFS_next)) { \
211 /* no children, try siblings */ \
212 _LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \
213 } \
214 while (!(LYSC_TREE_DFS_next)) { \
215 /* parent is already processed, go to its sibling */ \
216 (ELEM) = (ELEM)->parent; \
217 _LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \
218 } }
219
223#define _LYSC_TREE_DFS_NEXT(START, ELEM, NEXT) \
224 if ((ELEM) == (struct lysc_node *)(START)) { \
225 /* we are done, no next element to process */ \
226 break; \
227 } \
228 (NEXT) = (ELEM)->next;
229
230/* *INDENT-ON* */
231
232#define LY_REV_SIZE 11
233
239#define LYS_UNKNOWN 0x0000
240#define LYS_CONTAINER 0x0001
241#define LYS_CHOICE 0x0002
242#define LYS_LEAF 0x0004
243#define LYS_LEAFLIST 0x0008
244#define LYS_LIST 0x0010
245#define LYS_ANYXML 0x0020
246#define LYS_ANYDATA 0x0060
247#define LYS_CASE 0x0080
248
249#define LYS_RPC 0x0100
250#define LYS_ACTION 0x0200
251#define LYS_NOTIF 0x0400
252
253#define LYS_USES 0x0800
254#define LYS_INPUT 0x1000
255#define LYS_OUTPUT 0x2000
256#define LYS_GROUPING 0x4000
257#define LYS_AUGMENT 0x8000
258
259#define LYS_NODETYPE_MASK 0xffff
261
268 const char *name;
269 const char *prefix;
270 const char *dsc;
271 const char *ref;
273 uint16_t flags;
275};
276
283 const char *name;
284 const char *dsc;
285 const char *ref;
291};
292
296struct lysp_ext {
297 const char *name;
298 const char *argname;
299 const char *dsc;
300 const char *ref;
302 uintptr_t plugin_ref;
303 uint16_t flags;
304};
305
310 const char *name;
315 const char *dsc;
316 const char *ref;
318 uint16_t flags;
320};
321
326 uint8_t *expr;
328};
329
334 const char *str;
335 const struct lysp_module *mod;
337 uint16_t flags;
339};
340
345 const char *name;
347 const char **bases;
348 const char *dsc;
349 const char *ref;
351 uint16_t flags;
352};
353
358#define LYSP_RESTR_PATTERN_ACK 0x06
359#define LYSP_RESTR_PATTERN_NACK 0x15
363 const char *emsg;
364 const char *eapptag;
365 const char *dsc;
366 const char *ref;
368};
369
375 const char *dsc;
376 const char *ref;
378};
379
384 const char *name;
385 const char *dsc;
386 const char *ref;
387 int64_t value;
390 uint16_t flags;
392};
393
399struct lysp_type {
400 const char *name;
406 struct lyxp_expr *path;
407 const char **bases;
408 struct lysp_type *types;
410
411 const struct lysp_module *pmod;
413
416 uint16_t flags;
417};
418
422struct lysp_tpdf {
423 const char *name;
424 const char *units;
426 const char *dsc;
427 const char *ref;
430 uint16_t flags;
431};
432
436struct lysp_when {
437 const char *cond;
438 const char *dsc;
439 const char *ref;
441};
442
447 const char *nodeid;
448 const char *dsc;
449 const char *ref;
452 const char *presence;
454 uint32_t min;
455 uint32_t max;
457 uint16_t flags;
458};
459
468#define LYS_DEV_NOT_SUPPORTED 1
469#define LYS_DEV_ADD 2
470#define LYS_DEV_DELETE 3
471#define LYS_DEV_REPLACE 4
473
478 uint8_t mod;
481};
482
484 uint8_t mod;
487 const char *units;
491 uint16_t flags;
492 uint32_t min;
493 uint32_t max;
494};
495
497 uint8_t mod;
500 const char *units;
504};
505
507 uint8_t mod;
510 struct lysp_type *type;
511 const char *units;
513 uint16_t flags;
514 uint32_t min;
515 uint32_t max;
516};
517
519 const char *nodeid;
520 const char *dsc;
521 const char *ref;
524};
525
587
641
649#define LYS_CONFIG_W 0x01
650#define LYS_CONFIG_R 0x02
651#define LYS_CONFIG_MASK 0x03
652#define LYS_STATUS_CURR 0x04
653#define LYS_STATUS_DEPRC 0x08
654#define LYS_STATUS_OBSLT 0x10
655#define LYS_STATUS_MASK 0x1C
656#define LYS_MAND_TRUE 0x20
661#define LYS_MAND_FALSE 0x40
664#define LYS_MAND_MASK 0x60
665#define LYS_PRESENCE 0x80
668#define LYS_UNIQUE 0x80
669#define LYS_KEY 0x0100
670#define LYS_KEYLESS 0x0200
671#define LYS_DISABLED 0x0100
672#define LYS_FENABLED 0x20
673#define LYS_ORDBY_SYSTEM 0x80
675#define LYS_ORDBY_USER 0x40
678#define LYS_ORDBY_MASK 0xC0
679#define LYS_YINELEM_TRUE 0x80
680#define LYS_YINELEM_FALSE 0x0100
681#define LYS_YINELEM_MASK 0x0180
682#define LYS_USED_GRP 0x0400
684#define LYS_SET_VALUE 0x0200
685#define LYS_SET_MIN 0x0200
686#define LYS_SET_MAX 0x0400
687
688#define LYS_SET_BASE 0x0001
689#define LYS_SET_BIT 0x0002
690#define LYS_SET_ENUM 0x0004
691#define LYS_SET_FRDIGITS 0x0008
692#define LYS_SET_LENGTH 0x0010
693#define LYS_SET_PATH 0x0020
694#define LYS_SET_PATTERN 0x0040
695#define LYS_SET_RANGE 0x0080
696#define LYS_SET_TYPE 0x0100
697#define LYS_SET_REQINST 0x0200
698#define LYS_SET_DFLT 0x0200
703#define LYS_SET_UNITS 0x0400
704#define LYS_SET_CONFIG 0x0800
705
706#define LYS_SINGLEQUOTED 0x0100
708#define LYS_DOUBLEQUOTED 0x0200
710
711#define LYS_YIN_ATTR 0x0400
712#define LYS_YIN_ARGUMENT 0x0800
713
714#define LYS_INTERNAL 0x1000
715
716#define LYS_IS_ENUM 0x0200
717
718#define LYS_IS_INPUT 0x1000
719
720#define LYS_IS_OUTPUT 0x2000
721
722#define LYS_IS_NOTIF 0x4000
723
724#define LYS_FLAGS_COMPILED_MASK 0xff
726
730struct lysp_node {
732 uint16_t nodetype;
733 uint16_t flags;
734 struct lysp_node *next;
735 const char *name;
736 const char *dsc;
737 const char *ref;
741};
742
747 union {
748 struct lysp_node node;
749
750 struct {
751 struct lysp_node *parent;
752 uint16_t nodetype;
753 uint16_t flags;
754 struct lysp_node *next;
755 const char *name;
756 const char *dsc;
757 const char *ref;
758 struct lysp_qname *iffeatures;
759 struct lysp_ext_instance *exts;
760 };
761 };
762
763 /* container */
765 struct lysp_when *when;
766 const char *presence;
769 struct lysp_node *child;
772};
773
775 union {
776 struct lysp_node node;
777
778 struct {
779 struct lysp_node *parent;
780 uint16_t nodetype;
781 uint16_t flags;
782 struct lysp_node *next;
783 const char *name;
784 const char *dsc;
785 const char *ref;
786 struct lysp_qname *iffeatures;
787 struct lysp_ext_instance *exts;
788 };
789 };
790
791 /* leaf */
793 struct lysp_when *when;
795 const char *units;
797};
798
800 union {
801 struct lysp_node node;
802
803 struct {
804 struct lysp_node *parent;
805 uint16_t nodetype;
806 uint16_t flags;
807 struct lysp_node *next;
808 const char *name;
809 const char *dsc;
810 const char *ref;
811 struct lysp_qname *iffeatures;
812 struct lysp_ext_instance *exts;
813 };
814 };
815
816 /* leaf-list */
818 struct lysp_when *when;
820 const char *units;
823 uint32_t min;
824 uint32_t max;
825};
826
828 union {
829 struct lysp_node node;
830
831 struct {
832 struct lysp_node *parent;
833 uint16_t nodetype;
834 uint16_t flags;
835 struct lysp_node *next;
836 const char *name;
837 const char *dsc;
838 const char *ref;
839 struct lysp_qname *iffeatures;
840 struct lysp_ext_instance *exts;
841 };
842 };
843
844 /* list */
846 struct lysp_when *when;
847 const char *key;
850 struct lysp_node *child;
854 uint32_t min;
855 uint32_t max;
856};
857
859 union {
860 struct lysp_node node;
861
862 struct {
863 struct lysp_node *parent;
864 uint16_t nodetype;
865 uint16_t flags;
866 struct lysp_node *next;
867 const char *name;
868 const char *dsc;
869 const char *ref;
870 struct lysp_qname *iffeatures;
871 struct lysp_ext_instance *exts;
872 };
873 };
874
875 /* choice */
876 struct lysp_node *child;
877 struct lysp_when *when;
879};
880
882 union {
883 struct lysp_node node;
884
885 struct {
886 struct lysp_node *parent;
887 uint16_t nodetype;
888 uint16_t flags;
889 struct lysp_node *next;
890 const char *name;
891 const char *dsc;
892 const char *ref;
893 struct lysp_qname *iffeatures;
894 struct lysp_ext_instance *exts;
895 };
896 };
897
898 /* case */
899 struct lysp_node *child;
900 struct lysp_when *when;
901};
902
904 union {
905 struct lysp_node node;
906
907 struct {
908 struct lysp_node *parent;
909 uint16_t nodetype;
910 uint16_t flags;
911 struct lysp_node *next;
912 const char *name;
913 const char *dsc;
914 const char *ref;
915 struct lysp_qname *iffeatures;
916 struct lysp_ext_instance *exts;
917 };
918 };
919
920 /* anyxml/anydata */
922 struct lysp_when *when;
923};
924
926 union {
927 struct lysp_node node;
928
929 struct {
930 struct lysp_node *parent;
931 uint16_t nodetype;
932 uint16_t flags;
933 struct lysp_node *next;
934 const char *name;
935 const char *dsc;
936 const char *ref;
937 struct lysp_qname *iffeatures;
938 struct lysp_ext_instance *exts;
939 };
940 };
941
942 /* uses */
945 struct lysp_when *when;
946};
947
952 union {
953 struct lysp_node node;
954
955 struct {
956 struct lysp_node *parent;
957 uint16_t nodetype;
958 uint16_t flags;
959 struct lysp_node *next;
960 const char *name;
961 const char *dsc;
962 const char *ref;
963 struct lysp_qname *iffeatures;
964 struct lysp_ext_instance *exts;
965 };
966 };
967
968 /* inout */
972 struct lysp_node *child;
973};
974
979 union {
980 struct lysp_node node;
981
982 struct {
983 struct lysp_node *parent;
984 uint16_t nodetype;
985 uint16_t flags;
986 struct lysp_node_action *next;
987 const char *name;
988 const char *dsc;
989 const char *ref;
990 struct lysp_qname *iffeatures;
991 struct lysp_ext_instance *exts;
992 };
993 };
994
995 /* action */
998
1001};
1002
1007 union {
1008 struct lysp_node node;
1009
1010 struct {
1011 struct lysp_node *parent;
1012 uint16_t nodetype;
1013 uint16_t flags;
1014 struct lysp_node_notif *next;
1015 const char *name;
1016 const char *dsc;
1017 const char *ref;
1018 struct lysp_qname *iffeatures;
1019 struct lysp_ext_instance *exts;
1020 };
1021 };
1022
1023 /* notif */
1028};
1029
1034 union {
1035 struct lysp_node node;
1036
1037 struct {
1038 struct lysp_node *parent;
1039 uint16_t nodetype;
1040 uint16_t flags;
1041 struct lysp_node_grp *next;
1042 const char *name;
1043 const char *dsc;
1044 const char *ref;
1045 struct lysp_qname *iffeatures;
1046 struct lysp_ext_instance *exts;
1047 };
1048 };
1049
1050 /* grp */
1056};
1057
1062 union {
1063 struct lysp_node node;
1064
1065 struct {
1066 struct lysp_node *parent;
1067 uint16_t nodetype;
1068 uint16_t flags;
1069 struct lysp_node_augment *next;
1070 const char *nodeid;
1071 const char *dsc;
1072 const char *ref;
1073 struct lysp_qname *iffeatures;
1074 struct lysp_ext_instance *exts;
1075 };
1076 };
1077
1079 struct lysp_when *when;
1082};
1083
1092
1121
1123 struct lys_module *mod;
1124
1134 struct lysp_node *data;
1140
1141 uint8_t version;
1142 uint8_t parsing : 1;
1143 uint8_t is_submod : 1;
1144
1145 uint8_t latest_revision : 2;
1149 const char *name;
1150 const char *filepath;
1151 const char *prefix;
1152 const char *org;
1153 const char *contact;
1154 const char *dsc;
1155 const char *ref;
1156};
1157
1164#define LYSP_MODULE_NAME(PMOD) (PMOD->is_submod ? ((struct lysp_submodule *)PMOD)->name : ((struct lysp_module *)PMOD)->mod->name)
1165
1171 char *prefix;
1172 const struct lys_module *mod;
1173};
1174
1182struct lysc_ext {
1183 const char *name;
1184 const char *argname;
1186 uintptr_t plugin_ref;
1188 uint16_t flags;
1189};
1190
1195 struct lyxp_expr *cond;
1198 const char *dsc;
1199 const char *ref;
1201 uint32_t refcount;
1202 uint16_t flags;
1203};
1204
1209 const char *name;
1210 const char *dsc;
1211 const char *ref;
1216 uint16_t flags;
1217};
1218
1225#define LYS_IFF_NOT 0x00
1226#define LYS_IFF_AND 0x01
1227#define LYS_IFF_OR 0x02
1228#define LYS_IFF_F 0x03
1230
1238
1241 union {
1242 int64_t min_64;
1243 uint64_t min_u64;
1244 };
1245 union {
1246 int64_t max_64;
1247 uint64_t max_u64;
1248 };
1250 const char *dsc;
1251 const char *ref;
1252 const char *emsg;
1253 const char *eapptag;
1255};
1256
1258 const char *expr;
1259 const char *dsc;
1260 const char *ref;
1261 const char *emsg;
1262 const char *eapptag;
1264 uint32_t inverted : 1;
1265 uint32_t refcount : 31;
1266};
1267
1269 struct lyxp_expr *cond;
1271 const char *dsc;
1272 const char *ref;
1273 const char *emsg;
1274 const char *eapptag;
1276};
1277
1279 const char *name;
1281 uintptr_t plugin_ref;
1283 uint32_t refcount;
1285};
1286
1288 const char *name;
1290 uintptr_t plugin_ref;
1292 uint32_t refcount;
1293
1295};
1296
1307
1318
1320 const char *name;
1321 const char *dsc;
1322 const char *ref;
1324
1325 union {
1326 int32_t value;
1327 uint32_t position;
1328 };
1329 uint16_t flags;
1331};
1332
1342
1353
1355 const char *name;
1357 uintptr_t plugin_ref;
1359 uint32_t refcount;
1360
1361 struct lyxp_expr *path;
1365};
1366
1377
1387
1389 const char *name;
1391 uintptr_t plugin_ref;
1393 uint32_t refcount;
1394
1395 struct lysc_type **types;
1396};
1397
1407
1411#define LYS_NODE_HASH_COUNT 4
1412
1417 uint16_t nodetype;
1418 uint16_t flags;
1422 struct lysc_node *next;
1423 struct lysc_node *prev;
1427 const char *name;
1428 const char *dsc;
1429 const char *ref;
1431 void *priv;
1432};
1433
1435 union {
1436 struct lysc_node node;
1437
1438 struct {
1439 uint16_t nodetype;
1440 uint16_t flags;
1441 uint8_t hash[LYS_NODE_HASH_COUNT];
1442 struct lys_module *module;
1443 struct lysc_node *parent;
1444 struct lysc_node *next;
1445 struct lysc_node *prev;
1446 const char *name;
1447 const char *dsc;
1448 const char *ref;
1449 struct lysc_ext_instance *exts;
1450 void *priv;
1451 };
1452 };
1453
1456};
1457
1459 union {
1460 struct lysc_node node;
1461
1462 struct {
1463 uint16_t nodetype;
1464 uint16_t flags;
1465 uint8_t hash[LYS_NODE_HASH_COUNT];
1466 struct lys_module *module;
1467 struct lysc_node *parent;
1468 struct lysc_node_action *next;
1469 struct lysc_node_action *prev;
1473 const char *name;
1474 const char *dsc;
1475 const char *ref;
1476 struct lysc_ext_instance *exts;
1477 void *priv;
1478 };
1479 };
1480
1481 struct lysc_when **when;
1486
1487};
1488
1490 union {
1491 struct lysc_node node;
1492
1493 struct {
1494 uint16_t nodetype;
1495 uint16_t flags;
1496 uint8_t hash[LYS_NODE_HASH_COUNT];
1497 struct lys_module *module;
1498 struct lysc_node *parent;
1499 struct lysc_node_notif *next;
1500 struct lysc_node_notif *prev;
1504 const char *name;
1505 const char *dsc;
1506 const char *ref;
1507 struct lysc_ext_instance *exts;
1508 void *priv;
1509 };
1510 };
1511
1514 struct lysc_when **when;
1517};
1518
1520 union {
1521 struct lysc_node node;
1522
1523 struct {
1524 uint16_t nodetype;
1525 uint16_t flags;
1526 uint8_t hash[LYS_NODE_HASH_COUNT];
1527 struct lys_module *module;
1528 struct lysc_node *parent;
1529 struct lysc_node *next;
1530 struct lysc_node *prev;
1534 const char *name;
1535 const char *dsc;
1536 const char *ref;
1537 struct lysc_ext_instance *exts;
1538 void *priv;
1539 };
1540 };
1541
1544 struct lysc_when **when;
1547};
1548
1550 union {
1551 struct lysc_node node;
1552
1553 struct {
1554 uint16_t nodetype;
1555 uint16_t flags;
1556 uint8_t hash[LYS_NODE_HASH_COUNT];
1557 struct lys_module *module;
1558 struct lysc_node *parent;
1559 struct lysc_node *next;
1560 struct lysc_node *prev;
1564 const char *name;
1565 const char *dsc;
1566 const char *ref;
1567 struct lysc_ext_instance *exts;
1568 void *priv;
1569 };
1570 };
1571
1574 struct lysc_when **when;
1575};
1576
1578 union {
1579 struct lysc_node node;
1580
1581 struct {
1582 uint16_t nodetype;
1583 uint16_t flags;
1584 uint8_t hash[LYS_NODE_HASH_COUNT];
1585 struct lys_module *module;
1586 struct lysc_node *parent;
1587 struct lysc_node *next;
1588 struct lysc_node *prev;
1592 const char *name;
1593 const char *dsc;
1594 const char *ref;
1595 struct lysc_ext_instance *exts;
1596 void *priv;
1597 };
1598 };
1599
1601 struct lysc_when **when;
1603};
1604
1606 const char *str;
1608};
1609
1611 union {
1612 struct lysc_node node;
1613
1614 struct {
1615 uint16_t nodetype;
1616 uint16_t flags;
1617 uint8_t hash[LYS_NODE_HASH_COUNT];
1618 struct lys_module *module;
1619 struct lysc_node *parent;
1620 struct lysc_node *next;
1621 struct lysc_node *prev;
1625 const char *name;
1626 const char *dsc;
1627 const char *ref;
1628 struct lysc_ext_instance *exts;
1629 void *priv;
1630 };
1631 };
1632
1634 struct lysc_when **when;
1635 struct lysc_type *type;
1636
1637 const char *units;
1639};
1640
1642 union {
1643 struct lysc_node node;
1644
1645 struct {
1646 uint16_t nodetype;
1647 uint16_t flags;
1648 uint8_t hash[LYS_NODE_HASH_COUNT];
1649 struct lys_module *module;
1650 struct lysc_node *parent;
1651 struct lysc_node *next;
1652 struct lysc_node *prev;
1656 const char *name;
1657 const char *dsc;
1658 const char *ref;
1659 struct lysc_ext_instance *exts;
1660 void *priv;
1661 };
1662 };
1663
1665 struct lysc_when **when;
1666 struct lysc_type *type;
1667
1668 const char *units;
1671
1672 uint32_t min;
1673 uint32_t max;
1674
1675};
1676
1678 union {
1679 struct lysc_node node;
1680
1681 struct {
1682 uint16_t nodetype;
1683 uint16_t flags;
1684 uint8_t hash[LYS_NODE_HASH_COUNT];
1685 struct lys_module *module;
1686 struct lysc_node *parent;
1687 struct lysc_node *next;
1688 struct lysc_node *prev;
1692 const char *name;
1693 const char *dsc;
1694 const char *ref;
1695 struct lysc_ext_instance *exts;
1696 void *priv;
1697 };
1698 };
1699
1702 struct lysc_when **when;
1705
1707 uint32_t min;
1708 uint32_t max;
1709};
1710
1712 union {
1713 struct lysc_node node;
1714
1715 struct {
1716 uint16_t nodetype;
1717 uint16_t flags;
1718 uint8_t hash[LYS_NODE_HASH_COUNT];
1719 struct lys_module *module;
1720 struct lysc_node *parent;
1721 struct lysc_node *next;
1722 struct lysc_node *prev;
1726 const char *name;
1727 const char *dsc;
1728 const char *ref;
1729 struct lysc_ext_instance *exts;
1730 void *priv;
1731 };
1732 };
1733
1735 struct lysc_when **when;
1736};
1737
1742 const char *name;
1743 const char *revision;
1744 const char *filepath;
1745};
1746
1762
1769#define lysc_is_userordered(lysc_node) \
1770 ((!lysc_node || !(lysc_node->nodetype & (LYS_LEAFLIST | LYS_LIST)) || !(lysc_node->flags & LYS_ORDBY_USER)) ? 0 : 1)
1771
1778#define lysc_is_key(lysc_node) \
1779 ((!lysc_node || (lysc_node->nodetype != LYS_LEAF) || !(lysc_node->flags & LYS_KEY)) ? 0 : 1)
1780
1787#define lysc_is_np_cont(lysc_node) \
1788 ((!lysc_node || (lysc_node->nodetype != LYS_CONTAINER) || (lysc_node->flags & LYS_PRESENCE)) ? 0 : 1)
1789
1796#define lysc_is_dup_inst_list(lysc_node) \
1797 ((lysc_node && (((lysc_node->nodetype == LYS_LIST) && (lysc_node->flags & LYS_KEYLESS)) || \
1798 ((lysc_node->nodetype == LYS_LEAFLIST) && !(lysc_node->flags & LYS_CONFIG_W)))) ? 1 : 0)
1799
1807LIBYANG_API_DECL struct lyplg_type *lysc_get_type_plugin(uintptr_t plugin_ref);
1808
1816LIBYANG_API_DECL struct lyplg_ext *lysc_get_ext_plugin(uintptr_t plugin_ref);
1817
1824LIBYANG_API_DECL const struct lysc_node *lysc_data_node(const struct lysc_node *schema);
1825
1829#define lysc_data_parent(SCHEMA) lysc_data_node((SCHEMA) ? (SCHEMA)->parent : NULL)
1830
1841LIBYANG_API_DECL const struct lysc_when *lysc_has_when(const struct lysc_node *node);
1842
1850LIBYANG_API_DECL const struct lys_module *lysc_owner_module(const struct lysc_node *node);
1851
1858LIBYANG_API_DECL const struct lysp_node_grp *lysp_node_groupings(const struct lysp_node *node);
1859
1866LIBYANG_API_DECL const struct lysp_tpdf *lysp_node_typedefs(const struct lysp_node *node);
1867
1874LIBYANG_API_DECL const struct lysp_node_action *lysp_node_actions(const struct lysp_node *node);
1875
1882LIBYANG_API_DECL const struct lysp_node_notif *lysp_node_notifs(const struct lysp_node *node);
1883
1890LIBYANG_API_DECL const struct lysp_node *lysp_node_child(const struct lysp_node *node);
1891
1898LIBYANG_API_DECL const struct lysc_node_action *lysc_node_actions(const struct lysc_node *node);
1899
1906LIBYANG_API_DECL const struct lysc_node_notif *lysc_node_notifs(const struct lysc_node *node);
1907
1918LIBYANG_API_DECL const struct lysc_node *lysc_node_child(const struct lysc_node *node);
1919
1927LIBYANG_API_DECL struct lysc_must *lysc_node_musts(const struct lysc_node *node);
1928
1936LIBYANG_API_DECL struct lysc_when **lysc_node_when(const struct lysc_node *node);
1937
1945LIBYANG_API_DECL const struct lysc_node *lysc_node_lref_target(const struct lysc_node *node);
1946
1956LIBYANG_API_DECL LY_ERR lysc_node_lref_targets(const struct lysc_node *node, struct ly_set **set);
1957
1969LIBYANG_API_DECL LY_ERR lysc_node_lref_backlinks(const struct ly_ctx *ctx, const struct lysc_node *node,
1970 ly_bool match_ancestors, struct ly_set **set);
1971
1981typedef LY_ERR (*lysc_dfs_clb)(struct lysc_node *node, void *data, ly_bool *dfs_continue);
1982
1999LIBYANG_API_DECL LY_ERR lysc_tree_dfs_full(const struct lysc_node *root, lysc_dfs_clb dfs_clb, void *data);
2000
2012LIBYANG_API_DECL LY_ERR lysc_module_dfs_full(const struct lys_module *mod, lysc_dfs_clb dfs_clb, void *data);
2013
2022LIBYANG_API_DECL LY_ERR lysc_iffeature_value(const struct lysc_iffeature *iff);
2023
2035LIBYANG_API_DECL LY_ERR lys_identity_iffeature_value(const struct lysc_ident *ident);
2036
2045LIBYANG_API_DECL struct lysp_feature *lysp_feature_next(const struct lysp_feature *last, const struct lysp_module *pmod,
2046 uint32_t *idx);
2047
2053#define LYS_FIND_XP_SCHEMA 0x08
2054#define LYS_FIND_XP_OUTPUT 0x10
2055#define LYS_FIND_NO_MATCH_ERROR 0x40
2057#define LYS_FIND_SCHEMAMOUNT 0x0200
2060
2072LIBYANG_API_DECL LY_ERR lys_find_xpath_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath,
2073 uint32_t options, struct ly_set **set);
2074
2087LIBYANG_API_DECL LY_ERR lys_find_expr_atoms(const struct lysc_node *ctx_node, const struct lys_module *cur_mod,
2088 const struct lyxp_expr *expr, const struct lysc_prefix *prefixes, uint32_t options, struct ly_set **set);
2089
2101LIBYANG_API_DECL LY_ERR lys_find_xpath(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath,
2102 uint32_t options, struct ly_set **set);
2103
2112LIBYANG_API_DECL LY_ERR lys_find_lypath_atoms(const struct ly_path *path, struct ly_set **set);
2113
2124LIBYANG_API_DECL LY_ERR lys_find_path_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *path,
2125 ly_bool output, struct ly_set **set);
2126
2136LIBYANG_API_DECL const struct lysc_node *lys_find_path(const struct ly_ctx *ctx, const struct lysc_node *ctx_node,
2137 const char *path, ly_bool output);
2138
2148
2160LIBYANG_API_DECL char *lysc_path(const struct lysc_node *node, LYSC_PATH_TYPE pathtype, char *buffer, size_t buflen);
2161
2166 struct ly_ctx *ctx;
2167 const char *name;
2168 const char *revision;
2169 const char *ns;
2170 const char *prefix;
2171 const char *filepath;
2172 const char *org;
2173 const char *contact;
2174 const char *dsc;
2175 const char *ref;
2176
2180
2190
2194
2198 uint8_t version : 2;
2199 uint8_t latest_revision : 4;
2201};
2202
2210#define LYS_MOD_LATEST_REV 0x01
2211#define LYS_MOD_LATEST_SEARCHDIRS 0x02
2212#define LYS_MOD_IMPORTED_REV 0x04
2215#define LYS_MOD_LATEST_IMPCLB 0x08
2217
2230LIBYANG_API_DECL LY_ERR lys_feature_value(const struct lys_module *module, const char *feature);
2231
2251LIBYANG_API_DECL const struct lysc_node *lys_getnext(const struct lysc_node *last, const struct lysc_node *parent,
2252 const struct lysc_module *module, uint32_t options);
2253
2266LIBYANG_API_DECL const struct lysc_node *lys_getnext_ext(const struct lysc_node *last, const struct lysc_node *parent,
2267 const struct lysc_ext_instance *ext, uint32_t options);
2268
2276#define LYS_GETNEXT_WITHCHOICE 0x01
2277#define LYS_GETNEXT_NOCHOICE 0x02
2278#define LYS_GETNEXT_WITHCASE 0x04
2279#define LYS_GETNEXT_INTONPCONT 0x08
2280#define LYS_GETNEXT_OUTPUT 0x10
2282#define LYS_GETNEXT_WITHSCHEMAMOUNT 0x20
2285#define LYS_GETNEXT_EXT_XPATH 0x40
2288
2301LIBYANG_API_DECL const struct lysc_node *lys_find_child(const struct lysc_node *parent, const struct lys_module *module,
2302 const char *name, size_t name_len, uint16_t nodetype, uint32_t options);
2303
2319LIBYANG_API_DECL LY_ERR lys_set_implemented(struct lys_module *mod, const char **features);
2320
2327LIBYANG_API_DECL const char *lys_nodetype2str(uint16_t nodetype);
2328
2335LIBYANG_API_DECL const char *lyxp_get_expr(const struct lyxp_expr *path);
2336
2338
2339#ifdef __cplusplus
2340}
2341#endif
2342
2343#endif /* LY_TREE_SCHEMA_H_ */
libyang context handler.
LY_ERR
libyang's error codes returned by the libyang functions.
Definition log.h:237
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]
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 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 lysc_node *parent, const struct lys_module *module, const char *name, size_t name_len, uint16_t nodetype, uint32_t options)
Get 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 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 lysc_node * lys_getnext_ext(const struct lysc_node *last, const struct lysc_node *parent, const struct lysc_ext_instance *ext, uint32_t options)
Get next schema (sibling) node element in the schema order of an extension that can be instantiated i...
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
Logger manipulation routines and error definitions.
uint8_t ly_bool
Type to indicate boolean value.
Definition log.h:35
libyang generic macros and functions to work with YANG schema or data trees.