+1. See diffs below, which are a start on the problem / fix first-order build 
and infra issues. The “router” component needs FIB 2.0 brain-police.

I’m pretty sure that Pierre meant to write: “netlink and router plugin are NOT 
really maintained. It is not surprising that they do not compile without a bit 
of effort.”

HTH... Dave

diff --git a/netlink/librtnl/mapper.c b/netlink/librtnl/mapper.c
index b82fae8..b20a1f7 100644
--- a/netlink/librtnl/mapper.c
+++ b/netlink/librtnl/mapper.c
@@ -96,7 +96,8 @@ int mapper_add_del_route(mapper_ns_t *ns, ns_route_t *route, 
int del)
     fib_table_entry_path_add (ns->v6fib_index, &prefix, FIB_SOURCE_API,
                               FIB_ENTRY_FLAG_NONE, prefix.fp_proto,
                               &nh, map->sw_if_index, ns->v6fib_index,
-                              0 /* weight */, MPLS_LABEL_INVALID,
+                              0 /* weight */,
+                              (mpls_label_t *) MPLS_LABEL_INVALID,
                               FIB_ROUTE_PATH_FLAG_NONE);
#endif /* FIB_VERSION == 1 */
   } else {
@@ -126,7 +127,8 @@ int mapper_add_del_route(mapper_ns_t *ns, ns_route_t 
*route, int del)
     fib_table_entry_path_add (ns->v4fib_index, &prefix, FIB_SOURCE_API,
                               FIB_ENTRY_FLAG_NONE, prefix.fp_proto,
                               &nh, map->sw_if_index, ns->v4fib_index,
-                              0 /* weight */, MPLS_LABEL_INVALID,
+                              0 /* weight */,
+                              (mpls_label_t *) MPLS_LABEL_INVALID,
                               FIB_ROUTE_PATH_FLAG_NONE);
#endif /* FIB_VERSION == 1 */
   }
diff --git a/netlink/netlink.mk b/netlink/netlink.mk
index 677a1b5..610205f 100644
--- a/netlink/netlink.mk
+++ b/netlink/netlink.mk
@@ -1,31 +1,5 @@
-netlink_configure_depend =      \
-    vppinfra-install           \
-    dpdk-install                     \
-    svm-install                      \
-    vlib-api-install           \
-    vlib-install                     \
-    vnet-install                     \
-    vpp-install                      \
-    vpp-api-test-install
+netlink_configure_depend = vpp-install
-netlink_CPPFLAGS = $(call installed_includes_fn, \
-    vppinfra                         \
-    dpdk                             \
-    openssl                               \
-    svm                              \
-    vlib                             \
-    vlib-api                         \
-    vnet                             \
-    vpp                              \
-    vpp-api-test)
+netlink_CPPFLAGS = $(call installed_includes_fn, vpp)
-netlink_LDFLAGS = $(call installed_libs_fn,     \
-    vppinfra                         \
-    dpdk                             \
-    openssl                               \
-    svm                              \
-    vlib                             \
-    vlib-api                         \
-    vnet                             \
-    vpp                              \
-    vpp-api-test)
+netlink_LDFLAGS = $(call installed_libs_fn, vpp)
diff --git a/netlink/test/test.c b/netlink/test/test.c
index 96f49f8..2922a40 100644
--- a/netlink/test/test.c
+++ b/netlink/test/test.c
@@ -200,11 +200,10 @@ VLIB_CLI_COMMAND (mapper_iface_command, static) = {
     .function = mapper_iface_command_fn,
};
-clib_error_t *
-vlib_plugin_register (vlib_main_t * vm, vnet_plugin_handoff_t * h,
-                      int from_early_init)
-{
-  clib_warning("Loaded module");
-  return 0;
-}
+/* *INDENT-OFF* */
+VLIB_PLUGIN_REGISTER () = {
+    // .version = VPP_BUILD_VER, FIXME
+    .description = "netlink",
+};
+/* *INDENT-ON* */
diff --git a/router/router.mk b/router/router.mk
index f9bb917..c5a6a4a 100644
--- a/router/router.mk
+++ b/router/router.mk
@@ -1,34 +1,11 @@
-router_configure_depend =                       \
-    vppinfra-install                        \
-    dpdk-install                            \
-    svm-install                             \
-    vlib-api-install                        \
-    vlib-install                            \
-    vnet-install                            \
-    vpp-install                             \
-    netlink-install                         \
-    vpp-api-test-install
+router_configure_depend =            \
+    vpp-install                      \
+    netlink-install

 router_CPPFLAGS = $(call installed_includes_fn, \
-    vppinfra                                \
-    dpdk                                    \
-    openssl                                 \
-    svm                                     \
-    vlib                                    \
-    vlib-api                                \
-    vnet                                    \
    vpp                                     \
-    netlink                                 \
-    vpp-api-test)
+    netlink)
 router_LDFLAGS = $(call installed_libs_fn,      \
-    vppinfra                                \
-    dpdk                                    \
-    openssl                                 \
-    svm                                     \
-    vlib                                    \
-    vlib-api                                \
-    vnet                                    \
    vpp                                     \
-    netlink                                 \
-    vpp-api-test)
+    netlink)
diff --git a/router/router/tap_inject.c b/router/router/tap_inject.c
index 8d6f5af..9617e84 100644
--- a/router/router/tap_inject.c
+++ b/router/router/tap_inject.c
@@ -85,13 +85,6 @@ tap_inject_lookup_sw_if_index_from_tap_if_index (u32 
tap_if_index)
}

