summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-10-19 16:55:01 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-19 16:55:59 +0200
commitb2575bc05b53977dbf6006d3cbde5a1b98221bdc (patch)
treeddebdb028d3bf256f1f63211c0a82e7e54b9ed1e
parentvtysh: refactor vtysh_client_{config,execute} (diff)
downloadfrr-b2575bc05b53977dbf6006d3cbde5a1b98221bdc.tar.xz
frr-b2575bc05b53977dbf6006d3cbde5a1b98221bdc.zip
*: Consolidate routemap initialization
Consolidate the routemap initialization into one function. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
-rw-r--r--bgpd/bgp_routemap.c2
-rw-r--r--isisd/isis_routemap.c1
-rw-r--r--lib/routemap.c33
-rw-r--r--lib/routemap.h1
-rw-r--r--ospf6d/ospf6_asbr.c2
-rw-r--r--ospfd/ospf_routemap.c1
-rw-r--r--pimd/pim_routemap.c2
-rw-r--r--ripd/rip_routemap.c2
-rw-r--r--ripngd/ripng_routemap.c1
-rw-r--r--zebra/zebra_routemap.c1
10 files changed, 15 insertions, 31 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index acb7449a0..0702b4ffd 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -4578,7 +4578,7 @@ void
bgp_route_map_init (void)
{
route_map_init ();
- route_map_init_vty ();
+
route_map_add_hook (bgp_route_map_add);
route_map_delete_hook (bgp_route_map_delete);
route_map_event_hook (bgp_route_map_event);
diff --git a/isisd/isis_routemap.c b/isisd/isis_routemap.c
index 2bed5d65d..1f947fb04 100644
--- a/isisd/isis_routemap.c
+++ b/isisd/isis_routemap.c
@@ -535,7 +535,6 @@ void
isis_route_map_init(void)
{
route_map_init();
- route_map_init_vty();
route_map_install_match(&route_match_ip_address_cmd);
install_element(RMAP_NODE, &match_ip_address_cmd);
diff --git a/lib/routemap.c b/lib/routemap.c
index 1c759dc6d..7c30051bb 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -140,7 +140,6 @@ struct hash *route_map_dep_hash[ROUTE_MAP_DEP_MAX];
static unsigned int route_map_dep_hash_make_key (void *p);
static int route_map_dep_hash_cmp (const void *p1, const void *p2);
-static void route_map_init_dep_hashes (void);
static void route_map_clear_all_references (char *rmap_name);
static void route_map_rule_delete (struct route_map_rule_list *,
struct route_map_rule *);
@@ -1126,15 +1125,6 @@ route_map_event_hook (void (*func) (route_map_event_t, const char *))
}
void
-route_map_init (void)
-{
- /* Make vector for match and set. */
- route_match_vec = vector_init (1);
- route_set_vec = vector_init (1);
- route_map_master_hash = hash_create(route_map_hash_key_make, route_map_hash_cmp);
-}
-
-void
route_map_finish (void)
{
vector_free (route_match_vec);
@@ -1822,16 +1812,6 @@ static struct cmd_node rmap_node =
1
};
-static void
-route_map_init_dep_hashes (void)
-{
- int i;
-
- for (i = 1; i < ROUTE_MAP_DEP_MAX; i++)
- route_map_dep_hash[i] = hash_create(route_map_dep_hash_make_key,
- route_map_dep_hash_cmp);
-}
-
/* Common route map rules */
void *
@@ -1860,9 +1840,18 @@ route_map_rule_tag_free (void *rule)
/* Initialization of route map vector. */
void
-route_map_init_vty (void)
+route_map_init (void)
{
- route_map_init_dep_hashes();
+ int i;
+
+ /* Make vector for match and set. */
+ route_match_vec = vector_init (1);
+ route_set_vec = vector_init (1);
+ route_map_master_hash = hash_create(route_map_hash_key_make, route_map_hash_cmp);
+
+ for (i = 1; i < ROUTE_MAP_DEP_MAX; i++)
+ route_map_dep_hash[i] = hash_create(route_map_dep_hash_make_key,
+ route_map_dep_hash_cmp);
/* Install route map top node. */
install_node (&rmap_node, route_map_config_write);
diff --git a/lib/routemap.h b/lib/routemap.h
index 0f888897b..b5cdd2727 100644
--- a/lib/routemap.h
+++ b/lib/routemap.h
@@ -182,7 +182,6 @@ DECLARE_QOBJ_TYPE(route_map)
/* Prototypes. */
extern void route_map_init (void);
-extern void route_map_init_vty (void);
extern void route_map_finish (void);
/* Add match statement to route map. */
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index e3626c25d..46ea46305 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -1331,7 +1331,7 @@ static void
ospf6_routemap_init (void)
{
route_map_init ();
- route_map_init_vty ();
+
route_map_add_hook (ospf6_asbr_routemap_update);
route_map_delete_hook (ospf6_asbr_routemap_update);
diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c
index 6bd853bf8..f1483885c 100644
--- a/ospfd/ospf_routemap.c
+++ b/ospfd/ospf_routemap.c
@@ -946,7 +946,6 @@ void
ospf_route_map_init (void)
{
route_map_init ();
- route_map_init_vty ();
route_map_add_hook (ospf_route_map_update);
route_map_delete_hook (ospf_route_map_update);
diff --git a/pimd/pim_routemap.c b/pimd/pim_routemap.c
index adfd4fd2c..f65f35ba5 100644
--- a/pimd/pim_routemap.c
+++ b/pimd/pim_routemap.c
@@ -65,7 +65,7 @@ void
pim_route_map_init (void)
{
route_map_init ();
- route_map_init_vty ();
+
route_map_add_hook (pim_route_map_add);
route_map_delete_hook (pim_route_map_delete);
route_map_event_hook (pim_route_map_event);
diff --git a/ripd/rip_routemap.c b/ripd/rip_routemap.c
index 666ccf084..8b48adfd5 100644
--- a/ripd/rip_routemap.c
+++ b/ripd/rip_routemap.c
@@ -1070,7 +1070,7 @@ void
rip_route_map_init ()
{
route_map_init ();
- route_map_init_vty ();
+
route_map_add_hook (rip_route_map_update);
route_map_delete_hook (rip_route_map_update);
diff --git a/ripngd/ripng_routemap.c b/ripngd/ripng_routemap.c
index ee4f4afce..19fa70227 100644
--- a/ripngd/ripng_routemap.c
+++ b/ripngd/ripng_routemap.c
@@ -683,7 +683,6 @@ void
ripng_route_map_init ()
{
route_map_init ();
- route_map_init_vty ();
route_map_install_match (&route_match_metric_cmd);
route_map_install_match (&route_match_interface_cmd);
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 9cfae6e70..21fd6a4db 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -1811,7 +1811,6 @@ zebra_route_map_init ()
install_element (CONFIG_NODE, &no_zebra_route_map_timer_val_cmd);
route_map_init ();
- route_map_init_vty ();
route_map_add_hook (zebra_route_map_add);
route_map_delete_hook (zebra_route_map_delete);