diff options
| author | Chirag Shah <chirag@nvidia.com> | 2020-10-03 15:34:33 -0700 | 
|---|---|---|
| committer | Chirag Shah <chirag@nvidia.com> | 2020-10-05 13:15:59 -0700 | 
| commit | f63f5f1947c3b4a99e97494198520f03fb6b063e (patch) | |
| tree | 8c1071614c685dc9d8a68322ecd6cf0ce85b7e37 /lib/northbound.h | |
| parent | 002bac8b5bc229f892c66e3c13c4c058a2b10e27 (diff) | |
*: 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.h | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/northbound.h b/lib/northbound.h index 01dc528aa4..16f19b3d5b 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.  | 
