summaryrefslogtreecommitdiffstats
path: root/lib/if.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-04-04 18:38:51 +0200
committerRenato Westphal <renato@opensourcerouting.org>2020-04-23 15:14:32 +0200
commit60ee8be107c593212a9b53e8ed5c34c4c5e70af3 (patch)
treef86993b9f63afab4a8e0291f27fd8f938f5dec8d /lib/if.h
parentlib: create a wrapper function for all northbound callbacks (diff)
downloadfrr-60ee8be107c593212a9b53e8ed5c34c4c5e70af3.tar.xz
frr-60ee8be107c593212a9b53e8ed5c34c4c5e70af3.zip
*: 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>
Diffstat (limited to 'lib/if.h')
-rw-r--r--lib/if.h18
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/if.h b/lib/if.h
index 9afbb5acc..ac8d8e70b 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -602,24 +602,6 @@ extern void if_destroy_via_zapi(struct interface *ifp);
extern const struct frr_yang_module_info frr_interface_info;
-struct yang_data *lib_interface_state_if_index_get_elem(const char *xpath,
- const void *list_entry);
-struct yang_data *lib_interface_state_mtu_get_elem(const char *xpath,
- const void *list_entry);
-struct yang_data *lib_interface_state_mtu6_get_elem(const char *xpath,
- const void *list_entry);
-struct yang_data *lib_interface_state_speed_get_elem(const char *xpath,
- const void *list_entry);
-struct yang_data *lib_interface_state_metric_get_elem(const char *xpath,
- const void *list_entry);
-struct yang_data *lib_interface_state_flags_get_elem(const char *xpath,
- const void *list_entry);
-struct yang_data *lib_interface_state_type_get_elem(const char *xpath,
- const void *list_entry);
-struct yang_data *
-lib_interface_state_phy_address_get_elem(const char *xpath,
- const void *list_entry);
-
#ifdef __cplusplus
}
#endif