VPP-39 - refactoring of NSH into own folder
[vpp.git] / vnet / Makefile.am
index c0115eb..9393c1a 100644 (file)
@@ -19,6 +19,7 @@ libvnet_la_SOURCES =
 libvnetplugin_la_SOURCES =
 nobase_include_HEADERS =
 noinst_PROGRAMS =
+TESTS =
 
 ########################################
 # Generic stuff
@@ -81,7 +82,6 @@ nobase_include_HEADERS +=                     \
 ########################################
 libvnet_la_SOURCES +=                          \
  vnet/ethernet/arp.c                           \
- vnet/ethernet/cli.c                           \
  vnet/ethernet/format.c                                \
  vnet/ethernet/init.c                          \
  vnet/ethernet/interface.c                     \
@@ -114,6 +114,7 @@ libvnet_la_SOURCES +=                               \
  vnet/l2/l2_output_acl.c                       \
  vnet/l2/l2_output.c                           \
  vnet/l2/l2_patch.c                            \
+ vnet/l2/l2_rw.c                                \
  vnet/l2/l2_vtr.c                              \
  vnet/l2/l2_xcrw.c
 
@@ -129,6 +130,7 @@ nobase_include_HEADERS +=                   \
  vnet/l2/l2_bvi.h                              \
  vnet/l2/l2_flood.h                            \
  vnet/l2/l2_fib.h                              \
+ vnet/l2/l2_rw.h                                \
  vnet/l2/l2_xcrw.h                             \
  vnet/l2/l2_classify.h
 
@@ -238,6 +240,7 @@ nobase_include_HEADERS +=                   \
 # Layer 3 protocol: IP v4/v6
 ########################################
 libvnet_la_SOURCES +=                          \
+ vnet/ip/adj_alloc.c                           \
  vnet/ip/format.c                              \
  vnet/ip/icmp4.c                               \
  vnet/ip/icmp6.c                               \
@@ -267,6 +270,7 @@ libvnet_la_SOURCES +=                               \
  vnet/ip/ip_frag.c
 
 nobase_include_HEADERS +=                      \
+ vnet/ip/adj_alloc.h                           \
  vnet/ip/format.h                              \
  vnet/ip/icmp46_packet.h                       \
  vnet/ip/icmp4.h                               \
@@ -392,6 +396,15 @@ nobase_include_HEADERS +=                  \
  vnet/mpls-gre/error.def
 
 
+########################################
+# NSH Map: nsh
+########################################
+
+nobase_include_HEADERS +=                      \
+ vnet/nsh/nsh_packet.h                         \
+ vnet/nsh/nsh_error.def
+
+
 ########################################
 # Tunnel protocol: nsh-gre
 ########################################
@@ -402,9 +415,7 @@ libvnet_la_SOURCES +=                               \
  vnet/nsh-gre/decap.c
 
 nobase_include_HEADERS +=                      \
- vnet/nsh-gre/nsh_gre.h                                \
- vnet/nsh-gre/nsh_gre_packet.h                 \
- vnet/nsh-gre/nsh_gre_error.def
+ vnet/nsh-gre/nsh_gre.h                                
 
 ########################################
 # Tunnel protocol: nsh-vxlan-gpe
@@ -420,19 +431,80 @@ nobase_include_HEADERS +=                 \
  vnet/nsh-vxlan-gpe/vxlan_gpe_packet.h         \
  vnet/nsh-vxlan-gpe/nsh_vxlan_gpe_error.def
 
+########################################
+# LISP control plane: lisp-cp
+########################################
+
+libvnet_la_SOURCES +=                          \
+ vnet/lisp-cp/lisp_types.c                     \
+ vnet/lisp-cp/control.c                                \
+ vnet/lisp-cp/gid_dictionary.c                 \
+ vnet/lisp-cp/lisp_msg_serdes.c                        \
+ vnet/lisp-cp/packets.c                        
+
+nobase_include_HEADERS +=                      \
+ vnet/lisp-cp/lisp_types.h                     \
+ vnet/lisp-cp/packets.h                                \
+ vnet/lisp-cp/gid_dictionary.h                 \
+ vnet/lisp-cp/lisp_cp_messages.h               \
+ vnet/lisp-cp/lisp_msg_serdes.h                        \
+ vnet/lisp-cp/control.h                                
+
+
+if ENABLE_TESTS
+LDS = -lvppinfra -l:libvlib.a -l:libdpdk.a -l:libvlibmemory.a \
+       -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
+
+TESTS += test_cp_serdes test_lisp_types
+
+test_cp_serdes_SOURCES =                       \
+ test/lisp-cp/test_cp_serdes.c         \
+ vnet/lisp-cp/lisp_msg_serdes.c                        \
+ vnet/lisp-cp/lisp_types.c                     \
+ vnet/lisp-cp/packets.c                                \
+ vnet/ip/ip_checksum.c
+
+test_lisp_types_SOURCES =                      \
+ test/lisp-cp/test_lisp_types.c                \
+ vnet/lisp-cp/lisp_types.c
+
+test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
+test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
+
+test_cp_serdes_LDADD = libvnet.la $(LDS)
+test_lisp_types_LDADD = libvnet.la $(LDS)
+
+test_cp_serdes_LDFLAGS = -static
+test_lisp_types_LDFLAGS = -static
+endif
+
 ########################################
 # Tunnel protocol: lisp-gpe
 ########################################
 
 libvnet_la_SOURCES +=                          \
  vnet/lisp-gpe/lisp_gpe.c                      \
- vnet/lisp-gpe/encap.c                         \
- vnet/lisp-gpe/decap.c
+ vnet/lisp-gpe/interface.c                     \
+ vnet/lisp-gpe/ip_forward.c                    \
+ vnet/lisp-gpe/decap.c                         
 
 nobase_include_HEADERS +=                      \
  vnet/lisp-gpe/lisp_gpe.h                      \
  vnet/lisp-gpe/lisp_gpe_packet.h               \
- vnet/lisp-gpe/lisp_gpe_error.def
+ vnet/lisp-gpe/lisp_gpe_error.def              
+
+if ENABLE_TESTS
+TESTS += test_test
+
+test_test_SOURCES = test/lisp-gpe/test.c
+
+test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
+
+test_test_LDADD = $(LIBOBJS)
+
+noinst_PROGRAMS += $(TESTS)
+check_PROGRAMS = $(TESTS)
+endif
 
 ########################################
 # DHCP client
@@ -462,7 +534,8 @@ nobase_include_HEADERS +=                   \
 
 if WITH_IPV6SR
 libvnet_la_SOURCES +=                          \
- vnet/sr/sr.c
+ vnet/sr/sr.c                                  \
+ vnet/sr/sr_replicate.c
 endif
  
 nobase_include_HEADERS +=                      \
@@ -619,6 +692,20 @@ libvnet_la_SOURCES +=                              \
 nobase_include_HEADERS +=                      \
   vnet/devices/af_packet/af_packet.h
 
+########################################
+# NETMAP interface
+########################################
+
+libvnet_la_SOURCES +=                          \
+  vnet/devices/netmap/netmap.c                 \
+  vnet/devices/netmap/device.c                 \
+  vnet/devices/netmap/node.c                   \
+  vnet/devices/netmap/cli.c
+
+nobase_include_HEADERS +=                      \
+  vnet/devices/netmap/netmap.h
+
+
 ########################################
 # Unix kernel related
 ########################################
@@ -662,3 +749,5 @@ pcap2pg_LDFLAGS = -static
 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
 
 noinst_PROGRAMS += pcap2pg
+
+