}
void
-babel_if_init ()
+babel_if_init(void)
{
/* initialize interface list */
hook_register_prio(if_add, 0, babel_if_new_hook);
/* Delete all the added babel routes, make babeld only speak to zebra. */
static void
-babel_clean_routing_process()
+babel_clean_routing_process(void)
{
flush_all_routes();
babel_interface_close_all();
}
void
-update_myseqno()
+update_myseqno(void)
{
myseqno = seqno_plus(myseqno, 1);
}
}
unsigned
-check_neighbours()
+check_neighbours(void)
{
struct neighbour *neigh;
int changed, rc;
}
void
-expire_resend()
+expire_resend(void)
{
struct resend *current, *previous;
int recompute = 0;
}
void
-recompute_resend_time()
+recompute_resend_time(void)
{
struct resend *request;
struct timeval resend = {0, 0};
}
void
-do_resend()
+do_resend(void)
{
struct resend *resend;
}
void
-flush_all_routes()
+flush_all_routes(void)
{
int i;
}
void
-expire_sources()
+expire_sources(void)
{
struct source *src;
}
int
-daemonise()
+daemonise(void)
{
int rc;
/* Returns an overestimate of the number of xroutes. */
int
-xroutes_estimate()
+xroutes_estimate(void)
{
return numxroutes;
}
pthread_mutex_unlock(peerhash_mtx);
}
-void bgp_keepalives_wake()
+void bgp_keepalives_wake(void)
{
pthread_mutex_lock(peerhash_mtx);
{
/********************
* PUBLIC FUNCTIONS
********************/
-struct bpacket *bpacket_alloc()
+struct bpacket *bpacket_alloc(void)
{
struct bpacket *pkt;
struct frr_pthread *bgp_pth_io;
struct frr_pthread *bgp_pth_ka;
-static void bgp_pthreads_init()
+static void bgp_pthreads_init(void)
{
assert(!bgp_pth_io);
assert(!bgp_pth_ka);
bgp_pth_ka = frr_pthread_new(&ka, "BGP Keepalives thread", "bgpd_ka");
}
-void bgp_pthreads_run()
+void bgp_pthreads_run(void)
{
frr_pthread_run(bgp_pth_io, NULL);
frr_pthread_run(bgp_pth_ka, NULL);
frr_pthread_wait_running(bgp_pth_ka);
}
-void bgp_pthreads_finish()
+void bgp_pthreads_finish(void)
{
frr_pthread_stop_all();
frr_pthread_finish();
return NULL;
}
-static struct rfapi_l2_group_cfg *rfapi_l2_group_new()
+static struct rfapi_l2_group_cfg *rfapi_l2_group_new(void)
{
struct rfapi_l2_group_cfg *rfg;
return CMD_SUCCESS;
}
-static struct rfapi_rfg_name *rfgn_new()
+static struct rfapi_rfg_name *rfgn_new(void)
{
return XCALLOC(MTYPE_RFAPI_RFG_NAME, sizeof(struct rfapi_rfg_name));
}
* Count remote routes and compare with actively-maintained values.
* Abort if they disagree.
*/
-void rfapiCheckRouteCount()
+void rfapiCheckRouteCount(void)
{
struct bgp *bgp = bgp_get_default();
struct rfapi *h;
assert(t_ri_active + t_ri_deleted + t_ri_pend + offset == alloc_count);
}
-static struct rfapi_info *rfapi_info_new()
+static struct rfapi_info *rfapi_info_new(void)
{
return XCALLOC(MTYPE_RFAPI_INFO, sizeof(struct rfapi_info));
}
return vnc_clear_vrf(vty, NULL, arg_vrf, NULL, NULL);
}
-void rfapi_vty_init()
+void rfapi_vty_init(void)
{
install_element(ENABLE_NODE, &add_vnc_prefix_cost_life_lnh_cmd);
install_element(ENABLE_NODE, &add_vnc_prefix_life_cost_lnh_cmd);
return CMD_SUCCESS;
}
-static void rfp_vty_install()
+static void rfp_vty_install(void)
{
static int installed = 0;
if (installed) /* do this only once */
#include <stdio.h>
#include <stdlib.h>
#include "rfptest.h"
-int main()
+int main(void)
{
printf("Your test code goes here.\n");
exit(1);
};
/* Initialize debug commands. */
-void eigrp_debug_init()
+void eigrp_debug_init(void)
{
install_node(&eigrp_debug_node, config_write_debug);
struct list *eigrp_iflist;
-void eigrp_if_init()
+void eigrp_if_init(void)
{
/* Initialize Zebra interface data structure. */
// hook_register_prio(if_add, 0, eigrp_if_new);
return new;
}
-static struct TLV_IPv4_Internal_type *eigrp_IPv4_InternalTLV_new()
+static struct TLV_IPv4_Internal_type *eigrp_IPv4_InternalTLV_new(void)
{
struct TLV_IPv4_Internal_type *new;
return 0;
}
-struct TLV_MD5_Authentication_Type *eigrp_authTLV_MD5_new()
+struct TLV_MD5_Authentication_Type *eigrp_authTLV_MD5_new(void)
{
struct TLV_MD5_Authentication_Type *new;
XFREE(MTYPE_EIGRP_AUTH_TLV, authTLV);
}
-struct TLV_SHA256_Authentication_Type *eigrp_authTLV_SHA256_new()
+struct TLV_SHA256_Authentication_Type *eigrp_authTLV_SHA256_new(void)
{
struct TLV_SHA256_Authentication_Type *new;
XFREE(MTYPE_EIGRP_IPV4_INT_TLV, IPv4_InternalTLV);
}
-struct TLV_Sequence_Type *eigrp_SequenceTLV_new()
+struct TLV_Sequence_Type *eigrp_SequenceTLV_new(void)
{
struct TLV_Sequence_Type *new;
* del - assigned function executed before deleting topology node by list
* function
*/
-struct route_table *eigrp_topology_new()
+struct route_table *eigrp_topology_new(void)
{
return route_table_init();
}
* Returns new created toplogy node
* cmp - assigned function for comparing topology entry
*/
-struct eigrp_prefix_entry *eigrp_prefix_entry_new()
+struct eigrp_prefix_entry *eigrp_prefix_entry_new(void)
{
struct eigrp_prefix_entry *new;
new = XCALLOC(MTYPE_EIGRP_PREFIX_ENTRY,
* Returns new topology entry
*/
-struct eigrp_nexthop_entry *eigrp_nexthop_entry_new()
+struct eigrp_nexthop_entry *eigrp_nexthop_entry_new(void)
{
struct eigrp_nexthop_entry *new;
}
}
-void eigrp_master_init()
+void eigrp_master_init(void)
{
struct timeval tv;
int isis_if_new_hook(struct interface *);
int isis_if_delete_hook(struct interface *);
-struct isis_circuit *isis_circuit_new()
+struct isis_circuit *isis_circuit_new(void)
{
struct isis_circuit *circuit;
int i;
return 0;
}
-void isis_circuit_init()
+void isis_circuit_init(void)
{
/* Initialize Zebra interface data structure */
hook_register_prio(if_add, 0, isis_if_new_hook);
return CMD_SUCCESS;
}
-void isis_spf_cmds_init()
+void isis_spf_cmds_init(void)
{
install_element(VIEW_NODE, &show_isis_topology_cmd);
}
*------------------------------------------------------------------------*/
/* Create new MPLS TE Circuit context */
-struct mpls_te_circuit *mpls_te_circuit_new()
+struct mpls_te_circuit *mpls_te_circuit_new(void)
{
struct mpls_te_circuit *mtc;
struct cmd_node router_node = {ROUTER_NODE, "%s(config-router)# ", 1};
-void isis_init()
+void isis_init(void)
{
/* Install IS-IS top node */
install_node(&router_node, isis_config_write);
#endif
}
-void cmd_terminate()
+void cmd_terminate(void)
{
struct cmd_node *cmd_node;
install_element(CONFIG_NODE, &no_ipv6_access_list_remark_comment_cmd);
}
-void access_list_init()
+void access_list_init(void)
{
access_list_init_ipv4();
access_list_init_ipv6();
access_list_init_mac();
}
-void access_list_reset()
+void access_list_reset(void)
{
access_list_reset_ipv4();
access_list_reset_ipv6();
/* ------------------------------------------------------------------------ */
-void frr_pthread_init()
+void frr_pthread_init(void)
{
pthread_mutex_lock(&frr_pthread_list_mtx);
{
pthread_mutex_unlock(&frr_pthread_list_mtx);
}
-void frr_pthread_finish()
+void frr_pthread_finish(void)
{
pthread_mutex_lock(&frr_pthread_list_mtx);
{
return ret;
}
-void frr_pthread_stop_all()
+void frr_pthread_stop_all(void)
{
pthread_mutex_lock(&frr_pthread_list_mtx);
{
DEFINE_MTYPE_STATIC(LIB, GRAPH, "Graph")
DEFINE_MTYPE_STATIC(LIB, GRAPH_NODE, "Graph Node")
-struct graph *graph_new()
+struct graph *graph_new(void)
{
struct graph *graph = XCALLOC(MTYPE_GRAPH, sizeof(struct graph));
graph->nodes = vector_init(VECTOR_MIN_SIZE);
return CMD_SUCCESS;
}
-void hash_cmd_init()
+void hash_cmd_init(void)
{
install_element(ENABLE_NODE, &show_hash_stats_cmd);
}
return write;
}
-void if_rmap_reset()
+void if_rmap_reset(void)
{
hash_clean(ifrmaphash, (void (*)(void *))if_rmap_free);
}
return 0;
}
-void keychain_init()
+void keychain_init(void)
{
keychain_list = list_new();
}
/* From RFC 2104 */
-void hmac_md5(text, text_len, key, key_len,
- digest) unsigned char *text; /* pointer to data stream */
-int text_len; /* length of data stream */
-unsigned char *key; /* pointer to authentication key */
-int key_len; /* length of authentication key */
-uint8_t *digest; /* caller digest to be filled in */
-
+void hmac_md5(unsigned char *text, int text_len, unsigned char *key,
+ int key_len, uint8_t *digest)
{
MD5_CTX context;
unsigned char k_ipad[65]; /* inner padding -
install_element(ENABLE_NODE, &clear_ipv6_prefix_list_cmd);
}
-void prefix_list_init()
+void prefix_list_init(void)
{
cmd_variable_handler_register(plist_var_handlers);
prefix_list_init_ipv6();
}
-void prefix_list_reset()
+void prefix_list_reset(void)
{
prefix_list_reset_afi(AFI_IP, 0);
prefix_list_reset_afi(AFI_IP6, 0);
}
/* Allocate new prefix_ipv4 structure. */
-struct prefix_ipv4 *prefix_ipv4_new()
+struct prefix_ipv4 *prefix_ipv4_new(void)
{
struct prefix_ipv4 *p;
return str;
}
-struct prefix *prefix_new()
+struct prefix *prefix_new(void)
{
struct prefix *p;
#endif
-static int randomLevel()
+static int randomLevel(void)
{
register int level = 0;
register int b;
}
/* initializer, only ever called once */
-static void initializer()
+static void initializer(void)
{
pthread_key_create(&thread_current, NULL);
}
}
/* Allocate new vty struct. */
-struct vty *vty_new()
+struct vty *vty_new(void)
{
struct vty *new = XCALLOC(MTYPE_VTY, sizeof(struct vty));
};
/* Reset all VTY status. */
-void vty_reset()
+void vty_reset(void)
{
unsigned int i;
struct vty *vty;
strcpy(vty_cwd, cwd);
}
-char *vty_get_cwd()
+char *vty_get_cwd(void)
{
return vty_cwd;
}
return vty->type == VTY_SHELL_SERV ? 1 : 0;
}
-void vty_init_vtysh()
+void vty_init_vtysh(void)
{
vtyvec = vector_init(VECTOR_MIN_SIZE);
}
return 0;
}
-void install_element_ospf6_debug_asbr()
+void install_element_ospf6_debug_asbr(void)
{
install_element(ENABLE_NODE, &debug_ospf6_asbr_cmd);
install_element(ENABLE_NODE, &no_debug_ospf6_asbr_cmd);
* -----------------------------------------------------------
*/
-struct msg_fifo *msg_fifo_new()
+struct msg_fifo *msg_fifo_new(void)
{
return XCALLOC(MTYPE_OSPF_API_FIFO, sizeof(struct msg_fifo));
}
}
-struct crypt_key *ospf_crypt_key_new()
+struct crypt_key *ospf_crypt_key_new(void)
{
return XCALLOC(MTYPE_OSPF_CRYPT_KEY, sizeof(struct crypt_key));
}
return OSPF_IFTYPE_BROADCAST;
}
-void ospf_if_init()
+void ospf_if_init(void)
{
/* Initialize Zebra interface data structure. */
hook_register_prio(if_add, 0, ospf_if_new_hook);
/* Create OSPF LSA. */
-struct ospf_lsa *ospf_lsa_new()
+struct ospf_lsa *ospf_lsa_new(void)
{
struct ospf_lsa *new;
#include "ospfd/ospf_lsa.h"
#include "ospfd/ospf_lsdb.h"
-struct ospf_lsdb *ospf_lsdb_new()
+struct ospf_lsdb *ospf_lsdb_new(void)
{
struct ospf_lsdb *new;
XFREE(MTYPE_OSPF_PACKET, op);
}
-struct ospf_fifo *ospf_fifo_new()
+struct ospf_fifo *ospf_fifo_new(void)
{
struct ospf_fifo *new;
return rc;
}
-static int ospf_router_info_unregister()
+static int ospf_router_info_unregister(void)
{
if ((OspfRI.scope != OSPF_OPAQUE_AS_LSA)
#include "ospfd/ospf_zebra.h"
#include "ospfd/ospf_dump.h"
-struct ospf_route *ospf_route_new()
+struct ospf_route *ospf_route_new(void)
{
struct ospf_route *new;
return new;
}
-void ospf_route_free(struct ospf_route * or)
+void ospf_route_free(struct ospf_route *or)
{
if (or->paths)
list_delete(& or->paths);
XFREE(MTYPE_OSPF_ROUTE, or);
}
-struct ospf_path *ospf_path_new()
+struct ospf_path *ospf_path_new(void)
{
struct ospf_path *new;
return rc;
}
-static int ospf_mpls_te_unregister()
+static int ospf_mpls_te_unregister(void)
{
uint8_t scope;
* Signal handlers
*/
-static void pim_sighup()
+static void pim_sighup(void)
{
zlog_info("SIGHUP received, ignoring");
}
-static void pim_sigint()
+static void pim_sigint(void)
{
zlog_notice("Terminating on signal SIGINT");
pim_terminate();
exit(1);
}
-static void pim_sigterm()
+static void pim_sigterm(void)
{
zlog_notice("Terminating on signal SIGTERM");
pim_terminate();
exit(1);
}
-static void pim_sigusr1()
+static void pim_sigusr1(void)
{
zlog_rotate();
}
XFREE(MTYPE_PIM_STATIC_ROUTE, s_route);
}
-static struct static_route *static_route_alloc()
+static struct static_route *static_route_alloc(void)
{
return XCALLOC(MTYPE_PIM_STATIC_ROUTE, sizeof(struct static_route));
}
pim_time_monotonic_sec():
number of seconds since some unspecified starting point
*/
-int64_t pim_time_monotonic_sec()
+int64_t pim_time_monotonic_sec(void)
{
struct timeval now_tv;
pim_time_monotonic_dsec():
number of deciseconds since some unspecified starting point
*/
-int64_t pim_time_monotonic_dsec()
+int64_t pim_time_monotonic_dsec(void)
{
struct timeval now_tv;
int64_t now_dsec;
}
}
-static void pim_free()
+static void pim_free(void)
{
pim_route_map_terminate();
pim_cmd_init();
}
-void pim_terminate()
+void pim_terminate(void)
{
struct zclient *zclient;
}
/* Needed for stop RIP process. */
-void rip_if_down_all()
+void rip_if_down_all(void)
{
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
}
/* Apply network configuration to all interface. */
-void rip_enable_apply_all()
+void rip_enable_apply_all(void)
{
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
struct interface *ifp;
}
/* Clear all network and neighbor configuration. */
-void rip_clean_network()
+void rip_clean_network(void)
{
unsigned int i;
char *str;
return strcmp(o1->ifname, o2->ifname);
}
-void rip_offset_init()
+void rip_offset_init(void)
{
rip_offset_list_master = list_new();
rip_offset_list_master->cmp = (int (*)(void *, void *))offset_list_cmp;
rip_offset_list_master->del = (void (*)(void *))offset_list_del;
}
-void rip_offset_clean()
+void rip_offset_clean(void)
{
list_delete(&rip_offset_list_master);
#define SET_STR "Set values in destination routing protocol\n"
/* Route-map init */
-void rip_route_map_init()
+void rip_route_map_init(void)
{
route_map_init();
return write;
}
-void ripng_debug_init()
+void ripng_debug_init(void)
{
ripng_debug_event = 0;
ripng_debug_packet = 0;
}
/* Clear all network and neighbor configuration */
-void ripng_clean_network()
+void ripng_clean_network(void)
{
unsigned int i;
char *str;
};
/* Initialization of interface. */
-void ripng_if_init()
+void ripng_if_init(void)
{
/* Interface initialize. */
hook_register_prio(if_add, 0, ripng_if_new_hook);
return memcmp(&p1->addr, &p2->addr, sizeof(struct in6_addr));
}
-void ripng_peer_init()
+void ripng_peer_init(void)
{
peer_list = list_new();
peer_list->cmp = (int (*)(void *, void *))ripng_peer_list_cmp;
#define MATCH_STR "Match values from routing table\n"
#define SET_STR "Set values in destination routing protocol\n"
-void ripng_route_map_init()
+void ripng_route_map_init(void)
{
route_map_init();
return vrf_bitmap_check(zclient->redist[AFI_IP6][type], VRF_DEFAULT);
}
-void ripng_redistribute_clean()
+void ripng_redistribute_clean(void)
{
for (int i = 0; i < ZEBRA_ROUTE_MAX; i++) {
if (!vrf_bitmap_check(zclient->redist[AFI_IP6][i], VRF_DEFAULT))
}
/* Allocate new ripng information. */
-struct ripng_info *ripng_info_new()
+struct ripng_info *ripng_info_new(void)
{
struct ripng_info *new;
}
/* delete all the added ripng routes. */
-void ripng_clean()
+void ripng_clean(void)
{
int i;
struct agg_node *rp;
}
/* Initialize ripng structure and set commands. */
-void ripng_init()
+void ripng_init(void)
{
/* Install RIPNG_NODE. */
install_node(&cmd_ripng_node, ripng_config_write);
return fails;
}
-static void empty_get_test()
+static void empty_get_test(void)
{
struct aspath *as = aspath_empty_get();
struct test_spec sp = {"", "", 0, 0, 0, 0, 0, 0};
}
/* cmp_left tests */
-static void cmp_test()
+static void cmp_test(void)
{
unsigned int i;
#define CMP_TESTS_MAX (sizeof(left_compare) / sizeof(struct compare_tests))
#include "memory.h"
#include "memory_vty.h"
-extern void test_init();
+extern void test_init(void);
struct thread_master *master;
return 0;
}
-static void test_timer_init()
+static void test_timer_init(void)
{
thread_add_timer(master, test_timer, &timer_count, 10, NULL);
}
-static void test_vty_init()
+static void test_vty_init(void)
{
install_element(VIEW_NODE, &daemon_exit_cmd);
}
return CMD_SUCCESS;
}
-static void slow_vty_init()
+static void slow_vty_init(void)
{
install_element(VIEW_NODE, &clear_foo_cmd);
}
-void test_init()
+void test_init(void)
{
slow_vty_init();
}
return CMD_SUCCESS;
}
-void test_init()
+void test_init(void)
{
install_element(VIEW_NODE, &clear_foo_cmd);
}
return CMD_SUCCESS;
}
-static int heavy_wq_init()
+static int heavy_wq_init(void)
{
heavy_wq = work_queue_new(master, "heavy_work_queue");
return 0;
}
-void test_init()
+void test_init(void)
{
install_element(VIEW_NODE, &clear_foo_cmd);
heavy_wq_init();
*
* Tests comparision of prefixes according to order of iteration.
*/
-static void test_prefix_iter_cmp()
+static void test_prefix_iter_cmp(void)
{
printf("\n\nTesting route_table_prefix_iter_cmp()\n");
#endif
#ifdef HAVE_LXC
-static void set_namespaces()
+static void set_namespaces(void)
{
struct namespace *namespace;
int fd;
}
}
#else
-static void set_namespaces()
+static void set_namespaces(void)
{
if (!LIST_EMPTY(&namespace_head))
fatal("LCX namespaces not supported");
# Output install_element
print <<EOF;
-void
-vtysh_init_cmd ()
+void vtysh_init_cmd(void)
{
EOF
.completions = vtysh_autocomplete},
{.completions = NULL}};
-void vtysh_uninit()
+void vtysh_uninit(void)
{
if (vty->of != stdout)
fclose(vty->of);
* be edited by hand. So, we handle only "write terminal" case here and
* integrate vtysh specific conf with conf from daemons.
*/
-void vtysh_config_write()
+void vtysh_config_write(void)
{
char line[81];
user_config_write();
}
-void vtysh_config_init()
+void vtysh_config_init(void)
{
config_top = list_new();
config_top->del = (void (*)(void *))line_del;
return NULL;
}
-void user_config_write()
+void user_config_write(void)
{
struct listnode *node, *nnode;
struct vtysh_user *user;
return CMD_SUCCESS;
}
-void irdp_if_init()
+void irdp_if_init(void)
{
hook_register(zebra_if_config_wr, irdp_config_write);
hook_register(if_del, irdp_if_delete);
}
-void label_manager_close()
+void label_manager_close(void)
{
list_delete(&lbl_mgr.lc_list);
stream_free(obuf);
zebra_rmap_update_timer);
}
-void zebra_route_map_init()
+void zebra_route_map_init(void)
{
install_element(CONFIG_NODE, &ip_protocol_cmd);
install_element(CONFIG_NODE, &no_ip_protocol_cmd);
static int zvni_del(zebra_vni_t *zvni);
static int zvni_send_add_to_client(zebra_vni_t *zvni);
static int zvni_send_del_to_client(vni_t vni);
-static void zvni_build_hash_table();
+static void zvni_build_hash_table(void);
static int zvni_vtep_match(struct in_addr *vtep_ip, zebra_vtep_t *zvtep);
static zebra_vtep_t *zvni_vtep_find(zebra_vni_t *zvni, struct in_addr *vtep_ip);
static zebra_vtep_t *zvni_vtep_add(zebra_vni_t *zvni, struct in_addr *vtep_ip);
* Build the VNI hash table by going over the VxLAN interfaces. This
* is called when EVPN (advertise-all-vni) is enabled.
*/
-static void zvni_build_hash_table()
+static void zvni_build_hash_table(void)
{
struct zebra_ns *zns;
struct route_node *rn;
/* Is EVPN enabled? */
#define EVPN_ENABLED(zvrf) (zvrf)->advertise_all_vni
-static inline int is_evpn_enabled()
+static inline int is_evpn_enabled(void)
{
struct zebra_vrf *zvrf = NULL;
zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT);
}
static inline int
-is_vxlan_flooding_head_end()
+is_vxlan_flooding_head_end(void)
{
struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT);