/* apply the route-map */
if (bgp_vrf->adv_cmd_rmap[afi][safi].map) {
- route_map_result_t ret;
+ int ret = 0;
ret = route_map_apply(
bgp_vrf->adv_cmd_rmap[afi][safi]
static int bgp_input_modifier(struct peer *peer, struct prefix *p,
struct attr *attr, afi_t afi, safi_t safi,
- const char *rmap_name, mpls_label_t *label,
- uint32_t num_labels)
+ const char *rmap_name)
{
struct bgp_filter *filter;
- struct bgp_path_info rmap_path = { 0 };
- struct bgp_path_info_extra extra = { 0 };
+ struct bgp_path_info rmap_path;
route_map_result_t ret;
struct route_map *rmap = NULL;
/* Duplicate current value to new strucutre for modification. */
rmap_path.peer = peer;
rmap_path.attr = attr;
- rmap_path.extra = &extra;
- extra.num_labels = num_labels;
- if (label && num_labels && num_labels <= BGP_MAX_LABELS)
- memcpy(extra.label, label,
- num_labels * sizeof(mpls_label_t));
SET_FLAG(peer->rmap_type, PEER_RMAP_TYPE_IN);
struct bgp *bgp;
struct attr *piattr;
char buf[PREFIX_STRLEN];
- route_map_result_t ret;
+ int ret;
int transparent;
int reflect;
afi_t afi;
/* apply the route-map */
if (bgp->adv_cmd_rmap[afi][safi].map) {
- route_map_result_t ret;
+ int ret = 0;
ret = route_map_apply(
bgp->adv_cmd_rmap[afi][safi].map,
&rn->p, RMAP_BGP, new_select);
- if (ret == RMAP_PERMITMATCH)
+ if (ret == RMAP_MATCH)
bgp_evpn_advertise_type5_route(
bgp, &rn->p, new_select->attr,
afi, safi);
* commands, so we need bgp_attr_flush in the error paths, until we
* intern
* the attr (which takes over the memory references) */
- if (bgp_input_modifier(peer, p, &new_attr, afi, safi, NULL,
- label, num_labels) == RMAP_DENY) {
+ if (bgp_input_modifier(peer, p, &new_attr, afi, safi, NULL)
+ == RMAP_DENY) {
reason = "route-map;";
bgp_attr_flush(&new_attr);
goto filtered;
struct bgp_path_info rmap_path;
struct attr attr;
struct attr *attr_new;
- route_map_result_t ret;
+ int ret;
#if ENABLE_BGP_VNC
int vnc_implicit_withdraw = 0;
#endif
if (bgp_static->rmap.name) {
struct attr attr_tmp = attr;
struct bgp_path_info rmap_path;
- route_map_result_t ret;
+ int ret;
rmap_path.peer = bgp->peer_self;
rmap_path.attr = &attr_tmp;
struct attr attr;
struct attr *new_attr;
afi_t afi;
- route_map_result_t ret;
+ int ret;
struct bgp_redist *red;
/* Make default attribute. */
struct route_map *rmap = output_arg;
struct bgp_path_info path;
struct attr dummy_attr;
- route_map_result_t ret;
+ int ret;
bgp_attr_dup(&dummy_attr, pi->attr);
/* Filter prefix using route-map */
ret = bgp_input_modifier(peer, &rn->p, &attr,
- afi, safi, rmap_name, NULL, 0);
+ afi, safi, rmap_name);
if (type == bgp_show_adj_route_filtered &&
!route_filtered && ret != RMAP_DENY) {
#include "bgpd/bgp_evpn_private.h"
#include "bgpd/bgp_evpn_vty.h"
#include "bgpd/bgp_mplsvpn.h"
-#include "bgpd/bgp_encap_types.h"
#if ENABLE_BGP_VNC
#include "bgpd/rfapi/bgp_rfapi_cfg.h"
/* Compares the peer specified in the 'match peer' clause with the peer
received in bgp_path_info->peer. If it is the same, or if the peer structure
received is a peer_group containing it, returns RMAP_MATCH. */
-static enum route_map_match_result_t
-route_match_peer(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_peer(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct bgp_match_peer_compiled *pc;
union sockunion *su;
route_match_peer_free};
#if defined(HAVE_LUA)
-static enum route_map_match_result_t
-route_match_command(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_command(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
int status = RMAP_NOMATCH;
u_int32_t locpref = 0;
/* Match function should return 1 if match is success else return
zero. */
-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)
{
struct access_list *alist;
/* `match ip next-hop IP_ADDRESS' */
/* 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 bgp_path_info *path;
/* `match ip route-source ACCESS-LIST' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_ip_route_source(void *rule, const struct prefix *pfx,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_ip_route_source(void *rule,
+ const struct prefix *pfx,
+ route_map_object_t type,
+ void *object)
{
struct access_list *alist;
struct bgp_path_info *path;
/* `match ip address prefix-list PREFIX_LIST' */
-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)
{
/* `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)
{
/* `match ip next-hop type <blackhole>' */
-static enum route_map_match_result_t
+static route_map_result_t
route_match_ip_next_hop_type(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
/* `match ip route-source prefix-list PREFIX_LIST' */
-static enum route_map_match_result_t
+static route_map_result_t
route_match_ip_route_source_prefix_list(void *rule,
const struct prefix *prefix,
route_map_object_t type, void *object)
/* `match evpn default-route' */
/* Match function should return 1 if match is success else 0 */
-static enum route_map_match_result_t
-route_match_evpn_default_route(void *rule, const struct prefix *p,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_evpn_default_route(void *rule,
+ const struct prefix *p,
+ route_map_object_t
+ type, void *object)
{
if (type == RMAP_BGP && is_evpn_prefix_default(p))
return RMAP_MATCH;
/* Match function should return 1 if match is success else return
zero. */
-static enum route_map_match_result_t
-route_match_mac_address(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_mac_address(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct access_list *alist;
struct prefix p;
"mac address", route_match_mac_address, route_match_mac_address_compile,
route_match_mac_address_free};
-/*
- * Match function returns:
- * ...RMAP_MATCH if match is found.
- * ...RMAP_NOMATCH if match is not found.
- * ...RMAP_NOOP to ignore this match check.
- */
-static enum route_map_match_result_t
-route_match_vni(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+/* `match vni' */
+
+/* Match function should return 1 if match is success else return
+ zero. */
+static route_map_result_t route_match_vni(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type, void *object)
{
vni_t vni = 0;
- unsigned int label_cnt = 0;
struct bgp_path_info *path = NULL;
- struct prefix_evpn *evp = (struct prefix_evpn *) prefix;
if (type == RMAP_BGP) {
vni = *((vni_t *)rule);
path = (struct bgp_path_info *)object;
- /*
- * This rmap filter is valid for vxlan tunnel type only.
- * For any other tunnel type, return noop to ignore
- * this check.
- */
- if (path->attr && path->attr->encap_tunneltype !=
- BGP_ENCAP_TYPE_VXLAN)
- return RMAP_NOOP;
-
- /*
- * We do not want to filter type 3 routes because
- * they do not have vni associated with them.
- */
- if (evp && evp->prefix.route_type == BGP_EVPN_IMET_ROUTE)
- return RMAP_NOOP;
-
if (path->extra == NULL)
return RMAP_NOMATCH;
- for ( ; label_cnt < BGP_MAX_LABELS &&
- label_cnt < path->extra->num_labels; label_cnt++) {
- if (vni == label2vni(&path->extra->label[label_cnt]))
- return RMAP_MATCH;
- }
+ if (vni == label2vni(&path->extra->label[0]))
+ return RMAP_MATCH;
}
return RMAP_NOMATCH;
/* Match function should return 1 if match is success else return
zero. */
-static enum route_map_match_result_t
-route_match_evpn_route_type(void *rule, const struct prefix *pfx,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_evpn_route_type(void *rule,
+ const struct prefix *pfx,
+ route_map_object_t type,
+ void *object)
{
uint8_t route_type = 0;
route_match_evpn_route_type_compile, route_match_evpn_route_type_free};
/* Route map commands for VRF route leak with source vrf matching */
-static enum route_map_match_result_t
+static route_map_result_t
route_match_vrl_source_vrf(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
/* `match local-preference LOCAL-PREF' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_local_pref(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_local_pref(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
uint32_t *local_pref;
struct bgp_path_info *path;
/* `match metric METRIC' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_metric(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_metric(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct rmap_value *rv;
struct bgp_path_info *path;
/* `match as-path ASPATH' */
/* Match function for as-path match. I assume given object is */
-static enum route_map_match_result_t
-route_match_aspath(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_aspath(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct as_list *as_list;
};
/* Match function for community match. */
-static enum route_map_match_result_t
-route_match_community(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_community(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct community_list *list;
struct bgp_path_info *path;
route_match_community_free};
/* Match function for lcommunity match. */
-static enum route_map_match_result_t
-route_match_lcommunity(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_lcommunity(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct community_list *list;
struct bgp_path_info *path;
/* Match function for extcommunity match. */
-static enum route_map_match_result_t
-route_match_ecommunity(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_ecommunity(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct community_list *list;
struct bgp_path_info *path;
and `address-family vpnv4'. */
/* `match origin' */
-static enum route_map_match_result_t
-route_match_origin(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_origin(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
uint8_t *origin;
struct bgp_path_info *path;
/* match probability { */
-static enum route_map_match_result_t
-route_match_probability(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_probability(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
long r = random();
/* `match interface IFNAME' */
/* Match function should 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 interface *ifp;
struct bgp_path_info *path;
/* `set ip next-hop IP_ADDRESS' */
/* Match function return 1 if match is success else return zero. */
-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 bgp_path_info *path;
int unchanged;
};
-static enum route_map_match_result_t
-route_set_ip_nexthop(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_ip_nexthop(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct rmap_ip_nexthop_set *rins = rule;
struct bgp_path_info *path;
/* `set local-preference LOCAL_PREF' */
/* Set local preference. */
-static enum route_map_match_result_t
-route_set_local_pref(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_local_pref(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct rmap_value *rv;
struct bgp_path_info *path;
/* `set weight WEIGHT' */
/* Set weight. */
-static enum route_map_match_result_t
-route_set_weight(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_weight(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct rmap_value *rv;
struct bgp_path_info *path;
/* `set metric METRIC' */
/* Set metric to attribute. */
-static enum route_map_match_result_t
-route_set_metric(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_metric(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct rmap_value *rv;
struct bgp_path_info *path;
/* `set as-path prepend ASPATH' */
/* For AS path prepend mechanism. */
-static enum route_map_match_result_t
-route_set_aspath_prepend(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_aspath_prepend(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct aspath *aspath;
struct aspath *new;
* one.
* Make a deep copy of existing AS_PATH, but for the first ASn only.
*/
-static enum route_map_match_result_t
-route_set_aspath_exclude(void *rule, const struct prefix *dummy,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_aspath_exclude(void *rule,
+ const struct prefix *dummy,
+ route_map_object_t type,
+ void *object)
{
struct aspath *new_path, *exclude_path;
struct bgp_path_info *path;
};
/* For community set mechanism. */
-static enum route_map_match_result_t
-route_set_community(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_community(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct rmap_com_set *rcs;
struct bgp_path_info *path;
/* For lcommunity set mechanism. */
-static enum route_map_match_result_t
-route_set_lcommunity(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_lcommunity(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct rmap_lcom_set *rcs;
struct bgp_path_info *path;
/* `set large-comm-list (<1-99>|<100-500>|WORD) delete' */
/* For large community set mechanism. */
-static enum route_map_match_result_t
-route_set_lcommunity_delete(void *rule, const struct prefix *pfx,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_lcommunity_delete(void *rule,
+ const struct prefix *pfx,
+ route_map_object_t type,
+ void *object)
{
struct community_list *list;
struct lcommunity *merge;
/* `set comm-list (<1-99>|<100-500>|WORD) delete' */
/* For community set mechanism. */
-static enum route_map_match_result_t
-route_set_community_delete(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_community_delete(
+ void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct community_list *list;
struct community *merge;
/* `set extcommunity rt COMMUNITY' */
/* For community set mechanism. Used by _rt and _soo. */
-static enum route_map_match_result_t
-route_set_ecommunity(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_ecommunity(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct ecommunity *ecom;
struct ecommunity *new_ecom;
/* `set origin ORIGIN' */
/* For origin set. */
-static enum route_map_match_result_t
-route_set_origin(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_origin(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
uint8_t *origin;
struct bgp_path_info *path;
/* `set atomic-aggregate' */
/* For atomic aggregate set. */
-static enum route_map_match_result_t
-route_set_atomic_aggregate(void *rule, const struct prefix *pfx,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_atomic_aggregate(void *rule,
+ const struct prefix *pfx,
+ route_map_object_t type,
+ void *object)
{
struct bgp_path_info *path;
struct in_addr address;
};
-static enum route_map_match_result_t
-route_set_aggregator_as(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_aggregator_as(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct bgp_path_info *path;
struct aggregator *aggregator;
};
/* Set tag to object. object must be pointer to struct bgp_path_info */
-static enum route_map_match_result_t
-route_set_tag(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_tag(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type, void *object)
{
route_tag_t *tag;
struct bgp_path_info *path;
};
/* Set label-index to object. object must be pointer to struct bgp_path_info */
-static enum route_map_match_result_t
-route_set_label_index(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_label_index(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct rmap_value *rv;
struct bgp_path_info *path;
/* `match ipv6 address IP_ACCESS_LIST' */
-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)
{
struct access_list *alist;
/* `match ipv6 next-hop IP_ADDRESS' */
-static enum route_map_match_result_t
-route_match_ipv6_next_hop(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_ipv6_next_hop(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct in6_addr *addr = rule;
struct bgp_path_info *path;
/* `match ipv6 address prefix-list PREFIX_LIST' */
-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)
{
/* `match ipv6 next-hop type <TYPE>' */
-static enum route_map_match_result_t
+static route_map_result_t
route_match_ipv6_next_hop_type(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+ route_map_object_t type, void *object)
{
struct bgp_path_info *path;
struct in6_addr *addr = rule;
/* `set ipv6 nexthop global IP_ADDRESS' */
/* Set nexthop to object. ojbect must be pointer to struct attr. */
-static enum route_map_match_result_t
-route_set_ipv6_nexthop_global(void *rule, const struct prefix *p,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_ipv6_nexthop_global(void *rule,
+ const struct prefix *p,
+ route_map_object_t type,
+ void *object)
{
struct in6_addr *address;
struct bgp_path_info *path;
route_set_ipv6_nexthop_global_free};
/* Set next-hop preference value. */
-static enum route_map_match_result_t
+static route_map_result_t
route_set_ipv6_nexthop_prefer_global(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
/* `set ipv6 nexthop local IP_ADDRESS' */
/* Set nexthop to object. ojbect must be pointer to struct attr. */
-static enum route_map_match_result_t
-route_set_ipv6_nexthop_local(void *rule, const struct prefix *p,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_ipv6_nexthop_local(void *rule,
+ const struct prefix *p,
+ route_map_object_t type,
+ void *object)
{
struct in6_addr *address;
struct bgp_path_info *path;
/* `set ipv6 nexthop peer-address' */
/* Set nexthop to object. ojbect must be pointer to struct attr. */
-static enum route_map_match_result_t
-route_set_ipv6_nexthop_peer(void *rule, const struct prefix *pfx,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_ipv6_nexthop_peer(void *rule,
+ const struct prefix *pfx,
+ route_map_object_t type,
+ void *object)
{
struct in6_addr peer_address;
struct bgp_path_info *path;
/* `set ipv4 vpn next-hop A.B.C.D' */
-static enum route_map_match_result_t
-route_set_vpnv4_nexthop(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_vpnv4_nexthop(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct in_addr *address;
struct bgp_path_info *path;
/* `set ipv6 vpn next-hop A.B.C.D' */
-static enum route_map_match_result_t
-route_set_vpnv6_nexthop(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_vpnv6_nexthop(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct in6_addr *address;
struct bgp_path_info *path;
/* `set originator-id' */
/* For origin set. */
-static enum route_map_match_result_t
-route_set_originator_id(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_originator_id(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct in_addr *address;
struct bgp_path_info *path;
static int is_synchronized(void);
static int is_running(void);
static void route_match_free(void *rule);
-static enum route_map_match_result_t route_match(void *rule,
- const struct prefix *prefix,
- route_map_object_t type,
- void *object);
+static route_map_result_t route_match(void *rule, const struct prefix *prefix,
+ route_map_object_t type, void *object);
static void *route_match_compile(const char *arg);
static void revalidate_bgp_node(struct bgp_node *bgp_node, afi_t afi,
safi_t safi);
dest[i] = ntohl(src[i]);
}
-static enum route_map_match_result_t route_match(void *rule,
- const struct prefix *prefix,
- route_map_object_t type,
- void *object)
+static route_map_result_t route_match(void *rule, const struct prefix *prefix,
+ route_map_object_t type, void *object)
{
int *rpki_status = rule;
struct bgp_path_info *path;
struct bgp_node *rn;
struct bgp_path_info *ri;
struct peer *peer;
- route_map_result_t ret = RMAP_DENYMATCH;
+ int ret = RMAP_DENYMATCH;
afi_t afi;
safi_t safi;
/* `match metric METRIC' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_metric(void *rule, struct prefix *prefix, route_map_object_t type,
- void *object)
+static route_map_result_t route_match_metric(void *rule, struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
// uint32_t *metric;
// uint32_t check;
/* `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, struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_interface(void *rule,
+ struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
// struct rip_info *rinfo;
// struct interface *ifp;
/* `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, struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_ip_next_hop(void *rule,
+ struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
// struct access_list *alist;
// struct rip_info *rinfo;
/* `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, struct prefix *prefix,
route_map_object_t type, void *object)
{
/* Match function should return 1 if match is success else return
zero. */
-static enum route_map_match_result_t
-route_match_ip_address(void *rule, struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_ip_address(void *rule,
+ struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct access_list *alist;
/* `match ip address prefix-list PREFIX_LIST' */
-static enum route_map_match_result_t
+static route_map_result_t
route_match_ip_address_prefix_list(void *rule, struct prefix *prefix,
route_map_object_t type, void *object)
{
/* `match tag TAG' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_tag(void *rule, struct prefix *prefix, route_map_object_t type,
- void *object)
+static route_map_result_t route_match_tag(void *rule, struct prefix *prefix,
+ route_map_object_t type, void *object)
{
// unsigned short *tag;
// struct rip_info *rinfo;
"tag", route_match_tag, route_match_tag_compile, route_match_tag_free};
/* Set metric to attribute. */
-static enum route_map_match_result_t
-route_set_metric(void *rule, struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_metric(void *rule, struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
// if (type == RMAP_RIP)
// {
/* `set ip next-hop IP_ADDRESS' */
/* Set nexthop to object. ojbect must be pointer to struct attr. */
-static enum route_map_match_result_t
-route_set_ip_nexthop(void *rule, struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_ip_nexthop(void *rule,
+ struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
// struct in_addr *address;
// struct rip_info *rinfo;
/* `set tag TAG' */
/* Set tag to object. ojbect must be pointer to struct attr. */
-static enum route_map_match_result_t
-route_set_tag(void *rule, struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_tag(void *rule, struct prefix *prefix,
+ route_map_object_t type, void *object)
{
// unsigned short *tag;
// struct rip_info *rinfo;
#include "isis_zebra.h"
#include "isis_routemap.h"
-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)
{
struct access_list *alist;
/* ------------------------------------------------------------*/
-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)
{
/* ------------------------------------------------------------*/
-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)
{
struct access_list *alist;
/* ------------------------------------------------------------*/
-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)
{
/* ------------------------------------------------------------*/
-static enum route_map_match_result_t
-route_set_metric(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_metric(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
uint32_t *metric;
struct isis_ext_info *info;
(note, this includes the description for the "NEXT"
and "GOTO" frobs now
- | Match | No Match | No op
- |-----------|--------------|-------
- permit | action | cont | cont.
- | | default:deny | default:permit
- -------------------+-----------------------
- | deny | cont | cont.
- deny | | default:deny | default:permit
- |-----------|--------------|--------
+ Match | No Match
+ |
+ permit action | cont
+ |
+ ------------------+---------------
+ |
+ deny deny | cont
+ |
action)
-Apply Set statements, accept route
We need to make sure our route-map processing matches the above
*/
-static enum route_map_match_result_t
+static route_map_result_t
route_map_apply_match(struct route_map_rule_list *match_list,
const struct prefix *prefix, route_map_object_t type,
void *object)
{
- enum route_map_match_result_t ret = RMAP_NOMATCH;
+ route_map_result_t ret = RMAP_NOMATCH;
struct route_map_rule *match;
route_map_object_t type, void *object)
{
static int recursion = 0;
- enum route_map_match_result_t match_ret = RMAP_NOMATCH;
- route_map_result_t ret = 0;
+ int ret = 0;
struct route_map_index *index;
struct route_map_rule *set;
for (index = map->head; index; index = index->next) {
/* Apply this index. */
index->applied++;
- match_ret = route_map_apply_match(&index->match_list, prefix,
- type, object);
+ ret = route_map_apply_match(&index->match_list, prefix, type,
+ object);
/* Now we apply the matrix from above */
- if (match_ret == RMAP_NOMATCH || match_ret == RMAP_NOOP)
+ if (ret == RMAP_NOMATCH)
/* 'cont' from matrix - continue to next route-map
* sequence */
continue;
- else if (match_ret == RMAP_MATCH) {
+ else if (ret == RMAP_MATCH) {
if (index->type == RMAP_PERMIT)
/* 'action' */
{
- /* Match succeeded, rmap is of type permit */
- ret = RMAP_PERMITMATCH;
-
/* permit+match must execute sets */
for (set = index->set_list.head; set;
set = set->next)
- /*
- * We dont care abt the return value
- * for set cmd. Almost always,
- * RMAP_OKAY is returned. Rarely
- * do we see RMAP_ERROR
- */
- match_ret = (*set->cmd->func_apply)(
- set->value, prefix, type,
- object);
+ ret = (*set->cmd->func_apply)(
+ set->value, prefix, type,
+ object);
/* Call another route-map if available */
if (index->nextrm) {
}
}
}
-
- if (match_ret == RMAP_NOOP)
- return RMAP_PERMITMATCH;
-
/* Finally route-map does not match at all. */
return RMAP_DENYMATCH;
}
DECLARE_MTYPE(ROUTE_MAP_RULE)
DECLARE_MTYPE(ROUTE_MAP_COMPILED)
-/*
- * Route-map match or set result "Eg: match evpn vni xx"
- * route-map match cmd always returns match/nomatch/noop
- * match--> found a match
- * nomatch--> didnt find a match
- * noop--> invalid
- * route-map set retuns okay/error
- * okay --> set was successful
- * error --> set was not successful
- */
-enum route_map_match_result_t {
- /*
- * route-map match cmd results
- */
- RMAP_MATCH,
- RMAP_NOMATCH,
- RMAP_NOOP,
- /*
- * route-map set cmd results
- */
- RMAP_OKAY,
- RMAP_ERROR
-};
-
/* Route map's type. */
enum route_map_type { RMAP_PERMIT, RMAP_DENY, RMAP_ANY };
typedef enum {
+ RMAP_MATCH,
RMAP_DENYMATCH,
- RMAP_PERMITMATCH
+ RMAP_NOMATCH,
+ RMAP_ERROR,
+ RMAP_OKAY
} route_map_result_t;
typedef enum {
const char *str;
/* Function for value set or match. */
- enum route_map_match_result_t (*func_apply)(void *rule,
- const struct prefix *prefix,
- route_map_object_t type,
- void *object);
+ route_map_result_t (*func_apply)(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object);
/* Compile argument and return result as void *. */
void *(*func_compile)(const char *);
unsigned int nexthop_num,
struct in6_addr *nexthop, route_tag_t tag)
{
- route_map_result_t ret;
+ int ret;
struct ospf6_route troute;
struct ospf6_external_info tinfo;
struct ospf6_route *route, *match;
/* Routemap Functions */
-static enum route_map_match_result_t
+static route_map_result_t
ospf6_routemap_rule_match_address_prefixlist(void *rule,
const struct prefix *prefix,
route_map_object_t type,
/* `match interface IFNAME' */
/* Match function should return 1 if match is success else return
zero. */
-static enum route_map_match_result_t
+static route_map_result_t
ospf6_routemap_rule_match_interface(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
ospf6_routemap_rule_match_interface_free};
/* Match function for matching route tags */
-static enum route_map_match_result_t
-ospf6_routemap_rule_match_tag(void *rule, const struct prefix *p,
- route_map_object_t type, void *object)
+static route_map_result_t ospf6_routemap_rule_match_tag(void *rule,
+ const struct prefix *p,
+ route_map_object_t type,
+ void *object)
{
route_tag_t *tag = rule;
struct ospf6_route *route = object;
route_map_rule_tag_free,
};
-static enum route_map_match_result_t
+static route_map_result_t
ospf6_routemap_rule_set_metric_type(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
ospf6_routemap_rule_set_metric_type_free,
};
-static enum route_map_match_result_t
+static route_map_result_t
ospf6_routemap_rule_set_metric(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
ospf6_routemap_rule_set_metric_free,
};
-static enum route_map_match_result_t
+static route_map_result_t
ospf6_routemap_rule_set_forwarding(void *rule, const struct prefix *prefix,
route_map_object_t type, void *object)
{
ospf6_routemap_rule_set_forwarding_free,
};
-static enum route_map_match_result_t
-ospf6_routemap_rule_set_tag(void *rule, const struct prefix *p,
- route_map_object_t type, void *object)
+static route_map_result_t ospf6_routemap_rule_set_tag(void *rule,
+ const struct prefix *p,
+ route_map_object_t type,
+ void *object)
{
route_tag_t *tag = rule;
struct ospf6_route *route = object;
/* `match ip netxthop ' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_ip_nexthop(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_ip_nexthop(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct access_list *alist;
struct external_info *ei = object;
/* `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)
{
/* `match ip address IP_ACCESS_LIST' */
/* Match function should return 1 if match is success else return
zero. */
-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)
{
struct access_list *alist;
/* struct prefix_ipv4 match; */
route_match_ip_address_free};
/* `match ip address prefix-list PREFIX_LIST' */
-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)
{
/* `match interface IFNAME' */
/* Match function should 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 interface *ifp;
struct external_info *ei;
route_match_interface_free};
/* Match function return 1 if match is success else return zero. */
-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 external_info *ei;
/* `set metric METRIC' */
/* Set metric to attribute. */
-static enum route_map_match_result_t
-route_set_metric(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_metric(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
struct ospf_metric *metric;
struct external_info *ei;
/* `set metric-type TYPE' */
/* Set metric-type to attribute. */
-static enum route_map_match_result_t
-route_set_metric_type(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_metric_type(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
uint32_t *metric_type;
struct external_info *ei;
route_set_metric_type_free,
};
-static enum route_map_match_result_t
-route_set_tag(void *rule, const struct prefix *prefix, route_map_object_t type,
- void *object)
+static route_map_result_t route_set_tag(void *rule, const struct prefix *prefix,
+ route_map_object_t type, void *object)
{
route_tag_t *tag;
struct external_info *ei;
/* apply route-map if needed */
red = ospf_redist_lookup(ospf, type, instance);
if (red && ROUTEMAP_NAME(red)) {
- route_map_result_t ret;
+ int ret;
ret = route_map_apply(ROUTEMAP(red), (struct prefix *)p,
RMAP_OSPF, ei);
/* `match metric METRIC' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_metric(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_metric(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
uint32_t *metric;
uint32_t check;
/* `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 rip_info *rinfo;
struct interface *ifp;
/* `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 rip_info *rinfo;
/* `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)
{
/* Match function should return 1 if match is success else return
zero. */
-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)
{
struct access_list *alist;
/* `match ip address prefix-list PREFIX_LIST' */
-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)
{
/* `match tag TAG' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_tag(void *rule, const struct prefix *p, route_map_object_t type,
- void *object)
+static route_map_result_t route_match_tag(void *rule, const struct prefix *p,
+ route_map_object_t type, void *object)
{
route_tag_t *tag;
struct rip_info *rinfo;
/* `set metric METRIC' */
/* Set metric to attribute. */
-static enum route_map_match_result_t
-route_set_metric(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_metric(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
if (type == RMAP_RIP) {
struct rip_metric_modifier *mod;
/* `set ip next-hop IP_ADDRESS' */
/* Set nexthop to object. ojbect must be pointer to struct attr. */
-static enum route_map_match_result_t route_set_ip_nexthop(void *rule,
+static route_map_result_t route_set_ip_nexthop(void *rule,
const struct prefix *prefix,
route_map_object_t type,
void *object)
/* `set tag TAG' */
/* Set tag to object. ojbect must be pointer to struct attr. */
-static enum route_map_match_result_t
-route_set_tag(void *rule, const struct prefix *prefix, route_map_object_t type,
- void *object)
+static route_map_result_t route_set_tag(void *rule, const struct prefix *prefix,
+ route_map_object_t type, void *object)
{
route_tag_t *tag;
struct rip_info *rinfo;
/* `match metric METRIC' */
/* Match function return 1 if match is success else return zero. */
-static enum route_map_match_result_t
-route_match_metric(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_match_metric(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
uint32_t *metric;
struct ripng_info *rinfo;
/* `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 ripng_info *rinfo;
struct interface *ifp;
/* `match tag TAG' */
/* Match function return 1 if match is success else return zero. */
-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 ripng_info *rinfo;
/* `set metric METRIC' */
/* Set metric to attribute. */
-static enum route_map_match_result_t
-route_set_metric(void *rule, const struct prefix *prefix,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_metric(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type,
+ void *object)
{
if (type == RMAP_RIPNG) {
struct rip_metric_modifier *mod;
/* `set ipv6 next-hop local IP_ADDRESS' */
/* Set nexthop to object. ojbect must be pointer to struct attr. */
-static enum route_map_match_result_t
-route_set_ipv6_nexthop_local(void *rule, const struct prefix *p,
- route_map_object_t type, void *object)
+static route_map_result_t route_set_ipv6_nexthop_local(void *rule,
+ const struct prefix *p,
+ route_map_object_t type,
+ void *object)
{
struct in6_addr *address;
struct ripng_info *rinfo;
/* `set tag TAG' */
/* Set tag to object. ojbect must be pointer to struct attr. */
-static enum route_map_match_result_t
-route_set_tag(void *rule, const struct prefix *prefix, route_map_object_t type,
- void *object)
+static route_map_result_t route_set_tag(void *rule,
+ const struct prefix *prefix,
+ route_map_object_t type, void *object)
{
route_tag_t *tag;
struct ripng_info *rinfo;
struct route_entry *newre;
struct route_entry *same;
struct prefix p;
- route_map_result_t ret = RMAP_PERMITMATCH;
+ route_map_result_t ret = RMAP_MATCH;
afi_t afi;
afi = family2afi(rn->p.family);
afi, re->type, re->instance, &rn->p, re->ng.nexthop,
re->vrf_id, re->tag, rmap_name);
- if (ret != RMAP_PERMITMATCH) {
+ if (ret != RMAP_MATCH) {
UNSET_FLAG(re->flags, ZEBRA_FLAG_SELECTED);
zebra_del_import_table_entry(rn, re);
return 0;
struct nexthop *nexthop)
{
struct interface *ifp;
- route_map_result_t ret = RMAP_PERMITMATCH;
+ route_map_result_t ret = RMAP_MATCH;
int family;
char buf[SRCDEST2STR_BUFFER];
const struct prefix *p, *src_p;
{
int at_least_one = 0;
struct nexthop *nexthop;
- route_map_result_t ret;
+ int ret;
if (prn && re) {
for (nexthop = re->ng.nexthop; nexthop;
/* '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;
/* `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;
/* `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;
/* `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)
{
/* 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;
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);
}
/* `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)
{
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)
{
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)
{
/* `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)
{
/* `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)
{
/* `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;
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;
/* `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;
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;
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;
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;