-clib_error_t *
-vlib_plugin_register (vlib_main_t * vm, vnet_plugin_handoff_t * h, int f)
-{
-  return 0;
-}
-
-
static void
tap_inject_disable (void)
{
@@ -136,6 +129,7 @@ tap_inject_enable (void)
   ip6_register_protocol (IP_PROTOCOL_UDP, im->tx_node_index);
   /* Add IPv4 multicast route. */
+#if 0 /* $$$$ FIXME */
   {
     ip4_add_del_route_args_t a;
     ip_adjacency_t add_adj;
@@ -163,6 +157,7 @@ tap_inject_enable (void)
     ip4_add_del_route (&ip4_main, &a);
   }
+#endif
   im->flags |= TAP_INJECT_F_ENABLED;
diff --git a/router/router/tap_inject_netlink.c 
b/router/router/tap_inject_netlink.c
index a30e262..884b17f 100644
--- a/router/router/tap_inject_netlink.c
+++ b/router/router/tap_inject_netlink.c
@@ -19,6 +19,7 @@
#include <librtnl/netns.h>
#include <vlibmemory/api.h>
#include <vnet/ethernet/arp_packet.h>
+#include <vnet/ip/ip6_neighbor.h>

 static void
@@ -110,17 +111,21 @@ add_del_neigh (ns_neigh_t * n, int is_del)
       clib_memcpy (&a.ip4, n->dst, sizeof (a.ip4));
       if (n->nd.ndm_state & NUD_REACHABLE)
-        vnet_arp_set_ip4_over_ethernet (vnet_main, sw_if_index, ~0, &a, 0);
+          vnet_arp_set_ip4_over_ethernet (vnet_main, sw_if_index,
+                                          &a, 0 /* static */ ,
+                                          0 /* no fib entry */);
       else if (n->nd.ndm_state & NUD_FAILED)
-        vnet_arp_unset_ip4_over_ethernet (vnet_main, sw_if_index, ~0, &a);
+          vnet_arp_unset_ip4_over_ethernet (vnet_main, sw_if_index, &a);
     }
   else if (n->nd.ndm_family == AF_INET6)
     {
       if (n->nd.ndm_state & NUD_REACHABLE)
         vnet_set_ip6_ethernet_neighbor (vm, sw_if_index,
-            (ip6_address_t *) n->dst, n->lladdr, ETHER_ADDR_LEN, 0);
+            (ip6_address_t *) n->dst, n->lladdr, ETHER_ADDR_LEN,
+                                        0 /* static */,
+                                        0 /* no fib entry */);
       else
-        vnet_unset_ip6_ethernet_neighbor (vm, sw_if_index,
+          vnet_unset_ip6_ethernet_neighbor (vm, sw_if_index,
             (ip6_address_t *) n->dst, n->lladdr, ETHER_ADDR_LEN);
     }
}

Thanks… Dave

From: vpp-dev-boun...@lists.fd.io [mailto:vpp-dev-boun...@lists.fd.io] On 
Behalf Of Pierre Pfister (ppfister)
Sent: Sunday, March 26, 2017 8:07 AM
To: Łukasz Chrustek <ski...@tlen.pl>; Jeff Shaw <jeffrey.b.s...@intel.com>
Cc: Łukasz Chrustek <luk...@chrustek.net>; vpp-dev@lists.fd.io
Subject: Re: [vpp-dev] Building router plugin

Hello Lukasz,

I am sorry I won't be able to look in details into your problem this week, but 
I can still quickly dump some information.

netlink and router plugin are really maintained. It is not surprising that they 
do not compile without at bit of effort.
Commits are very welcome though, as I know that VPP integration into Linux is 
of interest to many people.

My guess is that netlink should just need some changes in the way it is 
compiled, and that's all.
router on the other way... I think it hasn't been updated since last FIB change 
in VPP, and will therefore probably need a little bit of work to compile and 
function properly.

Thanks,

- Pierre

Le 24 mars 2017 à 19:38, Łukasz Chrustek 
<ski...@tlen.pl<mailto:ski...@tlen.pl>> a écrit :

