bgpd: North-bound implementation for bgp rmaps

This commit introduces the implementation for the north-bound
callbacks for the bgp-specific route-map match and set clauses.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
This commit is contained in:
Sarita Patra 2020-10-30 00:45:43 -07:00 committed by Igor Ryzhov
parent a623b52619
commit 48cb7ea99d
7 changed files with 4812 additions and 1269 deletions

View file

@ -65,6 +65,7 @@
#include "bgpd/bgp_nb.h"
#include "bgpd/bgp_evpn_mh.h"
#include "bgpd/bgp_nht.h"
#include "bgpd/bgp_routemap_nb.h"
#ifdef ENABLE_BGP_VNC
#include "bgpd/rfapi/rfapi_backend.h"
@ -388,6 +389,7 @@ static const struct frr_yang_module_info *const bgpd_yang_modules[] = {
&frr_route_map_info,
&frr_routing_info,
&frr_vrf_info,
&frr_bgp_route_map_info,
};
FRR_DAEMON_INFO(bgpd, BGP, .vty_port = BGP_VTY_PORT,

File diff suppressed because it is too large Load diff

376
bgpd/bgp_routemap_nb.c Normal file
View file

@ -0,0 +1,376 @@
/*
* Copyright (C) 2020 Vmware
* Sarita Patra
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "lib/command.h"
#include "lib/log.h"
#include "lib/northbound.h"
#include "lib/routemap.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_routemap_nb.h"
/* clang-format off */
const struct frr_yang_module_info frr_bgp_route_map_info = {
.name = "frr-bgp-route-map",
.nodes = {
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:local-preference",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_local_preference_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_local_preference_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:script",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_script_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_script_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:origin",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_origin_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_origin_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:rpki",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_rpki_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_rpki_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:probability",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_probability_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_probability_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:source-vrf",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_source_vrf_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_source_vrf_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:peer-ipv4-address",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv4_address_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv4_address_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:peer-interface",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_peer_interface_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_peer_interface_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:peer-ipv6-address",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv6_address_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv6_address_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:peer-local",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_peer_local_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_peer_local_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:list-name",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_list_name_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_list_name_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:evpn-default-route",
.cbs = {
.create = lib_route_map_entry_match_condition_rmap_match_condition_evpn_default_route_create,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_evpn_default_route_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:evpn-vni",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_evpn_vni_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_evpn_vni_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:evpn-route-type",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_evpn_route_type_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_evpn_route_type_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:route-distinguisher",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_route_distinguisher_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_route_distinguisher_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:comm-list",
.cbs = {
.apply_finish = lib_route_map_entry_match_condition_rmap_match_condition_comm_list_finish,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:comm-list/comm-list-name",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:comm-list/comm-list-name-exact-match",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_exact_match_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_exact_match_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:ipv4-address",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_ipv4_address_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_ipv4_address_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:ipv6-address",
.cbs = {
.modify = lib_route_map_entry_match_condition_rmap_match_condition_ipv6_address_modify,
.destroy = lib_route_map_entry_match_condition_rmap_match_condition_ipv6_address_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:distance",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_distance_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_distance_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-rt",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_extcommunity_rt_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_extcommunity_rt_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-soo",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_extcommunity_soo_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_extcommunity_soo_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:ipv4-address",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_ipv4_address_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_ipv4_address_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:ipv4-nexthop",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_ipv4_nexthop_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_ipv4_nexthop_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:ipv6-address",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_ipv6_address_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_ipv6_address_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:preference",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_preference_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_preference_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:label-index",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_label_index_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_label_index_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:local-pref",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_local_pref_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_local_pref_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:weight",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_weight_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_weight_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:origin",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_origin_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_origin_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:originator-id",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_originator_id_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_originator_id_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:table",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_table_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_table_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:atomic-aggregate",
.cbs = {
.create = lib_route_map_entry_set_action_rmap_set_action_atomic_aggregate_create,
.destroy = lib_route_map_entry_set_action_rmap_set_action_atomic_aggregate_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:prepend-as-path",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_prepend_as_path_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_prepend_as_path_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:last-as",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_last_as_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_last_as_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:exclude-as-path",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_exclude_as_path_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_exclude_as_path_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:community-none",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_community_none_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_community_none_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:community-string",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_community_string_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_community_string_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:large-community-none",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_large_community_none_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_large_community_none_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:large-community-string",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_large_community_string_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_large_community_string_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:aggregator",
.cbs = {
.apply_finish = lib_route_map_entry_set_action_rmap_set_action_aggregator_finish,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:aggregator/aggregator-asn",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_asn_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_asn_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:aggregator/aggregator-address",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_address_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_address_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:comm-list-name",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_comm_list_name_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_comm_list_name_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-lb",
.cbs = {
.apply_finish = lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_finish,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-lb/lb-type",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_lb_type_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_lb_type_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-lb/bandwidth",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_bandwidth_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_bandwidth_destroy,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-lb/two-octet-as-specific",
.cbs = {
.modify = lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_two_octet_as_specific_modify,
.destroy = lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_two_octet_as_specific_destroy,
}
},
{
.xpath = NULL,
},
}
};

138
bgpd/bgp_routemap_nb.h Normal file
View file

@ -0,0 +1,138 @@
/*
* Copyright (C) 2020 Vmware
* Sarita Patra
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FRR_BGP_ROUTEMAP_NB_H_
#define _FRR_BGP_ROUTEMAP_NB_H_
#ifdef __cplusplus
extern "C" {
#endif
extern const struct frr_yang_module_info frr_bgp_route_map_info;
/* prototypes */
int lib_route_map_entry_match_condition_rmap_match_condition_local_preference_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_local_preference_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_script_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_script_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_origin_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_origin_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_rpki_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_rpki_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_probability_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_probability_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_source_vrf_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_source_vrf_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv4_address_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv4_address_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_peer_interface_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_peer_interface_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv6_address_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv6_address_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_peer_local_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_peer_local_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_access_list_num_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_access_list_num_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_access_list_num_extended_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_access_list_num_extended_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_list_name_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_list_name_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_evpn_default_route_create(struct nb_cb_create_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_evpn_default_route_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_evpn_vni_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_evpn_vni_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_evpn_route_type_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_evpn_route_type_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_route_distinguisher_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_route_distinguisher_destroy(struct nb_cb_destroy_args *args);
void lib_route_map_entry_match_condition_rmap_match_condition_comm_list_finish(struct nb_cb_apply_finish_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_exact_match_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_exact_match_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_ipv4_address_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_ipv4_address_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_ipv6_address_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_match_condition_rmap_match_condition_ipv6_address_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_distance_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_distance_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_rt_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_rt_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_soo_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_soo_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_ipv4_address_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_ipv4_address_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_ipv4_nexthop_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_ipv4_nexthop_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_ipv6_address_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_ipv6_address_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_preference_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_preference_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_label_index_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_label_index_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_local_pref_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_local_pref_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_weight_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_weight_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_origin_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_origin_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_originator_id_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_originator_id_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_table_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_table_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_atomic_aggregate_create(struct nb_cb_create_args *args);
int lib_route_map_entry_set_action_rmap_set_action_atomic_aggregate_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_prepend_as_path_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_prepend_as_path_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_last_as_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_last_as_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_exclude_as_path_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_exclude_as_path_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_community_none_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_community_none_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_community_string_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_community_string_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_large_community_none_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_large_community_none_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_large_community_string_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_large_community_string_destroy(struct nb_cb_destroy_args *args);
void lib_route_map_entry_set_action_rmap_set_action_aggregator_finish(struct nb_cb_apply_finish_args *args);
int lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_asn_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_asn_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_address_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_address_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_comm_list_num_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_comm_list_num_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_comm_list_num_extended_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_comm_list_num_extended_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_comm_list_name_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_comm_list_name_destroy(struct nb_cb_destroy_args *args);
void lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_finish(struct nb_cb_apply_finish_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_lb_type_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_lb_type_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_bandwidth_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_bandwidth_destroy(struct nb_cb_destroy_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_two_octet_as_specific_modify(struct nb_cb_modify_args *args);
int lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_two_octet_as_specific_destroy(struct nb_cb_destroy_args *args);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -1164,7 +1164,7 @@ DEFUN (show_rpki_prefix_table,
return CMD_SUCCESS;
}
DEFPY(show_rpki_as_number, show_rpki_as_number_cmd,
DEFPY (show_rpki_as_number, show_rpki_as_number_cmd,
"show rpki as-number (1-4294967295)$by_asn",
SHOW_STR RPKI_OUTPUT_STRING
"Lookup by ASN in prefix table\n"
@ -1357,7 +1357,7 @@ DEFUN (no_debug_rpki,
return CMD_SUCCESS;
}
DEFUN (match_rpki,
DEFUN_YANG (match_rpki,
match_rpki_cmd,
"match rpki <valid|invalid|notfound>",
MATCH_STR
@ -1366,27 +1366,19 @@ DEFUN (match_rpki,
"Invalid prefix\n"
"Prefix not found\n")
{
VTY_DECLVAR_CONTEXT(route_map_index, index);
enum rmap_compile_rets ret;
const char *xpath =
"./match-condition[condition='frr-bgp-route-map:rpki']";
char xpath_value[XPATH_MAXLEN];
ret = route_map_add_match(index, "rpki", argv[2]->arg,
RMAP_EVENT_MATCH_ADDED);
switch (ret) {
case RMAP_RULE_MISSING:
vty_out(vty, "%% BGP Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_ERROR:
vty_out(vty, "%% BGP Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED;
case RMAP_COMPILE_SUCCESS:
return CMD_SUCCESS;
break;
}
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
snprintf(xpath_value, sizeof(xpath_value),
"%s/rmap-match-condition/frr-bgp-route-map:rpki", xpath);
nb_cli_enqueue_change(vty, xpath_value, NB_OP_MODIFY, argv[2]->arg);
return CMD_SUCCESS;
return nb_cli_apply_changes(vty, NULL);
}
DEFUN (no_match_rpki,
DEFUN_YANG (no_match_rpki,
no_match_rpki_cmd,
"no match rpki <valid|invalid|notfound>",
NO_STR
@ -1396,26 +1388,12 @@ DEFUN (no_match_rpki,
"Invalid prefix\n"
"Prefix not found\n")
{
VTY_DECLVAR_CONTEXT(route_map_index, index);
enum rmap_compile_rets ret;
const char *xpath =
"./match-condition[condition='frr-bgp-route-map:rpki']";
char xpath_value[XPATH_MAXLEN];
ret = route_map_delete_match(index, "rpki", argv[3]->arg,
RMAP_EVENT_MATCH_DELETED);
switch (ret) {
case RMAP_RULE_MISSING:
vty_out(vty, "%% BGP Can't find rule.\n");
return CMD_WARNING_CONFIG_FAILED;
break;
case RMAP_COMPILE_ERROR:
vty_out(vty, "%% BGP Argument is malformed.\n");
return CMD_WARNING_CONFIG_FAILED;
break;
case RMAP_COMPILE_SUCCESS:
return CMD_SUCCESS;
break;
}
return CMD_SUCCESS;
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
return nb_cli_apply_changes(vty, NULL);
}
static void install_cli_commands(void)

View file

@ -96,6 +96,8 @@ bgpd_libbgp_a_SOURCES = \
bgpd/bgp_regex.c \
bgpd/bgp_route.c \
bgpd/bgp_routemap.c \
bgpd/bgp_routemap_nb.c \
bgpd/bgp_routemap_nb_config.c \
bgpd/bgp_script.c \
bgpd/bgp_table.c \
bgpd/bgp_updgrp.c \
@ -178,6 +180,7 @@ noinst_HEADERS += \
bgpd/bgp_regex.h \
bgpd/bgp_rpki.h \
bgpd/bgp_route.h \
bgpd/bgp_routemap_nb.h \
bgpd/bgp_script.h \
bgpd/bgp_table.h \
bgpd/bgp_updgrp.h \
@ -255,4 +258,6 @@ nodist_bgpd_bgpd_SOURCES = \
yang/frr-bgp-bmp.yang.c \
yang/frr-bgp-rpki.yang.c \
yang/frr-deviations-bgp-datacenter.yang.c \
yang/frr-bgp-filter.yang.c \
yang/frr-bgp-route-map.yang.c \
# end