Skip to content

Commit aa3f506

Browse files
choppsv1rjarry
authored andcommitted
data: add missing DNode.is_default API
Add access to libyang lyd_is_default() API. Signed-off-by: Christian Hopps <[email protected]>
1 parent 1714370 commit aa3f506

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cffi/cdefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,7 @@ struct lyd_value_union {
944944

945945
const char * lyd_get_value(const struct lyd_node *);
946946
struct lyd_node* lyd_child(const struct lyd_node *);
947+
ly_bool lyd_is_default(const struct lyd_node *);
947948
LY_ERR lyd_find_path(const struct lyd_node *, const char *, ly_bool, struct lyd_node **);
948949
void lyd_free_siblings(struct lyd_node *);
949950
struct lyd_node* lyd_first_sibling(const struct lyd_node *);

libyang/data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ def flags(self):
390390
ret["new"] = True
391391
return ret
392392

393+
def is_default(self) -> bool:
394+
return lib.lyd_is_default(self.cdata)
395+
393396
def set_when(self, value: bool):
394397
if value:
395398
self.cdata.flags |= lib.LYD_WHEN_TRUE

0 commit comments

Comments
 (0)