summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_routemap.c
diff options
context:
space:
mode:
authorLakshman Krishnamoorthy <lkrishnamoor@vmware.com>2019-06-04 00:36:02 +0200
committerLakshman Krishnamoorthy <lkrishnamoor@vmware.com>2019-06-04 00:43:02 +0200
commit2789041a46fd0109fa865a64bc1cf4751360f39e (patch)
tree9889aa5c920c47d172a4f6e50f1ff8686be1c8a3 /zebra/zebra_routemap.c
parentMerge pull request #4451 from donaldsharp/routemap_return (diff)
downloadfrr-2789041a46fd0109fa865a64bc1cf4751360f39e.tar.xz
frr-2789041a46fd0109fa865a64bc1cf4751360f39e.zip
Revert of PR 4078 and PR 4315
Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
Diffstat (limited to 'zebra/zebra_routemap.c')
-rw-r--r--zebra/zebra_routemap.c79
1 files changed, 43 insertions, 36 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index 78804635f..dbfe695a0 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -136,9 +136,9 @@ static int zebra_route_match_delete(struct vty *vty, const char *command,
/* 'match tag TAG'
* Match function return 1 if match is success else return 0
*/
-static enum route_map_match_result_t
-route_match_tag(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_tag(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type, void *object)
{
route_tag_t *tag;
struct nh_rmap_obj *nh_data;
@@ -162,9 +162,10 @@ static struct route_map_rule_cmd route_match_tag_cmd = {
/* `match interface IFNAME' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_interface(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_interface(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct nh_rmap_obj *nh_data;
char *ifname = rule;
@@ -1024,9 +1025,10 @@ DEFPY (show_ipv6_protocol_nht,
/* `match ip next-hop IP_ACCESS_LIST' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_ip_next_hop(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_ip_next_hop(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct access_list *alist;
struct nh_rmap_obj *nh_data;
@@ -1081,7 +1083,7 @@ static struct route_map_rule_cmd route_match_ip_next_hop_cmd = {
/* `match ip next-hop prefix-list PREFIX_LIST' */
-static enum route_map_match_result_t
+static route_map_result_t
route_match_ip_next_hop_prefix_list(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -1137,9 +1139,10 @@ static struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd = {
/* Match function should return 1 if match is success else return
zero. */
-static enum route_map_match_result_t
-route_match_address(afi_t afi, void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_address(afi_t afi, void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct access_list *alist;
@@ -1155,16 +1158,19 @@ route_match_address(afi_t afi, void *rule, const struct prefix *prefix,
return RMAP_NOMATCH;
}
-static enum route_map_match_result_t
-route_match_ip_address(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_ip_address(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
return route_match_address(AFI_IP, rule, prefix, type, object);
}
-static enum route_map_match_result_t
-route_match_ipv6_address(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_ipv6_address(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
+
{
return route_match_address(AFI_IP6, rule, prefix, type, object);
}
@@ -1194,7 +1200,7 @@ static struct route_map_rule_cmd route_match_ipv6_address_cmd = {
/* `match ip address prefix-list PREFIX_LIST' */
-static enum route_map_match_result_t
+static route_map_result_t
route_match_address_prefix_list(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object, afi_t afi)
{
@@ -1212,7 +1218,7 @@ route_match_address_prefix_list(void *rule, const struct prefix *prefix,
return RMAP_NOMATCH;
}
-static enum route_map_match_result_t
+static route_map_result_t
route_match_ip_address_prefix_list(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -1235,7 +1241,7 @@ static struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd = {
route_match_address_prefix_list_compile,
route_match_address_prefix_list_free};
-static enum route_map_match_result_t
+static route_map_result_t
route_match_ipv6_address_prefix_list(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -1250,7 +1256,7 @@ static struct route_map_rule_cmd route_match_ipv6_address_prefix_list_cmd = {
/* `match ip address prefix-len PREFIXLEN' */
-static enum route_map_match_result_t
+static route_map_result_t
route_match_address_prefix_len(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -1301,7 +1307,7 @@ static struct route_map_rule_cmd route_match_ipv6_address_prefix_len_cmd = {
/* `match ip nexthop prefix-len PREFIXLEN' */
-static enum route_map_match_result_t
+static route_map_result_t
route_match_ip_nexthop_prefix_len(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
@@ -1341,9 +1347,10 @@ static struct route_map_rule_cmd route_match_ip_nexthop_prefix_len_cmd = {
/* `match source-protocol PROTOCOL' */
-static enum route_map_match_result_t
-route_match_source_protocol(void *rule, const struct prefix *p,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_source_protocol(void *rule,
+ const struct prefix *p,
+ route_map_object_t type,
+ void *object)
{
uint32_t *rib_type = (uint32_t *)rule;
struct nh_rmap_obj *nh_data;
@@ -1382,9 +1389,10 @@ static struct route_map_rule_cmd route_match_source_protocol_cmd = {
route_match_source_protocol_compile, route_match_source_protocol_free};
/* `source-instance` */
-static enum route_map_match_result_t
-route_match_source_instance(void *rule, const struct prefix *p,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_source_instance(void *rule,
+ const struct prefix *p,
+ route_map_object_t type,
+ void *object)
{
uint8_t *instance = (uint8_t *)rule;
struct nh_rmap_obj *nh_data;
@@ -1424,9 +1432,8 @@ static struct route_map_rule_cmd route_match_source_instance_cmd = {
/* `set src A.B.C.D' */
/* Set src. */
-static enum route_map_match_result_t
-route_set_src(void *rule, const struct prefix *prefix, route_map_object_t type,
- void *object)
+static route_map_result_t route_set_src(void *rule, const struct prefix *prefix,
+ route_map_object_t type, void *object)
{
struct nh_rmap_obj *nh_data;
@@ -1692,7 +1699,7 @@ zebra_route_map_check(int family, int rib_type, uint8_t instance,
struct zebra_vrf *zvrf, route_tag_t tag)
{
struct route_map *rmap = NULL;
- route_map_result_t ret = RMAP_PERMITMATCH;
+ route_map_result_t ret = RMAP_MATCH;
struct nh_rmap_obj nh_obj;
nh_obj.nexthop = nexthop;
@@ -1738,7 +1745,7 @@ zebra_import_table_route_map_check(int family, int re_type, uint8_t instance,
const char *rmap_name)
{
struct route_map *rmap = NULL;
- enum route_map_match_result_t ret = RMAP_DENYMATCH;
+ route_map_result_t ret = RMAP_DENYMATCH;
struct nh_rmap_obj nh_obj;
nh_obj.nexthop = nexthop;
@@ -1764,7 +1771,7 @@ route_map_result_t zebra_nht_route_map_check(afi_t afi, int client_proto,
struct nexthop *nexthop)
{
struct route_map *rmap = NULL;
- route_map_result_t ret = RMAP_PERMITMATCH;
+ route_map_result_t ret = RMAP_MATCH;
struct nh_rmap_obj nh_obj;
nh_obj.nexthop = nexthop;