From bf8d3d6aca3f20255a621ed1c148fd05b3a8ae5c Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 21 Feb 2021 06:18:10 +0100 Subject: *: require semicolon after DEFINE_MTYPE & co Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter --- ospf6d/ospf6_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ospf6d/ospf6_interface.c') diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index a5d9138743..c05d9cab16 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -45,7 +45,7 @@ #include "ospf6_zebra.h" #include "lib/json.h" -DEFINE_MTYPE_STATIC(OSPF6D, CFG_PLIST_NAME, "configured prefix list names") +DEFINE_MTYPE_STATIC(OSPF6D, CFG_PLIST_NAME, "configured prefix list names"); DEFINE_QOBJ_TYPE(ospf6_interface) DEFINE_HOOK(ospf6_interface_change, (struct ospf6_interface * oi, int state, int old_state), -- cgit v1.2.3 From 8451921b70044a2c1075e7ba391f095fabee2550 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 21 Feb 2021 06:33:45 +0100 Subject: *: require semicolon after DEFINE_HOOK & co. See previous commit. Signed-off-by: David Lamparter --- bgpd/bgp_fsm.c | 4 ++-- bgpd/bgp_fsm.h | 4 ++-- bgpd/bgp_nb_config.c | 2 +- bgpd/bgp_packet.c | 4 ++-- bgpd/bgp_packet.h | 4 ++-- bgpd/bgp_route.c | 6 +++--- bgpd/bgp_route.h | 2 +- bgpd/bgp_vty.c | 4 ++-- bgpd/bgp_zebra.c | 2 +- bgpd/bgpd.c | 2 +- bgpd/bgpd.h | 16 ++++++++-------- doc/developer/hooks.rst | 10 +++++----- isisd/isis_adjacency.c | 2 +- isisd/isis_adjacency.h | 6 +++--- isisd/isis_circuit.c | 6 +++--- isisd/isis_circuit.h | 4 ++-- isisd/isis_route.c | 2 +- isisd/isis_route.h | 2 +- isisd/isis_tlvs.c | 4 ++-- isisd/isisd.h | 2 +- ldpd/ldpd.c | 2 +- ldpd/ldpd.h | 2 +- ldpd/ldpe.h | 3 ++- ldpd/neighbor.c | 3 ++- lib/agentx.c | 2 +- lib/hook.h | 13 ++++++++----- lib/if.c | 4 ++-- lib/if.h | 4 ++-- lib/libfrr.c | 8 ++++---- lib/libfrr.h | 8 ++++---- lib/log_vty.c | 2 +- lib/log_vty.h | 2 +- lib/northbound.h | 6 +++--- lib/routing_nb.h | 2 +- lib/routing_nb_config.c | 2 +- lib/smux.h | 2 +- lib/zlog.c | 6 +++--- lib/zlog.h | 6 +++--- ospf6d/ospf6_interface.c | 2 +- ospf6d/ospf6_interface.h | 2 +- ospf6d/ospf6_neighbor.c | 2 +- ospf6d/ospf6_neighbor.h | 2 +- ospfd/ospf_interface.c | 8 ++++---- ospfd/ospf_interface.h | 8 ++++---- ospfd/ospf_ism.c | 2 +- ospfd/ospf_ism.h | 2 +- ospfd/ospf_nsm.c | 2 +- ospfd/ospf_nsm.h | 2 +- pathd/pathd.c | 6 +++--- pathd/pathd.h | 6 +++--- ripd/rip_interface.c | 4 ++-- ripd/ripd.h | 4 ++-- zebra/interface.c | 4 ++-- zebra/interface.h | 4 ++-- zebra/rib.h | 2 +- zebra/zebra_mlag.c | 10 +++++----- zebra/zebra_mlag.h | 10 +++++----- zebra/zebra_pbr.c | 4 ++-- zebra/zebra_pbr.h | 4 ++-- zebra/zebra_pw.c | 4 ++-- zebra/zebra_pw.h | 4 ++-- zebra/zebra_rib.c | 2 +- zebra/zebra_vxlan.c | 2 +- zebra/zebra_vxlan_private.h | 2 +- 64 files changed, 137 insertions(+), 132 deletions(-) (limited to 'ospf6d/ospf6_interface.c') diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 757d76f69e..dbde39be03 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -57,8 +57,8 @@ #include "bgpd/bgp_zebra.h" #include "bgpd/bgp_vty.h" -DEFINE_HOOK(peer_backward_transition, (struct peer * peer), (peer)) -DEFINE_HOOK(peer_status_changed, (struct peer * peer), (peer)) +DEFINE_HOOK(peer_backward_transition, (struct peer * peer), (peer)); +DEFINE_HOOK(peer_status_changed, (struct peer * peer), (peer)); /* Definition of display strings corresponding to FSM events. This should be * kept consistent with the events defined in bgpd.h diff --git a/bgpd/bgp_fsm.h b/bgpd/bgp_fsm.h index bf4966c839..bcf697e153 100644 --- a/bgpd/bgp_fsm.h +++ b/bgpd/bgp_fsm.h @@ -155,8 +155,8 @@ extern void bgp_start_routeadv(struct bgp *); extern void bgp_adjust_routeadv(struct peer *); #include "hook.h" -DECLARE_HOOK(peer_backward_transition, (struct peer *peer), (peer)) -DECLARE_HOOK(peer_established, (struct peer *peer), (peer)) +DECLARE_HOOK(peer_backward_transition, (struct peer *peer), (peer)); +DECLARE_HOOK(peer_established, (struct peer *peer), (peer)); int bgp_gr_update_all(struct bgp *bgp, int global_gr_cmd); int bgp_neighbor_graceful_restart(struct peer *peer, int peer_gr_cmd); diff --git a/bgpd/bgp_nb_config.c b/bgpd/bgp_nb_config.c index 721ce5b5c6..adb0e17d29 100644 --- a/bgpd/bgp_nb_config.c +++ b/bgpd/bgp_nb_config.c @@ -32,7 +32,7 @@ #include "bgpd/bgp_io.h" #include "bgpd/bgp_damp.h" -DEFINE_HOOK(bgp_snmp_init_stats, (struct bgp *bgp), (bgp)) +DEFINE_HOOK(bgp_snmp_init_stats, (struct bgp *bgp), (bgp)); FRR_CFG_DEFAULT_ULONG(BGP_CONNECT_RETRY, { .val_ulong = 10, .match_profile = "datacenter", }, diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index f04b89594e..de85bfb3bb 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -68,12 +68,12 @@ DEFINE_HOOK(bgp_packet_dump, (struct peer *peer, uint8_t type, bgp_size_t size, struct stream *s), - (peer, type, size, s)) + (peer, type, size, s)); DEFINE_HOOK(bgp_packet_send, (struct peer *peer, uint8_t type, bgp_size_t size, struct stream *s), - (peer, type, size, s)) + (peer, type, size, s)); /** * Sets marker and type fields for a BGP message. diff --git a/bgpd/bgp_packet.h b/bgpd/bgp_packet.h index d32f091d0c..d69c862304 100644 --- a/bgpd/bgp_packet.h +++ b/bgpd/bgp_packet.h @@ -26,12 +26,12 @@ DECLARE_HOOK(bgp_packet_dump, (struct peer *peer, uint8_t type, bgp_size_t size, struct stream *s), - (peer, type, size, s)) + (peer, type, size, s)); DECLARE_HOOK(bgp_packet_send, (struct peer *peer, uint8_t type, bgp_size_t size, struct stream *s), - (peer, type, size, s)) + (peer, type, size, s)); #define BGP_NLRI_LENGTH 1U #define BGP_TOTAL_ATTR_LEN 2U diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 87fd5f28ca..124a477248 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -95,12 +95,12 @@ DEFINE_HOOK(bgp_snmp_update_stats, (struct bgp_node *rn, struct bgp_path_info *pi, bool added), - (rn, pi, added)) + (rn, pi, added)); DEFINE_HOOK(bgp_rpki_prefix_status, (struct peer *peer, struct attr *attr, const struct prefix *prefix), - (peer, attr, prefix)) + (peer, attr, prefix)); /* Extern from bgp_dump.c */ extern const char *bgp_origin_str[]; @@ -126,7 +126,7 @@ static const struct message bgp_pmsi_tnltype_str[] = { DEFINE_HOOK(bgp_process, (struct bgp * bgp, afi_t afi, safi_t safi, struct bgp_dest *bn, struct peer *peer, bool withdraw), - (bgp, afi, safi, bn, peer, withdraw)) + (bgp, afi, safi, bn, peer, withdraw)); /** Test if path is suppressed. */ static bool bgp_path_suppressed(struct bgp_path_info *pi) diff --git a/bgpd/bgp_route.h b/bgpd/bgp_route.h index 766e5ade92..1dec99f085 100644 --- a/bgpd/bgp_route.h +++ b/bgpd/bgp_route.h @@ -550,7 +550,7 @@ static inline bool bgp_check_advertise(struct bgp *bgp, struct bgp_dest *dest) DECLARE_HOOK(bgp_process, (struct bgp * bgp, afi_t afi, safi_t safi, struct bgp_dest *bn, struct peer *peer, bool withdraw), - (bgp, afi, safi, bn, peer, withdraw)) + (bgp, afi, safi, bn, peer, withdraw)); /* BGP show options */ #define BGP_SHOW_OPT_JSON (1 << 0) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index a4e56c95c8..274e8248a0 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -126,8 +126,8 @@ FRR_CFG_DEFAULT_BOOL(BGP_SUPPRESS_DUPLICATES, DEFINE_HOOK(bgp_inst_config_write, (struct bgp *bgp, struct vty *vty), - (bgp, vty)) -DEFINE_HOOK(bgp_snmp_update_last_changed, (struct bgp *bgp), (bgp)) + (bgp, vty)); +DEFINE_HOOK(bgp_snmp_update_last_changed, (struct bgp *bgp), (bgp)); #define GR_NO_OPER \ "The Graceful Restart No Operation was executed as cmd same as previous one." diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index c554332255..afdd5123fb 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -69,7 +69,7 @@ struct zclient *zclient = NULL; /* hook to indicate vrf status change for SNMP */ DEFINE_HOOK(bgp_vrf_status_changed, (struct bgp *bgp, struct interface *ifp), - (bgp, ifp)) + (bgp, ifp)); /* Can we install into zebra? */ static inline bool bgp_install_info_to_zebra(struct bgp *bgp) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 33c8f3c1f0..993caf6b9d 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -96,7 +96,7 @@ DEFINE_MTYPE_STATIC(BGPD, BGP_EVPN_INFO, "BGP EVPN instance information"); DEFINE_QOBJ_TYPE(bgp_master) DEFINE_QOBJ_TYPE(bgp) DEFINE_QOBJ_TYPE(peer) -DEFINE_HOOK(bgp_inst_delete, (struct bgp *bgp), (bgp)) +DEFINE_HOOK(bgp_inst_delete, (struct bgp *bgp), (bgp)); /* BGP process wide configuration. */ static struct bgp_master bgp_master; diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 3f5ec07796..a9ee7666da 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -714,10 +714,10 @@ struct bgp { }; DECLARE_QOBJ_TYPE(bgp) -DECLARE_HOOK(bgp_inst_delete, (struct bgp *bgp), (bgp)) +DECLARE_HOOK(bgp_inst_delete, (struct bgp *bgp), (bgp)); DECLARE_HOOK(bgp_inst_config_write, (struct bgp *bgp, struct vty *vty), - (bgp, vty)) + (bgp, vty)); /* Thread callback information */ struct afi_safi_info { @@ -2364,17 +2364,17 @@ extern int bgp_lookup_by_as_name_type(struct bgp **bgp_val, as_t *as, /* Hooks */ DECLARE_HOOK(bgp_vrf_status_changed, (struct bgp *bgp, struct interface *ifp), - (bgp, ifp)) -DECLARE_HOOK(peer_status_changed, (struct peer *peer), (peer)) -DECLARE_HOOK(bgp_snmp_init_stats, (struct bgp *bgp), (bgp)) -DECLARE_HOOK(bgp_snmp_update_last_changed, (struct bgp *bgp), (bgp)) + (bgp, ifp)); +DECLARE_HOOK(peer_status_changed, (struct peer *peer), (peer)); +DECLARE_HOOK(bgp_snmp_init_stats, (struct bgp *bgp), (bgp)); +DECLARE_HOOK(bgp_snmp_update_last_changed, (struct bgp *bgp), (bgp)); DECLARE_HOOK(bgp_snmp_update_stats, (struct bgp_node *rn, struct bgp_path_info *pi, bool added), - (rn, pi, added)) + (rn, pi, added)); DECLARE_HOOK(bgp_rpki_prefix_status, (struct peer * peer, struct attr *attr, const struct prefix *prefix), - (peer, attr, prefix)) + (peer, attr, prefix)); void peer_nsf_stop(struct peer *peer); diff --git a/doc/developer/hooks.rst b/doc/developer/hooks.rst index 10fe6b9c43..b37a4aeea7 100644 --- a/doc/developer/hooks.rst +++ b/doc/developer/hooks.rst @@ -15,13 +15,13 @@ Example: :caption: mydaemon.h #include "hook.h" - DECLARE_HOOK(some_update_event, (struct eventinfo *info), (info)) + DECLARE_HOOK(some_update_event, (struct eventinfo *info), (info)); .. code-block:: c :caption: mydaemon.c #include "mydaemon.h" - DEFINE_HOOK(some_update_event, (struct eventinfo *info), (info)) + DEFINE_HOOK(some_update_event, (struct eventinfo *info), (info)); ... hook_call(some_update_event, info); @@ -110,9 +110,9 @@ Definition .. code-block:: c - DECLARE_HOOK(foo, (), ()) - DECLARE_HOOK(bar, (int arg), (arg)) - DECLARE_HOOK(baz, (const void *x, in_addr_t y), (x, y)) + DECLARE_HOOK(foo, (), ()); + DECLARE_HOOK(bar, (int arg), (arg)); + DECLARE_HOOK(baz, (const void *x, in_addr_t y), (x, y)); .. c:macro:: DEFINE_HOOK(name, arglist, passlist) diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index 3c3a68764e..cb7038085f 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -146,7 +146,7 @@ struct isis_adjacency *isis_adj_find(const struct isis_area *area, int level, return NULL; } -DEFINE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj)) +DEFINE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj)); void isis_delete_adj(void *arg) { diff --git a/isisd/isis_adjacency.h b/isisd/isis_adjacency.h index 3afb7209f3..5f3adcdf45 100644 --- a/isisd/isis_adjacency.h +++ b/isisd/isis_adjacency.h @@ -123,11 +123,11 @@ void isis_delete_adj(void *adj); void isis_adj_process_threeway(struct isis_adjacency *adj, struct isis_threeway_adj *tw_adj, enum isis_adj_usage adj_usage); -DECLARE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj)) +DECLARE_HOOK(isis_adj_state_change_hook, (struct isis_adjacency *adj), (adj)); DECLARE_HOOK(isis_adj_ip_enabled_hook, - (struct isis_adjacency *adj, int family), (adj, family)) + (struct isis_adjacency *adj, int family), (adj, family)); DECLARE_HOOK(isis_adj_ip_disabled_hook, - (struct isis_adjacency *adj, int family), (adj, family)) + (struct isis_adjacency *adj, int family), (adj, family)); void isis_log_adj_change(struct isis_adjacency *adj, enum isis_adj_state old_state, enum isis_adj_state new_state, const char *reason); diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 62822cbf89..0c59826ddc 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -63,7 +63,7 @@ DEFINE_QOBJ_TYPE(isis_circuit) -DEFINE_HOOK(isis_if_new_hook, (struct interface *ifp), (ifp)) +DEFINE_HOOK(isis_if_new_hook, (struct interface *ifp), (ifp)); /* * Prototypes. @@ -308,7 +308,7 @@ struct isis_circuit *circuit_scan_by_ifp(struct interface *ifp) } DEFINE_HOOK(isis_circuit_add_addr_hook, (struct isis_circuit *circuit), - (circuit)) + (circuit)); void isis_circuit_add_addr(struct isis_circuit *circuit, struct connected *connected) @@ -1085,7 +1085,7 @@ void isis_circuit_print_vty(struct isis_circuit *circuit, struct vty *vty, #ifdef FABRICD DEFINE_HOOK(isis_circuit_config_write, (struct isis_circuit *circuit, struct vty *vty), - (circuit, vty)) + (circuit, vty)); static int isis_interface_config_write(struct vty *vty) { diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h index 15d58bd736..62d0478864 100644 --- a/isisd/isis_circuit.h +++ b/isisd/isis_circuit.h @@ -231,10 +231,10 @@ int isis_circuit_mt_enabled_set(struct isis_circuit *circuit, uint16_t mtid, #ifdef FABRICD DECLARE_HOOK(isis_circuit_config_write, (struct isis_circuit *circuit, struct vty *vty), - (circuit, vty)) + (circuit, vty)); #endif DECLARE_HOOK(isis_circuit_add_addr_hook, (struct isis_circuit *circuit), - (circuit)) + (circuit)); #endif /* _ZEBRA_ISIS_CIRCUIT_H */ diff --git a/isisd/isis_route.c b/isisd/isis_route.c index e1baf351f4..ed5fadde10 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -53,7 +53,7 @@ DEFINE_HOOK(isis_route_update_hook, (struct isis_area * area, struct prefix *prefix, struct isis_route_info *route_info), - (area, prefix, route_info)) + (area, prefix, route_info)); static struct isis_nexthop *nexthoplookup(struct list *nexthops, int family, union g_addr *ip, ifindex_t ifindex); diff --git a/isisd/isis_route.h b/isisd/isis_route.h index d6763ec76c..0e206d08f4 100644 --- a/isisd/isis_route.h +++ b/isisd/isis_route.h @@ -52,7 +52,7 @@ struct isis_route_info { DECLARE_HOOK(isis_route_update_hook, (struct isis_area * area, struct prefix *prefix, struct isis_route_info *route_info), - (area, prefix, route_info)) + (area, prefix, route_info)); void isis_nexthop_delete(struct isis_nexthop *nexthop); void adjinfo2nexthop(int family, struct list *nexthops, diff --git a/isisd/isis_tlvs.c b/isisd/isis_tlvs.c index fa47c2813c..6af9290467 100644 --- a/isisd/isis_tlvs.c +++ b/isisd/isis_tlvs.c @@ -4488,9 +4488,9 @@ static void tlvs_protocols_supported_to_adj(struct isis_tlvs *tlvs, } DEFINE_HOOK(isis_adj_ip_enabled_hook, (struct isis_adjacency *adj, int family), - (adj, family)) + (adj, family)); DEFINE_HOOK(isis_adj_ip_disabled_hook, - (struct isis_adjacency *adj, int family), (adj, family)) + (struct isis_adjacency *adj, int family), (adj, family)); static void tlvs_ipv4_addresses_to_adj(struct isis_tlvs *tlvs, struct isis_adjacency *adj, diff --git a/isisd/isisd.h b/isisd/isisd.h index 1b0ec2b4f0..4166216f9f 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -240,7 +240,7 @@ struct isis_area { }; DECLARE_QOBJ_TYPE(isis_area) -DECLARE_HOOK(isis_area_overload_bit_update, (struct isis_area * area), (area)) +DECLARE_HOOK(isis_area_overload_bit_update, (struct isis_area * area), (area)); void isis_terminate(void); void isis_finish(struct isis *isis); diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c index 14235a0f1f..2ee2dc12fa 100644 --- a/ldpd/ldpd.c +++ b/ldpd/ldpd.c @@ -88,7 +88,7 @@ static pid_t lde_pid; static struct frr_daemon_info ldpd_di; -DEFINE_HOOK(ldp_register_mib, (struct thread_master * tm), (tm)) +DEFINE_HOOK(ldp_register_mib, (struct thread_master * tm), (tm)); static void ldp_load_module(const char *name) { diff --git a/ldpd/ldpd.h b/ldpd/ldpd.h index 73c81349ce..dd29c68f50 100644 --- a/ldpd/ldpd.h +++ b/ldpd/ldpd.h @@ -915,7 +915,7 @@ int ldp_zebra_send_rlfa_labels(struct zapi_rlfa_response * (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_INTFACELOCAL)) #endif -DECLARE_HOOK(ldp_register_mib, (struct thread_master * tm), (tm)) +DECLARE_HOOK(ldp_register_mib, (struct thread_master * tm), (tm)); extern void ldp_agentx_enabled(void); diff --git a/ldpd/ldpe.h b/ldpd/ldpe.h index 9572f1ac12..880722424e 100644 --- a/ldpd/ldpe.h +++ b/ldpd/ldpe.h @@ -321,6 +321,7 @@ void ldpe_l2vpn_exit(struct l2vpn *); void ldpe_l2vpn_pw_init(struct l2vpn_pw *); void ldpe_l2vpn_pw_exit(struct l2vpn_pw *); -DECLARE_HOOK(ldp_nbr_state_change, (struct nbr * nbr, int old_state), (nbr, old_state)) +DECLARE_HOOK(ldp_nbr_state_change, (struct nbr * nbr, int old_state), + (nbr, old_state)); #endif /* _LDPE_H_ */ diff --git a/ldpd/neighbor.c b/ldpd/neighbor.c index 23c67ec1ca..e884b3ebfc 100644 --- a/ldpd/neighbor.c +++ b/ldpd/neighbor.c @@ -26,7 +26,8 @@ #include "lde.h" #include "log.h" -DEFINE_HOOK(ldp_nbr_state_change, (struct nbr * nbr, int old_state), (nbr, old_state)) +DEFINE_HOOK(ldp_nbr_state_change, (struct nbr * nbr, int old_state), + (nbr, old_state)); static __inline int nbr_id_compare(const struct nbr *, const struct nbr *); static __inline int nbr_addr_compare(const struct nbr *, diff --git a/lib/agentx.c b/lib/agentx.c index c1ff7a61b1..3f1a8edbaa 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -36,7 +36,7 @@ XREF_SETUP() -DEFINE_HOOK(agentx_enabled, (), ()) +DEFINE_HOOK(agentx_enabled, (), ()); static int agentx_enabled = 0; diff --git a/lib/hook.h b/lib/hook.h index bef5351e90..ff3ef29fa3 100644 --- a/lib/hook.h +++ b/lib/hook.h @@ -35,10 +35,10 @@ extern "C" { * * mydaemon.h: * #include "hook.h" - * DECLARE_HOOK (some_update_event, (struct eventinfo *info), (info)) + * DECLARE_HOOK (some_update_event, (struct eventinfo *info), (info)); * * mydaemon.c: - * DEFINE_HOOK (some_update_event, (struct eventinfo *info), (info)) + * DEFINE_HOOK (some_update_event, (struct eventinfo *info), (info)); * ... * hook_call (some_update_event, info) * @@ -184,7 +184,7 @@ extern void _hook_unregister(struct hook *hook, void *funcptr, void *arg, #define HOOK_ADDARG(...) (hookarg , ## __VA_ARGS__) /* use in header file - declares the hook and its arguments - * usage: DECLARE_HOOK(my_hook, (int arg1, struct foo *arg2), (arg1, arg2)) + * usage: DECLARE_HOOK(my_hook, (int arg1, struct foo *arg2), (arg1, arg2)); * as above, "passlist" must use the same order and same names as "arglist" * * theoretically passlist is not neccessary, but let's keep things simple and @@ -201,7 +201,9 @@ extern void _hook_unregister(struct hook *hook, void *funcptr, void *arg, int(*funcptr) HOOK_ADDDEF arglist) \ { \ return (void *)funcptr; \ - } + } \ + MACRO_REQUIRE_SEMICOLON() /* end */ + #define DECLARE_KOOH(hookname, arglist, passlist) \ DECLARE_HOOK(hookname, arglist, passlist) @@ -230,7 +232,8 @@ extern void _hook_unregister(struct hook *hook, void *funcptr, void *arg, hooksum += hookp.farg HOOK_ADDARG passlist; \ } \ return hooksum; \ - } + } \ + MACRO_REQUIRE_SEMICOLON() /* end */ #define DEFINE_HOOK(hookname, arglist, passlist) \ DEFINE_HOOK_INT(hookname, arglist, passlist, false) diff --git a/lib/if.c b/lib/if.c index 6af8aa6e0a..d4016c2850 100644 --- a/lib/if.c +++ b/lib/if.c @@ -55,8 +55,8 @@ RB_GENERATE(if_index_head, interface, index_entry, if_cmp_index_func); DEFINE_QOBJ_TYPE(interface) -DEFINE_HOOK(if_add, (struct interface * ifp), (ifp)) -DEFINE_KOOH(if_del, (struct interface * ifp), (ifp)) +DEFINE_HOOK(if_add, (struct interface * ifp), (ifp)); +DEFINE_KOOH(if_del, (struct interface * ifp), (ifp)); static struct interface_master{ int (*create_hook)(struct interface *ifp); diff --git a/lib/if.h b/lib/if.h index 1ea295fb43..8c86841755 100644 --- a/lib/if.h +++ b/lib/if.h @@ -378,8 +378,8 @@ DECLARE_QOBJ_TYPE(interface) * can use 1000+ so they run after the daemon has initialised daemon-specific * interface data */ -DECLARE_HOOK(if_add, (struct interface * ifp), (ifp)) -DECLARE_KOOH(if_del, (struct interface * ifp), (ifp)) +DECLARE_HOOK(if_add, (struct interface * ifp), (ifp)); +DECLARE_KOOH(if_del, (struct interface * ifp), (ifp)); #define METRIC_MAX (~0) diff --git a/lib/libfrr.c b/lib/libfrr.c index 51b97369c9..5b0a523fb5 100644 --- a/lib/libfrr.c +++ b/lib/libfrr.c @@ -45,10 +45,10 @@ #include "defaults.h" #include "frrscript.h" -DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm)) -DEFINE_HOOK(frr_very_late_init, (struct thread_master * tm), (tm)) -DEFINE_KOOH(frr_early_fini, (), ()) -DEFINE_KOOH(frr_fini, (), ()) +DEFINE_HOOK(frr_late_init, (struct thread_master * tm), (tm)); +DEFINE_HOOK(frr_very_late_init, (struct thread_master * tm), (tm)); +DEFINE_KOOH(frr_early_fini, (), ()); +DEFINE_KOOH(frr_fini, (), ()); const char frr_sysconfdir[] = SYSCONFDIR; char frr_vtydir[256]; diff --git a/lib/libfrr.h b/lib/libfrr.h index 825f502bdf..c1af598915 100644 --- a/lib/libfrr.h +++ b/lib/libfrr.h @@ -141,8 +141,8 @@ extern enum frr_cli_mode frr_get_cli_mode(void); extern uint32_t frr_get_fd_limit(void); extern bool frr_is_startup_fd(int fd); -DECLARE_HOOK(frr_late_init, (struct thread_master * tm), (tm)) -DECLARE_HOOK(frr_very_late_init, (struct thread_master * tm), (tm)) +DECLARE_HOOK(frr_late_init, (struct thread_master * tm), (tm)); +DECLARE_HOOK(frr_very_late_init, (struct thread_master * tm), (tm)); extern void frr_config_fork(void); extern void frr_run(struct thread_master *master); @@ -153,10 +153,10 @@ extern bool frr_zclient_addr(struct sockaddr_storage *sa, socklen_t *sa_len, /* these two are before the protocol daemon does its own shutdown * it's named this way being the counterpart to frr_late_init */ -DECLARE_KOOH(frr_early_fini, (), ()) +DECLARE_KOOH(frr_early_fini, (), ()); extern void frr_early_fini(void); /* and these two are after the daemon did its own cleanup */ -DECLARE_KOOH(frr_fini, (), ()) +DECLARE_KOOH(frr_fini, (), ()); extern void frr_fini(void); extern char config_default[512]; diff --git a/lib/log_vty.c b/lib/log_vty.c index d1dcac2340..7dadca8059 100644 --- a/lib/log_vty.c +++ b/lib/log_vty.c @@ -33,7 +33,7 @@ #define ZLOG_MAXLVL(a, b) MAX(a, b) -DEFINE_HOOK(zlog_rotate, (), ()) +DEFINE_HOOK(zlog_rotate, (), ()); static const int log_default_lvl = LOG_DEBUG; diff --git a/lib/log_vty.h b/lib/log_vty.h index 16c4475467..f0fb7d3dba 100644 --- a/lib/log_vty.h +++ b/lib/log_vty.h @@ -34,7 +34,7 @@ extern void log_config_write(struct vty *vty); extern int log_level_match(const char *s); extern void log_show_syslog(struct vty *vty); -DECLARE_HOOK(zlog_rotate, (), ()) +DECLARE_HOOK(zlog_rotate, (), ()); extern void zlog_rotate(void); #ifdef __cplusplus diff --git a/lib/northbound.h b/lib/northbound.h index 3e1342f985..21aad64a09 100644 --- a/lib/northbound.h +++ b/lib/northbound.h @@ -677,9 +677,9 @@ typedef int (*nb_oper_data_cb)(const struct lys_node *snode, /* Hooks. */ DECLARE_HOOK(nb_notification_send, (const char *xpath, struct list *arguments), - (xpath, arguments)) -DECLARE_HOOK(nb_client_debug_config_write, (struct vty *vty), (vty)) -DECLARE_HOOK(nb_client_debug_set_all, (uint32_t flags, bool set), (flags, set)) + (xpath, arguments)); +DECLARE_HOOK(nb_client_debug_config_write, (struct vty *vty), (vty)); +DECLARE_HOOK(nb_client_debug_set_all, (uint32_t flags, bool set), (flags, set)); /* Northbound debugging records */ extern struct debug nb_dbg_cbs_config; diff --git a/lib/routing_nb.h b/lib/routing_nb.h index ffba631a10..bdd12b262b 100644 --- a/lib/routing_nb.h +++ b/lib/routing_nb.h @@ -24,7 +24,7 @@ int routing_control_plane_protocols_control_plane_protocol_destroy( * callbacks for routing to handle configuration events * based on the control plane protocol */ -DECLARE_HOOK(routing_conf_event, (struct nb_cb_create_args *args), (args)) +DECLARE_HOOK(routing_conf_event, (struct nb_cb_create_args *args), (args)); void routing_control_plane_protocols_register_vrf_dependency(void); diff --git a/lib/routing_nb_config.c b/lib/routing_nb_config.c index 17698d2b87..f66f32015d 100644 --- a/lib/routing_nb_config.c +++ b/lib/routing_nb_config.c @@ -24,7 +24,7 @@ #include "routing_nb.h" -DEFINE_HOOK(routing_conf_event, (struct nb_cb_create_args *args), (args)) +DEFINE_HOOK(routing_conf_event, (struct nb_cb_create_args *args), (args)); /* * XPath: /frr-routing:routing/control-plane-protocols/control-plane-protocol diff --git a/lib/smux.h b/lib/smux.h index 57128b7928..c063833e41 100644 --- a/lib/smux.h +++ b/lib/smux.h @@ -157,7 +157,7 @@ extern void oid_copy_int(oid oid[], int *val); extern void oid2string(oid oid[], int len, char *string); extern void oid_copy_str(oid oid[], const char *string, int len); -DECLARE_HOOK(agentx_enabled, (), ()) +DECLARE_HOOK(agentx_enabled, (), ()); #ifdef __cplusplus } diff --git a/lib/zlog.c b/lib/zlog.c index ca7f8da2ef..7304854648 100644 --- a/lib/zlog.c +++ b/lib/zlog.c @@ -59,10 +59,10 @@ DEFINE_MTYPE_STATIC(LIB, LOG_TLSBUF, "log thread-local buffer"); DEFINE_HOOK(zlog_init, (const char *progname, const char *protoname, unsigned short instance, uid_t uid, gid_t gid), - (progname, protoname, instance, uid, gid)) -DEFINE_KOOH(zlog_fini, (), ()) + (progname, protoname, instance, uid, gid)); +DEFINE_KOOH(zlog_fini, (), ()); DEFINE_HOOK(zlog_aux_init, (const char *prefix, int prio_min), - (prefix, prio_min)) + (prefix, prio_min)); char zlog_prefix[128]; size_t zlog_prefixsz; diff --git a/lib/zlog.h b/lib/zlog.h index 4fdb47bb95..d95b801b2c 100644 --- a/lib/zlog.h +++ b/lib/zlog.h @@ -247,17 +247,17 @@ extern void zlog_init(const char *progname, const char *protoname, unsigned short instance, uid_t uid, gid_t gid); DECLARE_HOOK(zlog_init, (const char *progname, const char *protoname, unsigned short instance, uid_t uid, gid_t gid), - (progname, protoname, instance, uid, gid)) + (progname, protoname, instance, uid, gid)); extern void zlog_fini(void); -DECLARE_KOOH(zlog_fini, (), ()) +DECLARE_KOOH(zlog_fini, (), ()); /* for tools & test programs, i.e. anything not a daemon. * (no cleanup needed at exit) */ extern void zlog_aux_init(const char *prefix, int prio_min); DECLARE_HOOK(zlog_aux_init, (const char *prefix, int prio_min), - (prefix, prio_min)) + (prefix, prio_min)); extern void zlog_startup_end(void); diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index c05d9cab16..83950a4aaa 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -49,7 +49,7 @@ DEFINE_MTYPE_STATIC(OSPF6D, CFG_PLIST_NAME, "configured prefix list names"); DEFINE_QOBJ_TYPE(ospf6_interface) DEFINE_HOOK(ospf6_interface_change, (struct ospf6_interface * oi, int state, int old_state), - (oi, state, old_state)) + (oi, state, old_state)); unsigned char conf_debug_ospf6_interface = 0; diff --git a/ospf6d/ospf6_interface.h b/ospf6d/ospf6_interface.h index 6e4692920c..343a6d494f 100644 --- a/ospf6d/ospf6_interface.h +++ b/ospf6d/ospf6_interface.h @@ -199,6 +199,6 @@ extern void install_element_ospf6_debug_interface(void); DECLARE_HOOK(ospf6_interface_change, (struct ospf6_interface * oi, int state, int old_state), - (oi, state, old_state)) + (oi, state, old_state)); #endif /* OSPF6_INTERFACE_H */ diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c index 7a1b96c2b3..15065c98eb 100644 --- a/ospf6d/ospf6_neighbor.c +++ b/ospf6d/ospf6_neighbor.c @@ -48,7 +48,7 @@ DEFINE_HOOK(ospf6_neighbor_change, (struct ospf6_neighbor * on, int state, int next_state), - (on, state, next_state)) + (on, state, next_state)); unsigned char conf_debug_ospf6_neighbor = 0; diff --git a/ospf6d/ospf6_neighbor.h b/ospf6d/ospf6_neighbor.h index 94300ff2ba..f45b340507 100644 --- a/ospf6d/ospf6_neighbor.h +++ b/ospf6d/ospf6_neighbor.h @@ -166,6 +166,6 @@ extern void install_element_ospf6_debug_neighbor(void); DECLARE_HOOK(ospf6_neighbor_change, (struct ospf6_neighbor * on, int state, int next_state), - (on, state, next_state)) + (on, state, next_state)); #endif /* OSPF6_NEIGHBOR_H */ diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index 51599ccc8a..29de702e81 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -50,10 +50,10 @@ #include "ospfd/ospf_ldp_sync.h" DEFINE_QOBJ_TYPE(ospf_interface) -DEFINE_HOOK(ospf_vl_add, (struct ospf_vl_data * vd), (vd)) -DEFINE_HOOK(ospf_vl_delete, (struct ospf_vl_data * vd), (vd)) -DEFINE_HOOK(ospf_if_update, (struct interface * ifp), (ifp)) -DEFINE_HOOK(ospf_if_delete, (struct interface * ifp), (ifp)) +DEFINE_HOOK(ospf_vl_add, (struct ospf_vl_data * vd), (vd)); +DEFINE_HOOK(ospf_vl_delete, (struct ospf_vl_data * vd), (vd)); +DEFINE_HOOK(ospf_if_update, (struct interface * ifp), (ifp)); +DEFINE_HOOK(ospf_if_delete, (struct interface * ifp), (ifp)); int ospf_interface_neighbor_count(struct ospf_interface *oi) { diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h index bf59af16c2..bda98004b6 100644 --- a/ospfd/ospf_interface.h +++ b/ospfd/ospf_interface.h @@ -329,10 +329,10 @@ extern void ospf_if_set_multicast(struct ospf_interface *); extern void ospf_if_interface(struct interface *ifp); -DECLARE_HOOK(ospf_vl_add, (struct ospf_vl_data * vd), (vd)) -DECLARE_HOOK(ospf_vl_delete, (struct ospf_vl_data * vd), (vd)) +DECLARE_HOOK(ospf_vl_add, (struct ospf_vl_data * vd), (vd)); +DECLARE_HOOK(ospf_vl_delete, (struct ospf_vl_data * vd), (vd)); -DECLARE_HOOK(ospf_if_update, (struct interface * ifp), (ifp)) -DECLARE_HOOK(ospf_if_delete, (struct interface * ifp), (ifp)) +DECLARE_HOOK(ospf_if_update, (struct interface * ifp), (ifp)); +DECLARE_HOOK(ospf_if_delete, (struct interface * ifp), (ifp)); #endif /* _ZEBRA_OSPF_INTERFACE_H */ diff --git a/ospfd/ospf_ism.c b/ospfd/ospf_ism.c index 36e97f8779..1850d946b8 100644 --- a/ospfd/ospf_ism.c +++ b/ospfd/ospf_ism.c @@ -45,7 +45,7 @@ DEFINE_HOOK(ospf_ism_change, (struct ospf_interface * oi, int state, int oldstate), - (oi, state, oldstate)) + (oi, state, oldstate)); /* elect DR and BDR. Refer to RFC2319 section 9.4 */ static struct ospf_neighbor *ospf_dr_election_sub(struct list *routers) diff --git a/ospfd/ospf_ism.h b/ospfd/ospf_ism.h index c41ba6c843..5d0f95aed1 100644 --- a/ospfd/ospf_ism.h +++ b/ospfd/ospf_ism.h @@ -97,6 +97,6 @@ extern int ospf_dr_election(struct ospf_interface *oi); DECLARE_HOOK(ospf_ism_change, (struct ospf_interface * oi, int state, int oldstate), - (oi, state, oldstate)) + (oi, state, oldstate)); #endif /* _ZEBRA_OSPF_ISM_H */ diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c index 26e7855e8c..ca33fd4e18 100644 --- a/ospfd/ospf_nsm.c +++ b/ospfd/ospf_nsm.c @@ -53,7 +53,7 @@ DEFINE_HOOK(ospf_nsm_change, (struct ospf_neighbor * on, int state, int oldstate), - (on, state, oldstate)) + (on, state, oldstate)); static void nsm_clear_adj(struct ospf_neighbor *); diff --git a/ospfd/ospf_nsm.h b/ospfd/ospf_nsm.h index 24cf05009c..e8573c6301 100644 --- a/ospfd/ospf_nsm.h +++ b/ospfd/ospf_nsm.h @@ -78,6 +78,6 @@ extern void ospf_db_summary_clear(struct ospf_neighbor *); extern int nsm_should_adj(struct ospf_neighbor *nbr); DECLARE_HOOK(ospf_nsm_change, (struct ospf_neighbor * on, int state, int oldstate), - (on, state, oldstate)) + (on, state, oldstate)); #endif /* _ZEBRA_OSPF_NSM_H */ diff --git a/pathd/pathd.c b/pathd/pathd.c index 33e69e42d5..ef48c365b7 100644 --- a/pathd/pathd.c +++ b/pathd/pathd.c @@ -35,11 +35,11 @@ DEFINE_MTYPE_STATIC(PATHD, PATH_SR_POLICY, "SR Policy"); DEFINE_MTYPE_STATIC(PATHD, PATH_SR_CANDIDATE, "SR Policy candidate path"); DEFINE_HOOK(pathd_candidate_created, (struct srte_candidate * candidate), - (candidate)) + (candidate)); DEFINE_HOOK(pathd_candidate_updated, (struct srte_candidate * candidate), - (candidate)) + (candidate)); DEFINE_HOOK(pathd_candidate_removed, (struct srte_candidate * candidate), - (candidate)) + (candidate)); static void trigger_pathd_candidate_created(struct srte_candidate *candidate); static int trigger_pathd_candidate_created_timer(struct thread *thread); diff --git a/pathd/pathd.h b/pathd/pathd.h index 4879239db8..e3d26a0ac5 100644 --- a/pathd/pathd.h +++ b/pathd/pathd.h @@ -338,11 +338,11 @@ RB_HEAD(srte_policy_head, srte_policy); RB_PROTOTYPE(srte_policy_head, srte_policy, entry, srte_policy_compare) DECLARE_HOOK(pathd_candidate_created, (struct srte_candidate * candidate), - (candidate)) + (candidate)); DECLARE_HOOK(pathd_candidate_updated, (struct srte_candidate * candidate), - (candidate)) + (candidate)); DECLARE_HOOK(pathd_candidate_removed, (struct srte_candidate * candidate), - (candidate)) + (candidate)); extern struct srte_segment_list_head srte_segment_lists; extern struct srte_policy_head srte_policies; diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index c1cdf27bfb..1ef64ff0de 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -45,8 +45,8 @@ DEFINE_MTYPE_STATIC(RIPD, RIP_INTERFACE, "RIP interface"); DEFINE_MTYPE(RIPD, RIP_INTERFACE_STRING, "RIP Interface String"); -DEFINE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc)) -DEFINE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc)) +DEFINE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc)); +DEFINE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc)); /* static prototypes */ static void rip_enable_apply(struct interface *); diff --git a/ripd/ripd.h b/ripd/ripd.h index 97806abc89..85aac985f5 100644 --- a/ripd/ripd.h +++ b/ripd/ripd.h @@ -529,7 +529,7 @@ extern struct rip_instance_head rip_instances; /* Master thread strucutre. */ extern struct thread_master *master; -DECLARE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc)) -DECLARE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc)) +DECLARE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc)); +DECLARE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc)); #endif /* _ZEBRA_RIP_H */ diff --git a/zebra/interface.c b/zebra/interface.c index 9529f49d9b..c679e090ca 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -58,9 +58,9 @@ DEFINE_MTYPE_STATIC(ZEBRA, ZINFO, "Zebra Interface Information"); #define ZEBRA_PTM_SUPPORT DEFINE_HOOK(zebra_if_extra_info, (struct vty * vty, struct interface *ifp), - (vty, ifp)) + (vty, ifp)); DEFINE_HOOK(zebra_if_config_wr, (struct vty * vty, struct interface *ifp), - (vty, ifp)) + (vty, ifp)); static void if_down_del_nbr_connected(struct interface *ifp); diff --git a/zebra/interface.h b/zebra/interface.h index 64569742b4..67eb1176b9 100644 --- a/zebra/interface.h +++ b/zebra/interface.h @@ -417,9 +417,9 @@ struct zebra_if { }; DECLARE_HOOK(zebra_if_extra_info, (struct vty * vty, struct interface *ifp), - (vty, ifp)) + (vty, ifp)); DECLARE_HOOK(zebra_if_config_wr, (struct vty * vty, struct interface *ifp), - (vty, ifp)) + (vty, ifp)); #define IS_ZEBRA_IF_VRF(ifp) \ (((struct zebra_if *)(ifp->info))->zif_type == ZEBRA_IF_VRF) diff --git a/zebra/rib.h b/zebra/rib.h index 86766b8175..68b62f501b 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -541,7 +541,7 @@ static inline void rib_tables_iter_cleanup(rib_tables_iter_t *iter) } DECLARE_HOOK(rib_update, (struct route_node * rn, const char *reason), - (rn, reason)) + (rn, reason)); /* * Access installed/fib nexthops, which may be a subset of the diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c index fdf0d88151..2e65307ea3 100644 --- a/zebra/zebra_mlag.c +++ b/zebra/zebra_mlag.c @@ -38,11 +38,11 @@ #endif DEFINE_HOOK(zebra_mlag_private_write_data, - (uint8_t *data, uint32_t len), (data, len)) -DEFINE_HOOK(zebra_mlag_private_monitor_state, (), ()) -DEFINE_HOOK(zebra_mlag_private_open_channel, (), ()) -DEFINE_HOOK(zebra_mlag_private_close_channel, (), ()) -DEFINE_HOOK(zebra_mlag_private_cleanup_data, (), ()) + (uint8_t *data, uint32_t len), (data, len)); +DEFINE_HOOK(zebra_mlag_private_monitor_state, (), ()); +DEFINE_HOOK(zebra_mlag_private_open_channel, (), ()); +DEFINE_HOOK(zebra_mlag_private_close_channel, (), ()); +DEFINE_HOOK(zebra_mlag_private_cleanup_data, (), ()); #define ZEBRA_MLAG_METADATA_LEN 4 #define ZEBRA_MLAG_MSG_BCAST 0xFFFFFFFF diff --git a/zebra/zebra_mlag.h b/zebra/zebra_mlag.h index b195c75ea3..eb96a57d30 100644 --- a/zebra/zebra_mlag.h +++ b/zebra/zebra_mlag.h @@ -34,11 +34,11 @@ extern "C" { #define ZEBRA_MLAG_LEN_SIZE 4 DECLARE_HOOK(zebra_mlag_private_write_data, - (uint8_t *data, uint32_t len), (data, len)) -DECLARE_HOOK(zebra_mlag_private_monitor_state, (), ()) -DECLARE_HOOK(zebra_mlag_private_open_channel, (), ()) -DECLARE_HOOK(zebra_mlag_private_close_channel, (), ()) -DECLARE_HOOK(zebra_mlag_private_cleanup_data, (), ()) + (uint8_t *data, uint32_t len), (data, len)); +DECLARE_HOOK(zebra_mlag_private_monitor_state, (), ()); +DECLARE_HOOK(zebra_mlag_private_open_channel, (), ()); +DECLARE_HOOK(zebra_mlag_private_close_channel, (), ()); +DECLARE_HOOK(zebra_mlag_private_cleanup_data, (), ()); extern uint8_t mlag_wr_buffer[ZEBRA_MLAG_BUF_LIMIT]; extern uint8_t mlag_rd_buffer[ZEBRA_MLAG_BUF_LIMIT]; diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index 7ada407cfc..4b87432ffc 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -128,12 +128,12 @@ static const struct message fragment_value_str[] = { DEFINE_HOOK(zebra_pbr_ipset_entry_get_stat, (struct zebra_pbr_ipset_entry *ipset, uint64_t *pkts, uint64_t *bytes), - (ipset, pkts, bytes)) + (ipset, pkts, bytes)); DEFINE_HOOK(zebra_pbr_iptable_get_stat, (struct zebra_pbr_iptable *iptable, uint64_t *pkts, uint64_t *bytes), - (iptable, pkts, bytes)) + (iptable, pkts, bytes)); DEFINE_HOOK(zebra_pbr_iptable_update, (int cmd, struct zebra_pbr_iptable *iptable), (cmd, iptable)); diff --git a/zebra/zebra_pbr.h b/zebra/zebra_pbr.h index ef93033661..2e9658e7e5 100644 --- a/zebra/zebra_pbr.h +++ b/zebra/zebra_pbr.h @@ -249,11 +249,11 @@ size_t zebra_pbr_tcpflags_snprintf(char *buffer, size_t len, DECLARE_HOOK(zebra_pbr_ipset_entry_get_stat, (struct zebra_pbr_ipset_entry *ipset, uint64_t *pkts, uint64_t *bytes), - (ipset, pkts, bytes)) + (ipset, pkts, bytes)); DECLARE_HOOK(zebra_pbr_iptable_get_stat, (struct zebra_pbr_iptable *iptable, uint64_t *pkts, uint64_t *bytes), - (iptable, pkts, bytes)) + (iptable, pkts, bytes)); DECLARE_HOOK(zebra_pbr_iptable_update, (int cmd, struct zebra_pbr_iptable *iptable), (cmd, iptable)); diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c index c951fcfe73..c402f43265 100644 --- a/zebra/zebra_pw.c +++ b/zebra/zebra_pw.c @@ -39,8 +39,8 @@ DEFINE_MTYPE_STATIC(LIB, PW, "Pseudowire"); DEFINE_QOBJ_TYPE(zebra_pw) -DEFINE_HOOK(pw_install, (struct zebra_pw * pw), (pw)) -DEFINE_HOOK(pw_uninstall, (struct zebra_pw * pw), (pw)) +DEFINE_HOOK(pw_install, (struct zebra_pw * pw), (pw)); +DEFINE_HOOK(pw_uninstall, (struct zebra_pw * pw), (pw)); #define MPLS_NO_LABEL MPLS_INVALID_LABEL diff --git a/zebra/zebra_pw.h b/zebra/zebra_pw.h index 7b13c7e16b..19f0f8181b 100644 --- a/zebra/zebra_pw.h +++ b/zebra/zebra_pw.h @@ -63,8 +63,8 @@ RB_PROTOTYPE(zebra_pw_head, zebra_pw, pw_entry, zebra_pw_compare); RB_HEAD(zebra_static_pw_head, zebra_pw); RB_PROTOTYPE(zebra_static_pw_head, zebra_pw, static_pw_entry, zebra_pw_compare); -DECLARE_HOOK(pw_install, (struct zebra_pw * pw), (pw)) -DECLARE_HOOK(pw_uninstall, (struct zebra_pw * pw), (pw)) +DECLARE_HOOK(pw_install, (struct zebra_pw * pw), (pw)); +DECLARE_HOOK(pw_uninstall, (struct zebra_pw * pw), (pw)); struct zebra_pw *zebra_pw_add(struct zebra_vrf *zvrf, const char *ifname, uint8_t protocol, struct zserv *client); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index bc3c68638d..6b26192711 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -68,7 +68,7 @@ static struct thread *t_dplane; static struct dplane_ctx_q rib_dplane_q; DEFINE_HOOK(rib_update, (struct route_node * rn, const char *reason), - (rn, reason)) + (rn, reason)); /* Should we allow non Quagga processes to delete our routes */ extern int allow_delete; diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index e5efbe0d4a..d95967c55d 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -65,7 +65,7 @@ DEFINE_MTYPE_STATIC(ZEBRA, L3NEIGH, "EVPN Neighbor"); DEFINE_MTYPE_STATIC(ZEBRA, ZVXLAN_SG, "zebra VxLAN multicast group"); DEFINE_HOOK(zebra_rmac_update, (zebra_mac_t *rmac, zebra_l3vni_t *zl3vni, - bool delete, const char *reason), (rmac, zl3vni, delete, reason)) + bool delete, const char *reason), (rmac, zl3vni, delete, reason)); /* static function declarations */ static void zevpn_print_neigh_hash_all_evpn(struct hash_bucket *bucket, diff --git a/zebra/zebra_vxlan_private.h b/zebra/zebra_vxlan_private.h index 4ec55542a7..0556c4adce 100644 --- a/zebra/zebra_vxlan_private.h +++ b/zebra/zebra_vxlan_private.h @@ -226,7 +226,7 @@ extern struct interface *zl3vni_map_to_mac_vlan_if(zebra_l3vni_t *zl3vni); extern zebra_l3vni_t *zl3vni_lookup(vni_t vni); DECLARE_HOOK(zebra_rmac_update, (zebra_mac_t *rmac, zebra_l3vni_t *zl3vni, - bool delete, const char *reason), (rmac, zl3vni, delete, reason)) + bool delete, const char *reason), (rmac, zl3vni, delete, reason)); #ifdef __cplusplus -- cgit v1.2.3 From 96244aca23adec551c29b78f26605f8af8eea53e Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 21 Feb 2021 06:38:13 +0100 Subject: *: require semicolon after DEFINE_QOBJ & co. Again, see previous commits. Signed-off-by: David Lamparter --- bgpd/bgp_bmp.c | 2 +- bgpd/bgp_bmp.h | 4 ++-- bgpd/bgp_evpn.c | 4 ++-- bgpd/bgp_evpn_mh.h | 4 ++-- bgpd/bgp_evpn_private.h | 4 ++-- bgpd/bgpd.c | 6 +++--- bgpd/bgpd.h | 12 ++++++------ bgpd/rfapi/bgp_rfapi_cfg.c | 4 ++-- bgpd/rfapi/bgp_rfapi_cfg.h | 8 ++++---- eigrpd/eigrp_structs.h | 4 ++-- eigrpd/eigrpd.c | 2 +- isisd/isis_circuit.c | 2 +- isisd/isis_circuit.h | 4 ++-- isisd/isisd.c | 2 +- isisd/isisd.h | 4 ++-- ldpd/ldpd.c | 14 +++++++------- ldpd/ldpd.h | 28 ++++++++++++++-------------- lib/if.c | 2 +- lib/if.h | 4 ++-- lib/keychain.c | 4 ++-- lib/keychain.h | 8 ++++---- lib/nexthop_group.c | 2 +- lib/nexthop_group.h | 4 ++-- lib/qobj.h | 11 +++++++---- lib/routemap.c | 4 ++-- lib/routemap.h | 8 ++++---- lib/vrf.c | 2 +- lib/vrf.h | 4 ++-- ospf6d/ospf6_interface.c | 2 +- ospf6d/ospf6_interface.h | 4 ++-- ospf6d/ospf6_top.c | 2 +- ospf6d/ospf6_top.h | 4 ++-- ospfd/ospf_interface.c | 2 +- ospfd/ospf_interface.h | 4 ++-- ospfd/ospfd.c | 2 +- ospfd/ospfd.h | 4 ++-- pbrd/pbr_map.c | 2 +- pbrd/pbr_map.h | 4 ++-- zebra/zebra_pw.c | 2 +- zebra/zebra_pw.h | 4 ++-- 40 files changed, 100 insertions(+), 97 deletions(-) (limited to 'ospf6d/ospf6_interface.c') diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 996b3d038e..f733042f7e 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -73,7 +73,7 @@ DEFINE_MTYPE_STATIC(BMP, BMP_MIRRORQ, "BMP route mirroring buffer"); DEFINE_MTYPE_STATIC(BMP, BMP_PEER, "BMP per BGP peer data"); DEFINE_MTYPE_STATIC(BMP, BMP_OPEN, "BMP stored BGP OPEN message"); -DEFINE_QOBJ_TYPE(bmp_targets) +DEFINE_QOBJ_TYPE(bmp_targets); static int bmp_bgp_cmp(const struct bmp_bgp *a, const struct bmp_bgp *b) { diff --git a/bgpd/bgp_bmp.h b/bgpd/bgp_bmp.h index 262451a785..10ca1e80fa 100644 --- a/bgpd/bgp_bmp.h +++ b/bgpd/bgp_bmp.h @@ -245,9 +245,9 @@ struct bmp_targets { uint64_t cnt_accept, cnt_aclrefused; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(bmp_targets) +DECLARE_QOBJ_TYPE(bmp_targets); /* per struct peer * data. Lookup by peer->qobj_node.nid, created on demand, * deleted in peer_backward hook. */ diff --git a/bgpd/bgp_evpn.c b/bgpd/bgp_evpn.c index 7b29f1e4c9..ec71264081 100644 --- a/bgpd/bgp_evpn.c +++ b/bgpd/bgp_evpn.c @@ -57,8 +57,8 @@ /* * Definitions and external declarations. */ -DEFINE_QOBJ_TYPE(bgpevpn) -DEFINE_QOBJ_TYPE(bgp_evpn_es) +DEFINE_QOBJ_TYPE(bgpevpn); +DEFINE_QOBJ_TYPE(bgp_evpn_es); /* diff --git a/bgpd/bgp_evpn_mh.h b/bgpd/bgp_evpn_mh.h index e5186619ff..1053e3f022 100644 --- a/bgpd/bgp_evpn_mh.h +++ b/bgpd/bgp_evpn_mh.h @@ -125,9 +125,9 @@ struct bgp_evpn_es { /* preference config for BUM-DF election. advertised via the ESR. */ uint16_t df_pref; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(bgp_evpn_es) +DECLARE_QOBJ_TYPE(bgp_evpn_es); RB_HEAD(bgp_es_rb_head, bgp_evpn_es); RB_PROTOTYPE(bgp_es_rb_head, bgp_evpn_es, rb_node, bgp_es_rb_cmp); diff --git a/bgpd/bgp_evpn_private.h b/bgpd/bgp_evpn_private.h index 77b3746344..ff4970af41 100644 --- a/bgpd/bgp_evpn_private.h +++ b/bgpd/bgp_evpn_private.h @@ -112,10 +112,10 @@ struct bgpevpn { /* List of local ESs */ struct list *local_es_evi_list; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(bgpevpn) +DECLARE_QOBJ_TYPE(bgpevpn); /* Mapping of Import RT to VNIs. * The Import RTs of all VNIs are maintained in a hash table with each diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 993caf6b9d..666dfe0ed3 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -93,9 +93,9 @@ DEFINE_MTYPE_STATIC(BGPD, PEER_TX_SHUTDOWN_MSG, "Peer shutdown message (TX)"); DEFINE_MTYPE_STATIC(BGPD, BGP_EVPN_INFO, "BGP EVPN instance information"); -DEFINE_QOBJ_TYPE(bgp_master) -DEFINE_QOBJ_TYPE(bgp) -DEFINE_QOBJ_TYPE(peer) +DEFINE_QOBJ_TYPE(bgp_master); +DEFINE_QOBJ_TYPE(bgp); +DEFINE_QOBJ_TYPE(peer); DEFINE_HOOK(bgp_inst_delete, (struct bgp *bgp), (bgp)); /* BGP process wide configuration. */ diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index a9ee7666da..52c9491ff2 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -175,9 +175,9 @@ struct bgp_master { #define BM_FLAG_SEND_EXTRA_DATA_TO_ZEBRA (1 << 1) bool terminating; /* global flag that sigint terminate seen */ - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(bgp_master) +DECLARE_QOBJ_TYPE(bgp_master); /* BGP route-map structure. */ struct bgp_rmap { @@ -710,9 +710,9 @@ struct bgp { /* BGP route flap dampening configuration */ struct bgp_damp_config damp[AFI_MAX][SAFI_MAX]; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(bgp) +DECLARE_QOBJ_TYPE(bgp); DECLARE_HOOK(bgp_inst_delete, (struct bgp *bgp), (bgp)); DECLARE_HOOK(bgp_inst_config_write, @@ -1574,9 +1574,9 @@ struct peer { bool advmap_config_change[AFI_MAX][SAFI_MAX]; bool advmap_table_change; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(peer) +DECLARE_QOBJ_TYPE(peer); /* Inherit peer attribute from peer-group. */ #define PEER_ATTR_INHERIT(peer, group, attr) \ diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 3ad0b070b4..cc64261388 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -80,8 +80,8 @@ DEFINE_MTYPE(RFAPI, RFAPI_L2ADDR_OPT, "RFAPI L2 Address Option"); DEFINE_MTYPE(RFAPI, RFAPI_AP, "RFAPI Advertised Prefix"); DEFINE_MTYPE(RFAPI, RFAPI_MONITOR_ETH, "RFAPI Monitor Ethernet"); -DEFINE_QOBJ_TYPE(rfapi_nve_group_cfg) -DEFINE_QOBJ_TYPE(rfapi_l2_group_cfg) +DEFINE_QOBJ_TYPE(rfapi_nve_group_cfg); +DEFINE_QOBJ_TYPE(rfapi_l2_group_cfg); /*********************************************************************** * RFAPI Support ***********************************************************************/ diff --git a/bgpd/rfapi/bgp_rfapi_cfg.h b/bgpd/rfapi/bgp_rfapi_cfg.h index f1548a6173..ef97419c4d 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.h +++ b/bgpd/rfapi/bgp_rfapi_cfg.h @@ -35,9 +35,9 @@ struct rfapi_l2_group_cfg { struct ecommunity *rt_export_list; void *rfp_cfg; /* rfp owned group config */ - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(rfapi_l2_group_cfg) +DECLARE_QOBJ_TYPE(rfapi_l2_group_cfg); typedef enum { RFAPI_GROUP_CFG_NVE = 1, @@ -108,9 +108,9 @@ struct rfapi_nve_group_cfg { /* for VRF type groups */ uint32_t label; struct rfapi_descriptor *rfd; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(rfapi_nve_group_cfg) +DECLARE_QOBJ_TYPE(rfapi_nve_group_cfg); struct rfapi_rfg_name { struct rfapi_nve_group_cfg *rfg; diff --git a/eigrpd/eigrp_structs.h b/eigrpd/eigrp_structs.h index 0d8bb29964..eb4a91cb64 100644 --- a/eigrpd/eigrp_structs.h +++ b/eigrpd/eigrp_structs.h @@ -126,9 +126,9 @@ struct eigrp { /* distribute_ctx */ struct distribute_ctx *distribute_ctx; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(eigrp) +DECLARE_QOBJ_TYPE(eigrp); struct eigrp_if_params { uint8_t passive_interface; diff --git a/eigrpd/eigrpd.c b/eigrpd/eigrpd.c index 5002630796..8c16cf3d58 100644 --- a/eigrpd/eigrpd.c +++ b/eigrpd/eigrpd.c @@ -58,7 +58,7 @@ #include "eigrpd/eigrp_memory.h" #include "eigrpd/eigrp_filter.h" -DEFINE_QOBJ_TYPE(eigrp) +DEFINE_QOBJ_TYPE(eigrp); static struct eigrp_master eigrp_master; diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 0c59826ddc..6fc76fce43 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -61,7 +61,7 @@ #include "isisd/isis_nb.h" #include "isisd/isis_ldp_sync.h" -DEFINE_QOBJ_TYPE(isis_circuit) +DEFINE_QOBJ_TYPE(isis_circuit); DEFINE_HOOK(isis_if_new_hook, (struct interface *ifp), (ifp)); diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h index 62d0478864..cbe4040b64 100644 --- a/isisd/isis_circuit.h +++ b/isisd/isis_circuit.h @@ -174,9 +174,9 @@ struct isis_circuit { */ struct list *snmp_adj_list; /* List in id order */ - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(isis_circuit) +DECLARE_QOBJ_TYPE(isis_circuit); void isis_circuit_init(void); struct isis_circuit *isis_circuit_new(struct isis *isis); diff --git a/isisd/isisd.c b/isisd/isisd.c index 487a902c06..039a8db27e 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -81,7 +81,7 @@ unsigned long debug_sr; unsigned long debug_ldp_sync; unsigned long debug_lfa; -DEFINE_QOBJ_TYPE(isis_area) +DEFINE_QOBJ_TYPE(isis_area); /* ISIS process wide configuration. */ static struct isis_master isis_master; diff --git a/isisd/isisd.h b/isisd/isisd.h index 4166216f9f..ea716f998e 100644 --- a/isisd/isisd.h +++ b/isisd/isisd.h @@ -236,9 +236,9 @@ struct isis_area { uint64_t id_len_mismatches[2]; uint64_t lsp_error_counter[2]; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(isis_area) +DECLARE_QOBJ_TYPE(isis_area); DECLARE_HOOK(isis_area_overload_bit_update, (struct isis_area * area), (area)); diff --git a/ldpd/ldpd.c b/ldpd/ldpd.c index 2ee2dc12fa..d609ef4401 100644 --- a/ldpd/ldpd.c +++ b/ldpd/ldpd.c @@ -69,13 +69,13 @@ static void merge_l2vpns(struct ldpd_conf *, struct ldpd_conf *); static void merge_l2vpn(struct ldpd_conf *, struct l2vpn *, struct l2vpn *); -DEFINE_QOBJ_TYPE(iface) -DEFINE_QOBJ_TYPE(tnbr) -DEFINE_QOBJ_TYPE(nbr_params) -DEFINE_QOBJ_TYPE(l2vpn_if) -DEFINE_QOBJ_TYPE(l2vpn_pw) -DEFINE_QOBJ_TYPE(l2vpn) -DEFINE_QOBJ_TYPE(ldpd_conf) +DEFINE_QOBJ_TYPE(iface); +DEFINE_QOBJ_TYPE(tnbr); +DEFINE_QOBJ_TYPE(nbr_params); +DEFINE_QOBJ_TYPE(l2vpn_if); +DEFINE_QOBJ_TYPE(l2vpn_pw); +DEFINE_QOBJ_TYPE(l2vpn); +DEFINE_QOBJ_TYPE(ldpd_conf); struct ldpd_global global; struct ldpd_init init; diff --git a/ldpd/ldpd.h b/ldpd/ldpd.h index dd29c68f50..8fdc16fc7b 100644 --- a/ldpd/ldpd.h +++ b/ldpd/ldpd.h @@ -362,11 +362,11 @@ struct iface { struct iface_af ipv4; struct iface_af ipv6; struct iface_ldp_sync ldp_sync; - QOBJ_FIELDS + QOBJ_FIELDS; }; RB_HEAD(iface_head, iface); RB_PROTOTYPE(iface_head, iface, entry, iface_compare); -DECLARE_QOBJ_TYPE(iface) +DECLARE_QOBJ_TYPE(iface); /* source of targeted hellos */ struct tnbr { @@ -379,11 +379,11 @@ struct tnbr { uint16_t pw_count; uint32_t rlfa_count; uint8_t flags; - QOBJ_FIELDS + QOBJ_FIELDS; }; RB_HEAD(tnbr_head, tnbr); RB_PROTOTYPE(tnbr_head, tnbr, entry, tnbr_compare); -DECLARE_QOBJ_TYPE(tnbr) +DECLARE_QOBJ_TYPE(tnbr); #define F_TNBR_CONFIGURED 0x01 #define F_TNBR_DYNAMIC 0x02 @@ -405,11 +405,11 @@ struct nbr_params { uint8_t md5key_len; } auth; uint8_t flags; - QOBJ_FIELDS + QOBJ_FIELDS; }; RB_HEAD(nbrp_head, nbr_params); RB_PROTOTYPE(nbrp_head, nbr_params, entry, nbr_params_compare); -DECLARE_QOBJ_TYPE(nbr_params) +DECLARE_QOBJ_TYPE(nbr_params); #define F_NBRP_KEEPALIVE 0x01 #define F_NBRP_GTSM 0x02 #define F_NBRP_GTSM_HOPS 0x04 @@ -463,11 +463,11 @@ struct l2vpn_if { ifindex_t ifindex; int operative; uint8_t mac[ETH_ALEN]; - QOBJ_FIELDS + QOBJ_FIELDS; }; RB_HEAD(l2vpn_if_head, l2vpn_if); RB_PROTOTYPE(l2vpn_if_head, l2vpn_if, entry, l2vpn_if_compare); -DECLARE_QOBJ_TYPE(l2vpn_if) +DECLARE_QOBJ_TYPE(l2vpn_if); struct l2vpn_pw { RB_ENTRY(l2vpn_pw) entry; @@ -485,11 +485,11 @@ struct l2vpn_pw { uint32_t remote_status; uint8_t flags; uint8_t reason; - QOBJ_FIELDS + QOBJ_FIELDS; }; RB_HEAD(l2vpn_pw_head, l2vpn_pw); RB_PROTOTYPE(l2vpn_pw_head, l2vpn_pw, entry, l2vpn_pw_compare); -DECLARE_QOBJ_TYPE(l2vpn_pw) +DECLARE_QOBJ_TYPE(l2vpn_pw); #define F_PW_STATUSTLV_CONF 0x01 /* status tlv configured */ #define F_PW_STATUSTLV 0x02 /* status tlv negotiated */ #define F_PW_CWORD_CONF 0x04 /* control word configured */ @@ -513,11 +513,11 @@ struct l2vpn { struct l2vpn_if_head if_tree; struct l2vpn_pw_head pw_tree; struct l2vpn_pw_head pw_inactive_tree; - QOBJ_FIELDS + QOBJ_FIELDS; }; RB_HEAD(l2vpn_head, l2vpn); RB_PROTOTYPE(l2vpn_head, l2vpn, entry, l2vpn_compare); -DECLARE_QOBJ_TYPE(l2vpn) +DECLARE_QOBJ_TYPE(l2vpn); #define L2VPN_TYPE_VPWS 1 #define L2VPN_TYPE_VPLS 2 @@ -584,9 +584,9 @@ struct ldpd_conf { int flags; time_t config_change_time; struct ldp_entity_stats stats; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(ldpd_conf) +DECLARE_QOBJ_TYPE(ldpd_conf); #define F_LDPD_NO_FIB_UPDATE 0x0001 #define F_LDPD_DS_CISCO_INTEROP 0x0002 #define F_LDPD_ENABLED 0x0004 diff --git a/lib/if.c b/lib/if.c index d4016c2850..629ef4e708 100644 --- a/lib/if.c +++ b/lib/if.c @@ -53,7 +53,7 @@ static int if_cmp_index_func(const struct interface *ifp1, RB_GENERATE(if_name_head, interface, name_entry, if_cmp_func); RB_GENERATE(if_index_head, interface, index_entry, if_cmp_index_func); -DEFINE_QOBJ_TYPE(interface) +DEFINE_QOBJ_TYPE(interface); DEFINE_HOOK(if_add, (struct interface * ifp), (ifp)); DEFINE_KOOH(if_del, (struct interface * ifp), (ifp)); diff --git a/lib/if.h b/lib/if.h index 8c86841755..f425ba8bce 100644 --- a/lib/if.h +++ b/lib/if.h @@ -301,14 +301,14 @@ struct interface { */ bool configured; - QOBJ_FIELDS + QOBJ_FIELDS; }; RB_HEAD(if_name_head, interface); RB_PROTOTYPE(if_name_head, interface, name_entry, if_cmp_func) RB_HEAD(if_index_head, interface); RB_PROTOTYPE(if_index_head, interface, index_entry, if_cmp_index_func) -DECLARE_QOBJ_TYPE(interface) +DECLARE_QOBJ_TYPE(interface); #define IFNAME_RB_INSERT(vrf, ifp) \ ({ \ diff --git a/lib/keychain.c b/lib/keychain.c index 07f65f1825..db5c23b1ba 100644 --- a/lib/keychain.c +++ b/lib/keychain.c @@ -28,8 +28,8 @@ DEFINE_MTYPE_STATIC(LIB, KEY, "Key"); DEFINE_MTYPE_STATIC(LIB, KEYCHAIN, "Key chain"); -DEFINE_QOBJ_TYPE(keychain) -DEFINE_QOBJ_TYPE(key) +DEFINE_QOBJ_TYPE(keychain); +DEFINE_QOBJ_TYPE(key); /* Master list of key chain. */ static struct list *keychain_list; diff --git a/lib/keychain.h b/lib/keychain.h index e5cf39f7c6..eb6d2f175e 100644 --- a/lib/keychain.h +++ b/lib/keychain.h @@ -32,9 +32,9 @@ struct keychain { struct list *key; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(keychain) +DECLARE_QOBJ_TYPE(keychain); struct key_range { time_t start; @@ -51,9 +51,9 @@ struct key { struct key_range send; struct key_range accept; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(key) +DECLARE_QOBJ_TYPE(key); extern void keychain_init(void); extern struct keychain *keychain_lookup(const char *); diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index bf74cb62cc..4fee9bde3c 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -620,7 +620,7 @@ static void nhgc_delete(struct nexthop_group_cmd *nhgc) XFREE(MTYPE_TMP, nhgc); } -DEFINE_QOBJ_TYPE(nexthop_group_cmd) +DEFINE_QOBJ_TYPE(nexthop_group_cmd); DEFUN_NOSH(nexthop_group, nexthop_group_cmd, "nexthop-group NHGNAME", "Enter into the nexthop-group submode\n" diff --git a/lib/nexthop_group.h b/lib/nexthop_group.h index 5f7bde0def..8e75e5c6ac 100644 --- a/lib/nexthop_group.h +++ b/lib/nexthop_group.h @@ -97,12 +97,12 @@ struct nexthop_group_cmd { struct list *nhg_list; - QOBJ_FIELDS + QOBJ_FIELDS; }; RB_HEAD(nhgc_entry_head, nexthp_group_cmd); RB_PROTOTYPE(nhgc_entry_head, nexthop_group_cmd, nhgc_entry, nexthop_group_cmd_compare) -DECLARE_QOBJ_TYPE(nexthop_group_cmd) +DECLARE_QOBJ_TYPE(nexthop_group_cmd); /* * Initialize nexthop_groups. If you are interested in when diff --git a/lib/qobj.h b/lib/qobj.h index 400ae0151c..6d66dbf80d 100644 --- a/lib/qobj.h +++ b/lib/qobj.h @@ -92,7 +92,7 @@ struct qobj_node { const struct qobj_nodetype *type; }; -#define QOBJ_FIELDS struct qobj_node qobj_node; +#define QOBJ_FIELDS struct qobj_node qobj_node /* call these at the end of any _create function (QOBJ_REG) * and beginning of any _destroy function (QOBJ_UNREG) */ @@ -118,16 +118,19 @@ void *qobj_get_typed(uint64_t id, const struct qobj_nodetype *type); /* type declarations */ #define DECLARE_QOBJ_TYPE(structname) \ - extern const struct qobj_nodetype qobj_t_##structname; + extern const struct qobj_nodetype qobj_t_##structname \ + /* end */ #define DEFINE_QOBJ_TYPE(structname) \ const struct qobj_nodetype qobj_t_##structname = { \ .node_member_offset = \ - (ptrdiff_t)offsetof(struct structname, qobj_node)}; + (ptrdiff_t)offsetof(struct structname, qobj_node)} \ + /* end */ #define DEFINE_QOBJ_TYPE_INIT(structname, ...) \ const struct qobj_nodetype qobj_t_##structname = { \ .node_member_offset = \ (ptrdiff_t)offsetof(struct structname, qobj_node), \ - __VA_ARGS__}; + __VA_ARGS__} \ + /* end */ /* ID dereference with typecheck. * will return NULL if id not found or wrong type. */ diff --git a/lib/routemap.c b/lib/routemap.c index 05f82e34cf..b836b55aad 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -42,8 +42,8 @@ DEFINE_MTYPE(LIB, ROUTE_MAP_COMPILED, "Route map compiled"); DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP_DEP, "Route map dependency"); DEFINE_MTYPE_STATIC(LIB, ROUTE_MAP_DEP_DATA, "Route map dependency data"); -DEFINE_QOBJ_TYPE(route_map_index) -DEFINE_QOBJ_TYPE(route_map) +DEFINE_QOBJ_TYPE(route_map_index); +DEFINE_QOBJ_TYPE(route_map); #define IPv4_PREFIX_LIST "ip address prefix-list" #define IPv6_PREFIX_LIST "ipv6 address prefix-list" diff --git a/lib/routemap.h b/lib/routemap.h index 2d5d3a1f90..bad3ca6d3d 100644 --- a/lib/routemap.h +++ b/lib/routemap.h @@ -190,9 +190,9 @@ struct route_map_index { /* List of match/sets contexts. */ TAILQ_HEAD(, routemap_hook_context) rhclist; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(route_map_index) +DECLARE_QOBJ_TYPE(route_map_index); /* Route map list structure. */ struct route_map { @@ -225,9 +225,9 @@ struct route_map { struct route_table *ipv4_prefix_table; struct route_table *ipv6_prefix_table; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(route_map) +DECLARE_QOBJ_TYPE(route_map); /* Prototypes. */ extern void route_map_init(void); diff --git a/lib/vrf.c b/lib/vrf.c index b8364418db..dff041cbc7 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -45,7 +45,7 @@ DEFINE_MTYPE_STATIC(LIB, VRF, "VRF"); DEFINE_MTYPE_STATIC(LIB, VRF_BITMAP, "VRF bit-map"); -DEFINE_QOBJ_TYPE(vrf) +DEFINE_QOBJ_TYPE(vrf); static __inline int vrf_id_compare(const struct vrf *, const struct vrf *); static __inline int vrf_name_compare(const struct vrf *, const struct vrf *); diff --git a/lib/vrf.h b/lib/vrf.h index 333d68ce96..6cdb52244d 100644 --- a/lib/vrf.h +++ b/lib/vrf.h @@ -95,13 +95,13 @@ struct vrf { /* Back pointer to namespace context */ void *ns_ctxt; - QOBJ_FIELDS + QOBJ_FIELDS; }; RB_HEAD(vrf_id_head, vrf); RB_PROTOTYPE(vrf_id_head, vrf, id_entry, vrf_id_compare) RB_HEAD(vrf_name_head, vrf); RB_PROTOTYPE(vrf_name_head, vrf, name_entry, vrf_name_compare) -DECLARE_QOBJ_TYPE(vrf) +DECLARE_QOBJ_TYPE(vrf); /* Allow VRF with netns as backend */ enum vrf_backend_type { diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 83950a4aaa..7ef97f1b65 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -46,7 +46,7 @@ #include "lib/json.h" DEFINE_MTYPE_STATIC(OSPF6D, CFG_PLIST_NAME, "configured prefix list names"); -DEFINE_QOBJ_TYPE(ospf6_interface) +DEFINE_QOBJ_TYPE(ospf6_interface); DEFINE_HOOK(ospf6_interface_change, (struct ospf6_interface * oi, int state, int old_state), (oi, state, old_state)); diff --git a/ospf6d/ospf6_interface.h b/ospf6d/ospf6_interface.h index 343a6d494f..2a5a9ba4a2 100644 --- a/ospf6d/ospf6_interface.h +++ b/ospf6d/ospf6_interface.h @@ -134,9 +134,9 @@ struct ospf6_interface { uint32_t ls_ack_out; uint32_t discarded; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(ospf6_interface) +DECLARE_QOBJ_TYPE(ospf6_interface); /* interface state */ #define OSPF6_INTERFACE_NONE 0 diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 3f72ec828e..fea510da3f 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -53,7 +53,7 @@ #include "ospf6d.h" #include "lib/json.h" -DEFINE_QOBJ_TYPE(ospf6) +DEFINE_QOBJ_TYPE(ospf6); FRR_CFG_DEFAULT_BOOL(OSPF6_LOG_ADJACENCY_CHANGES, { .val_bool = true, .match_profile = "datacenter", }, diff --git a/ospf6d/ospf6_top.h b/ospf6d/ospf6_top.h index 75dff86cd7..7980659e68 100644 --- a/ospf6d/ospf6_top.h +++ b/ospf6d/ospf6_top.h @@ -132,9 +132,9 @@ struct ospf6 { */ uint16_t max_multipath; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(ospf6) +DECLARE_QOBJ_TYPE(ospf6); #define OSPF6_DISABLED 0x01 #define OSPF6_STUB_ROUTER 0x02 diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index 29de702e81..0161f05d71 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -49,7 +49,7 @@ #include "ospfd/ospf_dump.h" #include "ospfd/ospf_ldp_sync.h" -DEFINE_QOBJ_TYPE(ospf_interface) +DEFINE_QOBJ_TYPE(ospf_interface); DEFINE_HOOK(ospf_vl_add, (struct ospf_vl_data * vd), (vd)); DEFINE_HOOK(ospf_vl_delete, (struct ospf_vl_data * vd), (vd)); DEFINE_HOOK(ospf_if_update, (struct interface * ifp), (ifp)); diff --git a/ospfd/ospf_interface.h b/ospfd/ospf_interface.h index bda98004b6..2f146c06f3 100644 --- a/ospfd/ospf_interface.h +++ b/ospfd/ospf_interface.h @@ -252,9 +252,9 @@ struct ospf_interface { uint32_t full_nbrs; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(ospf_interface) +DECLARE_QOBJ_TYPE(ospf_interface); /* Prototypes. */ extern char *ospf_if_name(struct ospf_interface *); diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index 9590a9c73b..4005f2f21b 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -62,7 +62,7 @@ #include "ospfd/ospf_gr_helper.h" -DEFINE_QOBJ_TYPE(ospf) +DEFINE_QOBJ_TYPE(ospf); /* OSPF process wide configuration. */ static struct ospf_master ospf_master; diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h index 5148bf555c..0ac13f92fd 100644 --- a/ospfd/ospfd.h +++ b/ospfd/ospfd.h @@ -386,9 +386,9 @@ struct ospf { bool ti_lfa_enabled; enum protection_type ti_lfa_protection_type; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(ospf) +DECLARE_QOBJ_TYPE(ospf); enum ospf_ti_lfa_p_q_space_adjacency { OSPF_TI_LFA_P_Q_SPACE_ADJACENT, diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c index c3417a2759..053b7363a3 100644 --- a/pbrd/pbr_map.c +++ b/pbrd/pbr_map.c @@ -51,7 +51,7 @@ RB_GENERATE(pbr_map_entry_head, pbr_map, pbr_map_entry, pbr_map_compare) struct pbr_map_entry_head pbr_maps = RB_INITIALIZER(&pbr_maps); -DEFINE_QOBJ_TYPE(pbr_map_sequence) +DEFINE_QOBJ_TYPE(pbr_map_sequence); static inline int pbr_map_compare(const struct pbr_map *pbrmap1, const struct pbr_map *pbrmap2) diff --git a/pbrd/pbr_map.h b/pbrd/pbr_map.h index ad2db146b7..caeadb0644 100644 --- a/pbrd/pbr_map.h +++ b/pbrd/pbr_map.h @@ -149,10 +149,10 @@ struct pbr_map_sequence { #define PBR_MAP_INVALID_VRF (1 << 5) uint64_t reason; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(pbr_map_sequence) +DECLARE_QOBJ_TYPE(pbr_map_sequence); extern struct pbr_map_entry_head pbr_maps; diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c index c402f43265..5afb3e5926 100644 --- a/zebra/zebra_pw.c +++ b/zebra/zebra_pw.c @@ -37,7 +37,7 @@ DEFINE_MTYPE_STATIC(LIB, PW, "Pseudowire"); -DEFINE_QOBJ_TYPE(zebra_pw) +DEFINE_QOBJ_TYPE(zebra_pw); DEFINE_HOOK(pw_install, (struct zebra_pw * pw), (pw)); DEFINE_HOOK(pw_uninstall, (struct zebra_pw * pw), (pw)); diff --git a/zebra/zebra_pw.h b/zebra/zebra_pw.h index 19f0f8181b..0da8203802 100644 --- a/zebra/zebra_pw.h +++ b/zebra/zebra_pw.h @@ -53,9 +53,9 @@ struct zebra_pw { struct zserv *client; struct rnh *rnh; struct thread *install_retry_timer; - QOBJ_FIELDS + QOBJ_FIELDS; }; -DECLARE_QOBJ_TYPE(zebra_pw) +DECLARE_QOBJ_TYPE(zebra_pw); RB_HEAD(zebra_pw_head, zebra_pw); RB_PROTOTYPE(zebra_pw_head, zebra_pw, pw_entry, zebra_pw_compare); -- cgit v1.2.3