diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2020-05-14 21:18:26 -0300 | 
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2020-05-28 19:22:54 -0300 | 
| commit | 1abe6c535e89f8b445c7d5808bc7972a6b60236d (patch) | |
| tree | 7f93f6698f82931248b6628a407a3a2ceb704df0 /lib/northbound.h | |
| parent | 0e10aeeb1821729d24871e12d867d6037ebf6012 (diff) | |
lib: detect and log unexpected return values from northbound callbacks
Each northbound callback has a set of valid return values, some of
which might depend on the transaction phase. The valid return values
for each callback are documented in the northbound main header.
Add some code to detect when a callback returns an unexpected value
and log the occurrence. This should help us to identify and fix
such problems.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/northbound.h')
| -rw-r--r-- | lib/northbound.h | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/northbound.h b/lib/northbound.h index 40a97dad6b..c5f20d15be 100644 --- a/lib/northbound.h +++ b/lib/northbound.h @@ -359,6 +359,10 @@ struct nb_callbacks {  	 * args  	 *    Refer to the documentation comments of nb_cb_pre_validate_args for  	 *    details. +	 * +	 * Returns: +	 *    - NB_OK on success. +	 *    - NB_ERR_VALIDATION when a validation error occurred.  	 */  	int (*pre_validate)(struct nb_cb_pre_validate_args *args);  | 
