}
/* Route map commands for ip address matching. */
-struct route_map_rule_cmd route_match_peer_cmd = {"peer", route_match_peer,
- route_match_peer_compile,
- route_match_peer_free};
+static const struct route_map_rule_cmd route_match_peer_cmd = {
+ "peer",
+ route_match_peer,
+ route_match_peer_compile,
+ route_match_peer_free
+};
#if defined(HAVE_LUA)
static enum route_map_cmd_result_t
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_command_cmd = {
+static const struct route_map_rule_cmd route_match_command_cmd = {
"command",
route_match_command,
route_match_command_compile,
}
/* Route map commands for ip address matching. */
-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};
+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
+};
/* `match ip next-hop IP_ADDRESS' */
}
/* Route map commands for ip next-hop matching. */
-struct route_map_rule_cmd route_match_ip_next_hop_cmd = {
- "ip next-hop", route_match_ip_next_hop, route_match_ip_next_hop_compile,
- route_match_ip_next_hop_free};
+static const struct route_map_rule_cmd route_match_ip_next_hop_cmd = {
+ "ip next-hop",
+ route_match_ip_next_hop,
+ route_match_ip_next_hop_compile,
+ route_match_ip_next_hop_free
+};
/* `match ip route-source ACCESS-LIST' */
}
/* Route map commands for ip route-source matching. */
-struct route_map_rule_cmd route_match_ip_route_source_cmd = {
- "ip route-source", route_match_ip_route_source,
- route_match_ip_route_source_compile, route_match_ip_route_source_free};
+static const struct route_map_rule_cmd route_match_ip_route_source_cmd = {
+ "ip route-source",
+ route_match_ip_route_source,
+ route_match_ip_route_source_compile,
+ route_match_ip_route_source_free
+};
static enum route_map_cmd_result_t
route_match_prefix_list_flowspec(afi_t afi, struct prefix_list *plist,
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd = {
- "ip address prefix-list", route_match_ip_address_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_address_prefix_list_cmd = {
+ "ip address prefix-list",
+ route_match_ip_address_prefix_list,
route_match_ip_address_prefix_list_compile,
- route_match_ip_address_prefix_list_free};
+ route_match_ip_address_prefix_list_free
+};
/* `match ip next-hop prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd = {
- "ip next-hop prefix-list", route_match_ip_next_hop_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_next_hop_prefix_list_cmd = {
+ "ip next-hop prefix-list",
+ route_match_ip_next_hop_prefix_list,
route_match_ip_next_hop_prefix_list_compile,
- route_match_ip_next_hop_prefix_list_free};
+ route_match_ip_next_hop_prefix_list_free
+};
/* `match ip next-hop type <blackhole>' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_next_hop_type_cmd = {
- "ip next-hop type", route_match_ip_next_hop_type,
+static const struct route_map_rule_cmd
+ route_match_ip_next_hop_type_cmd = {
+ "ip next-hop type",
+ route_match_ip_next_hop_type,
route_match_ip_next_hop_type_compile,
- route_match_ip_next_hop_type_free};
+ route_match_ip_next_hop_type_free
+};
/* `match ip route-source prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ip_route_source_prefix_list_cmd = {
- "ip route-source prefix-list", route_match_ip_route_source_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_route_source_prefix_list_cmd = {
+ "ip route-source prefix-list",
+ route_match_ip_route_source_prefix_list,
route_match_ip_route_source_prefix_list_compile,
- route_match_ip_route_source_prefix_list_free};
+ route_match_ip_route_source_prefix_list_free
+};
/* `match evpn default-route' */
}
/* Route map commands for default-route matching. */
-struct route_map_rule_cmd route_match_evpn_default_route_cmd = {
- "evpn default-route", route_match_evpn_default_route, NULL, NULL};
+static const struct route_map_rule_cmd
+ route_match_evpn_default_route_cmd = {
+ "evpn default-route",
+ route_match_evpn_default_route,
+ NULL,
+ NULL
+};
/* `match mac address MAC_ACCESS_LIST' */
}
/* Route map commands for mac address matching. */
-struct route_map_rule_cmd route_match_mac_address_cmd = {
- "mac address", route_match_mac_address, route_match_mac_address_compile,
- route_match_mac_address_free};
+static const struct route_map_rule_cmd route_match_mac_address_cmd = {
+ "mac address",
+ route_match_mac_address,
+ route_match_mac_address_compile,
+ route_match_mac_address_free
+};
/*
* Match function returns:
}
/* Route map commands for vni matching. */
-struct route_map_rule_cmd route_match_evpn_vni_cmd = {
- "evpn vni", route_match_vni, route_match_vni_compile,
- route_match_vni_free};
+static const struct route_map_rule_cmd route_match_evpn_vni_cmd = {
+ "evpn vni",
+ route_match_vni,
+ route_match_vni_compile,
+ route_match_vni_free
+};
/* `match evpn route-type' */
}
/* Route map commands for evpn route-type matching. */
-struct route_map_rule_cmd route_match_evpn_route_type_cmd = {
- "evpn route-type", route_match_evpn_route_type,
- route_match_evpn_route_type_compile, route_match_evpn_route_type_free};
+static const struct route_map_rule_cmd route_match_evpn_route_type_cmd = {
+ "evpn route-type",
+ route_match_evpn_route_type,
+ route_match_evpn_route_type_compile,
+ route_match_evpn_route_type_free
+};
/* `match rd' */
}
/* Route map commands for rd matching. */
-struct route_map_rule_cmd route_match_evpn_rd_cmd = {
- "evpn rd", route_match_rd, route_match_rd_compile,
- route_match_rd_free};
+static const struct route_map_rule_cmd route_match_evpn_rd_cmd = {
+ "evpn rd",
+ route_match_rd,
+ route_match_rd_compile,
+ route_match_rd_free
+};
/* Route map commands for VRF route leak with source vrf matching */
static enum route_map_cmd_result_t
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_vrl_source_vrf_cmd = {
- "source-vrf", route_match_vrl_source_vrf,
+static const struct route_map_rule_cmd route_match_vrl_source_vrf_cmd = {
+ "source-vrf",
+ route_match_vrl_source_vrf,
route_match_vrl_source_vrf_compile,
- route_match_vrl_source_vrf_free};
+ route_match_vrl_source_vrf_free
+};
/* `match local-preference LOCAL-PREF' */
}
/* Route map commands for metric matching. */
-struct route_map_rule_cmd route_match_local_pref_cmd = {
- "local-preference", route_match_local_pref,
- route_match_local_pref_compile, route_match_local_pref_free};
+static const struct route_map_rule_cmd route_match_local_pref_cmd = {
+ "local-preference",
+ route_match_local_pref,
+ route_match_local_pref_compile,
+ route_match_local_pref_free
+};
/* `match metric METRIC' */
}
/* Route map commands for metric matching. */
-struct route_map_rule_cmd route_match_metric_cmd = {
- "metric", route_match_metric, route_value_compile, route_value_free,
+static const struct route_map_rule_cmd route_match_metric_cmd = {
+ "metric",
+ route_match_metric,
+ route_value_compile,
+ route_value_free,
};
/* `match as-path ASPATH' */
}
/* Route map commands for aspath matching. */
-struct route_map_rule_cmd route_match_aspath_cmd = {
- "as-path", route_match_aspath, route_match_aspath_compile,
- route_match_aspath_free};
+static const struct route_map_rule_cmd route_match_aspath_cmd = {
+ "as-path",
+ route_match_aspath,
+ route_match_aspath_compile,
+ route_match_aspath_free
+};
/* `match community COMMUNIY' */
struct rmap_community {
/* Route map commands for community matching. */
-struct route_map_rule_cmd route_match_community_cmd = {
- "community", route_match_community, route_match_community_compile,
- route_match_community_free, route_match_get_community_key};
+static const struct route_map_rule_cmd route_match_community_cmd = {
+ "community",
+ route_match_community,
+ route_match_community_compile,
+ route_match_community_free,
+ route_match_get_community_key
+};
/* Match function for lcommunity match. */
static enum route_map_cmd_result_t
}
/* Route map commands for community matching. */
-struct route_map_rule_cmd route_match_lcommunity_cmd = {
- "large-community", route_match_lcommunity,
- route_match_lcommunity_compile, route_match_lcommunity_free,
- route_match_get_community_key};
+static const struct route_map_rule_cmd route_match_lcommunity_cmd = {
+ "large-community",
+ route_match_lcommunity,
+ route_match_lcommunity_compile,
+ route_match_lcommunity_free,
+ route_match_get_community_key
+};
/* Match function for extcommunity match. */
}
/* Route map commands for community matching. */
-struct route_map_rule_cmd route_match_ecommunity_cmd = {
- "extcommunity", route_match_ecommunity, route_match_ecommunity_compile,
- route_match_ecommunity_free};
+static const struct route_map_rule_cmd route_match_ecommunity_cmd = {
+ "extcommunity",
+ route_match_ecommunity,
+ route_match_ecommunity_compile,
+ route_match_ecommunity_free
+};
/* `match nlri` and `set nlri` are replaced by `address-family ipv4`
and `address-family vpnv4'. */
}
/* Route map commands for origin matching. */
-struct route_map_rule_cmd route_match_origin_cmd = {
- "origin", route_match_origin, route_match_origin_compile,
- route_match_origin_free};
+static const struct route_map_rule_cmd route_match_origin_cmd = {
+ "origin",
+ route_match_origin,
+ route_match_origin_compile,
+ route_match_origin_free
+};
/* match probability { */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_probability_cmd = {
- "probability", route_match_probability, route_match_probability_compile,
- route_match_probability_free};
+static const struct route_map_rule_cmd route_match_probability_cmd = {
+ "probability",
+ route_match_probability,
+ route_match_probability_compile,
+ route_match_probability_free
+};
/* `match interface IFNAME' */
/* Match function should return 1 if match is success else return
}
/* Route map commands for ip address matching. */
-struct route_map_rule_cmd route_match_interface_cmd = {
- "interface", route_match_interface, route_match_interface_compile,
- route_match_interface_free};
+static const struct route_map_rule_cmd route_match_interface_cmd = {
+ "interface",
+ route_match_interface,
+ route_match_interface_compile,
+ route_match_interface_free
+};
/* } */
/* Route map commands for tag matching. */
-static struct route_map_rule_cmd route_match_tag_cmd = {
- "tag", route_match_tag, route_map_rule_tag_compile,
+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,
};
}
/* Route map commands for ip nexthop set. */
-struct route_map_rule_cmd route_set_ip_nexthop_cmd = {
- "ip next-hop", route_set_ip_nexthop, route_set_ip_nexthop_compile,
- route_set_ip_nexthop_free};
+static const struct route_map_rule_cmd route_set_ip_nexthop_cmd = {
+ "ip next-hop",
+ route_set_ip_nexthop,
+ route_set_ip_nexthop_compile,
+ route_set_ip_nexthop_free
+};
/* `set local-preference LOCAL_PREF' */
}
/* Set local preference rule structure. */
-struct route_map_rule_cmd route_set_local_pref_cmd = {
- "local-preference", route_set_local_pref, route_value_compile,
+static const struct route_map_rule_cmd route_set_local_pref_cmd = {
+ "local-preference",
+ route_set_local_pref,
+ route_value_compile,
route_value_free,
};
}
/* Set local preference rule structure. */
-struct route_map_rule_cmd route_set_weight_cmd = {
- "weight", route_set_weight, route_value_compile, route_value_free,
+static const struct route_map_rule_cmd route_set_weight_cmd = {
+ "weight",
+ route_set_weight,
+ route_value_compile,
+ route_value_free,
};
/* `set distance DISTANCE */
}
/* set distance rule structure */
-struct route_map_rule_cmd route_set_distance_cmd = {
+static const struct route_map_rule_cmd route_set_distance_cmd = {
"distance",
route_set_distance,
route_value_compile,
}
/* Set metric rule structure. */
-struct route_map_rule_cmd route_set_metric_cmd = {
- "metric", route_set_metric, route_value_compile, route_value_free,
+static const struct route_map_rule_cmd route_set_metric_cmd = {
+ "metric",
+ route_set_metric,
+ route_value_compile,
+ route_value_free,
};
/* `set table (1-4294967295)' */
}
/* Set table_id rule structure. */
-static struct route_map_rule_cmd route_set_table_id_cmd = {
- "table", route_set_table_id,
- route_value_compile, route_value_free
+static const struct route_map_rule_cmd route_set_table_id_cmd = {
+ "table",
+ route_set_table_id,
+ route_value_compile,
+ route_value_free
};
/* `set as-path prepend ASPATH' */
/* Set as-path prepend rule structure. */
-struct route_map_rule_cmd route_set_aspath_prepend_cmd = {
- "as-path prepend", route_set_aspath_prepend,
- route_set_aspath_prepend_compile, route_set_aspath_prepend_free,
+static const struct route_map_rule_cmd route_set_aspath_prepend_cmd = {
+ "as-path prepend",
+ route_set_aspath_prepend,
+ route_set_aspath_prepend_compile,
+ route_set_aspath_prepend_free,
};
/* `set as-path exclude ASn' */
}
/* Set ASn exlude rule structure. */
-struct route_map_rule_cmd route_set_aspath_exclude_cmd = {
- "as-path exclude", route_set_aspath_exclude, route_aspath_compile,
+static const struct route_map_rule_cmd route_set_aspath_exclude_cmd = {
+ "as-path exclude",
+ route_set_aspath_exclude,
+ route_aspath_compile,
route_aspath_free,
};
}
/* Set community rule structure. */
-struct route_map_rule_cmd route_set_community_cmd = {
- "community", route_set_community, route_set_community_compile,
+static const struct route_map_rule_cmd route_set_community_cmd = {
+ "community",
+ route_set_community,
+ route_set_community_compile,
route_set_community_free,
};
}
/* Set community rule structure. */
-struct route_map_rule_cmd route_set_lcommunity_cmd = {
- "large-community", route_set_lcommunity, route_set_lcommunity_compile,
+static const struct route_map_rule_cmd route_set_lcommunity_cmd = {
+ "large-community",
+ route_set_lcommunity,
+ route_set_lcommunity_compile,
route_set_lcommunity_free,
};
}
/* Set lcommunity rule structure. */
-struct route_map_rule_cmd route_set_lcommunity_delete_cmd = {
- "large-comm-list", route_set_lcommunity_delete,
- route_set_lcommunity_delete_compile, route_set_lcommunity_delete_free,
+static const struct route_map_rule_cmd route_set_lcommunity_delete_cmd = {
+ "large-comm-list",
+ route_set_lcommunity_delete,
+ route_set_lcommunity_delete_compile,
+ route_set_lcommunity_delete_free,
};
}
/* Set community rule structure. */
-struct route_map_rule_cmd route_set_community_delete_cmd = {
- "comm-list", route_set_community_delete,
- route_set_community_delete_compile, route_set_community_delete_free,
+static const struct route_map_rule_cmd route_set_community_delete_cmd = {
+ "comm-list",
+ route_set_community_delete,
+ route_set_community_delete_compile,
+ route_set_community_delete_free,
};
/* `set extcommunity rt COMMUNITY' */
}
/* Set community rule structure. */
-struct route_map_rule_cmd route_set_ecommunity_rt_cmd = {
- "extcommunity rt", route_set_ecommunity,
- route_set_ecommunity_rt_compile, route_set_ecommunity_free,
+static const struct route_map_rule_cmd route_set_ecommunity_rt_cmd = {
+ "extcommunity rt",
+ route_set_ecommunity,
+ route_set_ecommunity_rt_compile,
+ route_set_ecommunity_free,
};
/* `set extcommunity soo COMMUNITY' */
}
/* Set community rule structure. */
-struct route_map_rule_cmd route_set_ecommunity_soo_cmd = {
- "extcommunity soo", route_set_ecommunity,
- route_set_ecommunity_soo_compile, route_set_ecommunity_free,
+static const struct route_map_rule_cmd route_set_ecommunity_soo_cmd = {
+ "extcommunity soo",
+ route_set_ecommunity,
+ route_set_ecommunity_soo_compile,
+ route_set_ecommunity_free,
};
/* `set origin ORIGIN' */
}
/* Set origin rule structure. */
-struct route_map_rule_cmd route_set_origin_cmd = {
- "origin", route_set_origin, route_set_origin_compile,
+static const struct route_map_rule_cmd route_set_origin_cmd = {
+ "origin",
+ route_set_origin,
+ route_set_origin_compile,
route_set_origin_free,
};
}
/* Set atomic aggregate rule structure. */
-struct route_map_rule_cmd route_set_atomic_aggregate_cmd = {
- "atomic-aggregate", route_set_atomic_aggregate,
- route_set_atomic_aggregate_compile, route_set_atomic_aggregate_free,
+static const struct route_map_rule_cmd route_set_atomic_aggregate_cmd = {
+ "atomic-aggregate",
+ route_set_atomic_aggregate,
+ route_set_atomic_aggregate_compile,
+ route_set_atomic_aggregate_free,
};
/* `set aggregator as AS A.B.C.D' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_set_aggregator_as_cmd = {
- "aggregator as", route_set_aggregator_as,
- route_set_aggregator_as_compile, route_set_aggregator_as_free,
+static const struct route_map_rule_cmd route_set_aggregator_as_cmd = {
+ "aggregator as",
+ route_set_aggregator_as,
+ route_set_aggregator_as_compile,
+ route_set_aggregator_as_free,
};
/* Set tag to object. object must be pointer to struct bgp_path_info */
}
/* Route map commands for tag set. */
-static struct route_map_rule_cmd route_set_tag_cmd = {
- "tag", route_set_tag, route_map_rule_tag_compile,
+static const struct route_map_rule_cmd route_set_tag_cmd = {
+ "tag",
+ route_set_tag,
+ route_map_rule_tag_compile,
route_map_rule_tag_free,
};
}
/* Route map commands for label-index set. */
-static struct route_map_rule_cmd route_set_label_index_cmd = {
- "label-index", route_set_label_index, route_value_compile,
+static const struct route_map_rule_cmd route_set_label_index_cmd = {
+ "label-index",
+ route_set_label_index,
+ route_value_compile,
route_value_free,
};
}
/* Route map commands for ip address matching. */
-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};
+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
+};
/* `match ipv6 next-hop IP_ADDRESS' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ipv6_next_hop_cmd = {
- "ipv6 next-hop", route_match_ipv6_next_hop,
- route_match_ipv6_next_hop_compile, route_match_ipv6_next_hop_free};
+static const struct route_map_rule_cmd route_match_ipv6_next_hop_cmd = {
+ "ipv6 next-hop",
+ route_match_ipv6_next_hop,
+ route_match_ipv6_next_hop_compile,
+ route_match_ipv6_next_hop_free
+};
/* `match ipv6 address prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ipv6_address_prefix_list_cmd = {
- "ipv6 address prefix-list", route_match_ipv6_address_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ipv6_address_prefix_list_cmd = {
+ "ipv6 address prefix-list",
+ route_match_ipv6_address_prefix_list,
route_match_ipv6_address_prefix_list_compile,
- route_match_ipv6_address_prefix_list_free};
+ route_match_ipv6_address_prefix_list_free
+};
/* `match ipv6 next-hop type <TYPE>' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ipv6_next_hop_type_cmd = {
- "ipv6 next-hop type", route_match_ipv6_next_hop_type,
+static const struct route_map_rule_cmd
+ route_match_ipv6_next_hop_type_cmd = {
+ "ipv6 next-hop type",
+ route_match_ipv6_next_hop_type,
route_match_ipv6_next_hop_type_compile,
- route_match_ipv6_next_hop_type_free};
+ route_match_ipv6_next_hop_type_free
+};
/* `set ipv6 nexthop global IP_ADDRESS' */
}
/* Route map commands for ip nexthop set. */
-struct route_map_rule_cmd route_set_ipv6_nexthop_global_cmd = {
- "ipv6 next-hop global", route_set_ipv6_nexthop_global,
+static const struct route_map_rule_cmd
+ route_set_ipv6_nexthop_global_cmd = {
+ "ipv6 next-hop global",
+ route_set_ipv6_nexthop_global,
route_set_ipv6_nexthop_global_compile,
- route_set_ipv6_nexthop_global_free};
+ route_set_ipv6_nexthop_global_free
+};
/* Set next-hop preference value. */
static enum route_map_cmd_result_t
}
/* Route map commands for ip nexthop set preferred. */
-struct route_map_rule_cmd route_set_ipv6_nexthop_prefer_global_cmd = {
- "ipv6 next-hop prefer-global", route_set_ipv6_nexthop_prefer_global,
+static const struct route_map_rule_cmd
+ route_set_ipv6_nexthop_prefer_global_cmd = {
+ "ipv6 next-hop prefer-global",
+ route_set_ipv6_nexthop_prefer_global,
route_set_ipv6_nexthop_prefer_global_compile,
- route_set_ipv6_nexthop_prefer_global_free};
+ route_set_ipv6_nexthop_prefer_global_free
+};
/* `set ipv6 nexthop local IP_ADDRESS' */
}
/* Route map commands for ip nexthop set. */
-struct route_map_rule_cmd route_set_ipv6_nexthop_local_cmd = {
- "ipv6 next-hop local", route_set_ipv6_nexthop_local,
+static const struct route_map_rule_cmd
+ route_set_ipv6_nexthop_local_cmd = {
+ "ipv6 next-hop local",
+ route_set_ipv6_nexthop_local,
route_set_ipv6_nexthop_local_compile,
- route_set_ipv6_nexthop_local_free};
+ route_set_ipv6_nexthop_local_free
+};
/* `set ipv6 nexthop peer-address' */
}
/* Route map commands for ip nexthop set. */
-struct route_map_rule_cmd route_set_ipv6_nexthop_peer_cmd = {
- "ipv6 next-hop peer-address", route_set_ipv6_nexthop_peer,
- route_set_ipv6_nexthop_peer_compile, route_set_ipv6_nexthop_peer_free};
+static const struct route_map_rule_cmd route_set_ipv6_nexthop_peer_cmd = {
+ "ipv6 next-hop peer-address",
+ route_set_ipv6_nexthop_peer,
+ route_set_ipv6_nexthop_peer_compile,
+ route_set_ipv6_nexthop_peer_free
+};
/* `set ipv4 vpn next-hop A.B.C.D' */
}
/* Route map commands for ipv4 next-hop set. */
-struct route_map_rule_cmd route_set_vpnv4_nexthop_cmd = {
- "ipv4 vpn next-hop", route_set_vpnv4_nexthop,
- route_set_vpnv4_nexthop_compile, route_set_vpn_nexthop_free};
+static const struct route_map_rule_cmd route_set_vpnv4_nexthop_cmd = {
+ "ipv4 vpn next-hop",
+ route_set_vpnv4_nexthop,
+ route_set_vpnv4_nexthop_compile,
+ route_set_vpn_nexthop_free
+};
/* Route map commands for ipv6 next-hop set. */
-struct route_map_rule_cmd route_set_vpnv6_nexthop_cmd = {
- "ipv6 vpn next-hop", route_set_vpnv6_nexthop,
- route_set_vpnv6_nexthop_compile, route_set_vpn_nexthop_free};
+static const struct route_map_rule_cmd route_set_vpnv6_nexthop_cmd = {
+ "ipv6 vpn next-hop",
+ route_set_vpnv6_nexthop,
+ route_set_vpnv6_nexthop_compile,
+ route_set_vpn_nexthop_free
+};
/* `set originator-id' */
}
/* Set originator-id rule structure. */
-struct route_map_rule_cmd route_set_originator_id_cmd = {
- "originator-id", route_set_originator_id,
- route_set_originator_id_compile, route_set_originator_id_free,
+static const struct route_map_rule_cmd route_set_originator_id_cmd = {
+ "originator-id",
+ route_set_originator_id,
+ route_set_originator_id_compile,
+ route_set_originator_id_free,
};
/* Add bgp route map rule. */
static int rpki_sync_socket_bgpd;
static struct cmd_node rpki_node = {RPKI_NODE, "%s(config-rpki)# ", 1};
-static struct route_map_rule_cmd route_match_rpki_cmd = {
+static const struct route_map_rule_cmd route_match_rpki_cmd = {
"rpki", route_match, route_match_compile, route_match_free};
static void *malloc_wrapper(size_t size)
}
/* Route map commands for metric matching. */
-struct route_map_rule_cmd route_match_metric_cmd = {
- "metric", route_match_metric, route_match_metric_compile,
- route_match_metric_free};
+static const struct route_map_rule_cmd route_match_metric_cmd = {
+ "metric",
+ route_match_metric,
+ route_match_metric_compile,
+ route_match_metric_free
+};
/* `match interface IFNAME' */
/* Match function return 1 if match is success else return zero. */
}
/* Route map commands for interface matching. */
-struct route_map_rule_cmd route_match_interface_cmd = {
- "interface", route_match_interface, route_match_interface_compile,
- route_match_interface_free};
+static const struct route_map_rule_cmd route_match_interface_cmd = {
+ "interface",
+ route_match_interface,
+ route_match_interface_compile,
+ route_match_interface_free
+};
/* `match ip next-hop IP_ACCESS_LIST' */
}
/* Route map commands for ip next-hop matching. */
-static struct route_map_rule_cmd route_match_ip_next_hop_cmd = {
- "ip next-hop", route_match_ip_next_hop, route_match_ip_next_hop_compile,
- route_match_ip_next_hop_free};
+static const struct route_map_rule_cmd route_match_ip_next_hop_cmd = {
+ "ip next-hop",
+ route_match_ip_next_hop,
+ route_match_ip_next_hop_compile,
+ route_match_ip_next_hop_free
+};
/* `match ip next-hop prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd = {
- "ip next-hop prefix-list", route_match_ip_next_hop_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_next_hop_prefix_list_cmd = {
+ "ip next-hop prefix-list",
+ route_match_ip_next_hop_prefix_list,
route_match_ip_next_hop_prefix_list_compile,
- route_match_ip_next_hop_prefix_list_free};
+ route_match_ip_next_hop_prefix_list_free
+};
/* `match ip address IP_ACCESS_LIST' */
}
/* Route map commands for ip address matching. */
-static 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};
+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
+};
/* `match ip address prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd = {
- "ip address prefix-list", route_match_ip_address_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_address_prefix_list_cmd = {
+ "ip address prefix-list",
+ route_match_ip_address_prefix_list,
route_match_ip_address_prefix_list_compile,
- route_match_ip_address_prefix_list_free};
+ route_match_ip_address_prefix_list_free
+};
/* `match tag TAG' */
/* Match function return 1 if match is success else return zero. */
}
/* Route map commands for tag matching. */
-struct route_map_rule_cmd route_match_tag_cmd = {
- "tag", route_match_tag, route_match_tag_compile, route_match_tag_free};
+static const struct route_map_rule_cmd route_match_tag_cmd = {
+ "tag",
+ route_match_tag,
+ route_match_tag_compile,
+ route_match_tag_free
+};
/* Set metric to attribute. */
static enum route_map_cmd_result_t
}
/* Set metric rule structure. */
-static struct route_map_rule_cmd route_set_metric_cmd = {
- "metric", route_set_metric, route_set_metric_compile,
+static const struct route_map_rule_cmd route_set_metric_cmd = {
+ "metric",
+ route_set_metric,
+ route_set_metric_compile,
route_set_metric_free,
};
}
/* Route map commands for ip nexthop set. */
-static struct route_map_rule_cmd route_set_ip_nexthop_cmd = {
- "ip next-hop", route_set_ip_nexthop, route_set_ip_nexthop_compile,
- route_set_ip_nexthop_free};
+static const struct route_map_rule_cmd route_set_ip_nexthop_cmd = {
+ "ip next-hop",
+ route_set_ip_nexthop,
+ route_set_ip_nexthop_compile,
+ route_set_ip_nexthop_free
+};
/* `set tag TAG' */
}
/* Route map commands for tag set. */
-static struct route_map_rule_cmd route_set_tag_cmd = {
- "tag", route_set_tag, route_set_tag_compile, route_set_tag_free};
+static const struct route_map_rule_cmd route_set_tag_cmd = {
+ "tag",
+ route_set_tag,
+ route_set_tag_compile,
+ route_set_tag_free
+};
#define MATCH_STR "Match values from routing table\n"
#define SET_STR "Set values in destination routing protocol\n"
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static 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};
+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
+};
/* ------------------------------------------------------------*/
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd = {
- "ip address prefix-list", route_match_ip_address_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_address_prefix_list_cmd = {
+ "ip address prefix-list",
+ route_match_ip_address_prefix_list,
route_match_ip_address_prefix_list_compile,
- route_match_ip_address_prefix_list_free};
+ route_match_ip_address_prefix_list_free
+};
/* ------------------------------------------------------------*/
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static 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};
+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
+};
/* ------------------------------------------------------------*/
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ipv6_address_prefix_list_cmd = {
- "ipv6 address prefix-list", route_match_ipv6_address_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ipv6_address_prefix_list_cmd = {
+ "ipv6 address prefix-list",
+ route_match_ipv6_address_prefix_list,
route_match_ipv6_address_prefix_list_compile,
- route_match_ipv6_address_prefix_list_free};
+ route_match_ipv6_address_prefix_list_free
+};
/* ------------------------------------------------------------*/
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_set_metric_cmd = {
- "metric", route_set_metric, route_set_metric_compile,
- route_set_metric_free};
+static const struct route_map_rule_cmd route_set_metric_cmd = {
+ "metric",
+ route_set_metric,
+ route_set_metric_compile,
+ route_set_metric_free
+};
void isis_route_map_init(void)
{
/* Route map rule. This rule has both `match' rule and `set' rule. */
struct route_map_rule {
/* Rule type. */
- struct route_map_rule_cmd *cmd;
+ const struct route_map_rule_cmd *cmd;
/* For pretty printing. */
char *rule_str;
}
/* Install rule command to the match list. */
-void route_map_install_match(struct route_map_rule_cmd *cmd)
+void route_map_install_match(const struct route_map_rule_cmd *cmd)
{
- vector_set(route_match_vec, cmd);
+ vector_set(route_match_vec, (void *)cmd);
}
/* Install rule command to the set list. */
-void route_map_install_set(struct route_map_rule_cmd *cmd)
+void route_map_install_set(const struct route_map_rule_cmd *cmd)
{
- vector_set(route_set_vec, cmd);
+ vector_set(route_set_vec, (void *)cmd);
}
/* Lookup rule command from match list. */
-static struct route_map_rule_cmd *route_map_lookup_match(const char *name)
+static const struct route_map_rule_cmd *route_map_lookup_match(const char *name)
{
unsigned int i;
- struct route_map_rule_cmd *rule;
+ const struct route_map_rule_cmd *rule;
for (i = 0; i < vector_active(route_match_vec); i++)
if ((rule = vector_slot(route_match_vec, i)) != NULL)
}
/* Lookup rule command from set list. */
-static struct route_map_rule_cmd *route_map_lookup_set(const char *name)
+static const struct route_map_rule_cmd *route_map_lookup_set(const char *name)
{
unsigned int i;
- struct route_map_rule_cmd *rule;
+ const struct route_map_rule_cmd *rule;
for (i = 0; i < vector_active(route_set_vec); i++)
if ((rule = vector_slot(route_set_vec, i)) != NULL)
const char *match_name)
{
struct route_map_rule *rule;
- struct route_map_rule_cmd *cmd;
+ const struct route_map_rule_cmd *cmd;
/* First lookup rule for add match statement. */
cmd = route_map_lookup_match(match_name);
{
struct route_map_rule *rule;
struct route_map_rule *next;
- struct route_map_rule_cmd *cmd;
+ const struct route_map_rule_cmd *cmd;
void *compile;
int8_t delete_rmap_event_type = 0;
const char *rule_key;
route_map_event_t type)
{
struct route_map_rule *rule;
- struct route_map_rule_cmd *cmd;
+ const struct route_map_rule_cmd *cmd;
const char *rule_key;
cmd = route_map_lookup_match(match_name);
{
struct route_map_rule *rule;
struct route_map_rule *next;
- struct route_map_rule_cmd *cmd;
+ const struct route_map_rule_cmd *cmd;
void *compile;
cmd = route_map_lookup_set(set_name);
const char *set_arg)
{
struct route_map_rule *rule;
- struct route_map_rule_cmd *cmd;
+ const struct route_map_rule_cmd *cmd;
cmd = route_map_lookup_set(set_name);
if (cmd == NULL)
const char *set_name, const char *set_arg);
/* Install rule command to the match list. */
-extern void route_map_install_match(struct route_map_rule_cmd *cmd);
+extern void route_map_install_match(const struct route_map_rule_cmd *cmd);
/*
* Install rule command to the set list.
* in the apply command). See 'set metric' command
* as it is handled in ripd/ripngd and ospfd.
*/
-extern void route_map_install_set(struct route_map_rule_cmd *cmd);
+extern void route_map_install_set(const struct route_map_rule_cmd *cmd);
/* Lookup route map by name. */
extern struct route_map *route_map_lookup_by_name(const char *name);
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd ospf6_routemap_rule_match_address_prefixlist_cmd = {
+static const struct route_map_rule_cmd
+ ospf6_routemap_rule_match_address_prefixlist_cmd = {
"ipv6 address prefix-list",
ospf6_routemap_rule_match_address_prefixlist,
ospf6_routemap_rule_match_address_prefixlist_compile,
}
/* Route map commands for interface matching. */
-struct route_map_rule_cmd ospf6_routemap_rule_match_interface_cmd = {
- "interface", ospf6_routemap_rule_match_interface,
+static const struct route_map_rule_cmd
+ ospf6_routemap_rule_match_interface_cmd = {
+ "interface",
+ ospf6_routemap_rule_match_interface,
ospf6_routemap_rule_match_interface_compile,
- ospf6_routemap_rule_match_interface_free};
+ ospf6_routemap_rule_match_interface_free
+};
/* Match function for matching route tags */
static enum route_map_cmd_result_t
return RMAP_NOMATCH;
}
-static struct route_map_rule_cmd ospf6_routemap_rule_match_tag_cmd = {
- "tag", ospf6_routemap_rule_match_tag, route_map_rule_tag_compile,
+static const struct route_map_rule_cmd
+ ospf6_routemap_rule_match_tag_cmd = {
+ "tag",
+ ospf6_routemap_rule_match_tag,
+ route_map_rule_tag_compile,
route_map_rule_tag_free,
};
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd ospf6_routemap_rule_set_metric_type_cmd = {
- "metric-type", ospf6_routemap_rule_set_metric_type,
+static const struct route_map_rule_cmd
+ ospf6_routemap_rule_set_metric_type_cmd = {
+ "metric-type",
+ ospf6_routemap_rule_set_metric_type,
ospf6_routemap_rule_set_metric_type_compile,
ospf6_routemap_rule_set_metric_type_free,
};
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd ospf6_routemap_rule_set_metric_cmd = {
- "metric", ospf6_routemap_rule_set_metric,
+static const struct route_map_rule_cmd
+ ospf6_routemap_rule_set_metric_cmd = {
+ "metric",
+ ospf6_routemap_rule_set_metric,
ospf6_routemap_rule_set_metric_compile,
ospf6_routemap_rule_set_metric_free,
};
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd ospf6_routemap_rule_set_forwarding_cmd = {
- "forwarding-address", ospf6_routemap_rule_set_forwarding,
+static const struct route_map_rule_cmd
+ ospf6_routemap_rule_set_forwarding_cmd = {
+ "forwarding-address",
+ ospf6_routemap_rule_set_forwarding,
ospf6_routemap_rule_set_forwarding_compile,
ospf6_routemap_rule_set_forwarding_free,
};
return RMAP_OKAY;
}
-static struct route_map_rule_cmd ospf6_routemap_rule_set_tag_cmd = {
- "tag", ospf6_routemap_rule_set_tag, route_map_rule_tag_compile,
+static const struct route_map_rule_cmd
+ ospf6_routemap_rule_set_tag_cmd = {
+ "tag",
+ ospf6_routemap_rule_set_tag,
+ route_map_rule_tag_compile,
route_map_rule_tag_free,
};
return CMD_SUCCESS;
}
-struct ospf6_lsa_handler as_external_handler = {
+static const struct ospf6_lsa_handler as_external_handler = {
.lh_type = OSPF6_LSTYPE_AS_EXTERNAL,
.lh_name = "AS-External",
.lh_short_name = "ASE",
}
/* Route map commands for metric matching. */
-struct route_map_rule_cmd route_match_ip_nexthop_cmd = {
- "ip next-hop", route_match_ip_nexthop, route_match_ip_nexthop_compile,
- route_match_ip_nexthop_free};
+static const struct route_map_rule_cmd route_match_ip_nexthop_cmd = {
+ "ip next-hop",
+ route_match_ip_nexthop,
+ route_match_ip_nexthop_compile,
+ route_match_ip_nexthop_free
+};
/* `match ip next-hop prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd = {
- "ip next-hop prefix-list", route_match_ip_next_hop_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_next_hop_prefix_list_cmd = {
+ "ip next-hop prefix-list",
+ route_match_ip_next_hop_prefix_list,
route_match_ip_next_hop_prefix_list_compile,
- route_match_ip_next_hop_prefix_list_free};
+ route_match_ip_next_hop_prefix_list_free
+};
/* `match ip next-hop type <blackhole>' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_next_hop_type_cmd = {
- "ip next-hop type", route_match_ip_next_hop_type,
+static const struct route_map_rule_cmd
+ route_match_ip_next_hop_type_cmd = {
+ "ip next-hop type",
+ route_match_ip_next_hop_type,
route_match_ip_next_hop_type_compile,
- route_match_ip_next_hop_type_free};
+ route_match_ip_next_hop_type_free
+};
/* `match ip address IP_ACCESS_LIST' */
/* Match function should return 1 if match is success else return
}
/* Route map commands for ip address matching. */
-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};
+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
+};
/* `match ip address prefix-list PREFIX_LIST' */
static enum route_map_cmd_result_t
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd = {
- "ip address prefix-list", route_match_ip_address_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_address_prefix_list_cmd = {
+ "ip address prefix-list",
+ route_match_ip_address_prefix_list,
route_match_ip_address_prefix_list_compile,
- route_match_ip_address_prefix_list_free};
+ route_match_ip_address_prefix_list_free
+};
/* `match interface IFNAME' */
/* Match function should return 1 if match is success else return
}
/* Route map commands for ip address matching. */
-struct route_map_rule_cmd route_match_interface_cmd = {
- "interface", route_match_interface, route_match_interface_compile,
- route_match_interface_free};
+static const struct route_map_rule_cmd route_match_interface_cmd = {
+ "interface",
+ route_match_interface,
+ route_match_interface_compile,
+ route_match_interface_free
+};
/* Match function return 1 if match is success else return zero. */
static enum route_map_cmd_result_t
}
/* Route map commands for tag matching. */
-static struct route_map_rule_cmd route_match_tag_cmd = {
- "tag", route_match_tag, route_map_rule_tag_compile,
+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,
};
}
/* Set metric rule structure. */
-struct route_map_rule_cmd route_set_metric_cmd = {
- "metric", route_set_metric, route_set_metric_compile,
+static const struct route_map_rule_cmd route_set_metric_cmd = {
+ "metric",
+ route_set_metric,
+ route_set_metric_compile,
route_set_metric_free,
};
}
/* Set metric rule structure. */
-struct route_map_rule_cmd route_set_metric_type_cmd = {
- "metric-type", route_set_metric_type, route_set_metric_type_compile,
+static const struct route_map_rule_cmd route_set_metric_type_cmd = {
+ "metric-type",
+ route_set_metric_type,
+ route_set_metric_type_compile,
route_set_metric_type_free,
};
}
/* Route map commands for tag set. */
-static struct route_map_rule_cmd route_set_tag_cmd = {
- "tag", route_set_tag, route_map_rule_tag_compile,
+static const struct route_map_rule_cmd route_set_tag_cmd = {
+ "tag",
+ route_set_tag,
+ route_map_rule_tag_compile,
route_map_rule_tag_free,
};
}
/* Route map commands for metric matching. */
-struct route_map_rule_cmd route_match_metric_cmd = {
- "metric", route_match_metric, route_match_metric_compile,
- route_match_metric_free};
+static const struct route_map_rule_cmd route_match_metric_cmd = {
+ "metric",
+ route_match_metric,
+ route_match_metric_compile,
+ route_match_metric_free
+};
/* `match interface IFNAME' */
/* Match function return 1 if match is success else return zero. */
}
/* Route map commands for interface matching. */
-struct route_map_rule_cmd route_match_interface_cmd = {
- "interface", route_match_interface, route_match_interface_compile,
- route_match_interface_free};
+static const struct route_map_rule_cmd route_match_interface_cmd = {
+ "interface",
+ route_match_interface,
+ route_match_interface_compile,
+ route_match_interface_free
+};
/* `match ip next-hop IP_ACCESS_LIST' */
}
/* Route map commands for ip next-hop matching. */
-static struct route_map_rule_cmd route_match_ip_next_hop_cmd = {
- "ip next-hop", route_match_ip_next_hop, route_match_ip_next_hop_compile,
- route_match_ip_next_hop_free};
+static const struct route_map_rule_cmd route_match_ip_next_hop_cmd = {
+ "ip next-hop",
+ route_match_ip_next_hop,
+ route_match_ip_next_hop_compile,
+ route_match_ip_next_hop_free
+};
/* `match ip next-hop prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd = {
- "ip next-hop prefix-list", route_match_ip_next_hop_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_next_hop_prefix_list_cmd = {
+ "ip next-hop prefix-list",
+ route_match_ip_next_hop_prefix_list,
route_match_ip_next_hop_prefix_list_compile,
- route_match_ip_next_hop_prefix_list_free};
+ route_match_ip_next_hop_prefix_list_free
+};
/* `match ip next-hop type <blackhole>' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_next_hop_type_cmd = {
- "ip next-hop type", route_match_ip_next_hop_type,
+static const struct route_map_rule_cmd
+ route_match_ip_next_hop_type_cmd = {
+ "ip next-hop type",
+ route_match_ip_next_hop_type,
route_match_ip_next_hop_type_compile,
- route_match_ip_next_hop_type_free};
+ route_match_ip_next_hop_type_free
+};
/* `match ip address IP_ACCESS_LIST' */
}
/* Route map commands for ip address matching. */
-static 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};
+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
+};
/* `match ip address prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd = {
- "ip address prefix-list", route_match_ip_address_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_address_prefix_list_cmd = {
+ "ip address prefix-list",
+ route_match_ip_address_prefix_list,
route_match_ip_address_prefix_list_compile,
- route_match_ip_address_prefix_list_free};
+ route_match_ip_address_prefix_list_free
+};
/* `match tag TAG' */
/* Match function return 1 if match is success else return zero. */
}
/* Route map commands for tag matching. */
-static struct route_map_rule_cmd route_match_tag_cmd = {
- "tag", route_match_tag, route_map_rule_tag_compile,
+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,
};
}
/* Set metric rule structure. */
-static struct route_map_rule_cmd route_set_metric_cmd = {
- "metric", route_set_metric, route_set_metric_compile,
+static const struct route_map_rule_cmd route_set_metric_cmd = {
+ "metric",
+ route_set_metric,
+ route_set_metric_compile,
route_set_metric_free,
};
}
/* Route map commands for ip nexthop set. */
-static struct route_map_rule_cmd route_set_ip_nexthop_cmd = {
- "ip next-hop", route_set_ip_nexthop, route_set_ip_nexthop_compile,
- route_set_ip_nexthop_free};
+static const struct route_map_rule_cmd route_set_ip_nexthop_cmd = {
+ "ip next-hop",
+ route_set_ip_nexthop,
+ route_set_ip_nexthop_compile,
+ route_set_ip_nexthop_free
+};
/* `set tag TAG' */
}
/* Route map commands for tag set. */
-static struct route_map_rule_cmd route_set_tag_cmd = {
- "tag", route_set_tag, route_map_rule_tag_compile,
- route_map_rule_tag_free};
+static const struct route_map_rule_cmd route_set_tag_cmd = {
+ "tag",
+ route_set_tag,
+ route_map_rule_tag_compile,
+ route_map_rule_tag_free
+};
#define MATCH_STR "Match values from routing table\n"
#define SET_STR "Set values in destination routing protocol\n"
}
/* Route map commands for metric matching. */
-static struct route_map_rule_cmd route_match_metric_cmd = {
- "metric", route_match_metric, route_match_metric_compile,
- route_match_metric_free};
+static const struct route_map_rule_cmd route_match_metric_cmd = {
+ "metric",
+ route_match_metric,
+ route_match_metric_compile,
+ route_match_metric_free
+};
/* `match interface IFNAME' */
/* Match function return 1 if match is success else return zero. */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_interface_cmd = {
- "interface", route_match_interface, route_match_interface_compile,
- route_match_interface_free};
+static const struct route_map_rule_cmd route_match_interface_cmd = {
+ "interface",
+ route_match_interface,
+ route_match_interface_compile,
+ route_match_interface_free
+};
/* `match tag TAG' */
/* Match function return 1 if match is success else return zero. */
return RMAP_NOMATCH;
}
-static struct route_map_rule_cmd route_match_tag_cmd = {
- "tag", route_match_tag, route_map_rule_tag_compile,
+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,
};
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_set_metric_cmd = {
- "metric", route_set_metric, route_set_metric_compile,
+static const struct route_map_rule_cmd route_set_metric_cmd = {
+ "metric",
+ route_set_metric,
+ route_set_metric_compile,
route_set_metric_free,
};
}
/* Route map commands for ipv6 nexthop local set. */
-static struct route_map_rule_cmd route_set_ipv6_nexthop_local_cmd = {
- "ipv6 next-hop local", route_set_ipv6_nexthop_local,
+static const struct route_map_rule_cmd
+ route_set_ipv6_nexthop_local_cmd = {
+ "ipv6 next-hop local",
+ route_set_ipv6_nexthop_local,
route_set_ipv6_nexthop_local_compile,
- route_set_ipv6_nexthop_local_free};
+ route_set_ipv6_nexthop_local_free
+};
/* `set tag TAG' */
}
/* Route map commands for tag set. */
-static struct route_map_rule_cmd route_set_tag_cmd = {
- "tag", route_set_tag, route_map_rule_tag_compile,
- route_map_rule_tag_free};
+static const struct route_map_rule_cmd route_set_tag_cmd = {
+ "tag",
+ route_set_tag,
+ route_map_rule_tag_compile,
+ route_map_rule_tag_free
+};
#define MATCH_STR "Match values from routing table\n"
#define SET_STR "Set values in destination routing protocol\n"
}
/* Route map commands for tag matching */
-static struct route_map_rule_cmd route_match_tag_cmd = {
- "tag", route_match_tag, route_map_rule_tag_compile,
+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,
};
}
/* Route map commands for interface matching */
-struct route_map_rule_cmd route_match_interface_cmd = {
- "interface", route_match_interface, route_match_interface_compile,
- route_match_interface_free};
+static const struct route_map_rule_cmd route_match_interface_cmd = {
+ "interface",
+ route_match_interface,
+ route_match_interface_compile,
+ route_match_interface_free
+};
static int ip_protocol_rm_add(struct zebra_vrf *zvrf, const char *rmap,
int rtype, afi_t afi, safi_t safi)
}
/* Route map commands for ip next-hop matching. */
-static struct route_map_rule_cmd route_match_ip_next_hop_cmd = {
- "ip next-hop", route_match_ip_next_hop, route_match_ip_next_hop_compile,
- route_match_ip_next_hop_free};
+static const struct route_map_rule_cmd route_match_ip_next_hop_cmd = {
+ "ip next-hop",
+ route_match_ip_next_hop,
+ route_match_ip_next_hop_compile,
+ route_match_ip_next_hop_free
+};
/* `match ip next-hop prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_next_hop_prefix_list_cmd = {
- "ip next-hop prefix-list", route_match_ip_next_hop_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_next_hop_prefix_list_cmd = {
+ "ip next-hop prefix-list",
+ route_match_ip_next_hop_prefix_list,
route_match_ip_next_hop_prefix_list_compile,
- route_match_ip_next_hop_prefix_list_free};
+ route_match_ip_next_hop_prefix_list_free
+};
/* `match ip address IP_ACCESS_LIST' */
}
/* Route map commands for ip address matching. */
-static struct route_map_rule_cmd route_match_ip_address_cmd = {
- "ip address", route_match_ip_address, route_match_address_compile,
- route_match_address_free};
+static const struct route_map_rule_cmd route_match_ip_address_cmd = {
+ "ip address",
+ route_match_ip_address,
+ route_match_address_compile,
+ route_match_address_free
+};
/* Route map commands for ipv6 address matching. */
-static struct route_map_rule_cmd route_match_ipv6_address_cmd = {
- "ipv6 address", route_match_ipv6_address, route_match_address_compile,
- route_match_address_free};
+static const struct route_map_rule_cmd route_match_ipv6_address_cmd = {
+ "ipv6 address",
+ route_match_ipv6_address,
+ route_match_address_compile,
+ route_match_address_free
+};
/* `match ip address prefix-list PREFIX_LIST' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_address_prefix_list_cmd = {
- "ip address prefix-list", route_match_ip_address_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ip_address_prefix_list_cmd = {
+ "ip address prefix-list",
+ route_match_ip_address_prefix_list,
route_match_address_prefix_list_compile,
- route_match_address_prefix_list_free};
+ route_match_address_prefix_list_free
+};
static enum route_map_cmd_result_t
route_match_ipv6_address_prefix_list(void *rule, const struct prefix *prefix,
AFI_IP6));
}
-static struct route_map_rule_cmd route_match_ipv6_address_prefix_list_cmd = {
- "ipv6 address prefix-list", route_match_ipv6_address_prefix_list,
+static const struct route_map_rule_cmd
+ route_match_ipv6_address_prefix_list_cmd = {
+ "ipv6 address prefix-list",
+ route_match_ipv6_address_prefix_list,
route_match_address_prefix_list_compile,
- route_match_address_prefix_list_free};
+ route_match_address_prefix_list_free
+};
/* `match ipv6 next-hop type <TYPE>' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-struct route_map_rule_cmd route_match_ipv6_next_hop_type_cmd = {
- "ipv6 next-hop type", route_match_ipv6_next_hop_type,
+static const struct route_map_rule_cmd
+ route_match_ipv6_next_hop_type_cmd = {
+ "ipv6 next-hop type",
+ route_match_ipv6_next_hop_type,
route_match_ipv6_next_hop_type_compile,
- route_match_ipv6_next_hop_type_free};
+ route_match_ipv6_next_hop_type_free
+};
/* `match ip address prefix-len PREFIXLEN' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_address_prefix_len_cmd = {
- "ip address prefix-len", route_match_address_prefix_len,
+static const struct route_map_rule_cmd
+ route_match_ip_address_prefix_len_cmd = {
+ "ip address prefix-len",
+ route_match_address_prefix_len,
route_match_address_prefix_len_compile,
- route_match_address_prefix_len_free};
+ route_match_address_prefix_len_free
+};
-static struct route_map_rule_cmd route_match_ipv6_address_prefix_len_cmd = {
- "ipv6 address prefix-len", route_match_address_prefix_len,
+static const struct route_map_rule_cmd
+ route_match_ipv6_address_prefix_len_cmd = {
+ "ipv6 address prefix-len",
+ route_match_address_prefix_len,
route_match_address_prefix_len_compile,
- route_match_address_prefix_len_free};
+ route_match_address_prefix_len_free
+};
/* `match ip nexthop prefix-len PREFIXLEN' */
return RMAP_NOMATCH;
}
-static struct route_map_rule_cmd route_match_ip_nexthop_prefix_len_cmd = {
- "ip next-hop prefix-len", route_match_ip_nexthop_prefix_len,
+static const struct route_map_rule_cmd
+ route_match_ip_nexthop_prefix_len_cmd = {
+ "ip next-hop prefix-len",
+ route_match_ip_nexthop_prefix_len,
route_match_address_prefix_len_compile, /* reuse */
route_match_address_prefix_len_free /* reuse */
};
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_ip_next_hop_type_cmd = {
- "ip next-hop type", route_match_ip_next_hop_type,
+static const struct route_map_rule_cmd
+ route_match_ip_next_hop_type_cmd = {
+ "ip next-hop type",
+ route_match_ip_next_hop_type,
route_match_ip_next_hop_type_compile,
- route_match_ip_next_hop_type_free};
+ route_match_ip_next_hop_type_free
+};
/* `match source-protocol PROTOCOL' */
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_source_protocol_cmd = {
- "source-protocol", route_match_source_protocol,
- route_match_source_protocol_compile, route_match_source_protocol_free};
+static const struct route_map_rule_cmd route_match_source_protocol_cmd = {
+ "source-protocol",
+ route_match_source_protocol,
+ route_match_source_protocol_compile,
+ route_match_source_protocol_free
+};
/* `source-instance` */
static enum route_map_cmd_result_t
XFREE(MTYPE_ROUTE_MAP_COMPILED, rule);
}
-static struct route_map_rule_cmd route_match_source_instance_cmd = {
- "source-instance", route_match_source_instance,
- route_match_source_instance_compile, route_match_source_instance_free};
+static const struct route_map_rule_cmd route_match_source_instance_cmd = {
+ "source-instance",
+ route_match_source_instance,
+ route_match_source_instance_compile,
+ route_match_source_instance_free
+};
/* `set src A.B.C.D' */
}
/* Set src rule structure. */
-static struct route_map_rule_cmd route_set_src_cmd = {
- "src", route_set_src, route_set_src_compile, route_set_src_free,
+static const struct route_map_rule_cmd route_set_src_cmd = {
+ "src",
+ route_set_src,
+ route_set_src_compile,
+ route_set_src_free,
};
/* The function checks if the changed routemap specified by parameter rmap