mirror_frr/tools/coccinelle
Renato Westphal 60ee8be107 *: change the signature of the northbound callbacks to be more flexible
Having a fixed set of parameters for each northbound callback isn't a
good idea since it makes it difficult to add new parameters whenever
that becomes necessary, as several hundreds or thousands of existing
callbacks need to be updated accordingly.

To remediate this issue, this commit changes the signature of all
northbound callbacks to have a single parameter: a pointer to a
'nb_cb_x_args' structure (where x is different for each type
of callback). These structures encapsulate all real parameters
(both input and output) the callbacks need to have access to. And
adding a new parameter to a given callback is as simple as adding
a new field to the corresponding 'nb_cb_x_args' structure, without
needing to update any instance of that callback in any daemon.

This commit includes a .cocci semantic patch that can be used to
update old code to the new format automatically.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-23 10:14:32 -03:00
..
__func__.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
alloc_cast.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
array_size.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
badty.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
badzero.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
bool_assignment.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
bool_expression.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
bool_function_type.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
bool_function.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
boolconv.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
boolinit.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
boolreturn.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
cast_to_larger_sizes.cocci tools: Add coccinelle script to catch typecasts to larger sizes 2020-04-07 18:03:57 +03:00
cond_no_effect.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
ctype_cast.cocci *: fix ctype (isalpha & co.) casts 2019-08-06 16:54:52 +02:00
deref_null.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
double_lock.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
doublebitand.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
doubleinit.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
doubletest.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
frr_with_mutex.cocci lib: add frr_with_mutex() block-wrapper 2019-09-03 17:15:17 +02:00
hash_const.cocci lib: hashing functions should take const arguments 2019-05-14 21:23:08 +00:00
ifaddr.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
ifnullxfree.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
int_to_bool_function.cocci tools: Convert type int functions to bool where possible 2020-03-21 14:58:21 +02:00
itnull.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
mini_lock.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
nb-cbs.cocci *: change the signature of the northbound callbacks to be more flexible 2020-04-23 10:14:32 -03:00
noderef.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
replace_bgp_flag_functions.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
replace-strncpy.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
return_without_parenthesis.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
returnvar.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
s_addr_0_to_INADDR_ANY.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
same_type_casting.cocci tools: Add coccinelle script to catch typecasts to same type 2020-04-08 17:15:10 +03:00
semicolon.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
shorthand_operator.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
strncpy_truncation.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
test_after_assert.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
unsigned_lesser_than_zero.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
void_no_return.cocci tools: Move scripts/coccinelle to tools/coccinelle 2020-03-10 11:41:09 +02:00
vty_check.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
vty_index.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
xcalloc-simple.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
xfree.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
xfreeaddr.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
xmalloc_returnval.cocci tools: add coccinelle spatches 2019-02-26 17:40:40 +00:00
zprivs.cocci *: frr_elevate_privs -> frr_with_privs 2019-09-03 17:18:35 +02:00