summaryrefslogtreecommitdiffstats
path: root/lib/northbound.h
diff options
context:
space:
mode:
authorChirag Shah <chirag@nvidia.com>2020-10-04 00:34:33 +0200
committerChirag Shah <chirag@nvidia.com>2020-10-05 22:15:59 +0200
commitf63f5f1947c3b4a99e97494198520f03fb6b063e (patch)
tree8c1071614c685dc9d8a68322ecd6cf0ce85b7e37 /lib/northbound.h
parentMerge pull request #6904 from chiragshah6/yang_nb6 (diff)
downloadfrr-f63f5f1947c3b4a99e97494198520f03fb6b063e.tar.xz
frr-f63f5f1947c3b4a99e97494198520f03fb6b063e.zip
*: add errmsg to nb rpc
Display human readable error message in northbound rpc transaction failure. In case of vtysh nb client, the error message will be displayed to user. Testing: bharat# clear evpn dup-addr vni 1002 ip 11.11.11.11 Error type: generic error Error description: Requested IP's associated MAC aa:aa:aa:aa:aa:aa is still in duplicate state Signed-off-by: Chirag Shah <chirag@nvidia.com>
Diffstat (limited to 'lib/northbound.h')
-rw-r--r--lib/northbound.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/northbound.h b/lib/northbound.h
index 01dc528aa..16f19b3d5 100644
--- a/lib/northbound.h
+++ b/lib/northbound.h
@@ -258,6 +258,12 @@ struct nb_cb_rpc_args {
/* List of output parameters to be populated by the callback. */
struct list *output;
+
+ /* Buffer to store human-readable error message in case of error. */
+ char *errmsg;
+
+ /* Size of errmsg. */
+ size_t errmsg_len;
};
/*
@@ -689,7 +695,8 @@ extern const void *nb_callback_lookup_entry(const struct nb_node *nb_node,
const void *parent_list_entry,
const struct yang_list_keys *keys);
extern int nb_callback_rpc(const struct nb_node *nb_node, const char *xpath,
- const struct list *input, struct list *output);
+ const struct list *input, struct list *output,
+ char *errmsg, size_t errmsg_len);
/*
* Create a northbound node for all YANG schema nodes.