summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_routemap.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-10-18 01:36:21 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-10-18 01:36:21 +0200
commite52702f29d003585dcfbb4914b2a52d77a177739 (patch)
tree3e130ded38c48316796bfb602dc6fe6d119129d2 /ospfd/ospf_routemap.c
parentospf6d: fix a few vty help strings (diff)
parentvtysh: fix build failure in vtysh_writeconfig_integrated() (diff)
downloadfrr-e52702f29d003585dcfbb4914b2a52d77a177739.tar.xz
frr-e52702f29d003585dcfbb4914b2a52d77a177739.zip
Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: bgpd/bgp_route.c bgpd/bgp_routemap.c bgpd/bgp_vty.c isisd/isis_redist.c isisd/isis_routemap.c isisd/isis_vty.c isisd/isisd.c lib/command.c lib/distribute.c lib/if.c lib/keychain.c lib/routemap.c lib/routemap.h ospf6d/ospf6_asbr.c ospf6d/ospf6_interface.c ospf6d/ospf6_neighbor.c ospf6d/ospf6_top.c ospf6d/ospf6_zebra.c ospf6d/ospf6d.c ospfd/ospf_routemap.c ospfd/ospf_vty.c ripd/rip_routemap.c ripngd/ripng_routemap.c vtysh/extract.pl.in vtysh/vtysh.c zebra/interface.c zebra/irdp_interface.c zebra/rt_netlink.c zebra/rtadv.c zebra/test_main.c zebra/zebra_routemap.c zebra/zebra_vty.c
Diffstat (limited to 'ospfd/ospf_routemap.c')
-rw-r--r--ospfd/ospf_routemap.c82
1 files changed, 8 insertions, 74 deletions
diff --git a/ospfd/ospf_routemap.c b/ospfd/ospf_routemap.c
index ebe426cee..6e88515d3 100644
--- a/ospfd/ospf_routemap.c
+++ b/ospfd/ospf_routemap.c
@@ -397,7 +397,7 @@ static route_map_result_t
route_match_tag (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
- u_short *tag;
+ route_tag_t *tag;
struct external_info *ei;
if (type == RMAP_OSPF)
@@ -411,45 +411,13 @@ route_match_tag (void *rule, struct prefix *prefix,
return RMAP_NOMATCH;
}
-/* Route map `match tag' match statement. `arg' is TAG value */
-static void *
-route_match_tag_compile (const char *arg)
-{
- u_short *tag;
- u_short tmp;
-
- /* tag value shoud be integer. */
- if (! all_digit (arg))
- return NULL;
-
- tmp = atoi(arg);
- if (tmp < 1)
- return NULL;
-
- tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-
- if (!tag)
- return tag;
-
- *tag = tmp;
-
- return tag;
-}
-
-/* Free route map's compiled 'match tag' value. */
-static void
-route_match_tag_free (void *rule)
-{
- XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
/* Route map commands for tag matching. */
-struct route_map_rule_cmd route_match_tag_cmd =
+static struct route_map_rule_cmd route_match_tag_cmd =
{
"tag",
route_match_tag,
- route_match_tag_compile,
- route_match_tag_free,
+ route_map_rule_tag_compile,
+ route_map_rule_tag_free,
};
@@ -587,7 +555,7 @@ static route_map_result_t
route_set_tag (void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
- u_short *tag;
+ route_tag_t *tag;
struct external_info *ei;
if (type == RMAP_OSPF)
@@ -602,46 +570,13 @@ route_set_tag (void *rule, struct prefix *prefix,
return RMAP_OKAY;
}
-/* Route map `tag' compile function. Given string is converted to u_short. */
-static void *
-route_set_tag_compile (const char *arg)
-{
- u_short *tag;
- u_short tmp;
-
- /* tag value shoud be integer. */
- if (! all_digit (arg))
- return NULL;
-
- tmp = atoi(arg);
-
- if (tmp < 1)
- return NULL;
-
- tag = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, sizeof (u_short));
-
- if (!tag)
- return tag;
-
- *tag = tmp;
-
- return tag;
-}
-
-/* Free route map's tag value. */
-static void
-route_set_tag_free (void *rule)
-{
- XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
-}
-
/* Route map commands for tag set. */
-struct route_map_rule_cmd route_set_tag_cmd =
+static struct route_map_rule_cmd route_set_tag_cmd =
{
"tag",
route_set_tag,
- route_set_tag_compile,
- route_set_tag_free,
+ route_map_rule_tag_compile,
+ route_map_rule_tag_free,
};
DEFUN (match_ip_nexthop,
@@ -673,7 +608,6 @@ DEFUN (no_match_ip_nexthop,
return ospf_route_match_delete (vty, vty->index, "ip next-hop", al);
}
-
DEFUN (set_metric_type,
set_metric_type_cmd,
"set metric-type <type-1|type-2>",