1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2020 Vmware
10 #include "lib/command.h"
12 #include "lib/northbound.h"
13 #include "lib/routemap.h"
14 #include "bgpd/bgpd.h"
15 #include "bgpd/bgp_routemap_nb.h"
17 /* clang-format off */
18 const struct frr_yang_module_info frr_bgp_route_map_info
= {
19 .name
= "frr-bgp-route-map",
22 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:local-preference",
24 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_local_preference_modify
,
25 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_local_preference_destroy
,
29 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:alias",
31 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_alias_modify
,
32 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_alias_destroy
,
36 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:script",
38 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_script_modify
,
39 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_script_destroy
,
43 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:origin",
45 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_origin_modify
,
46 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_origin_destroy
,
50 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:rpki",
52 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_rpki_modify
,
53 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_rpki_destroy
,
57 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:rpki-extcommunity",
59 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_rpki_extcommunity_modify
,
60 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_rpki_extcommunity_destroy
,
64 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:probability",
66 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_probability_modify
,
67 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_probability_destroy
,
71 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:source-vrf",
73 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_source_vrf_modify
,
74 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_source_vrf_destroy
,
78 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:peer-ipv4-address",
80 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv4_address_modify
,
81 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv4_address_destroy
,
85 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:peer-interface",
87 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_peer_interface_modify
,
88 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_peer_interface_destroy
,
92 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:peer-ipv6-address",
94 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv6_address_modify
,
95 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_peer_ipv6_address_destroy
,
99 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:peer-local",
101 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_peer_local_modify
,
102 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_peer_local_destroy
,
106 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:list-name",
108 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_list_name_modify
,
109 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_list_name_destroy
,
113 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:evpn-default-route",
115 .create
= lib_route_map_entry_match_condition_rmap_match_condition_evpn_default_route_create
,
116 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_evpn_default_route_destroy
,
120 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:evpn-vni",
122 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_evpn_vni_modify
,
123 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_evpn_vni_destroy
,
127 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:evpn-route-type",
129 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_evpn_route_type_modify
,
130 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_evpn_route_type_destroy
,
134 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:route-distinguisher",
136 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_route_distinguisher_modify
,
137 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_route_distinguisher_destroy
,
141 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:comm-list",
143 .apply_finish
= lib_route_map_entry_match_condition_rmap_match_condition_comm_list_finish
,
147 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:comm-list/comm-list-name",
149 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_modify
,
150 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_destroy
,
154 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:comm-list/comm-list-name-exact-match",
156 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_exact_match_modify
,
157 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_comm_list_comm_list_name_exact_match_destroy
,
161 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:ipv4-address",
163 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_ipv4_address_modify
,
164 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_ipv4_address_destroy
,
168 .xpath
= "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-bgp-route-map:ipv6-address",
170 .modify
= lib_route_map_entry_match_condition_rmap_match_condition_ipv6_address_modify
,
171 .destroy
= lib_route_map_entry_match_condition_rmap_match_condition_ipv6_address_destroy
,
175 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:distance",
177 .modify
= lib_route_map_entry_set_action_rmap_set_action_distance_modify
,
178 .destroy
= lib_route_map_entry_set_action_rmap_set_action_distance_destroy
,
182 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-rt",
184 .modify
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_rt_modify
,
185 .destroy
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_rt_destroy
,
189 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-soo",
191 .modify
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_soo_modify
,
192 .destroy
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_soo_destroy
,
196 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:ipv4-address",
198 .modify
= lib_route_map_entry_set_action_rmap_set_action_ipv4_address_modify
,
199 .destroy
= lib_route_map_entry_set_action_rmap_set_action_ipv4_address_destroy
,
203 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:ipv4-nexthop",
205 .modify
= lib_route_map_entry_set_action_rmap_set_action_ipv4_nexthop_modify
,
206 .destroy
= lib_route_map_entry_set_action_rmap_set_action_ipv4_nexthop_destroy
,
210 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:ipv6-address",
212 .modify
= lib_route_map_entry_set_action_rmap_set_action_ipv6_address_modify
,
213 .destroy
= lib_route_map_entry_set_action_rmap_set_action_ipv6_address_destroy
,
217 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:preference",
219 .modify
= lib_route_map_entry_set_action_rmap_set_action_preference_modify
,
220 .destroy
= lib_route_map_entry_set_action_rmap_set_action_preference_destroy
,
224 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:label-index",
226 .modify
= lib_route_map_entry_set_action_rmap_set_action_label_index_modify
,
227 .destroy
= lib_route_map_entry_set_action_rmap_set_action_label_index_destroy
,
231 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:local-pref",
233 .modify
= lib_route_map_entry_set_action_rmap_set_action_local_pref_modify
,
234 .destroy
= lib_route_map_entry_set_action_rmap_set_action_local_pref_destroy
,
238 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:weight",
240 .modify
= lib_route_map_entry_set_action_rmap_set_action_weight_modify
,
241 .destroy
= lib_route_map_entry_set_action_rmap_set_action_weight_destroy
,
245 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:origin",
247 .modify
= lib_route_map_entry_set_action_rmap_set_action_origin_modify
,
248 .destroy
= lib_route_map_entry_set_action_rmap_set_action_origin_destroy
,
252 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:originator-id",
254 .modify
= lib_route_map_entry_set_action_rmap_set_action_originator_id_modify
,
255 .destroy
= lib_route_map_entry_set_action_rmap_set_action_originator_id_destroy
,
259 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:table",
261 .modify
= lib_route_map_entry_set_action_rmap_set_action_table_modify
,
262 .destroy
= lib_route_map_entry_set_action_rmap_set_action_table_destroy
,
266 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:atomic-aggregate",
268 .create
= lib_route_map_entry_set_action_rmap_set_action_atomic_aggregate_create
,
269 .destroy
= lib_route_map_entry_set_action_rmap_set_action_atomic_aggregate_destroy
,
273 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:aigp-metric",
275 .modify
= lib_route_map_entry_set_action_rmap_set_action_aigp_metric_modify
,
276 .destroy
= lib_route_map_entry_set_action_rmap_set_action_aigp_metric_destroy
,
280 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:prepend-as-path",
282 .modify
= lib_route_map_entry_set_action_rmap_set_action_prepend_as_path_modify
,
283 .destroy
= lib_route_map_entry_set_action_rmap_set_action_prepend_as_path_destroy
,
287 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:last-as",
289 .modify
= lib_route_map_entry_set_action_rmap_set_action_last_as_modify
,
290 .destroy
= lib_route_map_entry_set_action_rmap_set_action_last_as_destroy
,
294 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:exclude-as-path",
296 .modify
= lib_route_map_entry_set_action_rmap_set_action_exclude_as_path_modify
,
297 .destroy
= lib_route_map_entry_set_action_rmap_set_action_exclude_as_path_destroy
,
301 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:replace-as-path",
303 .modify
= lib_route_map_entry_set_action_rmap_set_action_replace_as_path_modify
,
304 .destroy
= lib_route_map_entry_set_action_rmap_set_action_replace_as_path_destroy
,
308 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:community-none",
310 .modify
= lib_route_map_entry_set_action_rmap_set_action_community_none_modify
,
311 .destroy
= lib_route_map_entry_set_action_rmap_set_action_community_none_destroy
,
315 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:community-string",
317 .modify
= lib_route_map_entry_set_action_rmap_set_action_community_string_modify
,
318 .destroy
= lib_route_map_entry_set_action_rmap_set_action_community_string_destroy
,
322 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:large-community-none",
324 .modify
= lib_route_map_entry_set_action_rmap_set_action_large_community_none_modify
,
325 .destroy
= lib_route_map_entry_set_action_rmap_set_action_large_community_none_destroy
,
329 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:large-community-string",
331 .modify
= lib_route_map_entry_set_action_rmap_set_action_large_community_string_modify
,
332 .destroy
= lib_route_map_entry_set_action_rmap_set_action_large_community_string_destroy
,
336 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:aggregator",
338 .apply_finish
= lib_route_map_entry_set_action_rmap_set_action_aggregator_finish
,
342 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:aggregator/aggregator-asn",
344 .modify
= lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_asn_modify
,
345 .destroy
= lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_asn_destroy
,
349 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:aggregator/aggregator-address",
351 .modify
= lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_address_modify
,
352 .destroy
= lib_route_map_entry_set_action_rmap_set_action_aggregator_aggregator_address_destroy
,
356 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:comm-list-name",
358 .modify
= lib_route_map_entry_set_action_rmap_set_action_comm_list_name_modify
,
359 .destroy
= lib_route_map_entry_set_action_rmap_set_action_comm_list_name_destroy
,
363 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-none",
365 .modify
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_none_modify
,
366 .destroy
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_none_destroy
,
370 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-lb",
372 .apply_finish
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_finish
,
376 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-lb/lb-type",
378 .modify
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_lb_type_modify
,
379 .destroy
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_lb_type_destroy
,
383 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-lb/bandwidth",
385 .modify
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_bandwidth_modify
,
386 .destroy
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_bandwidth_destroy
,
390 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:extcommunity-lb/two-octet-as-specific",
392 .modify
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_two_octet_as_specific_modify
,
393 .destroy
= lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_two_octet_as_specific_destroy
,
397 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:evpn-gateway-ip-ipv4",
399 .modify
= lib_route_map_entry_set_action_rmap_set_action_evpn_gateway_ip_ipv4_modify
,
400 .destroy
= lib_route_map_entry_set_action_rmap_set_action_evpn_gateway_ip_ipv4_destroy
,
404 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:evpn-gateway-ip-ipv6",
406 .modify
= lib_route_map_entry_set_action_rmap_set_action_evpn_gateway_ip_ipv6_modify
,
407 .destroy
= lib_route_map_entry_set_action_rmap_set_action_evpn_gateway_ip_ipv6_destroy
,
411 .xpath
= "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-bgp-route-map:l3vpn-nexthop-encapsulation",
413 .modify
= lib_route_map_entry_set_action_rmap_set_action_l3vpn_nexthop_encapsulation_modify
,
414 .destroy
= lib_route_map_entry_set_action_rmap_set_action_l3vpn_nexthop_encapsulation_destroy
,