mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-01 13:23:01 +02:00
statd: add parent-interface to operational data
Add ietf-if-extensions:parent-interface which is synonymous with link in ip-route. Signed-off-by: Richard Alpe <richard@bit42.se>
This commit is contained in:
committed by
Joachim Wiberg
parent
48120c9144
commit
5ac24eb29e
@@ -432,6 +432,22 @@ static int ly_add_ip_link_data(const struct ly_ctx *ctx, struct lyd_node **paren
|
||||
return err;
|
||||
}
|
||||
|
||||
j_val = json_object_get(j_iface, "link");
|
||||
if (j_val) {
|
||||
if (!json_is_string(j_val)) {
|
||||
ERROR("Expected a JSON string for 'link'");
|
||||
return SR_ERR_SYS;
|
||||
}
|
||||
|
||||
err = lydx_new_path(ctx, parent, xpath,
|
||||
"ietf-if-extensions:parent-interface", "%s",
|
||||
json_string_value(j_val));
|
||||
if (err) {
|
||||
ERROR("Error, adding 'link' to data tree, libyang error %d", err);
|
||||
return SR_ERR_LY;
|
||||
}
|
||||
}
|
||||
|
||||
return SR_ERR_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user