summaryrefslogtreecommitdiffstats
path: root/zebra/zapi_msg.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-12-20 10:51:25 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2021-04-30 10:33:18 +0200
commitb716ab61e2a40da54115a39297e3aca0834bbea7 (patch)
treec35f8ff598db56ea8c556abc312d060867604a84 /zebra/zapi_msg.c
parentzebra: add 3 new gre commands, and enforce synchro mecanism (diff)
downloadfrr-b716ab61e2a40da54115a39297e3aca0834bbea7.tar.xz
frr-b716ab61e2a40da54115a39297e3aca0834bbea7.zip
zebra: add stub implementation for zebra gre source set
this functionality is stubbed. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to '')
-rw-r--r--zebra/zapi_msg.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 77a9188fe..645cb2bd0 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -3373,6 +3373,34 @@ stream_failure:
return;
}
+static inline void zebra_gre_source_set(ZAPI_HANDLER_ARGS)
+{
+ struct stream *s;
+ ifindex_t idx, link_idx;
+ vrf_id_t link_vrf_id;
+ struct interface *ifp;
+ struct interface *ifp_link;
+ ns_id_t ns_id;
+ vrf_id_t vrf_id = zvrf->vrf->vrf_id;
+
+ s = msg;
+ STREAM_GETL(s, idx);
+ ifp = if_lookup_by_index(idx, vrf_id);
+ STREAM_GETL(s, link_idx);
+ STREAM_GETL(s, link_vrf_id);
+ ifp_link = if_lookup_by_index(link_idx, link_vrf_id);
+ if (!ifp_link || !ifp) {
+ zlog_warn("GRE (index %u, VRF %u) or GRE link interface (index %u, VRF %u) not found, when setting GRE params",
+ idx, vrf_id, link_idx, link_vrf_id);
+ return;
+ }
+ ns_id = zvrf->zns->ns_id;
+ kernel_configure_if_link(ifp, ifp_link, ns_id);
+
+ stream_failure:
+ return;
+}
+
static void zsend_error_msg(struct zserv *client, enum zebra_error_types error,
struct zmsghdr *bad_hdr)
{
@@ -3488,6 +3516,7 @@ void (*const zserv_handlers[])(ZAPI_HANDLER_ARGS) = {
[ZEBRA_NHRP_NEIGH_REGISTER] = zebra_neigh_register,
[ZEBRA_NHRP_NEIGH_UNREGISTER] = zebra_neigh_unregister,
[ZEBRA_CONFIGURE_ARP] = zebra_configure_arp,
+ [ZEBRA_GRE_SOURCE_SET] = zebra_gre_source_set,
};
/*