diff options
author | Paul Jakma <paul.jakma@sun.com> | 2008-08-15 14:45:30 +0200 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2008-08-22 20:52:58 +0200 |
commit | 6ac29a51075def99217a4ab1015635db3b3e83ed (patch) | |
tree | 1152b55eb3a2099c67a0ba8e62d7e41f07e00135 /ospf6d | |
parent | [lib] mes_lookup string lookup table argument should be marked const (diff) | |
download | frr-6ac29a51075def99217a4ab1015635db3b3e83ed.tar.xz frr-6ac29a51075def99217a4ab1015635db3b3e83ed.zip |
[trivia] finish off static'ification of ospf6d and ripngd
2008-08-15 Paul Jakma <paul.jakma@sun.com>
* {ospf6d,ripngd}/*: Finish job of marking functions as static, or
exporting declarations for them, to quell warning noise with
Quagga's GCC default high-level of warning flags. Thus allowing
remaining, more useful warnings to be more easily seen.
Diffstat (limited to 'ospf6d')
34 files changed, 476 insertions, 492 deletions
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index 180a2048d..8224b109f 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -472,7 +472,7 @@ ospf6_abr_originate_summary_to_area (struct ospf6_route *route, ospf6_lsa_originate_area (lsa, area); } -void +static void ospf6_abr_range_update (struct ospf6_route *range) { u_int32_t cost = 0; @@ -762,7 +762,7 @@ ospf6_abr_reimport (struct ospf6_area *oa) /* Display functions */ -int +static int ospf6_inter_area_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { struct ospf6_inter_prefix_lsa *prefix_lsa; @@ -787,7 +787,7 @@ ospf6_inter_area_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) return 0; } -int +static int ospf6_inter_area_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { struct ospf6_inter_router_lsa *router_lsa; @@ -841,7 +841,7 @@ config_write_ospf6_debug_abr (struct vty *vty) } void -install_element_ospf6_debug_abr () +install_element_ospf6_debug_abr (void) { install_element (ENABLE_NODE, &debug_ospf6_abr_cmd); install_element (ENABLE_NODE, &no_debug_ospf6_abr_cmd); @@ -864,7 +864,7 @@ struct ospf6_lsa_handler inter_router_handler = }; void -ospf6_abr_init () +ospf6_abr_init (void) { ospf6_install_lsa_handler (&inter_prefix_handler); ospf6_install_lsa_handler (&inter_router_handler); diff --git a/ospf6d/ospf6_abr.h b/ospf6d/ospf6_abr.h index 84c6fa5eb..5d00c4748 100644 --- a/ospf6d/ospf6_abr.h +++ b/ospf6d/ospf6_abr.h @@ -52,24 +52,22 @@ struct ospf6_inter_router_lsa { (E)->metric &= htonl (0x00000000); \ (E)->metric |= htonl (0x00ffffff) & htonl (C); } -int ospf6_is_router_abr (struct ospf6 *o); +extern int ospf6_is_router_abr (struct ospf6 *o); -void ospf6_abr_enable_area (struct ospf6_area *oa); -void ospf6_abr_disable_area (struct ospf6_area *oa); +extern void ospf6_abr_enable_area (struct ospf6_area *oa); +extern void ospf6_abr_disable_area (struct ospf6_area *oa); -void ospf6_abr_originate_summary_to_area (struct ospf6_route *route, - struct ospf6_area *area); -void ospf6_abr_originate_summary (struct ospf6_route *route); -void ospf6_abr_examin_summary (struct ospf6_lsa *lsa, struct ospf6_area *oa); -void ospf6_abr_examin_brouter (u_int32_t router_id); -void ospf6_abr_reimport (struct ospf6_area *oa); +extern void ospf6_abr_originate_summary_to_area (struct ospf6_route *route, + struct ospf6_area *area); +extern void ospf6_abr_originate_summary (struct ospf6_route *route); +extern void ospf6_abr_examin_summary (struct ospf6_lsa *lsa, struct ospf6_area *oa); +extern void ospf6_abr_examin_brouter (u_int32_t router_id); +extern void ospf6_abr_reimport (struct ospf6_area *oa); -int config_write_ospf6_debug_abr (struct vty *vty); -void install_element_ospf6_debug_abr (); -int ospf6_abr_config_write (struct vty *vty); +extern int config_write_ospf6_debug_abr (struct vty *vty); +extern void install_element_ospf6_debug_abr (void); +extern int ospf6_abr_config_write (struct vty *vty); -void ospf6_abr_init (); +extern void ospf6_abr_init (void); #endif /*OSPF6_ABR_H*/ - - diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index 94283dba7..3bfc0cae5 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -54,7 +54,7 @@ ospf6_area_cmp (void *va, void *vb) } /* schedule routing table recalculation */ -void +static void ospf6_area_lsdb_hook_add (struct ospf6_lsa *lsa) { switch (ntohs (lsa->header->type)) @@ -84,7 +84,7 @@ ospf6_area_lsdb_hook_add (struct ospf6_lsa *lsa) } } -void +static void ospf6_area_lsdb_hook_remove (struct ospf6_lsa *lsa) { switch (ntohs (lsa->header->type)) @@ -114,14 +114,14 @@ ospf6_area_lsdb_hook_remove (struct ospf6_lsa *lsa) } } -void +static void ospf6_area_route_hook_add (struct ospf6_route *route) { struct ospf6_route *copy = ospf6_route_copy (route); ospf6_route_add (copy, ospf6->route_table); } -void +static void ospf6_area_route_hook_remove (struct ospf6_route *route) { struct ospf6_route *copy; @@ -230,7 +230,7 @@ ospf6_area_lookup (u_int32_t area_id, struct ospf6 *ospf6) return (struct ospf6_area *) NULL; } -struct ospf6_area * +static struct ospf6_area * ospf6_area_get (u_int32_t area_id, struct ospf6 *o) { struct ospf6_area *oa; @@ -364,7 +364,7 @@ ALIAS (area_range, OSPF6_AREA_ID_STR "Configured address range\n" "Specify IPv6 prefix\n" - ); + ) DEFUN (no_area_range, no_area_range_cmd, @@ -746,7 +746,7 @@ DEFUN (show_ipv6_ospf6_simulate_spf_tree_root, } void -ospf6_area_init () +ospf6_area_init (void) { install_element (VIEW_NODE, &show_ipv6_ospf6_spf_tree_cmd); install_element (VIEW_NODE, &show_ipv6_ospf6_area_spf_tree_cmd); diff --git a/ospf6d/ospf6_area.h b/ospf6d/ospf6_area.h index 6bf7e0b5f..c7c5ee358 100644 --- a/ospf6d/ospf6_area.h +++ b/ospf6d/ospf6_area.h @@ -112,19 +112,18 @@ struct ospf6_area #define IS_AREA_STUB(oa) (CHECK_FLAG ((oa)->flag, OSPF6_AREA_STUB)) /* prototypes */ -int ospf6_area_cmp (void *va, void *vb); +extern int ospf6_area_cmp (void *va, void *vb); -struct ospf6_area *ospf6_area_create (u_int32_t, struct ospf6 *); -void ospf6_area_delete (struct ospf6_area *); -struct ospf6_area *ospf6_area_lookup (u_int32_t, struct ospf6 *); +extern struct ospf6_area *ospf6_area_create (u_int32_t, struct ospf6 *); +extern void ospf6_area_delete (struct ospf6_area *); +extern struct ospf6_area *ospf6_area_lookup (u_int32_t, struct ospf6 *); -void ospf6_area_enable (struct ospf6_area *); -void ospf6_area_disable (struct ospf6_area *); +extern void ospf6_area_enable (struct ospf6_area *); +extern void ospf6_area_disable (struct ospf6_area *); -void ospf6_area_show (struct vty *, struct ospf6_area *); +extern void ospf6_area_show (struct vty *, struct ospf6_area *); -void ospf6_area_config_write (struct vty *vty); -void ospf6_area_init (); +extern void ospf6_area_config_write (struct vty *vty); +extern void ospf6_area_init (void); #endif /* OSPF_AREA_H */ - diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index c12eecae4..37b912b45 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -53,7 +53,7 @@ unsigned char conf_debug_ospf6_asbr = 0; #define ZROUTE_NAME(x) zebra_route_string(x) /* AS External LSA origination */ -void +static void ospf6_as_external_lsa_originate (struct ospf6_route *route) { char buffer[OSPF6_MAX_LSASIZE]; @@ -336,7 +336,7 @@ ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry) /* redistribute function */ -void +static void ospf6_asbr_routemap_set (int type, const char *mapname) { if (ospf6->rmap[type].name) @@ -345,7 +345,7 @@ ospf6_asbr_routemap_set (int type, const char *mapname) ospf6->rmap[type].map = route_map_lookup_by_name (mapname); } -void +static void ospf6_asbr_routemap_unset (int type) { if (ospf6->rmap[type].name) @@ -354,7 +354,7 @@ ospf6_asbr_routemap_unset (int type) ospf6->rmap[type].map = NULL; } -void +static void ospf6_asbr_routemap_update (const char *mapname) { int type; @@ -378,13 +378,13 @@ ospf6_asbr_is_asbr (struct ospf6 *o) return o->external_table->count; } -void +static void ospf6_asbr_redistribute_set (int type) { ospf6_zebra_redistribute (type); } -void +static void ospf6_asbr_redistribute_unset (int type) { struct ospf6_route *route; @@ -731,7 +731,7 @@ ospf6_redistribute_config_write (struct vty *vty) return 0; } -void +static void ospf6_redistribute_show_config (struct vty *vty) { int type; @@ -774,7 +774,7 @@ ospf6_redistribute_show_config (struct vty *vty) /* Routemap Functions */ -route_map_result_t +static route_map_result_t ospf6_routemap_rule_match_address_prefixlist (void *rule, struct prefix *prefix, route_map_object_t type, @@ -793,13 +793,13 @@ ospf6_routemap_rule_match_address_prefixlist (void *rule, RMAP_NOMATCH : RMAP_MATCH); } -void * +static void * ospf6_routemap_rule_match_address_prefixlist_compile (const char *arg) { return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg); } -void +static void ospf6_routemap_rule_match_address_prefixlist_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); @@ -814,7 +814,7 @@ ospf6_routemap_rule_match_address_prefixlist_cmd = ospf6_routemap_rule_match_address_prefixlist_free, }; -route_map_result_t +static route_map_result_t ospf6_routemap_rule_set_metric_type (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { @@ -832,7 +832,7 @@ ospf6_routemap_rule_set_metric_type (void *rule, struct prefix *prefix, return RMAP_OKAY; } -void * +static void * ospf6_routemap_rule_set_metric_type_compile (const char *arg) { if (strcmp (arg, "type-2") && strcmp (arg, "type-1")) @@ -840,7 +840,7 @@ ospf6_routemap_rule_set_metric_type_compile (const char *arg) return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg); } -void +static void ospf6_routemap_rule_set_metric_type_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); @@ -855,7 +855,7 @@ ospf6_routemap_rule_set_metric_type_cmd = ospf6_routemap_rule_set_metric_type_free, }; -route_map_result_t +static route_map_result_t ospf6_routemap_rule_set_metric (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { @@ -869,7 +869,7 @@ ospf6_routemap_rule_set_metric (void *rule, struct prefix *prefix, return RMAP_OKAY; } -void * +static void * ospf6_routemap_rule_set_metric_compile (const char *arg) { u_int32_t metric; @@ -880,7 +880,7 @@ ospf6_routemap_rule_set_metric_compile (const char *arg) return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg); } -void +static void ospf6_routemap_rule_set_metric_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); @@ -895,7 +895,7 @@ ospf6_routemap_rule_set_metric_cmd = ospf6_routemap_rule_set_metric_free, }; -route_map_result_t +static route_map_result_t ospf6_routemap_rule_set_forwarding (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { @@ -915,7 +915,7 @@ ospf6_routemap_rule_set_forwarding (void *rule, struct prefix *prefix, return RMAP_OKAY; } -void * +static void * ospf6_routemap_rule_set_forwarding_compile (const char *arg) { struct in6_addr a; @@ -924,7 +924,7 @@ ospf6_routemap_rule_set_forwarding_compile (const char *arg) return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg); } -void +static void ospf6_routemap_rule_set_forwarding_free (void *rule) { XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); @@ -939,7 +939,7 @@ ospf6_routemap_rule_set_forwarding_cmd = ospf6_routemap_rule_set_forwarding_free, }; -int +static int route_map_command_status (struct vty *vty, int ret) { if (! ret) @@ -1074,8 +1074,8 @@ DEFUN (ospf6_routemap_no_set_forwarding, return route_map_command_status (vty, ret); } -void -ospf6_routemap_init () +static void +ospf6_routemap_init (void) { route_map_init (); route_map_init_vty (); @@ -1106,7 +1106,7 @@ ospf6_routemap_init () /* Display functions */ -int +static int ospf6_as_external_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { struct ospf6_as_external_lsa *external; @@ -1154,7 +1154,7 @@ ospf6_as_external_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) return 0; } -void +static void ospf6_asbr_external_route_show (struct vty *vty, struct ospf6_route *route) { struct ospf6_external_info *info = route->route_option; @@ -1206,7 +1206,7 @@ struct ospf6_lsa_handler as_external_handler = }; void -ospf6_asbr_init () +ospf6_asbr_init (void) { ospf6_routemap_init (); diff --git a/ospf6d/ospf6_asbr.h b/ospf6d/ospf6_asbr.h index f3aabc8d6..7166aa3ed 100644 --- a/ospf6d/ospf6_asbr.h +++ b/ospf6d/ospf6_asbr.h @@ -63,24 +63,24 @@ struct ospf6_as_external_lsa { (E)->bits_metric &= htonl (0xff000000); \ (E)->bits_metric |= htonl (0x00ffffff) & htonl (C); } -void ospf6_asbr_lsa_add (struct ospf6_lsa *lsa); -void ospf6_asbr_lsa_remove (struct ospf6_lsa *lsa); -void ospf6_asbr_lsentry_add (struct ospf6_route *asbr_entry); -void ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry); +extern void ospf6_asbr_lsa_add (struct ospf6_lsa *lsa); +extern void ospf6_asbr_lsa_remove (struct ospf6_lsa *lsa); +extern void ospf6_asbr_lsentry_add (struct ospf6_route *asbr_entry); +extern void ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry); -int ospf6_asbr_is_asbr (struct ospf6 *o); -void -ospf6_asbr_redistribute_add (int type, int ifindex, struct prefix *prefix, - u_int nexthop_num, struct in6_addr *nexthop); -void -ospf6_asbr_redistribute_remove (int type, int ifindex, struct prefix *prefix); +extern int ospf6_asbr_is_asbr (struct ospf6 *o); +extern void ospf6_asbr_redistribute_add (int type, int ifindex, + struct prefix *prefix, + u_int nexthop_num, + struct in6_addr *nexthop); +extern void ospf6_asbr_redistribute_remove (int type, int ifindex, + struct prefix *prefix); -int ospf6_redistribute_config_write (struct vty *vty); +extern int ospf6_redistribute_config_write (struct vty *vty); -void ospf6_asbr_init (); +extern void ospf6_asbr_init (void); -int config_write_ospf6_debug_asbr (struct vty *vty); -void install_element_ospf6_debug_asbr (); +extern int config_write_ospf6_debug_asbr (struct vty *vty); +extern void install_element_ospf6_debug_asbr (void); #endif /* OSPF6_ASBR_H */ - diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 39b7c1f36..8c460293e 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -241,7 +241,7 @@ ospf6_install_lsa (struct ospf6_lsa *lsa) /* RFC2740 section 3.5.2. Sending Link State Update packets */ /* RFC2328 section 13.3 Next step in the flooding procedure */ -void +static void ospf6_flood_interface (struct ospf6_neighbor *from, struct ospf6_lsa *lsa, struct ospf6_interface *oi) { @@ -387,7 +387,7 @@ ospf6_flood_interface (struct ospf6_neighbor *from, } } -void +static void ospf6_flood_area (struct ospf6_neighbor *from, struct ospf6_lsa *lsa, struct ospf6_area *oa) { @@ -410,7 +410,7 @@ ospf6_flood_area (struct ospf6_neighbor *from, } } -void +static void ospf6_flood_process (struct ospf6_neighbor *from, struct ospf6_lsa *lsa, struct ospf6 *process) { @@ -440,7 +440,7 @@ ospf6_flood (struct ospf6_neighbor *from, struct ospf6_lsa *lsa) ospf6_flood_process (from, lsa, ospf6); } -void +static void ospf6_flood_clear_interface (struct ospf6_lsa *lsa, struct ospf6_interface *oi) { struct listnode *node, *nnode; @@ -463,7 +463,7 @@ ospf6_flood_clear_interface (struct ospf6_lsa *lsa, struct ospf6_interface *oi) } } -void +static void ospf6_flood_clear_area (struct ospf6_lsa *lsa, struct ospf6_area *oa) { struct listnode *node, *nnode; @@ -485,7 +485,7 @@ ospf6_flood_clear_area (struct ospf6_lsa *lsa, struct ospf6_area *oa) } } -void +static void ospf6_flood_clear_process (struct ospf6_lsa *lsa, struct ospf6 *process) { struct listnode *node, *nnode; @@ -676,7 +676,7 @@ ospf6_acknowledge_lsa_allother (struct ospf6_lsa *lsa, int ismore_recent, early of ospf6_receive_lsa () */ } -void +static void ospf6_acknowledge_lsa (struct ospf6_lsa *lsa, int ismore_recent, struct ospf6_neighbor *from) { @@ -1013,7 +1013,7 @@ config_write_ospf6_debug_flood (struct vty *vty) } void -install_element_ospf6_debug_flood () +install_element_ospf6_debug_flood (void) { install_element (ENABLE_NODE, &debug_ospf6_flooding_cmd); install_element (ENABLE_NODE, &no_debug_ospf6_flooding_cmd); diff --git a/ospf6d/ospf6_flood.h b/ospf6d/ospf6_flood.h index 4851c141e..3a6f300ba 100644 --- a/ospf6d/ospf6_flood.h +++ b/ospf6d/ospf6_flood.h @@ -32,34 +32,34 @@ extern unsigned char conf_debug_ospf6_flooding; (conf_debug_ospf6_flooding) /* Function Prototypes */ -struct ospf6_lsdb *ospf6_get_scoped_lsdb (struct ospf6_lsa *lsa); -struct ospf6_lsdb *ospf6_get_scoped_lsdb_self (struct ospf6_lsa *lsa); +extern struct ospf6_lsdb *ospf6_get_scoped_lsdb (struct ospf6_lsa *lsa); +extern struct ospf6_lsdb *ospf6_get_scoped_lsdb_self (struct ospf6_lsa *lsa); /* origination & purging */ -void ospf6_lsa_originate (struct ospf6_lsa *lsa); -void ospf6_lsa_originate_process (struct ospf6_lsa *lsa, - struct ospf6 *process); -void ospf6_lsa_originate_area (struct ospf6_lsa *lsa, - struct ospf6_area *oa); -void ospf6_lsa_originate_interface (struct ospf6_lsa *lsa, - struct ospf6_interface *oi); -void ospf6_lsa_purge (struct ospf6_lsa *lsa); +extern void ospf6_lsa_originate (struct ospf6_lsa *lsa); +extern void ospf6_lsa_originate_process (struct ospf6_lsa *lsa, + struct ospf6 *process); +extern void ospf6_lsa_originate_area (struct ospf6_lsa *lsa, + struct ospf6_area *oa); +extern void ospf6_lsa_originate_interface (struct ospf6_lsa *lsa, + struct ospf6_interface *oi); +extern void ospf6_lsa_purge (struct ospf6_lsa *lsa); /* access method to retrans_count */ -void ospf6_increment_retrans_count (struct ospf6_lsa *lsa); -void ospf6_decrement_retrans_count (struct ospf6_lsa *lsa); +extern void ospf6_increment_retrans_count (struct ospf6_lsa *lsa); +extern void ospf6_decrement_retrans_count (struct ospf6_lsa *lsa); /* flooding & clear flooding */ -void ospf6_flood_clear (struct ospf6_lsa *lsa); -void ospf6_flood (struct ospf6_neighbor *from, struct ospf6_lsa *lsa); +extern void ospf6_flood_clear (struct ospf6_lsa *lsa); +extern void ospf6_flood (struct ospf6_neighbor *from, struct ospf6_lsa *lsa); /* receive & install */ -void ospf6_receive_lsa (struct ospf6_neighbor *from, - struct ospf6_lsa_header *header); -void ospf6_install_lsa (struct ospf6_lsa *lsa); +extern void ospf6_receive_lsa (struct ospf6_neighbor *from, + struct ospf6_lsa_header *header); +extern void ospf6_install_lsa (struct ospf6_lsa *lsa); -int config_write_ospf6_debug_flood (struct vty *vty); -void install_element_ospf6_debug_flood (); +extern int config_write_ospf6_debug_flood (struct vty *vty); +extern void install_element_ospf6_debug_flood (void); #endif /* OSPF6_FLOOD_H */ diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 95464b63a..8d9a7f016 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -72,7 +72,7 @@ ospf6_interface_lookup_by_ifindex (int ifindex) } /* schedule routing table recalculation */ -void +static void ospf6_interface_lsdb_hook (struct ospf6_lsa *lsa) { switch (ntohs (lsa->header->type)) @@ -692,7 +692,7 @@ neighbor_change (struct thread *thread) return 0; } -int +static int loopind (struct thread *thread) { struct ospf6_interface *oi; @@ -739,7 +739,7 @@ interface_down (struct thread *thread) /* show specified interface structure */ -int +static int ospf6_interface_show (struct vty *vty, struct interface *ifp) { struct ospf6_interface *oi; @@ -897,7 +897,7 @@ ALIAS (show_ipv6_ospf6_interface, IP6_STR OSPF6_STR INTERFACE_STR - ); + ) DEFUN (show_ipv6_ospf6_interface_ifname_prefix, show_ipv6_ospf6_interface_ifname_prefix_cmd, @@ -946,7 +946,7 @@ ALIAS (show_ipv6_ospf6_interface_ifname_prefix, OSPF6_ROUTE_ADDRESS_STR OSPF6_ROUTE_PREFIX_STR "Dispaly details of the prefixes\n" - ); + ) ALIAS (show_ipv6_ospf6_interface_ifname_prefix, show_ipv6_ospf6_interface_ifname_prefix_match_cmd, @@ -960,7 +960,7 @@ ALIAS (show_ipv6_ospf6_interface_ifname_prefix, OSPF6_ROUTE_PREFIX_STR OSPF6_ROUTE_MATCH_STR "Dispaly details of the prefixes\n" - ); + ) DEFUN (show_ipv6_ospf6_interface_prefix, show_ipv6_ospf6_interface_prefix_cmd, @@ -999,7 +999,7 @@ ALIAS (show_ipv6_ospf6_interface_prefix, OSPF6_ROUTE_ADDRESS_STR OSPF6_ROUTE_PREFIX_STR "Dispaly details of the prefixes\n" - ); + ) ALIAS (show_ipv6_ospf6_interface_prefix, show_ipv6_ospf6_interface_prefix_match_cmd, @@ -1012,7 +1012,7 @@ ALIAS (show_ipv6_ospf6_interface_prefix, OSPF6_ROUTE_PREFIX_STR OSPF6_ROUTE_MATCH_STR "Dispaly details of the prefixes\n" - ); + ) /* interface variable set command */ @@ -1463,7 +1463,7 @@ DEFUN (no_ipv6_ospf6_advertise_prefix_list, return CMD_SUCCESS; } -int +static int config_write_ospf6_interface (struct vty *vty) { struct listnode *i; @@ -1519,7 +1519,7 @@ struct cmd_node interface_node = }; void -ospf6_interface_init () +ospf6_interface_init (void) { /* Install interface node. */ install_node (&interface_node, config_write_ospf6_interface); @@ -1596,7 +1596,7 @@ config_write_ospf6_debug_interface (struct vty *vty) } void -install_element_ospf6_debug_interface () +install_element_ospf6_debug_interface (void) { install_element (ENABLE_NODE, &debug_ospf6_interface_cmd); install_element (ENABLE_NODE, &no_debug_ospf6_interface_cmd); diff --git a/ospf6d/ospf6_interface.h b/ospf6d/ospf6_interface.h index fb93cedac..878c29e26 100644 --- a/ospf6d/ospf6_interface.h +++ b/ospf6d/ospf6_interface.h @@ -124,29 +124,28 @@ extern const char *ospf6_interface_state_str[]; /* Function Prototypes */ -struct ospf6_interface *ospf6_interface_lookup_by_ifindex (int); -struct ospf6_interface *ospf6_interface_create (struct interface *); -void ospf6_interface_delete (struct ospf6_interface *); +extern struct ospf6_interface *ospf6_interface_lookup_by_ifindex (int); +extern struct ospf6_interface *ospf6_interface_create (struct interface *); +extern void ospf6_interface_delete (struct ospf6_interface *); -void ospf6_interface_enable (struct ospf6_interface *); -void ospf6_interface_disable (struct ospf6_interface *); +extern void ospf6_interface_enable (struct ospf6_interface *); +extern void ospf6_interface_disable (struct ospf6_interface *); -void ospf6_interface_if_add (struct interface *); -void ospf6_interface_if_del (struct interface *); -void ospf6_interface_state_update (struct interface *); -void ospf6_interface_connected_route_update (struct interface *); +extern void ospf6_interface_if_add (struct interface *); +extern void ospf6_interface_if_del (struct interface *); +extern void ospf6_interface_state_update (struct interface *); +extern void ospf6_interface_connected_route_update (struct interface *); /* interface event */ -int interface_up (struct thread *); -int interface_down (struct thread *); -int wait_timer (struct thread *); -int backup_seen (struct thread *); -int neighbor_change (struct thread *); +extern int interface_up (struct thread *); +extern int interface_down (struct thread *); +extern int wait_timer (struct thread *); +extern int backup_seen (struct thread *); +extern int neighbor_change (struct thread *); -void ospf6_interface_init (); +extern void ospf6_interface_init (void); -int config_write_ospf6_debug_interface (struct vty *vty); -void install_element_ospf6_debug_interface (); +extern int config_write_ospf6_debug_interface (struct vty *vty); +extern void install_element_ospf6_debug_interface (void); #endif /* OSPF6_INTERFACE_H */ - diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index ffd9c725e..103e8fc2e 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -56,7 +56,7 @@ u_int32_t conf_debug_ospf6_brouter_specific_area_id; /* RFC2740 3.4.3.1 Router-LSA */ /******************************/ -int +static int ospf6_router_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { char *start, *end, *current; @@ -316,7 +316,7 @@ ospf6_router_lsa_originate (struct thread *thread) /* RFC2740 3.4.3.2 Network-LSA */ /*******************************/ -int +static int ospf6_network_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { char *start, *end, *current; @@ -462,7 +462,7 @@ ospf6_network_lsa_originate (struct thread *thread) /* RFC2740 3.4.3.6 Link-LSA */ /****************************/ -int +static int ospf6_link_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { char *start, *end, *current; @@ -615,7 +615,7 @@ ospf6_link_lsa_originate (struct thread *thread) /* RFC2740 3.4.3.7 Intra-Area-Prefix-LSA */ /*****************************************/ -int +static int ospf6_intra_prefix_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { char *start, *end, *current; @@ -1238,7 +1238,7 @@ ospf6_intra_route_calculation (struct ospf6_area *oa) zlog_debug ("Re-examin intra-routes for area %s: Done", oa->name); } -void +static void ospf6_brouter_debug_print (struct ospf6_route *brouter) { u_int32_t brouter_id; diff --git a/ospf6d/ospf6_intra.h b/ospf6d/ospf6_intra.h index 8a9474a81..31643fd89 100644 --- a/ospf6d/ospf6_intra.h +++ b/ospf6d/ospf6_intra.h @@ -187,28 +187,28 @@ struct ospf6_intra_prefix_lsa /* Function Prototypes */ -char *ospf6_router_lsdesc_lookup (u_char type, u_int32_t interface_id, - u_int32_t neighbor_interface_id, - u_int32_t neighbor_router_id, - struct ospf6_lsa *lsa); -char *ospf6_network_lsdesc_lookup (u_int32_t router_id, - struct ospf6_lsa *lsa); - -int ospf6_router_lsa_originate (struct thread *); -int ospf6_network_lsa_originate (struct thread *); -int ospf6_link_lsa_originate (struct thread *); -int ospf6_intra_prefix_lsa_originate_transit (struct thread *); -int ospf6_intra_prefix_lsa_originate_stub (struct thread *); -void ospf6_intra_prefix_lsa_add (struct ospf6_lsa *lsa); -void ospf6_intra_prefix_lsa_remove (struct ospf6_lsa *lsa); - -void ospf6_intra_route_calculation (struct ospf6_area *oa); -void ospf6_intra_brouter_calculation (struct ospf6_area *oa); - -void ospf6_intra_init (); - -int config_write_ospf6_debug_brouter (struct vty *vty); -void install_element_ospf6_debug_brouter (); +extern char *ospf6_router_lsdesc_lookup (u_char type, u_int32_t interface_id, + u_int32_t neighbor_interface_id, + u_int32_t neighbor_router_id, + struct ospf6_lsa *lsa); +extern char *ospf6_network_lsdesc_lookup (u_int32_t router_id, + struct ospf6_lsa *lsa); + +extern int ospf6_router_lsa_originate (struct thread *); +extern int ospf6_network_lsa_originate (struct thread *); +extern int ospf6_link_lsa_originate (struct thread *); +extern int ospf6_intra_prefix_lsa_originate_transit (struct thread *); +extern int ospf6_intra_prefix_lsa_originate_stub (struct thread *); +extern void ospf6_intra_prefix_lsa_add (struct ospf6_lsa *lsa); +extern void ospf6_intra_prefix_lsa_remove (struct ospf6_lsa *lsa); + +extern void ospf6_intra_route_calculation (struct ospf6_area *oa); +extern void ospf6_intra_brouter_calculation (struct ospf6_area *oa); + +extern void ospf6_intra_init (void); + +extern int config_write_ospf6_debug_brouter (struct vty *vty); +extern void install_element_ospf6_debug_brouter (void); #endif /* OSPF6_LSA_H */ diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index e57384b3f..87df7418a 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -45,7 +45,7 @@ vector ospf6_lsa_handler_vector; -int +static int ospf6_unknown_lsa_show (struct vty *vty, struct ospf6_lsa *lsa) { u_char *start, *end, *current; @@ -703,14 +703,14 @@ ospf6_lsa_checksum (struct ospf6_lsa_header *lsa_header) } void -ospf6_lsa_init () +ospf6_lsa_init (void) { ospf6_lsa_handler_vector = vector_init (0); ospf6_install_lsa_handler (&unknown_handler); } -char * +static char * ospf6_lsa_handler_name (struct ospf6_lsa_handler *h) { static char buf[64]; @@ -870,7 +870,7 @@ struct cmd_element no_debug_ospf6_lsa_type_cmd; struct cmd_element no_debug_ospf6_lsa_type_detail_cmd; void -install_element_ospf6_debug_lsa () +install_element_ospf6_debug_lsa (void) { u_int i; struct ospf6_lsa_handler *handler; diff --git a/ospf6d/ospf6_lsa.h b/ospf6d/ospf6_lsa.h index 0e1b91174..fb0f27cda 100644 --- a/ospf6d/ospf6_lsa.h +++ b/ospf6d/ospf6_lsa.h @@ -206,47 +206,47 @@ extern struct ospf6_lsa_handler unknown_handler; /* Function Prototypes */ -const char *ospf6_lstype_name (u_int16_t type); -u_char ospf6_lstype_debug (u_int16_t type); -int ospf6_lsa_is_differ (struct ospf6_lsa *lsa1, struct ospf6_lsa *lsa2); -int ospf6_lsa_is_changed (struct ospf6_lsa *lsa1, struct ospf6_lsa *lsa2); -u_int16_t ospf6_lsa_age_current (struct ospf6_lsa *); -void ospf6_lsa_age_update_to_send (struct ospf6_lsa *, u_int32_t); -void ospf6_lsa_premature_aging (struct ospf6_lsa *); -int ospf6_lsa_compare (struct ospf6_lsa *, struct ospf6_lsa *); - -char *ospf6_lsa_printbuf (struct ospf6_lsa *lsa, char *buf, int size); -void ospf6_lsa_header_print_raw (struct ospf6_lsa_header *header); -void ospf6_lsa_header_print (struct ospf6_lsa *lsa); -void ospf6_lsa_show_summary_header (struct vty *vty); -void ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa); -void ospf6_lsa_show_dump (struct vty *vty, struct ospf6_lsa *lsa); -void ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa); -void ospf6_lsa_show (struct vty *vty, struct ospf6_lsa *lsa); - -struct ospf6_lsa *ospf6_lsa_create (struct ospf6_lsa_header *header); -struct ospf6_lsa *ospf6_lsa_create_headeronly (struct ospf6_lsa_header *header); -void ospf6_lsa_delete (struct ospf6_lsa *lsa); -struct ospf6_lsa *ospf6_lsa_copy (struct ospf6_lsa *); - -void ospf6_lsa_lock (struct ospf6_lsa *); -void ospf6_lsa_unlock (struct ospf6_lsa *); - -int ospf6_lsa_expire (struct thread *); -int ospf6_lsa_refresh (struct thread *); - -unsigned short ospf6_lsa_checksum (struct ospf6_lsa_header *); -int ospf6_lsa_prohibited_duration (u_int16_t type, u_int32_t id, - u_int32_t adv_router, void *scope); - -void ospf6_install_lsa_handler (struct ospf6_lsa_handler *handler); -struct ospf6_lsa_handler *ospf6_get_lsa_handler (u_int16_t type); - -void ospf6_lsa_init (); -void ospf6_lsa_cmd_init (); - -int config_write_ospf6_debug_lsa (struct vty *vty); -void install_element_ospf6_debug_lsa (); +extern const char *ospf6_lstype_name (u_int16_t type); +extern u_char ospf6_lstype_debug (u_int16_t type); +extern int ospf6_lsa_is_differ (struct ospf6_lsa *lsa1, struct ospf6_lsa *lsa2); +extern int ospf6_lsa_is_changed (struct ospf6_lsa *lsa1, struct ospf6_lsa *lsa2); +extern u_int16_t ospf6_lsa_age_current (struct ospf6_lsa *); +extern void ospf6_lsa_age_update_to_send (struct ospf6_lsa *, u_int32_t); +extern void ospf6_lsa_premature_aging (struct ospf6_lsa *); +extern int ospf6_lsa_compare (struct ospf6_lsa *, struct ospf6_lsa *); + +extern char *ospf6_lsa_printbuf (struct ospf6_lsa *lsa, char *buf, int size); +extern void ospf6_lsa_header_print_raw (struct ospf6_lsa_header *header); +extern void ospf6_lsa_header_print (struct ospf6_lsa *lsa); +extern void ospf6_lsa_show_summary_header (struct vty *vty); +extern void ospf6_lsa_show_summary (struct vty *vty, struct ospf6_lsa *lsa); +extern void ospf6_lsa_show_dump (struct vty *vty, struct ospf6_lsa *lsa); +extern void ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa); +extern void ospf6_lsa_show (struct vty *vty, struct ospf6_lsa *lsa); + +extern struct ospf6_lsa *ospf6_lsa_create (struct ospf6_lsa_header *header); +extern struct ospf6_lsa *ospf6_lsa_create_headeronly (struct ospf6_lsa_header *header); +extern void ospf6_lsa_delete (struct ospf6_lsa *lsa); +extern struct ospf6_lsa *ospf6_lsa_copy (struct ospf6_lsa *); + +extern void ospf6_lsa_lock (struct ospf6_lsa *); +extern void ospf6_lsa_unlock (struct ospf6_lsa *); + +extern int ospf6_lsa_expire (struct thread *); +extern int ospf6_lsa_refresh (struct thread *); + +extern unsigned short ospf6_lsa_checksum (struct ospf6_lsa_header *); +extern int ospf6_lsa_prohibited_duration (u_int16_t type, u_int32_t id, + u_int32_t adv_router, void *scope); + +extern void ospf6_install_lsa_handler (struct ospf6_lsa_handler *handler); +extern struct ospf6_lsa_handler *ospf6_get_lsa_handler (u_int16_t type); + +extern void ospf6_lsa_init (void); +extern void ospf6_lsa_cmd_init (void); + +extern int config_write_ospf6_debug_lsa (struct vty *vty); +extern void install_element_ospf6_debug_lsa (void); #endif /* OSPF6_LSA_H */ diff --git a/ospf6d/ospf6_lsdb.h b/ospf6d/ospf6_lsdb.h index a9eba69d0..71297daec 100644 --- a/ospf6d/ospf6_lsdb.h +++ b/ospf6d/ospf6_lsdb.h @@ -50,51 +50,49 @@ struct ospf6_lsdb } while (0) /* Function Prototypes */ -struct ospf6_lsdb *ospf6_lsdb_create (void *data); -void ospf6_lsdb_delete (struct ospf6_lsdb *lsdb); +extern struct ospf6_lsdb *ospf6_lsdb_create (void *data); +extern void ospf6_lsdb_delete (struct ospf6_lsdb *lsdb); -struct ospf6_lsa * -ospf6_lsdb_lookup (u_int16_t type, u_int32_t id, u_int32_t adv_router, - struct ospf6_lsdb *lsdb); -struct ospf6_lsa * -ospf6_lsdb_lookup_next (u_int16_t type, u_int32_t id, - u_int32_t adv_router, struct ospf6_lsdb *lsdb); +extern struct ospf6_lsa *ospf6_lsdb_lookup (u_int16_t type, u_int32_t id, + u_int32_t adv_router, + struct ospf6_lsdb *lsdb); +extern struct ospf6_lsa *ospf6_lsdb_lookup_next (u_int16_t type, u_int32_t id, + u_int32_t adv_router, + struct ospf6_lsdb *lsdb); -void ospf6_lsdb_add (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb); -void ospf6_lsdb_remove (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb); +extern void ospf6_lsdb_add (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb); +extern void ospf6_lsdb_remove (struct ospf6_lsa *lsa, struct ospf6_lsdb *lsdb); -struct ospf6_lsa *ospf6_lsdb_head (struct ospf6_lsdb *lsdb); -struct ospf6_lsa *ospf6_lsdb_next (struct ospf6_lsa *lsa); +extern struct ospf6_lsa *ospf6_lsdb_head (struct ospf6_lsdb *lsdb); +extern struct ospf6_lsa *ospf6_lsdb_next (struct ospf6_lsa *lsa); -struct ospf6_lsa *ospf6_lsdb_type_router_head (u_int16_t type, +extern struct ospf6_lsa *ospf6_lsdb_type_router_head (u_int16_t type, u_int32_t adv_router, struct ospf6_lsdb *lsdb); -struct ospf6_lsa *ospf6_lsdb_type_router_next (u_int16_t type, +extern struct ospf6_lsa *ospf6_lsdb_type_router_next (u_int16_t type, u_int32_t adv_router, struct ospf6_lsa *lsa); -struct ospf6_lsa *ospf6_lsdb_type_head (u_int16_t type, - struct ospf6_lsdb *lsdb); -struct ospf6_lsa *ospf6_lsdb_type_next (u_int16_t type, - struct ospf6_lsa *lsa); +extern struct ospf6_lsa *ospf6_lsdb_type_head (u_int16_t type, + struct ospf6_lsdb *lsdb); +extern struct ospf6_lsa *ospf6_lsdb_type_next (u_int16_t type, + struct ospf6_lsa *lsa); -void ospf6_lsdb_remove_all (struct ospf6_lsdb *lsdb); +extern void ospf6_lsdb_remove_all (struct ospf6_lsdb *lsdb); #define OSPF6_LSDB_SHOW_LEVEL_NORMAL 0 #define OSPF6_LSDB_SHOW_LEVEL_DETAIL 1 #define OSPF6_LSDB_SHOW_LEVEL_INTERNAL 2 #define OSPF6_LSDB_SHOW_LEVEL_DUMP 3 -void ospf6_lsdb_show - (struct vty *vty, int level, - u_int16_t *type, u_int32_t *id, u_int32_t *adv_router, - struct ospf6_lsdb *lsdb); +extern void ospf6_lsdb_show (struct vty *vty, int level, u_int16_t *type, + u_int32_t *id, u_int32_t *adv_router, + struct ospf6_lsdb *lsdb); -u_int32_t ospf6_new_ls_id - (u_int16_t type, u_int32_t adv_router, struct ospf6_lsdb *lsdb); -u_int32_t ospf6_new_ls_seqnum - (u_int16_t type, u_int32_t id, u_int32_t adv_router, struct ospf6_lsdb *lsdb); +extern u_int32_t ospf6_new_ls_id (u_int16_t type, u_int32_t adv_router, + struct ospf6_lsdb *lsdb); +extern u_int32_t ospf6_new_ls_seqnum (u_int16_t type, u_int32_t id, + u_int32_t adv_router, + struct ospf6_lsdb *lsdb); #endif /* OSPF6_LSDB_H */ - - diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index 680f4b7fa..73d9150e8 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -125,14 +125,14 @@ Report bugs to zebra@zebra.org\n", progname); } /* SIGHUP handler. */ -void +static void sighup (void) { zlog_info ("SIGHUP received"); } /* SIGINT handler. */ -void +static void sigint (void) { zlog_notice ("Terminating on signal SIGINT"); @@ -140,7 +140,7 @@ sigint (void) } /* SIGTERM handler. */ -void +static void sigterm (void) { zlog_notice ("Terminating on signal SIGTERM"); @@ -148,7 +148,7 @@ sigterm (void) } /* SIGUSR1 handler. */ -void +static void sigusr1 (void) { zlog_info ("SIGUSR1 received"); diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index 6ece88b8c..c257092a4 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -272,7 +272,7 @@ ospf6_header_examin (struct in6_addr *src, struct in6_addr *dst, return MSG_OK; } -void +static void ospf6_hello_recv (struct in6_addr *src, struct in6_addr *dst, struct ospf6_interface *oi, struct ospf6_header *oh) { @@ -810,7 +810,7 @@ ospf6_dbdesc_recv_slave (struct ospf6_header *oh, memcpy (&on->dbdesc_last, dbdesc, sizeof (struct ospf6_dbdesc)); } -void +static void ospf6_dbdesc_recv (struct in6_addr *src, struct in6_addr *dst, struct ospf6_interface *oi, struct ospf6_header *oh) { @@ -859,7 +859,7 @@ ospf6_dbdesc_recv (struct in6_addr *src, struct in6_addr *dst, } } -void +static void ospf6_lsreq_recv (struct in6_addr *src, struct in6_addr *dst, struct ospf6_interface *oi, struct ospf6_header *oh) { @@ -946,7 +946,7 @@ ospf6_lsreq_recv (struct in6_addr *src, struct in6_addr *dst, thread_add_event (master, ospf6_lsupdate_send_neighbor, on, 0); } -void +static void ospf6_lsupdate_recv (struct in6_addr *src, struct in6_addr *dst, struct ospf6_interface *oi, struct ospf6_header *oh) { @@ -1025,7 +1025,7 @@ ospf6_lsupdate_recv (struct in6_addr *src, struct in6_addr *dst, } } -void +static void ospf6_lsack_recv (struct in6_addr *src, struct in6_addr *dst, struct ospf6_interface *oi, struct ospf6_header *oh) { @@ -1133,14 +1133,14 @@ ospf6_lsack_recv (struct in6_addr *src, struct in6_addr *dst, } } -u_char *recvbuf = NULL; -u_char *sendbuf = NULL; -unsigned int iobuflen = 0; +static u_char *recvbuf = NULL; +static u_char *sendbuf = NULL; +static unsigned int iobuflen = 0; int ospf6_iobuf_size (unsigned int size) { - char *recvnew, *sendnew; + u_char *recvnew, *sendnew; if (size <= iobuflen) return iobuflen; @@ -1290,7 +1290,7 @@ ospf6_receive (struct thread *thread) return 0; } -void +static void ospf6_send (struct in6_addr *src, struct in6_addr *dst, struct ospf6_interface *oi, struct ospf6_header *oh) { @@ -1396,7 +1396,7 @@ ospf6_hello_send (struct thread *thread) hello->drouter = oi->drouter; hello->bdrouter = oi->bdrouter; - p = (char *)((caddr_t) hello + sizeof (struct ospf6_hello)); + p = (u_char *)((caddr_t) hello + sizeof (struct ospf6_hello)); for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) { @@ -1469,7 +1469,7 @@ ospf6_dbdesc_send (struct thread *thread) dbdesc->seqnum = htonl (on->dbdesc_seqnum); /* if this is not initial one, set LSA headers in dbdesc */ - p = (char *)((caddr_t) dbdesc + sizeof (struct ospf6_dbdesc)); + p = (u_char *)((caddr_t) dbdesc + sizeof (struct ospf6_dbdesc)); if (! CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT)) { for (lsa = ospf6_lsdb_head (on->dbdesc_list); lsa; @@ -1575,7 +1575,7 @@ ospf6_lsreq_send (struct thread *thread) oh = (struct ospf6_header *) sendbuf; /* set Request entries in lsreq */ - p = (char *)((caddr_t) oh + sizeof (struct ospf6_header)); + p = (u_char *)((caddr_t) oh + sizeof (struct ospf6_header)); for (lsa = ospf6_lsdb_head (on->request_list); lsa; lsa = ospf6_lsdb_next (lsa)) { @@ -1639,7 +1639,7 @@ ospf6_lsupdate_send_neighbor (struct thread *thread) lsupdate = (struct ospf6_lsupdate *) ((caddr_t) oh + sizeof (struct ospf6_header)); - p = (char *)((caddr_t) lsupdate + sizeof (struct ospf6_lsupdate)); + p = (u_char *)((caddr_t) lsupdate + sizeof (struct ospf6_lsupdate)); num = 0; /* lsupdate_list lists those LSA which doesn't need to be @@ -1734,7 +1734,7 @@ ospf6_lsupdate_send_interface (struct thread *thread) lsupdate = (struct ospf6_lsupdate *)((caddr_t) oh + sizeof (struct ospf6_header)); - p = (char *)((caddr_t) lsupdate + sizeof (struct ospf6_lsupdate)); + p = (u_char *)((caddr_t) lsupdate + sizeof (struct ospf6_lsupdate)); num = 0; for (lsa = ospf6_lsdb_head (oi->lsupdate_list); lsa; @@ -1803,7 +1803,7 @@ ospf6_lsack_send_neighbor (struct thread *thread) memset (sendbuf, 0, iobuflen); oh = (struct ospf6_header *) sendbuf; - p = (char *)((caddr_t) oh + sizeof (struct ospf6_header)); + p = (u_char *)((caddr_t) oh + sizeof (struct ospf6_header)); for (lsa = ospf6_lsdb_head (on->lsack_list); lsa; lsa = ospf6_lsdb_next (lsa)) @@ -1863,7 +1863,7 @@ ospf6_lsack_send_interface (struct thread *thread) memset (sendbuf, 0, iobuflen); oh = (struct ospf6_header *) sendbuf; - p = (char *)((caddr_t) oh + sizeof (struct ospf6_header)); + p = (u_char *)((caddr_t) oh + sizeof (struct ospf6_header)); for (lsa = ospf6_lsdb_head (oi->lsack_list); lsa; lsa = ospf6_lsdb_next (lsa)) @@ -1979,7 +1979,7 @@ ALIAS (debug_ospf6_message, "Debug All message\n" "Debug only sending message\n" "Debug only receiving message\n" - ); + ) DEFUN (no_debug_ospf6_message, @@ -2055,7 +2055,7 @@ ALIAS (no_debug_ospf6_message, "Debug All message\n" "Debug only sending message\n" "Debug only receiving message\n" - ); + ) int config_write_ospf6_debug_message (struct vty *vty) @@ -2116,7 +2116,7 @@ config_write_ospf6_debug_message (struct vty *vty) } void -install_element_ospf6_debug_message () +install_element_ospf6_debug_message (void) { install_element (ENABLE_NODE, &debug_ospf6_message_cmd); install_element (ENABLE_NODE, &no_debug_ospf6_message_cmd); diff --git a/ospf6d/ospf6_message.h b/ospf6d/ospf6_message.h index 95b07ced5..ebb6308e5 100644 --- a/ospf6d/ospf6_message.h +++ b/ospf6d/ospf6_message.h @@ -116,26 +116,26 @@ struct ospf6_lsupdate /* It is just a sequence of LSA Headers */ /* Function definition */ -void ospf6_hello_print (struct ospf6_header *); -void ospf6_dbdesc_print (struct ospf6_header *); -void ospf6_lsreq_print (struct ospf6_header *); -void ospf6_lsupdate_print (struct ospf6_header *); -void ospf6_lsack_print (struct ospf6_header *); - -int ospf6_iobuf_size (unsigned int size); -int ospf6_receive (struct thread *thread); - -int ospf6_hello_send (struct thread *thread); -int ospf6_dbdesc_send (struct thread *thread); -int ospf6_dbdesc_send_newone (struct thread *thread); -int ospf6_lsreq_send (struct thread *thread); -int ospf6_lsupdate_send_interface (struct thread *thread); -int ospf6_lsupdate_send_neighbor (struct thread *thread); -int ospf6_lsack_send_interface (struct thread *thread); -int ospf6_lsack_send_neighbor (struct thread *thread); - -int config_write_ospf6_debug_message (struct vty *); -void install_element_ospf6_debug_message (); +extern void ospf6_hello_print (struct ospf6_header *); +extern void ospf6_dbdesc_print (struct ospf6_header *); +extern void ospf6_lsreq_print (struct ospf6_header *); +extern void ospf6_lsupdate_print (struct ospf6_header *); +extern void ospf6_lsack_print (struct ospf6_header *); + +extern int ospf6_iobuf_size (unsigned int size); +extern int ospf6_receive (struct thread *thread); + +extern int ospf6_hello_send (struct thread *thread); +extern int ospf6_dbdesc_send (struct thread *thread); +extern int ospf6_dbdesc_send_newone (struct thread *thread); +extern int ospf6_lsreq_send (struct thread *thread); +extern int ospf6_lsupdate_send_interface (struct thread *thread); +extern int ospf6_lsupdate_send_neighbor (struct thread *thread); +extern int ospf6_lsack_send_interface (struct thread *thread); +extern int ospf6_lsack_send_neighbor (struct thread *thread); + +extern int config_write_ospf6_debug_message (struct vty *); +extern void install_element_ospf6_debug_message (void); #endif /* OSPF6_MESSAGE_H */ diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c index 9c1cf2363..8a5d698db 100644 --- a/ospf6d/ospf6_neighbor.c +++ b/ospf6d/ospf6_neighbor.c @@ -183,7 +183,7 @@ ospf6_neighbor_state_change (u_char next_state, struct ospf6_neighbor *on) } /* RFC2328 section 10.4 */ -int +static int need_adjacency (struct ospf6_neighbor *on) { if (on->ospf6_if->state == OSPF6_INTERFACE_POINTTOPOINT || @@ -551,7 +551,7 @@ inactivity_timer (struct thread *thread) /* vty functions */ /* show neighbor structure */ -void +static void ospf6_neighbor_show (struct vty *vty, struct ospf6_neighbor *on) { char router_id[16]; @@ -612,7 +612,7 @@ ospf6_neighbor_show (struct vty *vty, struct ospf6_neighbor *on) ospf6_interface_state_str[on->ospf6_if->state], VNL); } -void +static void ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on) { char router_id[16]; @@ -641,7 +641,7 @@ ospf6_neighbor_show_drchoice (struct vty *vty, struct ospf6_neighbor *on) VNL); } -void +static void ospf6_neighbor_show_detail (struct vty *vty, struct ospf6_neighbor *on) { char drouter[16], bdrouter[16]; @@ -801,7 +801,7 @@ ALIAS (show_ipv6_ospf6_neighbor, "Neighbor list\n" "Display details\n" "Display DR choices\n" - ); + ) DEFUN (show_ipv6_ospf6_neighbor_one, show_ipv6_ospf6_neighbor_one_cmd, @@ -839,7 +839,7 @@ DEFUN (show_ipv6_ospf6_neighbor_one, } void -ospf6_neighbor_init () +ospf6_neighbor_init (void) { install_element (VIEW_NODE, &show_ipv6_ospf6_neighbor_cmd); install_element (VIEW_NODE, &show_ipv6_ospf6_neighbor_detail_cmd); @@ -878,7 +878,7 @@ ALIAS (debug_ospf6_neighbor, "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n" - ); + ) DEFUN (no_debug_ospf6_neighbor, no_debug_ospf6_neighbor_cmd, @@ -913,7 +913,7 @@ ALIAS (no_debug_ospf6_neighbor, "Debug OSPFv3 Neighbor\n" "Debug OSPFv3 Neighbor State Change\n" "Debug OSPFv3 Neighbor Event\n" - ); + ) int config_write_ospf6_debug_neighbor (struct vty *vty) @@ -929,7 +929,7 @@ config_write_ospf6_debug_neighbor (struct vty *vty) } void -install_element_ospf6_debug_neighbor () +install_element_ospf6_debug_neighbor (void) { install_element (ENABLE_NODE, &debug_ospf6_neighbor_cmd); install_element (ENABLE_NODE, &debug_ospf6_neighbor_detail_cmd); diff --git a/ospf6d/ospf6_neighbor.h b/ospf6d/ospf6_neighbor.h index 8f94790d7..b3bd173fc 100644 --- a/ospf6d/ospf6_neighbor.h +++ b/ospf6d/ospf6_neighbor.h @@ -105,7 +105,7 @@ struct ospf6_neighbor #define OSPF6_NEIGHBOR_LOADING 7 #define OSPF6_NEIGHBOR_FULL 8 -const extern char *ospf6_neighbor_state_str[]; +extern const char *ospf6_neighbor_state_str[]; /* Function Prototypes */ @@ -119,20 +119,19 @@ struct ospf6_neighbor *ospf6_neighbor_create (u_int32_t, void ospf6_neighbor_delete (struct ospf6_neighbor *); /* Neighbor event */ -int hello_received (struct thread *); -int twoway_received (struct thread *); -int negotiation_done (struct thread *); -int exchange_done (struct thread *); -int loading_done (struct thread *); -int adj_ok (struct thread *); -int seqnumber_mismatch (struct thread *); -int bad_lsreq (struct thread *); -int oneway_received (struct thread *); -int inactivity_timer (struct thread *); - -void ospf6_neighbor_init (); -int config_write_ospf6_debug_neighbor (struct vty *vty); -void install_element_ospf6_debug_neighbor (); +extern int hello_received (struct thread *); +extern int twoway_received (struct thread *); +extern int negotiation_done (struct thread *); +extern int exchange_done (struct thread *); +extern int loading_done (struct thread *); +extern int adj_ok (struct thread *); +extern int seqnumber_mismatch (struct thread *); +extern int bad_lsreq (struct thread *); +extern int oneway_received (struct thread *); +extern int inactivity_timer (struct thread *); + +extern void ospf6_neighbor_init (void); +extern int config_write_ospf6_debug_neighbor (struct vty *vty); +extern void install_element_ospf6_debug_neighbor (void); #endif /* OSPF6_NEIGHBOR_H */ - diff --git a/ospf6d/ospf6_network.c b/ospf6d/ospf6_network.c index 8c0cbf5ee..96b82af32 100644 --- a/ospf6d/ospf6_network.c +++ b/ospf6d/ospf6_network.c @@ -38,7 +38,7 @@ struct in6_addr alldrouters6; /* setsockopt ReUseAddr to on */ void -ospf6_set_reuseaddr () +ospf6_set_reuseaddr (void) { u_int on = 0; if (setsockopt (ospf6_sock, SOL_SOCKET, SO_REUSEADDR, &on, @@ -48,7 +48,7 @@ ospf6_set_reuseaddr () /* setsockopt MulticastLoop to off */ void -ospf6_reset_mcastloop () +ospf6_reset_mcastloop (void) { u_int off = 0; if (setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, @@ -58,13 +58,13 @@ ospf6_reset_mcastloop () } void -ospf6_set_pktinfo () +ospf6_set_pktinfo (void) { setsockopt_ipv6_pktinfo (ospf6_sock, 1); } void -ospf6_set_checksum () +ospf6_set_checksum (void) { int offset = 12; #ifndef DISABLE_IPV6_CHECKSUM @@ -78,7 +78,7 @@ ospf6_set_checksum () /* Make ospf6d's server socket. */ int -ospf6_serv_sock () +ospf6_serv_sock (void) { if (ospf6d_privs.change (ZPRIVS_RAISE)) zlog_err ("ospf6_serv_sock: could not raise privs"); @@ -193,7 +193,7 @@ ospf6_leave_alldrouters (u_int ifindex) #endif } -int +static int iov_count (struct iovec *iov) { int i; @@ -202,7 +202,7 @@ iov_count (struct iovec *iov) return i; } -int +static int iov_totallen (struct iovec *iov) { int i; diff --git a/ospf6d/ospf6_network.h b/ospf6d/ospf6_network.h index 9a4d795e5..fd8758e8e 100644 --- a/ospf6d/ospf6_network.h +++ b/ospf6d/ospf6_network.h @@ -29,22 +29,22 @@ extern struct in6_addr allspfrouters6; extern struct in6_addr alldrouters6; /* Function Prototypes */ -void ospf6_set_reuseaddr (); -void ospf6_reset_mcastloop (); -void ospf6_set_pktinfo (); -void ospf6_set_checksum (); - -int ospf6_serv_sock (); - -void ospf6_join_allspfrouters (u_int); -void ospf6_leave_allspfrouters (u_int); -void ospf6_join_alldrouters (u_int); -void ospf6_leave_alldrouters (u_int); - -int ospf6_sendmsg (struct in6_addr *, struct in6_addr *, - unsigned int *, struct iovec *); -int ospf6_recvmsg (struct in6_addr *, struct in6_addr *, - unsigned int *, struct iovec *); +extern void ospf6_set_reuseaddr (void); +extern void ospf6_reset_mcastloop (void); +extern void ospf6_set_pktinfo (void); +extern void ospf6_set_checksum (void); + +extern int ospf6_serv_sock (void); + +extern void ospf6_join_allspfrouters (u_int); +extern void ospf6_leave_allspfrouters (u_int); +extern void ospf6_join_alldrouters (u_int); +extern void ospf6_leave_alldrouters (u_int); + +extern int ospf6_sendmsg (struct in6_addr *, struct in6_addr *, + unsigned int *, struct iovec *); +extern int ospf6_recvmsg (struct in6_addr *, struct in6_addr *, + unsigned int *, struct iovec *); #endif /* OSPF6_NETWORK_H */ diff --git a/ospf6d/ospf6_proto.h b/ospf6d/ospf6_proto.h index 9fe821dfb..a8c1b1a03 100644 --- a/ospf6d/ospf6_proto.h +++ b/ospf6d/ospf6_proto.h @@ -112,11 +112,10 @@ do { \ OSPF6_PREFIX_SPACE ((op)->prefix_length)); \ } while (0) -void ospf6_prefix_apply_mask (struct ospf6_prefix *op); -void ospf6_prefix_options_printbuf (u_int8_t prefix_options, - char *buf, int size); -void ospf6_capability_printbuf (char capability, char *buf, int size); -void ospf6_options_printbuf (u_char *options, char *buf, int size); +extern void ospf6_prefix_apply_mask (struct ospf6_prefix *op); +extern void ospf6_prefix_options_printbuf (u_int8_t prefix_options, + char *buf, int size); +extern void ospf6_capability_printbuf (char capability, char *buf, int size); +extern void ospf6_options_printbuf (u_char *options, char *buf, int size); #endif /* OSPF6_PROTO_H */ - diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c index 38fdd51a6..a89ed7e7c 100644 --- a/ospf6d/ospf6_route.c +++ b/ospf6d/ospf6_route.c @@ -174,7 +174,7 @@ const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX] = struct ospf6_route * -ospf6_route_create () +ospf6_route_create (void) { struct ospf6_route *route; route = XCALLOC (MTYPE_OSPF6_ROUTE, sizeof (struct ospf6_route)); @@ -928,7 +928,7 @@ ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route) vty_out (vty, "%s", VNL); } -void +static void ospf6_route_show_table_summary (struct vty *vty, struct ospf6_route_table *table) { @@ -971,7 +971,7 @@ ospf6_route_show_table_summary (struct vty *vty, } } -void +static void ospf6_route_show_table_prefix (struct vty *vty, struct prefix *prefix, struct ospf6_route_table *table) @@ -993,7 +993,7 @@ ospf6_route_show_table_prefix (struct vty *vty, ospf6_route_unlock (route); } -void +static void ospf6_route_show_table_address (struct vty *vty, struct prefix *prefix, struct ospf6_route_table *table) @@ -1016,7 +1016,7 @@ ospf6_route_show_table_address (struct vty *vty, ospf6_route_unlock (route); } -void +static void ospf6_route_show_table_match (struct vty *vty, int detail, struct prefix *prefix, struct ospf6_route_table *table) @@ -1035,7 +1035,7 @@ ospf6_route_show_table_match (struct vty *vty, int detail, } } -void +static void ospf6_route_show_table_type (struct vty *vty, int detail, u_char type, struct ospf6_route_table *table) { @@ -1055,7 +1055,7 @@ ospf6_route_show_table_type (struct vty *vty, int detail, u_char type, } } -void +static void ospf6_route_show_table (struct vty *vty, int detail, struct ospf6_route_table *table) { @@ -1173,14 +1173,14 @@ ospf6_route_table_show (struct vty *vty, int argc, const char *argv[], return CMD_SUCCESS; } -void +static void ospf6_linkstate_show_header (struct vty *vty) { vty_out (vty, "%-7s %-15s %-15s %-8s %-14s %s%s", "Type", "Router-ID", "Net-ID", "Rtr-Bits", "Options", "Cost", VNL); } -void +static void ospf6_linkstate_show (struct vty *vty, struct ospf6_route *route) { u_int32_t router, id; @@ -1205,7 +1205,7 @@ ospf6_linkstate_show (struct vty *vty, struct ospf6_route *route) } -void +static void ospf6_linkstate_show_table_exact (struct vty *vty, struct prefix *prefix, struct ospf6_route_table *table) @@ -1227,7 +1227,7 @@ ospf6_linkstate_show_table_exact (struct vty *vty, ospf6_route_unlock (route); } -void +static void ospf6_linkstate_show_table (struct vty *vty, int detail, struct ospf6_route_table *table) { @@ -1393,7 +1393,7 @@ config_write_ospf6_debug_route (struct vty *vty) } void -install_element_ospf6_debug_route () +install_element_ospf6_debug_route (void) { install_element (ENABLE_NODE, &debug_ospf6_route_cmd); install_element (ENABLE_NODE, &no_debug_ospf6_route_cmd); diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h index 722fa1580..8dcc877fa 100644 --- a/ospf6d/ospf6_route.h +++ b/ospf6d/ospf6_route.h @@ -246,61 +246,60 @@ extern const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX]; (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[4])) /* Function prototype */ -void ospf6_linkstate_prefix (u_int32_t adv_router, u_int32_t id, - struct prefix *prefix); -void ospf6_linkstate_prefix2str (struct prefix *prefix, char *buf, int size); - -struct ospf6_route *ospf6_route_create (); -void ospf6_route_delete (struct ospf6_route *); -struct ospf6_route *ospf6_route_copy (struct ospf6_route *route); - -void ospf6_route_lock (struct ospf6_route *route); -void ospf6_route_unlock (struct ospf6_route *route); - -struct ospf6_route * -ospf6_route_lookup (struct prefix *prefix, - struct ospf6_route_table *table); -struct ospf6_route * -ospf6_route_lookup_identical (struct ospf6_route *route, - struct ospf6_route_table *table); -struct ospf6_route * -ospf6_route_lookup_bestmatch (struct prefix *prefix, - struct ospf6_route_table *table); - -struct ospf6_route * -ospf6_route_add (struct ospf6_route *route, struct ospf6_route_table *table); -void -ospf6_route_remove (struct ospf6_route *route, struct ospf6_route_table *table); - -struct ospf6_route *ospf6_route_head (struct ospf6_route_table *table); -struct ospf6_route *ospf6_route_next (struct ospf6_route *route); -struct ospf6_route *ospf6_route_best_next (struct ospf6_route *route); - -struct ospf6_route *ospf6_route_match_head (struct prefix *prefix, +extern void ospf6_linkstate_prefix (u_int32_t adv_router, u_int32_t id, + struct prefix *prefix); +extern void ospf6_linkstate_prefix2str (struct prefix *prefix, char *buf, + int size); + +extern struct ospf6_route *ospf6_route_create (void); +extern void ospf6_route_delete (struct ospf6_route *); +extern struct ospf6_route *ospf6_route_copy (struct ospf6_route *route); + +extern void ospf6_route_lock (struct ospf6_route *route); +extern void ospf6_route_unlock (struct ospf6_route *route); + +extern struct ospf6_route *ospf6_route_lookup (struct prefix *prefix, + struct ospf6_route_table *table); +extern struct ospf6_route *ospf6_route_lookup_identical (struct ospf6_route *route, + struct ospf6_route_table *table); +extern struct ospf6_route *ospf6_route_lookup_bestmatch (struct prefix *prefix, + struct ospf6_route_table *table); + +extern struct ospf6_route *ospf6_route_add (struct ospf6_route *route, + struct ospf6_route_table *table); +extern void ospf6_route_remove (struct ospf6_route *route, + struct ospf6_route_table *table); + +extern struct ospf6_route *ospf6_route_head (struct ospf6_route_table *table); +extern struct ospf6_route *ospf6_route_next (struct ospf6_route *route); +extern struct ospf6_route *ospf6_route_best_next (struct ospf6_route *route); + +extern struct ospf6_route *ospf6_route_match_head (struct prefix *prefix, struct ospf6_route_table *table); -struct ospf6_route *ospf6_route_match_next (struct prefix *prefix, +extern struct ospf6_route *ospf6_route_match_next (struct prefix *prefix, struct ospf6_route *route); -void ospf6_route_remove_all (struct ospf6_route_table *); -struct ospf6_route_table *ospf6_route_table_create (int s, int t); -void ospf6_route_table_delete (struct ospf6_route_table *); -void ospf6_route_dump (struct ospf6_route_table *table); +extern void ospf6_route_remove_all (struct ospf6_route_table *); +extern struct ospf6_route_table *ospf6_route_table_create (int s, int t); +extern void ospf6_route_table_delete (struct ospf6_route_table *); +extern void ospf6_route_dump (struct ospf6_route_table *table); -void ospf6_route_show (struct vty *vty, struct ospf6_route *route); -void ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route); +extern void ospf6_route_show (struct vty *vty, struct ospf6_route *route); +extern void ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route); -int ospf6_route_table_show (struct vty *, int, const char *[], - struct ospf6_route_table *); -int ospf6_linkstate_table_show (struct vty *vty, int argc, const char *argv[], - struct ospf6_route_table *table); +extern int ospf6_route_table_show (struct vty *, int, const char *[], + struct ospf6_route_table *); +extern int ospf6_linkstate_table_show (struct vty *vty, int argc, + const char *argv[], + struct ospf6_route_table *table); -void ospf6_brouter_show_header (struct vty *vty); -void ospf6_brouter_show (struct vty *vty, struct ospf6_route *route); +extern void ospf6_brouter_show_header (struct vty *vty); +extern void ospf6_brouter_show (struct vty *vty, struct ospf6_route *route); -int config_write_ospf6_debug_route (struct vty *vty); -void install_element_ospf6_debug_route (); -void ospf6_route_init (); +extern int config_write_ospf6_debug_route (struct vty *vty); +extern void install_element_ospf6_debug_route (void); +extern void ospf6_route_init (void); #endif /* OSPF6_ROUTE_H */ diff --git a/ospf6d/ospf6_snmp.h b/ospf6d/ospf6_snmp.h index 7ef784c91..5c67893c4 100644 --- a/ospf6d/ospf6_snmp.h +++ b/ospf6d/ospf6_snmp.h @@ -22,7 +22,7 @@ #ifndef OSPF6_SNMP_H #define OSPF6_SNMP_H -void ospf6_snmp_init (struct thread_master *); +extern void ospf6_snmp_init (struct thread_master *); #endif /*OSPF6_SNMP_H*/ diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c index 08c1eb73b..44e11f9d5 100644 --- a/ospf6d/ospf6_spf.c +++ b/ospf6d/ospf6_spf.c @@ -43,7 +43,7 @@ unsigned char conf_debug_ospf6_spf = 0; -int +static int ospf6_vertex_cmp (void *a, void *b) { struct ospf6_vertex *va = (struct ospf6_vertex *) a; @@ -53,7 +53,7 @@ ospf6_vertex_cmp (void *a, void *b) return (va->cost - vb->cost); } -int +static int ospf6_vertex_id_cmp (void *a, void *b) { struct ospf6_vertex *va = (struct ospf6_vertex *) a; @@ -70,7 +70,7 @@ ospf6_vertex_id_cmp (void *a, void *b) return ret; } -struct ospf6_vertex * +static struct ospf6_vertex * ospf6_vertex_create (struct ospf6_lsa *lsa) { struct ospf6_vertex *v; @@ -113,14 +113,14 @@ ospf6_vertex_create (struct ospf6_lsa *lsa) return v; } -void +static void ospf6_vertex_delete (struct ospf6_vertex *v) { list_delete (v->child_list); XFREE (MTYPE_OSPF6_VERTEX, v); } -struct ospf6_lsa * +static struct ospf6_lsa * ospf6_lsdesc_lsa (caddr_t lsdesc, struct ospf6_vertex *v) { struct ospf6_lsa *lsa; @@ -166,7 +166,7 @@ ospf6_lsdesc_lsa (caddr_t lsdesc, struct ospf6_vertex *v) return lsa; } -char * +static char * ospf6_lsdesc_backlink (struct ospf6_lsa *lsa, caddr_t lsdesc, struct ospf6_vertex *v) { @@ -218,7 +218,7 @@ ospf6_lsdesc_backlink (struct ospf6_lsa *lsa, return found; } -void +static void ospf6_nexthop_calc (struct ospf6_vertex *w, struct ospf6_vertex *v, caddr_t lsdesc) { @@ -274,7 +274,7 @@ ospf6_nexthop_calc (struct ospf6_vertex *w, struct ospf6_vertex *v, zlog_debug ("No nexthop for %s found", w->name); } -int +static int ospf6_spf_install (struct ospf6_vertex *v, struct ospf6_route_table *result_table) { @@ -487,7 +487,7 @@ ospf6_spf_calculation (u_int32_t router_id, pqueue_delete (candidate_list); } -void +static void ospf6_spf_log_database (struct ospf6_area *oa) { char *p, *end, buffer[256]; @@ -512,7 +512,7 @@ ospf6_spf_log_database (struct ospf6_area *oa) zlog_debug ("%s", buffer); } -int +static int ospf6_spf_calculation_thread (struct thread *t) { struct ospf6_area *oa; @@ -689,7 +689,7 @@ config_write_ospf6_debug_spf (struct vty *vty) } void -install_element_ospf6_debug_spf () +install_element_ospf6_debug_spf (void) { install_element (ENABLE_NODE, &debug_ospf6_spf_process_cmd); install_element (ENABLE_NODE, &debug_ospf6_spf_time_cmd); @@ -706,7 +706,7 @@ install_element_ospf6_debug_spf () } void -ospf6_spf_init () +ospf6_spf_init (void) { } diff --git a/ospf6d/ospf6_spf.h b/ospf6d/ospf6_spf.h index 728eec511..c7069c258 100644 --- a/ospf6d/ospf6_spf.h +++ b/ospf6d/ospf6_spf.h @@ -77,18 +77,18 @@ struct ospf6_vertex #define VERTEX_IS_TYPE(t, v) \ ((v)->type == OSPF6_VERTEX_TYPE_ ## t ? 1 : 0) -void ospf6_spf_table_finish (struct ospf6_route_table *result_table); -void ospf6_spf_calculation (u_int32_t router_id, - struct ospf6_route_table *result_table, - struct ospf6_area *oa); -void ospf6_spf_schedule (struct ospf6_area *oa); - -void ospf6_spf_display_subtree (struct vty *vty, const char *prefix, - int rest, struct ospf6_vertex *v); - -int config_write_ospf6_debug_spf (struct vty *vty); -void install_element_ospf6_debug_spf (); -void ospf6_spf_init (); +extern void ospf6_spf_table_finish (struct ospf6_route_table *result_table); +extern void ospf6_spf_calculation (u_int32_t router_id, + struct ospf6_route_table *result_table, + struct ospf6_area *oa); +extern void ospf6_spf_schedule (struct ospf6_area *oa); + +extern void ospf6_spf_display_subtree (struct vty *vty, const char *prefix, + int rest, struct ospf6_vertex *v); + +extern int config_write_ospf6_debug_spf (struct vty *vty); +extern void install_element_ospf6_debug_spf (void); +extern void ospf6_spf_init (void); #endif /* OSPF6_SPF_H */ diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index a5efcb8d7..f59b6f95c 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -51,7 +51,7 @@ /* global ospf6d variable */ struct ospf6 *ospf6; -void +static void ospf6_top_lsdb_hook_add (struct ospf6_lsa *lsa) { switch (ntohs (lsa->header->type)) @@ -65,7 +65,7 @@ ospf6_top_lsdb_hook_add (struct ospf6_lsa *lsa) } } -void +static void ospf6_top_lsdb_hook_remove (struct ospf6_lsa *lsa) { switch (ntohs (lsa->header->type)) @@ -79,21 +79,21 @@ ospf6_top_lsdb_hook_remove (struct ospf6_lsa *lsa) } } -void +static void ospf6_top_route_hook_add (struct ospf6_route *route) { ospf6_abr_originate_summary (route); ospf6_zebra_route_update_add (route); } -void +static void ospf6_top_route_hook_remove (struct ospf6_route *route) { ospf6_abr_originate_summary (route); ospf6_zebra_route_update_remove (route); } -void +static void ospf6_top_brouter_hook_add (struct ospf6_route *route) { ospf6_abr_examin_brouter (ADV_ROUTER_IN_PREFIX (&route->prefix)); @@ -101,7 +101,7 @@ ospf6_top_brouter_hook_add (struct ospf6_route *route) ospf6_abr_originate_summary (route); } -void +static void ospf6_top_brouter_hook_remove (struct ospf6_route *route) { ospf6_abr_examin_brouter (ADV_ROUTER_IN_PREFIX (&route->prefix)); @@ -109,8 +109,8 @@ ospf6_top_brouter_hook_remove (struct ospf6_route *route) ospf6_abr_originate_summary (route); } -struct ospf6 * -ospf6_create () +static struct ospf6 * +ospf6_create (void) { struct ospf6 *o; @@ -144,7 +144,7 @@ ospf6_create () return o; } -void +static void ospf6_delete (struct ospf6 *o) { struct listnode *node, *nnode; @@ -165,7 +165,7 @@ ospf6_delete (struct ospf6 *o) XFREE (MTYPE_OSPF6_TOP, o); } -void +static void ospf6_enable (struct ospf6 *o) { struct listnode *node, *nnode; @@ -179,7 +179,7 @@ ospf6_enable (struct ospf6 *o) } } -void +static void ospf6_disable (struct ospf6 *o) { struct listnode *node, *nnode; @@ -198,7 +198,7 @@ ospf6_disable (struct ospf6 *o) } } -int +static int ospf6_maxage_remover (struct thread *thread) { struct ospf6 *o = (struct ospf6 *) THREAD_ARG (thread); @@ -427,7 +427,7 @@ DEFUN (no_ospf6_interface_area, return CMD_SUCCESS; } -void +static void ospf6_show (struct vty *vty, struct ospf6 *o) { struct listnode *n; @@ -499,7 +499,7 @@ ALIAS (show_ipv6_ospf6_route, "Specify IPv6 prefix\n" "Detailed information\n" "Summary of route table\n" - ); + ) DEFUN (show_ipv6_ospf6_route_match, show_ipv6_ospf6_route_match_cmd, @@ -562,7 +562,7 @@ ALIAS (show_ipv6_ospf6_route_match, ROUTE_STR "Specify IPv6 prefix\n" "Display routes longer than the specified route\n" - ); + ) DEFUN (show_ipv6_ospf6_route_match_detail, show_ipv6_ospf6_route_longer_detail_cmd, @@ -587,7 +587,7 @@ ALIAS (show_ipv6_ospf6_route, "Dispaly Inter-Area routes\n" "Dispaly Type-1 External routes\n" "Dispaly Type-2 External routes\n" - ); + ) DEFUN (show_ipv6_ospf6_route_type_detail, show_ipv6_ospf6_route_type_detail_cmd, @@ -618,7 +618,7 @@ DEFUN (show_ipv6_ospf6_route_type_detail, } /* OSPF configuration write function. */ -int +static int config_write_ospf6 (struct vty *vty) { char router_id[16]; @@ -660,7 +660,7 @@ struct cmd_node ospf6_node = /* Install ospf related commands. */ void -ospf6_top_init () +ospf6_top_init (void) { /* Install ospf6 top node. */ install_node (&ospf6_node, config_write_ospf6); diff --git a/ospf6d/ospf6_top.h b/ospf6d/ospf6_top.h index eae20e6ee..ba485f9ea 100644 --- a/ospf6d/ospf6_top.h +++ b/ospf6d/ospf6_top.h @@ -68,9 +68,9 @@ struct ospf6 extern struct ospf6 *ospf6; /* prototypes */ -void ospf6_top_init (); +extern void ospf6_top_init (void); -void ospf6_maxage_remove (struct ospf6 *o); +extern void ospf6_maxage_remove (struct ospf6 *o); #endif /* OSPF6_TOP_H */ diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index c974005fd..b5ffc0aa6 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -47,7 +47,7 @@ struct zclient *zclient = NULL; struct in_addr router_id_zebra; /* Router-id update message from zebra. */ -int +static int ospf6_router_id_update_zebra (int command, struct zclient *zclient, zebra_size_t length) { @@ -88,7 +88,7 @@ ospf6_zebra_no_redistribute (int type) } /* Inteface addition message from zebra. */ -int +static int ospf6_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length) { struct interface *ifp; @@ -101,7 +101,7 @@ ospf6_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length) return 0; } -int +static int ospf6_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length) { struct interface *ifp; @@ -125,7 +125,7 @@ ospf6_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length) return 0; } -int +static int ospf6_zebra_if_state_update (int command, struct zclient *zclient, zebra_size_t length) { @@ -141,7 +141,7 @@ ospf6_zebra_if_state_update (int command, struct zclient *zclient, return 0; } -int +static int ospf6_zebra_if_address_update_add (int command, struct zclient *zclient, zebra_size_t length) { @@ -164,7 +164,7 @@ ospf6_zebra_if_address_update_add (int command, struct zclient *zclient, return 0; } -int +static int ospf6_zebra_if_address_update_delete (int command, struct zclient *zclient, zebra_size_t length) { @@ -187,7 +187,7 @@ ospf6_zebra_if_address_update_delete (int command, struct zclient *zclient, return 0; } -int +static int ospf6_zebra_read_ipv6 (int command, struct zclient *zclient, zebra_size_t length) { @@ -317,7 +317,7 @@ DEFUN (no_router_zebra, } /* Zebra configuration write function. */ -int +static int config_write_ospf6_zebra (struct vty *vty) { if (! zclient->enable) @@ -553,7 +553,7 @@ DEFUN (no_redistribute_ospf6, } void -ospf6_zebra_init () +ospf6_zebra_init (void) { /* Allocate zebra structure. */ zclient = zclient_new (); @@ -623,7 +623,7 @@ ALIAS (debug_ospf6_zebra_sendrecv, DEBUG_STR OSPF6_STR "Debug connection between zebra\n" - ); + ) DEFUN (no_debug_ospf6_zebra_sendrecv, @@ -660,7 +660,7 @@ ALIAS (no_debug_ospf6_zebra_sendrecv, DEBUG_STR OSPF6_STR "Debug connection between zebra\n" - ); + ) int config_write_ospf6_debug_zebra (struct vty *vty) @@ -678,7 +678,7 @@ config_write_ospf6_debug_zebra (struct vty *vty) } void -install_element_ospf6_debug_zebra () +install_element_ospf6_debug_zebra (void) { install_element (ENABLE_NODE, &debug_ospf6_zebra_cmd); install_element (ENABLE_NODE, &no_debug_ospf6_zebra_cmd); diff --git a/ospf6d/ospf6_zebra.h b/ospf6d/ospf6_zebra.h index fb9877bf1..24a4ae639 100644 --- a/ospf6d/ospf6_zebra.h +++ b/ospf6d/ospf6_zebra.h @@ -37,17 +37,15 @@ extern unsigned char conf_debug_ospf6_zebra; extern struct zclient *zclient; -void ospf6_zebra_route_update_add (struct ospf6_route *request); -void ospf6_zebra_route_update_remove (struct ospf6_route *request); +extern void ospf6_zebra_route_update_add (struct ospf6_route *request); +extern void ospf6_zebra_route_update_remove (struct ospf6_route *request); -void ospf6_zebra_redistribute (int); -void ospf6_zebra_no_redistribute (int); -#define ospf6_zebra_is_redistribute(type) \ - (zclient->redist[type]) -void ospf6_zebra_init (); +extern void ospf6_zebra_redistribute (int); +extern void ospf6_zebra_no_redistribute (int); +#define ospf6_zebra_is_redistribute(type) (zclient->redist[type]) +extern void ospf6_zebra_init (void); -int config_write_ospf6_debug_zebra (struct vty *vty); -void install_element_ospf6_debug_zebra (); +extern int config_write_ospf6_debug_zebra (struct vty *vty); +extern void install_element_ospf6_debug_zebra (void); #endif /*OSPF6_ZEBRA_H*/ - diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c index 3c84fe658..1a615ffae 100644 --- a/ospf6d/ospf6d.c +++ b/ospf6d/ospf6d.c @@ -50,11 +50,6 @@ char ospf6_daemon_version[] = OSPF6_DAEMON_VERSION; -void -ospf6_debug () -{ -} - struct route_node * route_prev (struct route_node *node) { @@ -104,7 +99,7 @@ struct cmd_node debug_node = 1 /* VTYSH */ }; -int +static int config_write_ospf6_debug (struct vty *vty) { config_write_ospf6_debug_message (vty); @@ -221,7 +216,7 @@ ALIAS (show_ipv6_ospf6_database, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_type, show_ipv6_ospf6_database_type_cmd, @@ -315,7 +310,7 @@ ALIAS (show_ipv6_ospf6_database_type, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_id, show_ipv6_ospf6_database_id_cmd, @@ -384,7 +379,7 @@ ALIAS (show_ipv6_ospf6_database_id, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) ALIAS (show_ipv6_ospf6_database_id, show_ipv6_ospf6_database_linkstate_id_cmd, @@ -395,7 +390,7 @@ ALIAS (show_ipv6_ospf6_database_id, "Display Link state database\n" "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" - ); + ) ALIAS (show_ipv6_ospf6_database_id, show_ipv6_ospf6_database_linkstate_id_detail_cmd, @@ -410,7 +405,7 @@ ALIAS (show_ipv6_ospf6_database_id, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_router, show_ipv6_ospf6_database_router_cmd, @@ -481,7 +476,7 @@ ALIAS (show_ipv6_ospf6_database_router, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) ALIAS (show_ipv6_ospf6_database_router, show_ipv6_ospf6_database_adv_router_cmd, @@ -492,7 +487,7 @@ ALIAS (show_ipv6_ospf6_database_router, "Display Link state database\n" "Search by Advertising Router\n" "Specify Advertising Router as IPv4 address notation\n" - ); + ) ALIAS (show_ipv6_ospf6_database_router, show_ipv6_ospf6_database_adv_router_detail_cmd, @@ -507,7 +502,7 @@ ALIAS (show_ipv6_ospf6_database_router, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_type_id, show_ipv6_ospf6_database_type_id_cmd, @@ -614,7 +609,7 @@ ALIAS (show_ipv6_ospf6_database_type_id, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) ALIAS (show_ipv6_ospf6_database_type_id, show_ipv6_ospf6_database_type_linkstate_id_cmd, @@ -636,7 +631,7 @@ ALIAS (show_ipv6_ospf6_database_type_id, "Display Intra-Area-Prefix LSAs\n" "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" - ); + ) ALIAS (show_ipv6_ospf6_database_type_id, show_ipv6_ospf6_database_type_linkstate_id_detail_cmd, @@ -662,7 +657,7 @@ ALIAS (show_ipv6_ospf6_database_type_id, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_type_router, show_ipv6_ospf6_database_type_router_cmd, @@ -771,7 +766,7 @@ ALIAS (show_ipv6_ospf6_database_type_router, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) ALIAS (show_ipv6_ospf6_database_type_router, show_ipv6_ospf6_database_type_adv_router_cmd, @@ -793,7 +788,7 @@ ALIAS (show_ipv6_ospf6_database_type_router, "Display Intra-Area-Prefix LSAs\n" "Search by Advertising Router\n" "Specify Advertising Router as IPv4 address notation\n" - ); + ) ALIAS (show_ipv6_ospf6_database_type_router, show_ipv6_ospf6_database_type_adv_router_detail_cmd, @@ -819,7 +814,7 @@ ALIAS (show_ipv6_ospf6_database_type_router, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_id_router, show_ipv6_ospf6_database_id_router_cmd, @@ -901,7 +896,7 @@ ALIAS (show_ipv6_ospf6_database_id_router, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id, show_ipv6_ospf6_database_adv_router_linkstate_id_cmd, @@ -985,7 +980,7 @@ ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_type_id_router, show_ipv6_ospf6_database_type_id_router_cmd, @@ -1104,7 +1099,7 @@ ALIAS (show_ipv6_ospf6_database_type_id_router, "Specify Advertising Router as IPv4 address notation\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id, show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd, @@ -1229,7 +1224,7 @@ ALIAS (show_ipv6_ospf6_database_type_adv_router_linkstate_id, "Specify Link state ID as IPv4 address notation\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_self_originated, show_ipv6_ospf6_database_self_originated_cmd, @@ -1386,7 +1381,7 @@ ALIAS (show_ipv6_ospf6_database_type_self_originated, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id, show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd, @@ -1501,7 +1496,7 @@ ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_database_type_id_self_originated, show_ipv6_ospf6_database_type_id_self_originated_cmd, @@ -1614,7 +1609,7 @@ ALIAS (show_ipv6_ospf6_database_type_id_self_originated, "Display details of LSAs\n" "Dump LSAs\n" "Display LSA's internal information\n" - ); + ) DEFUN (show_ipv6_ospf6_border_routers, @@ -1675,7 +1670,7 @@ ALIAS (show_ipv6_ospf6_border_routers, "Display routing table for ABR and ASBR\n" "Specify Router-ID\n" "Display Detail\n" - ); + ) DEFUN (show_ipv6_ospf6_linkstate, show_ipv6_ospf6_linkstate_cmd, @@ -1709,7 +1704,7 @@ ALIAS (show_ipv6_ospf6_linkstate, "Display linkstate routing table\n" "Display Router Entry\n" "Specify Router ID as IPv4 address notation\n" - ); + ) ALIAS (show_ipv6_ospf6_linkstate, show_ipv6_ospf6_linkstate_network_cmd, @@ -1721,7 +1716,7 @@ ALIAS (show_ipv6_ospf6_linkstate, "Display Network Entry\n" "Specify Router ID as IPv4 address notation\n" "Specify Link state ID as IPv4 address notation\n" - ); + ) DEFUN (show_ipv6_ospf6_linkstate_detail, show_ipv6_ospf6_linkstate_detail_cmd, @@ -1757,7 +1752,7 @@ DEFUN (show_ipv6_ospf6_linkstate_detail, /* Install ospf related commands. */ void -ospf6_init () +ospf6_init (void) { ospf6_top_init (); ospf6_area_init (); diff --git a/ospf6d/ospf6d.h b/ospf6d/ospf6d.h index 2d1f725b9..b6f1b7378 100644 --- a/ospf6d/ospf6d.h +++ b/ospf6d/ospf6d.h @@ -112,10 +112,10 @@ extern struct thread_master *master; /* Function Prototypes */ -struct route_node *route_prev (struct route_node *node); +extern struct route_node *route_prev (struct route_node *node); -void ospf6_debug (); -void ospf6_init (); +extern void ospf6_debug (void); +extern void ospf6_init (void); #endif /* OSPF6D_H */ |