summaryrefslogtreecommitdiffstats
path: root/lib/yang_wrappers.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-01-19 23:13:14 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2024-01-28 22:28:39 +0100
commit93744dbe883a0211d5b771ce2cbcb4da93b95e1b (patch)
treed43e827d70df266fef4235f212b6d1709f9dc389 /lib/yang_wrappers.c
parentlib: don't set LP_EXTEND_ADM_GRP by default (diff)
downloadfrr-93744dbe883a0211d5b771ce2cbcb4da93b95e1b.tar.xz
frr-93744dbe883a0211d5b771ce2cbcb4da93b95e1b.zip
zebra: convert interface link-params bandwidth commands to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/yang_wrappers.c')
-rw-r--r--lib/yang_wrappers.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/yang_wrappers.c b/lib/yang_wrappers.c
index dc049a374..53f40e89b 100644
--- a/lib/yang_wrappers.c
+++ b/lib/yang_wrappers.c
@@ -1046,6 +1046,17 @@ struct yang_data *yang_data_new_date_and_time(const char *xpath, time_t time)
return yang_data_new(xpath, timebuf);
}
+float yang_dnode_get_bandwidth_ieee_float32(const struct lyd_node *dnode,
+ const char *xpath_fmt, ...)
+{
+ const char *canon = YANG_DNODE_XPATH_GET_CANON(dnode, xpath_fmt);
+ float value;
+
+ assert(sscanf(canon, "%a", &value) == 1);
+
+ return value;
+}
+
const char *yang_nexthop_type2str(uint32_t ntype)
{
switch (ntype) {