summaryrefslogtreecommitdiff
path: root/zebra/zebra_routemap_nb.c
diff options
context:
space:
mode:
authorSarita Patra <saritap@vmware.com>2020-10-30 00:41:19 -0700
committerIgor Ryzhov <iryzhov@nfware.com>2021-03-30 22:58:42 +0300
commite71627cbcb5f7771b78a028815ccdb65c066e00a (patch)
tree22530556d4a248e197737eb300eae68aa45062f8 /zebra/zebra_routemap_nb.c
parentd5d737a2df8cf18f7b76dcb8a634961513d1d0fa (diff)
zebra: North-bound implementation for zebra rmaps
This commit introduces the implementation for the north-bound callbacks for the zebra-specific route-map match and set clauses. Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com> Signed-off-by: Sarita Patra <saritap@vmware.com>
Diffstat (limited to 'zebra/zebra_routemap_nb.c')
-rw-r--r--zebra/zebra_routemap_nb.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/zebra/zebra_routemap_nb.c b/zebra/zebra_routemap_nb.c
new file mode 100644
index 0000000000..c82c34dd53
--- /dev/null
+++ b/zebra/zebra_routemap_nb.c
@@ -0,0 +1,74 @@
+/*
+ * 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 "northbound.h"
+#include "libfrr.h"
+#include "zebra_routemap_nb.h"
+
+/* clang-format off */
+const struct frr_yang_module_info frr_zebra_route_map_info = {
+ .name = "frr-zebra-route-map",
+ .nodes = {
+ {
+ .xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-zebra-route-map:ipv4-prefix-length",
+ .cbs = {
+ .modify = lib_route_map_entry_match_condition_rmap_match_condition_ipv4_prefix_length_modify,
+ .destroy = lib_route_map_entry_match_condition_rmap_match_condition_ipv4_prefix_length_destroy,
+ }
+ },
+ {
+ .xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-zebra-route-map:ipv6-prefix-length",
+ .cbs = {
+ .modify = lib_route_map_entry_match_condition_rmap_match_condition_ipv6_prefix_length_modify,
+ .destroy = lib_route_map_entry_match_condition_rmap_match_condition_ipv6_prefix_length_destroy,
+ }
+ },
+ {
+ .xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-zebra-route-map:source-instance",
+ .cbs = {
+ .modify = lib_route_map_entry_match_condition_rmap_match_condition_source_instance_modify,
+ .destroy = lib_route_map_entry_match_condition_rmap_match_condition_source_instance_destroy,
+ }
+ },
+ {
+ .xpath = "/frr-route-map:lib/route-map/entry/match-condition/rmap-match-condition/frr-zebra-route-map:source-protocol",
+ .cbs = {
+ .modify = lib_route_map_entry_match_condition_rmap_match_condition_source_protocol_modify,
+ .destroy = lib_route_map_entry_match_condition_rmap_match_condition_source_protocol_destroy,
+ }
+ },
+ {
+ .xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-zebra-route-map:ipv4-src-address",
+ .cbs = {
+ .modify = lib_route_map_entry_set_action_rmap_set_action_ipv4_src_address_modify,
+ .destroy = lib_route_map_entry_set_action_rmap_set_action_ipv4_src_address_destroy,
+ }
+ },
+ {
+ .xpath = "/frr-route-map:lib/route-map/entry/set-action/rmap-set-action/frr-zebra-route-map:ipv6-src-address",
+ .cbs = {
+ .modify = lib_route_map_entry_set_action_rmap_set_action_ipv6_src_address_modify,
+ .destroy = lib_route_map_entry_set_action_rmap_set_action_ipv6_src_address_destroy,
+ }
+ },
+ {
+ .xpath = NULL,
+ },
+ }
+};