[dev] FRR support for FPM

Tiwari, Mayank (Contractor) Mayank_Tiwari at comcast.com
Tue Aug 7 14:37:05 EDT 2018


Hi,

  We are using quagga in our solution for FPM connection and Reverse FPM connection with ONOS. In order to support BFD feature I need to upgrade from quagga to FRR. For that I was patching the changes present in quagga to FRR. During that patching process the following patch is causing compilation issue:

diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 43d76a6..03c4a6b 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -20,6 +20,7 @@

#include <zebra.h>

+#include "zebra_fpm.h"
#include "memory.h"
#include "zebra_memory.h"
#include "if.h"

+
+/* function to write the fpm config info */
+static int config_write_fpm (struct vty *vty)
+{
+  return fpm_remote_srv_write (vty);
+}
+
+/* Zebra node  */
+static struct cmd_node zebra_node =
+{
+  ZEBRA_NODE,
+  "",
+  1
+};

/* Route VTY.  */
void zebra_vty_init(void)
{
        /* Install configuration write function. */
        install_node(&table_node, config_write_table);
        install_node(&forwarding_node, config_write_forwarding);
+    install_node (&zebra_node, config_write_fpm);


        install_element(VIEW_NODE, &show_ip_forwarding_cmd);
        install_element(CONFIG_NODE, &ip_forwarding_cmd);


diff --git a/zebra/zebra_fpm.h b/zebra/zebra_fpm.h
new file mode 100644
index 0000000..9291ffa
--- /dev/null
+++ b/zebra/zebra_fpm.h
@@ -0,0 +1,35 @@
+/*
+ * Router ID for zebra daemon.
+ *
+ * Copyright (C) 2004 James R. Leu
+ *
+ * This file is part of Quagga routing suite.
+ *
+ * Quagga 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, or (at your option) any
+ * later version.
+ *
+ * Quagga 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 _ZEBRA_VTY_H_
+#define _ZEBRA_VTY_H_
+
+#include <zebra.h>
+#include "memory.h"
+#include "prefix.h"
+#include "zclient.h"
+#include "if.h"
+
+
+static int fpm_remote_srv_write (struct vty *vty );
+
+#endif





The function 'fpm_remote_srv_write'  is already defined in zebra_fpm.c file which I need to use zebra_vty.c file. I have created a header with name zebra_fpm.h and declared that function there and later included this header in zebra_vty.c. The compilation of zebra_vty.c fails as it is not able to find  'fpm_remote_srv_write' function

This is the compilation error:

  CCLD     zebra/zebra_irdp.la
  CC       zebra/zebra_fpm.lo
  CC       zebra/zebra_fpm_netlink.lo
.....
.....

  CC       zebra/zebra_vty.o
In file included from zebra/zebra_vty.c:23:0:
zebra/zebra_fpm.h:33:12: warning: 'fpm_remote_srv_write' used but never defined
static int fpm_remote_srv_write (struct vty *vty );
            ^
  CC       zebra/zebra_vxlan.o
  CC       zebra/zserv.o
  CC       zebra/zebra_netns_id.o
  CC       zebra/zebra_netns_notify.o
  CC       zebra/table_manager.o
  CC       zebra/zapi_msg.o
  CCLD     zebra/zebra
zebra/zebra_vty.o: In function `config_write_fpm':
/frr/zebra/zebra_vty.c:3697: undefined reference to `fpm_remote_srv_write'
collect2: error: ld returned 1 exit status
make[2]: *** [zebra/zebra] Error 1
Makefile:3246: recipe for target 'zebra/zebra' failed
make[2]: Leaving directory '/frr'
Makefile:4421: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/frr'
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

  I have observed that zebra_fpm.c is compiled as zebra_fpm.lo instead of zebra_fpm.o. I am not sure if that can cause this issue. Please suggest what I am missing here and what approach I need to take to fix this issue.

Thanks and Regards,
Mayank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.frrouting.org/pipermail/dev/attachments/20180807/38db930b/attachment.html>


More information about the dev mailing list