2003-12-23 09:09:43 +01:00
|
|
|
/*
|
2015-11-12 14:24:22 +01:00
|
|
|
* IS-IS Rout(e)ing protocol - isis_routemap.c
|
2003-12-23 09:09:43 +01:00
|
|
|
*
|
2015-11-12 14:24:22 +01:00
|
|
|
* Copyright (C) 2013-2015 Christian Franke <chris@opensourcerouting.org>
|
2003-12-23 09:09:43 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
2015-11-12 14:24:22 +01:00
|
|
|
* under the terms of the GNU General Public License as published by the Free
|
2003-12-23 09:09:43 +01:00
|
|
|
* Software Foundation; either version 2 of the License, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
2017-05-13 10:25:29 +02:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; see the file COPYING; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2003-12-23 09:09:43 +01:00
|
|
|
*/
|
2015-11-12 14:24:22 +01:00
|
|
|
|
2003-12-23 09:09:43 +01:00
|
|
|
#include <zebra.h>
|
|
|
|
|
2015-11-12 14:24:22 +01:00
|
|
|
#include "command.h"
|
|
|
|
#include "filter.h"
|
|
|
|
#include "hash.h"
|
|
|
|
#include "if.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
#include "linklist.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "memory.h"
|
|
|
|
#include "prefix.h"
|
2015-11-12 14:24:22 +01:00
|
|
|
#include "plist.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
#include "routemap.h"
|
2015-11-12 14:24:22 +01:00
|
|
|
#include "table.h"
|
|
|
|
#include "thread.h"
|
|
|
|
#include "vty.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
|
|
|
|
#include "isis_constants.h"
|
|
|
|
#include "isis_common.h"
|
2012-03-24 16:35:20 +01:00
|
|
|
#include "isis_flags.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
#include "isisd.h"
|
|
|
|
#include "isis_misc.h"
|
|
|
|
#include "isis_adjacency.h"
|
|
|
|
#include "isis_circuit.h"
|
|
|
|
#include "isis_pdu.h"
|
|
|
|
#include "isis_lsp.h"
|
|
|
|
#include "isis_spf.h"
|
|
|
|
#include "isis_route.h"
|
|
|
|
#include "isis_zebra.h"
|
2015-11-12 14:24:22 +01:00
|
|
|
#include "isis_routemap.h"
|
2003-12-23 09:09:43 +01:00
|
|
|
|
lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOP
Introducing a 3rd state for route_map_apply library function: RMAP_NOOP
Traditionally route map MATCH rule apis were designed to return
a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH.
(Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR).
Depending on this response, the following statemachine decided the
course of action:
State1:
If match cmd returns RMAP_MATCH then, keep existing behaviour.
If routemap type is PERMIT, execute set cmds or call cmds if applicable,
otherwise PERMIT!
Else If routemap type is DENY, we DENYMATCH right away
State2:
If match cmd returns RMAP_NOMATCH, continue on to next route-map. If there
are no other rules or if all the rules return RMAP_NOMATCH, return DENYMATCH
We require a 3rd state because of the following situation:
The issue - what if, the rule api needs to abort or ignore a rule?:
"match evpn vni xx" route-map filter can be applied to incoming routes
regardless of whether the tunnel type is vxlan or mpls.
This rule should be N/A for mpls based evpn route, but applicable to only
vxlan based evpn route.
Also, this rule should be applicable for routes with VNI label only, and
not for routes without labels. For example, type 3 and type 4 EVPN routes
do not have labels, so, this match cmd should let them through.
Today, the filter produces either a match or nomatch response regardless of
whether it is mpls/vxlan, resulting in either permitting or denying the
route.. So an mpls evpn route may get filtered out incorrectly.
Eg: "route-map RM1 permit 10 ; match evpn vni 20" or
"route-map RM2 deny 20 ; match vni 20"
With the introduction of the 3rd state, we can abort this rule check safely.
How? The rules api can now return RMAP_NOOP to indicate
that it encountered an invalid check, and needs to abort just that rule,
but continue with other rules.
As a result we have a 3rd state:
State3:
If match cmd returned RMAP_NOOP
Then, proceed to other route-map, otherwise if there are no more
rules or if all the rules return RMAP_NOOP, then, return RMAP_PERMITMATCH.
Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-06-19 23:04:36 +02:00
|
|
|
static enum route_map_cmd_result_t
|
2020-11-14 01:35:20 +01:00
|
|
|
route_match_ip_address(void *rule, const struct prefix *prefix, void *object)
|
2015-11-12 14:24:22 +01:00
|
|
|
{
|
|
|
|
struct access_list *alist;
|
2003-12-23 09:09:43 +01:00
|
|
|
|
2015-11-12 14:24:22 +01:00
|
|
|
alist = access_list_lookup(AFI_IP, (char *)rule);
|
|
|
|
if (access_list_apply(alist, prefix) != FILTER_DENY)
|
|
|
|
return RMAP_MATCH;
|
2006-12-08 02:09:50 +01:00
|
|
|
|
2015-11-12 14:24:22 +01:00
|
|
|
return RMAP_NOMATCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *route_match_ip_address_compile(const char *arg)
|
|
|
|
{
|
|
|
|
return XSTRDUP(MTYPE_ROUTE_MAP_COMPILED, arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void route_match_ip_address_free(void *rule)
|
|
|
|
{
|
|
|
|
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
|
|
|
|
}
|
|
|
|
|
2019-11-20 17:20:58 +01:00
|
|
|
static const struct route_map_rule_cmd route_match_ip_address_cmd = {
|
|
|
|
"ip address",
|
|
|
|
route_match_ip_address,
|
|
|
|
route_match_ip_address_compile,
|
|
|
|
route_match_ip_address_free
|
|
|
|
};
|
2015-11-12 14:24:22 +01:00
|
|
|
|
|
|
|
/* ------------------------------------------------------------*/
|
|
|
|
|
lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOP
Introducing a 3rd state for route_map_apply library function: RMAP_NOOP
Traditionally route map MATCH rule apis were designed to return
a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH.
(Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR).
Depending on this response, the following statemachine decided the
course of action:
State1:
If match cmd returns RMAP_MATCH then, keep existing behaviour.
If routemap type is PERMIT, execute set cmds or call cmds if applicable,
otherwise PERMIT!
Else If routemap type is DENY, we DENYMATCH right away
State2:
If match cmd returns RMAP_NOMATCH, continue on to next route-map. If there
are no other rules or if all the rules return RMAP_NOMATCH, return DENYMATCH
We require a 3rd state because of the following situation:
The issue - what if, the rule api needs to abort or ignore a rule?:
"match evpn vni xx" route-map filter can be applied to incoming routes
regardless of whether the tunnel type is vxlan or mpls.
This rule should be N/A for mpls based evpn route, but applicable to only
vxlan based evpn route.
Also, this rule should be applicable for routes with VNI label only, and
not for routes without labels. For example, type 3 and type 4 EVPN routes
do not have labels, so, this match cmd should let them through.
Today, the filter produces either a match or nomatch response regardless of
whether it is mpls/vxlan, resulting in either permitting or denying the
route.. So an mpls evpn route may get filtered out incorrectly.
Eg: "route-map RM1 permit 10 ; match evpn vni 20" or
"route-map RM2 deny 20 ; match vni 20"
With the introduction of the 3rd state, we can abort this rule check safely.
How? The rules api can now return RMAP_NOOP to indicate
that it encountered an invalid check, and needs to abort just that rule,
but continue with other rules.
As a result we have a 3rd state:
State3:
If match cmd returned RMAP_NOOP
Then, proceed to other route-map, otherwise if there are no more
rules or if all the rules return RMAP_NOOP, then, return RMAP_PERMITMATCH.
Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-06-19 23:04:36 +02:00
|
|
|
static enum route_map_cmd_result_t
|
2018-07-12 22:05:19 +02:00
|
|
|
route_match_ip_address_prefix_list(void *rule, const struct prefix *prefix,
|
2020-11-14 01:35:20 +01:00
|
|
|
void *object)
|
2015-11-12 14:24:22 +01:00
|
|
|
{
|
|
|
|
struct prefix_list *plist;
|
|
|
|
|
|
|
|
plist = prefix_list_lookup(AFI_IP, (char *)rule);
|
|
|
|
if (prefix_list_apply(plist, prefix) != PREFIX_DENY)
|
|
|
|
return RMAP_MATCH;
|
|
|
|
|
|
|
|
return RMAP_NOMATCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *route_match_ip_address_prefix_list_compile(const char *arg)
|
|
|
|
{
|
|
|
|
return XSTRDUP(MTYPE_ROUTE_MAP_COMPILED, arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void route_match_ip_address_prefix_list_free(void *rule)
|
|
|
|
{
|
|
|
|
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
|
|
|
|
}
|
|
|
|
|
2019-11-20 17:20:58 +01:00
|
|
|
static const struct route_map_rule_cmd
|
|
|
|
route_match_ip_address_prefix_list_cmd = {
|
|
|
|
"ip address prefix-list",
|
|
|
|
route_match_ip_address_prefix_list,
|
2015-11-12 14:24:22 +01:00
|
|
|
route_match_ip_address_prefix_list_compile,
|
2019-11-20 17:20:58 +01:00
|
|
|
route_match_ip_address_prefix_list_free
|
|
|
|
};
|
2015-11-12 14:24:22 +01:00
|
|
|
|
|
|
|
/* ------------------------------------------------------------*/
|
|
|
|
|
2021-03-05 23:12:00 +01:00
|
|
|
/* `match tag TAG' */
|
|
|
|
/* Match function return 1 if match is success else return zero. */
|
|
|
|
static enum route_map_cmd_result_t
|
|
|
|
route_match_tag(void *rule, const struct prefix *p, void *object)
|
|
|
|
{
|
|
|
|
route_tag_t *tag;
|
|
|
|
struct isis_ext_info *info;
|
|
|
|
route_tag_t info_tag;
|
|
|
|
|
|
|
|
tag = rule;
|
|
|
|
info = object;
|
|
|
|
|
|
|
|
info_tag = info->tag;
|
|
|
|
if (info_tag == *tag)
|
|
|
|
return RMAP_MATCH;
|
|
|
|
else
|
|
|
|
return RMAP_NOMATCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Route map commands for tag matching. */
|
|
|
|
static const struct route_map_rule_cmd route_match_tag_cmd = {
|
|
|
|
"tag",
|
|
|
|
route_match_tag,
|
|
|
|
route_map_rule_tag_compile,
|
|
|
|
route_map_rule_tag_free,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------*/
|
|
|
|
|
lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOP
Introducing a 3rd state for route_map_apply library function: RMAP_NOOP
Traditionally route map MATCH rule apis were designed to return
a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH.
(Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR).
Depending on this response, the following statemachine decided the
course of action:
State1:
If match cmd returns RMAP_MATCH then, keep existing behaviour.
If routemap type is PERMIT, execute set cmds or call cmds if applicable,
otherwise PERMIT!
Else If routemap type is DENY, we DENYMATCH right away
State2:
If match cmd returns RMAP_NOMATCH, continue on to next route-map. If there
are no other rules or if all the rules return RMAP_NOMATCH, return DENYMATCH
We require a 3rd state because of the following situation:
The issue - what if, the rule api needs to abort or ignore a rule?:
"match evpn vni xx" route-map filter can be applied to incoming routes
regardless of whether the tunnel type is vxlan or mpls.
This rule should be N/A for mpls based evpn route, but applicable to only
vxlan based evpn route.
Also, this rule should be applicable for routes with VNI label only, and
not for routes without labels. For example, type 3 and type 4 EVPN routes
do not have labels, so, this match cmd should let them through.
Today, the filter produces either a match or nomatch response regardless of
whether it is mpls/vxlan, resulting in either permitting or denying the
route.. So an mpls evpn route may get filtered out incorrectly.
Eg: "route-map RM1 permit 10 ; match evpn vni 20" or
"route-map RM2 deny 20 ; match vni 20"
With the introduction of the 3rd state, we can abort this rule check safely.
How? The rules api can now return RMAP_NOOP to indicate
that it encountered an invalid check, and needs to abort just that rule,
but continue with other rules.
As a result we have a 3rd state:
State3:
If match cmd returned RMAP_NOOP
Then, proceed to other route-map, otherwise if there are no more
rules or if all the rules return RMAP_NOOP, then, return RMAP_PERMITMATCH.
Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-06-19 23:04:36 +02:00
|
|
|
static enum route_map_cmd_result_t
|
2020-11-14 01:35:20 +01:00
|
|
|
route_match_ipv6_address(void *rule, const struct prefix *prefix, void *object)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2015-11-12 14:24:22 +01:00
|
|
|
struct access_list *alist;
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2015-11-12 14:24:22 +01:00
|
|
|
alist = access_list_lookup(AFI_IP6, (char *)rule);
|
|
|
|
if (access_list_apply(alist, prefix) != FILTER_DENY)
|
|
|
|
return RMAP_MATCH;
|
|
|
|
|
|
|
|
return RMAP_NOMATCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *route_match_ipv6_address_compile(const char *arg)
|
|
|
|
{
|
|
|
|
return XSTRDUP(MTYPE_ROUTE_MAP_COMPILED, arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void route_match_ipv6_address_free(void *rule)
|
|
|
|
{
|
|
|
|
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
|
|
|
|
}
|
|
|
|
|
2019-11-20 17:20:58 +01:00
|
|
|
static const struct route_map_rule_cmd route_match_ipv6_address_cmd = {
|
|
|
|
"ipv6 address",
|
|
|
|
route_match_ipv6_address,
|
|
|
|
route_match_ipv6_address_compile,
|
|
|
|
route_match_ipv6_address_free
|
|
|
|
};
|
2015-11-12 14:24:22 +01:00
|
|
|
|
|
|
|
/* ------------------------------------------------------------*/
|
|
|
|
|
lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOP
Introducing a 3rd state for route_map_apply library function: RMAP_NOOP
Traditionally route map MATCH rule apis were designed to return
a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH.
(Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR).
Depending on this response, the following statemachine decided the
course of action:
State1:
If match cmd returns RMAP_MATCH then, keep existing behaviour.
If routemap type is PERMIT, execute set cmds or call cmds if applicable,
otherwise PERMIT!
Else If routemap type is DENY, we DENYMATCH right away
State2:
If match cmd returns RMAP_NOMATCH, continue on to next route-map. If there
are no other rules or if all the rules return RMAP_NOMATCH, return DENYMATCH
We require a 3rd state because of the following situation:
The issue - what if, the rule api needs to abort or ignore a rule?:
"match evpn vni xx" route-map filter can be applied to incoming routes
regardless of whether the tunnel type is vxlan or mpls.
This rule should be N/A for mpls based evpn route, but applicable to only
vxlan based evpn route.
Also, this rule should be applicable for routes with VNI label only, and
not for routes without labels. For example, type 3 and type 4 EVPN routes
do not have labels, so, this match cmd should let them through.
Today, the filter produces either a match or nomatch response regardless of
whether it is mpls/vxlan, resulting in either permitting or denying the
route.. So an mpls evpn route may get filtered out incorrectly.
Eg: "route-map RM1 permit 10 ; match evpn vni 20" or
"route-map RM2 deny 20 ; match vni 20"
With the introduction of the 3rd state, we can abort this rule check safely.
How? The rules api can now return RMAP_NOOP to indicate
that it encountered an invalid check, and needs to abort just that rule,
but continue with other rules.
As a result we have a 3rd state:
State3:
If match cmd returned RMAP_NOOP
Then, proceed to other route-map, otherwise if there are no more
rules or if all the rules return RMAP_NOOP, then, return RMAP_PERMITMATCH.
Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-06-19 23:04:36 +02:00
|
|
|
static enum route_map_cmd_result_t
|
2018-07-12 22:05:19 +02:00
|
|
|
route_match_ipv6_address_prefix_list(void *rule, const struct prefix *prefix,
|
2020-11-14 01:35:20 +01:00
|
|
|
void *object)
|
2015-11-12 14:24:22 +01:00
|
|
|
{
|
|
|
|
struct prefix_list *plist;
|
2004-09-10 22:48:21 +02:00
|
|
|
|
2015-11-12 14:24:22 +01:00
|
|
|
plist = prefix_list_lookup(AFI_IP6, (char *)rule);
|
|
|
|
if (prefix_list_apply(plist, prefix) != PREFIX_DENY)
|
|
|
|
return RMAP_MATCH;
|
|
|
|
|
|
|
|
return RMAP_NOMATCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *route_match_ipv6_address_prefix_list_compile(const char *arg)
|
|
|
|
{
|
|
|
|
return XSTRDUP(MTYPE_ROUTE_MAP_COMPILED, arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void route_match_ipv6_address_prefix_list_free(void *rule)
|
|
|
|
{
|
|
|
|
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
|
|
|
|
}
|
|
|
|
|
2019-11-20 17:20:58 +01:00
|
|
|
static const struct route_map_rule_cmd
|
|
|
|
route_match_ipv6_address_prefix_list_cmd = {
|
|
|
|
"ipv6 address prefix-list",
|
|
|
|
route_match_ipv6_address_prefix_list,
|
2015-11-12 14:24:22 +01:00
|
|
|
route_match_ipv6_address_prefix_list_compile,
|
2019-11-20 17:20:58 +01:00
|
|
|
route_match_ipv6_address_prefix_list_free
|
|
|
|
};
|
2015-11-12 14:24:22 +01:00
|
|
|
|
|
|
|
/* ------------------------------------------------------------*/
|
|
|
|
|
lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOP
Introducing a 3rd state for route_map_apply library function: RMAP_NOOP
Traditionally route map MATCH rule apis were designed to return
a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH.
(Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR).
Depending on this response, the following statemachine decided the
course of action:
State1:
If match cmd returns RMAP_MATCH then, keep existing behaviour.
If routemap type is PERMIT, execute set cmds or call cmds if applicable,
otherwise PERMIT!
Else If routemap type is DENY, we DENYMATCH right away
State2:
If match cmd returns RMAP_NOMATCH, continue on to next route-map. If there
are no other rules or if all the rules return RMAP_NOMATCH, return DENYMATCH
We require a 3rd state because of the following situation:
The issue - what if, the rule api needs to abort or ignore a rule?:
"match evpn vni xx" route-map filter can be applied to incoming routes
regardless of whether the tunnel type is vxlan or mpls.
This rule should be N/A for mpls based evpn route, but applicable to only
vxlan based evpn route.
Also, this rule should be applicable for routes with VNI label only, and
not for routes without labels. For example, type 3 and type 4 EVPN routes
do not have labels, so, this match cmd should let them through.
Today, the filter produces either a match or nomatch response regardless of
whether it is mpls/vxlan, resulting in either permitting or denying the
route.. So an mpls evpn route may get filtered out incorrectly.
Eg: "route-map RM1 permit 10 ; match evpn vni 20" or
"route-map RM2 deny 20 ; match vni 20"
With the introduction of the 3rd state, we can abort this rule check safely.
How? The rules api can now return RMAP_NOOP to indicate
that it encountered an invalid check, and needs to abort just that rule,
but continue with other rules.
As a result we have a 3rd state:
State3:
If match cmd returned RMAP_NOOP
Then, proceed to other route-map, otherwise if there are no more
rules or if all the rules return RMAP_NOOP, then, return RMAP_PERMITMATCH.
Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-06-19 23:04:36 +02:00
|
|
|
static enum route_map_cmd_result_t
|
2020-11-14 01:35:20 +01:00
|
|
|
route_set_metric(void *rule, const struct prefix *prefix, void *object)
|
2015-11-12 14:24:22 +01:00
|
|
|
{
|
|
|
|
uint32_t *metric;
|
|
|
|
struct isis_ext_info *info;
|
|
|
|
|
2020-11-14 01:35:20 +01:00
|
|
|
metric = rule;
|
|
|
|
info = object;
|
|
|
|
|
|
|
|
info->metric = *metric;
|
2015-11-12 14:24:22 +01:00
|
|
|
|
|
|
|
return RMAP_OKAY;
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|
|
|
|
|
2015-11-12 14:24:22 +01:00
|
|
|
static void *route_set_metric_compile(const char *arg)
|
|
|
|
{
|
|
|
|
unsigned long metric;
|
|
|
|
char *endp;
|
|
|
|
uint32_t *ret;
|
|
|
|
|
|
|
|
metric = strtoul(arg, &endp, 10);
|
|
|
|
if (arg[0] == '\0' || *endp != '\0' || metric > MAX_WIDE_PATH_METRIC)
|
|
|
|
return NULL;
|
|
|
|
|
2016-06-14 20:07:06 +02:00
|
|
|
ret = XCALLOC(MTYPE_ROUTE_MAP_COMPILED, sizeof(*ret));
|
2015-11-12 14:24:22 +01:00
|
|
|
*ret = metric;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void route_set_metric_free(void *rule)
|
2003-12-23 09:09:43 +01:00
|
|
|
{
|
2015-11-12 14:24:22 +01:00
|
|
|
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
|
|
|
|
}
|
|
|
|
|
2019-11-20 17:20:58 +01:00
|
|
|
static const struct route_map_rule_cmd route_set_metric_cmd = {
|
|
|
|
"metric",
|
|
|
|
route_set_metric,
|
|
|
|
route_set_metric_compile,
|
|
|
|
route_set_metric_free
|
|
|
|
};
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-10-06 21:56:13 +02:00
|
|
|
void isis_route_map_init(void)
|
2015-11-12 14:24:22 +01:00
|
|
|
{
|
2016-10-06 21:56:13 +02:00
|
|
|
route_map_init();
|
2015-11-12 14:24:22 +01:00
|
|
|
|
2016-10-06 21:56:13 +02:00
|
|
|
route_map_match_ip_address_hook(generic_match_add);
|
|
|
|
route_map_no_match_ip_address_hook(generic_match_delete);
|
2015-11-12 14:24:22 +01:00
|
|
|
|
2016-10-06 21:56:13 +02:00
|
|
|
route_map_match_ip_address_prefix_list_hook(generic_match_add);
|
|
|
|
route_map_no_match_ip_address_prefix_list_hook(generic_match_delete);
|
2015-11-12 14:24:22 +01:00
|
|
|
|
2016-10-06 21:56:13 +02:00
|
|
|
route_map_match_ipv6_address_hook(generic_match_add);
|
|
|
|
route_map_no_match_ipv6_address_hook(generic_match_delete);
|
2015-11-12 14:24:22 +01:00
|
|
|
|
2016-10-06 21:56:13 +02:00
|
|
|
route_map_match_ipv6_address_prefix_list_hook(generic_match_add);
|
|
|
|
route_map_no_match_ipv6_address_prefix_list_hook(generic_match_delete);
|
2015-11-12 14:24:22 +01:00
|
|
|
|
2021-03-05 23:12:00 +01:00
|
|
|
route_map_match_tag_hook(generic_match_add);
|
|
|
|
route_map_no_match_tag_hook(generic_match_delete);
|
|
|
|
|
2016-10-06 21:56:13 +02:00
|
|
|
route_map_set_metric_hook(generic_set_add);
|
|
|
|
route_map_no_set_metric_hook(generic_set_delete);
|
2015-11-12 14:24:22 +01:00
|
|
|
|
|
|
|
route_map_install_match(&route_match_ip_address_cmd);
|
|
|
|
route_map_install_match(&route_match_ip_address_prefix_list_cmd);
|
|
|
|
route_map_install_match(&route_match_ipv6_address_cmd);
|
|
|
|
route_map_install_match(&route_match_ipv6_address_prefix_list_cmd);
|
2021-03-05 23:12:00 +01:00
|
|
|
route_map_install_match(&route_match_tag_cmd);
|
2015-11-12 14:24:22 +01:00
|
|
|
route_map_install_set(&route_set_metric_cmd);
|
2003-12-23 09:09:43 +01:00
|
|
|
}
|