Hi,

I'm trying to compile vpp from git sources (git clone 
https://gerrit.fd.io/r/vpp) + router plugin (also from git, but for vppsb: git 
clone https://gerrit.fd.io/r/vppsb). Compilation of vpp is working, but I would 
like to test tap inject from router plugin from vppsb (vpp sandbox). 
Compilation procedure from router/README.mk in vppsb directory doesn't work:

<quote>
## Build/Install

The router is implemented as a plugin to inject, e.g. arp, icmp4, traffic
from data plane devices. To use it, you must build the plugin and put it
in VPPs runtime plugin directory. The plugin depends on vpp and the netlink
repository from the vppsb project. This README assumes familiarity with the
build environment for both projects.

Build vpp, netlink, and router all at once by creating symbolic links in the
top level vpp directory to the netlink and router directories as well as
symbolic links to the respective .mk files in 'build-data/packages'.

```
$ cd /git/vpp
$ ln -sf /git/vppsb/netlink
$ ln -sf /git/vppsb/router
$ ln -sf ../../netlink/netlink.mk build-data/packages/
$ ln -sf ../../router/router.mk build-data/packages/
```

Now build everything and create a link to the plugin in vpp's plugin path.

```
$ cd build-root
$ ./bootstrap.sh
$ make V=0 PLATFORM=vpp TAG=vpp_debug router-install
$ ln -sf 
/git/vpp/build-root/install-vpp_debug-native/router/lib64/router.so.0.0.0 \
        /usr/lib/vpp_plugins/router.so
```

Once VPP is running and the plugin is loaded, data plane interfaces can
be tapped.

```
$ vppctl tap inject arp,icmp4 from TenGigabitEthernet2/0/0 as vpp0
```

</quote>

Regards
Luk

Luk,

Are you installing the vpp-dev (or vpp-devel if Centos) package?
I would imagine you'd need that for headers etc.

Ed

On Fri, Mar 24, 2017 at 8:14 AM, Łukasz Chrustek 
<luk...@chrustek.net<mailto:luk...@chrustek.net>> wrote:

Hi Dave,

but this plugin isn't part of core vpp code tree, it is from vppsb.

Regards
Luk
> Dear Luk,

> The "vpp-install," "install-packags," "install-deb" etc. targets
> will build the set of plugins configured in 
> src/configure.ac<http://configure.ac/>:

> For example:

> $ cd build-root
> $ make PLATFORM=vpp TAG=vpp vpp-install

> HTH. Dave

> -----Original Message-----
> From: vpp-dev-boun...@lists.fd.io<mailto:vpp-dev-boun...@lists.fd.io>
> [mailto:vpp-dev-boun...@lists.fd.io<mailto:vpp-dev-boun...@lists.fd.io>] On 
> Behalf Of Lukasz Chrustek
> Sent: Friday, March 24, 2017 4:55 AM
> To: vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>
> Subject: [vpp-dev] Building router plugin

> Hi,

> Can You advice what is the proper way for building router plugin now ?

> I'm trying to build this plugin as stated in README, but I get:

> # ./bootstrap.sh

> Saving PATH settings in /git/vpp/build-root/path_setup
> Source this file later, as needed
> Compile native tools
> @@@@ Arch for platform 'native' is native @@@@
> @@@@ Finding source for tools @@@@
> @@@@ Makefile fragment found in
> /git/vpp/build-root/packages/tools.mk<http://tools.mk/> @@@@
> @@@@ Source found in /git/vpp/src @@@@
> @@@@ Configuring tools: nothing to do @@@@
> @@@@ Building tools: nothing to do @@@@
> @@@@ Installing tools: nothing to do @@@@

> # make V=0 PLATFORM=vpp TAG=vpp_debug router-install
> @@@@ Arch for platform 'vpp' is native @@@@
> @@@@ Finding source for vppinfra @@@@
> @@@@ Package vppinfra not found with path /git/vpp @@@@
> Makefile:780: recipe for target 'vppinfra-find-source' failed
> make: *** [vppinfra-find-source] Error 1

> compilation  of  vpp is working fine, but not from /git/vpp/build-root
> but from /git/vpp.

> Regards
> Luk

> _______________________________________________
> vpp-dev mailing list
> vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>
> https://lists.fd.io/mailman/listinfo/vpp-dev



--
Pozdrawiam,
Łukasz Chrustek

_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>
https://lists.fd.io/mailman/listinfo/vpp-dev





--
Pozdrowienia,
Łukasz Chrustek
_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io<mailto:vpp-dev@lists.fd.io>
https://lists.fd.io/mailman/listinfo/vpp-dev

_______________________________________________
vpp-dev mailing list
vpp-dev@lists.fd.io
https://lists.fd.io/mailman/listinfo/vpp-dev

Reply via email to