Add support for native vpp_lite (non-dpdk) platform
[vpp.git] / vnet / Makefile.am
1 # Copyright (c) 2015 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 AUTOMAKE_OPTIONS = foreign subdir-objects
15
16 AM_CFLAGS = -Wall @DPDK@ @VIRL@ @IPSEC@ @VCGN@ @IPV6SR@
17
18 libvnet_la_SOURCES =
19 nobase_include_HEADERS =
20 noinst_PROGRAMS =
21
22 ########################################
23 # Generic stuff
24 ########################################
25 libvnet_la_SOURCES +=                                   \
26   vnet/config.c                                         \
27   vnet/interface.c                                      \
28   vnet/interface_cli.c                                  \
29   vnet/interface_format.c                               \
30   vnet/interface_output.c                               \
31   vnet/misc.c                                           \
32   vnet/replication.c                                    \
33   vnet/rewrite.c                                
34
35 nobase_include_HEADERS +=                       \
36   vnet/api_errno.h                              \
37   vnet/buffer.h                                 \
38   vnet/config.h                                 \
39   vnet/global_funcs.h                           \
40   vnet/interface.h                              \
41   vnet/interface_funcs.h                        \
42   vnet/l3_types.h                               \
43   vnet/pipeline.h                               \
44   vnet/plugin/plugin.h                          \
45   vnet/replication.h                            \
46   vnet/rewrite.h                                \
47   vnet/vnet.h
48
49 ########################################
50 # Policer infra
51 ########################################
52
53 libvnet_la_SOURCES +=                           \
54   vnet/policer/node_funcs.c                     \
55   vnet/policer/policer.c                        \
56   vnet/policer/xlate.c
57
58 nobase_include_HEADERS +=                       \
59   vnet/policer/police.h                         \
60   vnet/policer/xlate.h
61
62 ########################################
63 # Cop - junk filter
64 ########################################
65
66 libvnet_la_SOURCES +=                           \
67   vnet/cop/cop.c                                \
68   vnet/cop/node1.c                              \
69   vnet/cop/ip4_whitelist.c                      \
70   vnet/cop/ip6_whitelist.c      
71
72 nobase_include_HEADERS +=                       \
73   vnet/cop/cop.h
74
75 ########################################
76 # Layer 2 protocols go here
77 ########################################
78
79 ########################################
80 # Layer 2 protocol: Ethernet
81 ########################################
82 libvnet_la_SOURCES +=                           \
83  vnet/ethernet/arp.c                            \
84  vnet/ethernet/cli.c                            \
85  vnet/ethernet/format.c                         \
86  vnet/ethernet/init.c                           \
87  vnet/ethernet/interface.c                      \
88  vnet/ethernet/node.c                           \
89  vnet/ethernet/pg.c
90
91 nobase_include_HEADERS +=                       \
92  vnet/ethernet/arp_packet.h                     \
93  vnet/ethernet/error.def                        \
94  vnet/ethernet/ethernet.h                       \
95  vnet/ethernet/packet.h                         \
96  vnet/ethernet/types.def
97
98 ########################################
99 # Layer 2 protocol: Ethernet bridging
100 ########################################
101 libvnet_la_SOURCES +=                           \
102  vnet/l2/feat_bitmap.c                          \
103  vnet/l2/l2_bd.c                                \
104  vnet/l2/l2_bvi.c                               \
105  vnet/l2/l2_classify.c                          \
106  vnet/l2/l2_efp_filter.c                        \
107  vnet/l2/l2_fib.c                               \
108  vnet/l2/l2_flood.c                             \
109  vnet/l2/l2_fwd.c                               \
110  vnet/l2/l2_input_acl.c                         \
111  vnet/l2/l2_input.c                             \
112  vnet/l2/l2_input_vtr.c                         \
113  vnet/l2/l2_learn.c                             \
114  vnet/l2/l2_output_acl.c                        \
115  vnet/l2/l2_output.c                            \
116  vnet/l2/l2_patch.c                             \
117  vnet/l2/l2_vtr.c                               \
118  vnet/l2/l2_xcrw.c
119
120 nobase_include_HEADERS +=                       \
121  vnet/l2/feat_bitmap.h                          \
122  vnet/l2/l2_input.h                             \
123  vnet/l2/l2_output.h                            \
124  vnet/l2/l2_vtr.h                               \
125  vnet/l2/l2_input_vtr.h                         \
126  vnet/l2/l2_efp_filter.h                        \
127  vnet/l2/l2_fwd.h                               \
128  vnet/l2/l2_bd.h                                \
129  vnet/l2/l2_bvi.h                               \
130  vnet/l2/l2_flood.h                             \
131  vnet/l2/l2_fib.h                               \
132  vnet/l2/l2_xcrw.h                              \
133  vnet/l2/l2_classify.h
134
135 ########################################
136 # Layer 2 protocol: SRP
137 ########################################
138 libvnet_la_SOURCES +=                           \
139  vnet/srp/format.c                              \
140  vnet/srp/interface.c                           \
141  vnet/srp/node.c                                \
142  vnet/srp/pg.c
143
144 nobase_include_HEADERS +=                       \
145  vnet/srp/packet.h                              \
146  vnet/srp/srp.h
147
148 ########################################
149 # Layer 2 protocol: PPP
150 ########################################
151 libvnet_la_SOURCES +=                           \
152   vnet/ppp/node.c                               \
153   vnet/ppp/pg.c                                 \
154   vnet/ppp/ppp.c
155
156 nobase_include_HEADERS +=                       \
157  vnet/ppp/error.def                             \
158  vnet/ppp/ppp.h                                 \
159  vnet/ppp/packet.h
160
161 ########################################
162 # Layer 2 protocol: HDLC
163 ########################################
164 libvnet_la_SOURCES +=                           \
165   vnet/hdlc/node.c                              \
166   vnet/hdlc/pg.c                                \
167   vnet/hdlc/hdlc.c
168
169 nobase_include_HEADERS +=                       \
170  vnet/hdlc/error.def                            \
171  vnet/hdlc/hdlc.h                               \
172  vnet/hdlc/packet.h
173
174 ########################################
175 # Layer 2 protocol: LLC
176 ########################################
177 libvnet_la_SOURCES +=                           \
178   vnet/llc/llc.c                                \
179   vnet/llc/node.c                               \
180   vnet/llc/pg.c
181
182 nobase_include_HEADERS +=                       \
183  vnet/llc/llc.h
184
185 ########################################
186 # Layer 2 protocol: SNAP
187 ########################################
188 libvnet_la_SOURCES +=                           \
189   vnet/snap/snap.c                              \
190   vnet/snap/node.c                              \
191   vnet/snap/pg.c
192
193 nobase_include_HEADERS +=                       \
194  vnet/snap/snap.h
195
196 ########################################
197 # Layer 2 / vxlan
198 ########################################
199 libvnet_la_SOURCES +=                           \
200   vnet/vxlan/vxlan.c                            \
201   vnet/vxlan/encap.c                            \
202   vnet/vxlan/decap.c    
203
204 nobase_include_HEADERS +=                       \
205   vnet/vxlan/vxlan.h                            \
206   vnet/vxlan/vxlan_packet.h                     \
207   vnet/vxlan/vxlan_error.def
208
209 ########################################
210 # Layer 2 / CDP
211 ########################################
212 libvnet_la_SOURCES +=                           \
213   vnet/cdp/cdp_input.c                          \
214   vnet/cdp/cdp_node.c                           \
215   vnet/cdp/cdp_periodic.c       
216
217 nobase_include_HEADERS +=                       \
218   vnet/cdp/cdp_protocol.h
219
220 ########################################
221 # Layer 2/3 "classify"
222 ########################################
223 libvnet_la_SOURCES +=                           \
224   vnet/classify/vnet_classify.c                 \
225   vnet/classify/ip_classify.c                   \
226   vnet/classify/input_acl.c                     \
227   vnet/classify/vnet_classify.h
228
229 nobase_include_HEADERS +=                       \
230   vnet/classify/vnet_classify.h                 \
231   vnet/classify/input_acl.h
232
233 ########################################
234 # Layer 3 protocols go here
235 ########################################
236
237 ########################################
238 # Layer 3 protocol: IP v4/v6
239 ########################################
240 libvnet_la_SOURCES +=                           \
241  vnet/ip/format.c                               \
242  vnet/ip/icmp4.c                                \
243  vnet/ip/icmp6.c                                \
244  vnet/ip/ip46_cli.c                             \
245  vnet/ip/ip4_format.c                           \
246  vnet/ip/ip4_forward.c                          \
247  vnet/ip/ip4_hop_by_hop.c                       \
248  vnet/ip/ip4_input.c                            \
249  vnet/ip/ip4_mtrie.c                            \
250  vnet/ip/ip4_pg.c                               \
251  vnet/ip/ip4_source_check.c                     \
252  vnet/ip/ip6_format.c                           \
253  vnet/ip/ip6_forward.c                          \
254  vnet/ip/ip6_hop_by_hop.c                       \
255  vnet/ip/ip6_input.c                            \
256  vnet/ip/ip6_neighbor.c                         \
257  vnet/ip/ip6_pg.c                               \
258  vnet/ip/ip_checksum.c                          \
259  vnet/ip/ip.h                                   \
260  vnet/ip/ip_init.c                              \
261  vnet/ip/lookup.c                               \
262  vnet/ip/udp_format.c                           \
263  vnet/ip/udp_init.c                             \
264  vnet/ip/udp_local.c                            \
265  vnet/ip/udp_pg.c                               \
266  vnet/ip/ip_input_acl.c                         \
267  vnet/ip/ip_frag.c
268
269 nobase_include_HEADERS +=                       \
270  vnet/ip/format.h                               \
271  vnet/ip/icmp46_packet.h                        \
272  vnet/ip/icmp4.h                                \
273  vnet/ip/icmp6.h                                \
274  vnet/ip/igmp_packet.h                          \
275  vnet/ip/ip.h                                   \
276  vnet/ip/ip4.h                                  \
277  vnet/ip/ip4_mtrie.h                            \
278  vnet/ip/ip4_error.h                            \
279  vnet/ip/ip4_packet.h                           \
280  vnet/ip/ip6.h                                  \
281  vnet/ip/ip6_error.h                            \
282  vnet/ip/ip6_hop_by_hop.h                       \
283  vnet/ip/ip6_hop_by_hop_packet.h                \
284  vnet/ip/ip6_packet.h                           \
285  vnet/ip/lookup.h                               \
286  vnet/ip/ip_packet.h                            \
287  vnet/ip/ports.def                              \
288  vnet/ip/protocols.def                          \
289  vnet/ip/tcp_packet.h                           \
290  vnet/ip/udp.h                                  \
291  vnet/ip/udp_error.def                          \
292  vnet/ip/udp_packet.h
293
294 ########################################
295 # Layer 3 protocol: IPSec
296 ########################################
297 if WITH_IPSEC
298 libvnet_la_SOURCES +=                           \
299  vnet/ipsec/ipsec.c                             \
300  vnet/ipsec/ipsec_cli.c                         \
301  vnet/ipsec/ipsec_format.c                      \
302  vnet/ipsec/ipsec_input.c                       \
303  vnet/ipsec/ipsec_if.c                          \
304  vnet/ipsec/ipsec_if_in.c                       \
305  vnet/ipsec/ipsec_if_out.c                      \
306  vnet/ipsec/esp_encrypt.c                       \
307  vnet/ipsec/esp_decrypt.c                       \
308  vnet/ipsec/ikev2.c                             \
309  vnet/ipsec/ikev2_crypto.c                      \
310  vnet/ipsec/ikev2_cli.c                         \
311  vnet/ipsec/ikev2_payload.c                     \
312  vnet/ipsec/ikev2_format.c
313 endif 
314
315 libvnet_la_SOURCES +=                           \
316  vnet/ipsec/ipsec_output.c
317
318 nobase_include_HEADERS +=                       \
319  vnet/ipsec/ipsec.h                             \
320  vnet/ipsec/esp.h                               \
321  vnet/ipsec/ikev2.h                             \
322  vnet/ipsec/ikev2_priv.h
323
324 ########################################
325 # Layer 3 protocol: osi
326 ########################################
327 libvnet_la_SOURCES +=                           \
328  vnet/osi/node.c                                \
329  vnet/osi/osi.c                                 \
330  vnet/osi/pg.c
331
332 nobase_include_HEADERS +=                       \
333  vnet/osi/osi.h
334
335 ########################################
336 # Layer 3 protocol: MAP
337 ########################################
338 libvnet_la_SOURCES +=                           \
339  vnet/map/map.c                                 \
340  vnet/map/ip4_map.c                             \
341  vnet/map/ip6_map.c                             \
342  vnet/map/sixrd.c                               \
343  vnet/map/ip4_sixrd.c                           \
344  vnet/map/ip6_sixrd.c                           \
345  vnet/map/ip4_map_t.c                           \
346  vnet/map/ip6_map_t.c
347
348 nobase_include_HEADERS +=                       \
349  vnet/map/map.h                                 \
350  vnet/map/sixrd.h
351
352 ########################################
353 # Tunnel protocol: gre
354 ########################################
355 libvnet_la_SOURCES +=                           \
356  vnet/gre/gre.c                                 \
357  vnet/gre/node.c                                \
358  vnet/gre/interface.c                           \
359  vnet/gre/pg.c
360  
361 nobase_include_HEADERS +=                       \
362  vnet/gre/gre.h                                 \
363  vnet/gre/packet.h                              \
364  vnet/gre/error.def
365
366 ########################################
367 # Tunnel protocol: l2tpv3
368 ########################################
369 libvnet_la_SOURCES +=                           \
370  vnet/l2tp/l2tp.c                               \
371  vnet/l2tp/encap.c                              \
372  vnet/l2tp/decap.c                              \
373  vnet/l2tp/pg.c
374  
375 nobase_include_HEADERS +=                       \
376  vnet/l2tp/l2tp.h                               \
377  vnet/l2tp/packet.h                             
378
379 ########################################
380 # Tunnel protocol: gre+mpls
381 ########################################
382 libvnet_la_SOURCES +=                           \
383  vnet/mpls-gre/mpls.c                           \
384  vnet/mpls-gre/node.c                           \
385  vnet/mpls-gre/interface.c                      \
386  vnet/mpls-gre/policy_encap.c                   \
387  vnet/mpls-gre/pg.c
388  
389 nobase_include_HEADERS +=                       \
390  vnet/mpls-gre/mpls.h                           \
391  vnet/mpls-gre/packet.h                         \
392  vnet/mpls-gre/error.def
393
394
395 ########################################
396 # Tunnel protocol: nsh-gre
397 ########################################
398
399 libvnet_la_SOURCES +=                           \
400  vnet/nsh-gre/nsh_gre.c                         \
401  vnet/nsh-gre/encap.c                           \
402  vnet/nsh-gre/decap.c
403
404 nobase_include_HEADERS +=                       \
405  vnet/nsh-gre/nsh_gre.h                         \
406  vnet/nsh-gre/nsh_gre_packet.h                  \
407  vnet/nsh-gre/nsh_gre_error.def
408
409 ########################################
410 # Tunnel protocol: nsh-vxlan-gpe
411 ########################################
412
413 libvnet_la_SOURCES +=                           \
414  vnet/nsh-vxlan-gpe/nsh_vxlan_gpe.c             \
415  vnet/nsh-vxlan-gpe/encap.c                     \
416  vnet/nsh-vxlan-gpe/decap.c
417
418 nobase_include_HEADERS +=                       \
419  vnet/nsh-vxlan-gpe/nsh_vxlan_gpe.h             \
420  vnet/nsh-vxlan-gpe/vxlan_gpe_packet.h          \
421  vnet/nsh-vxlan-gpe/nsh_vxlan_gpe_error.def
422
423 ########################################
424 # Tunnel protocol: lisp-gpe
425 ########################################
426
427 libvnet_la_SOURCES +=                           \
428  vnet/lisp-gpe/lisp_gpe.c                       \
429  vnet/lisp-gpe/encap.c                          \
430  vnet/lisp-gpe/decap.c
431
432 nobase_include_HEADERS +=                       \
433  vnet/lisp-gpe/lisp_gpe.h                       \
434  vnet/lisp-gpe/lisp_gpe_packet.h                \
435  vnet/lisp-gpe/lisp_gpe_error.def
436
437 ########################################
438 # DHCP client
439 ########################################
440 libvnet_la_SOURCES +=                           \
441  vnet/dhcp/client.c                             \
442  vnet/dhcp/client.h     
443
444 nobase_include_HEADERS +=                       \
445  vnet/dhcp/client.h     
446
447 ########################################
448 # DHCP proxy
449 ########################################
450 libvnet_la_SOURCES +=                           \
451  vnet/dhcp/proxy_node.c                         \
452  vnet/dhcp/proxy.h
453  
454 nobase_include_HEADERS +=                       \
455  vnet/dhcp/packet.h                             \
456  vnet/dhcp/proxy.h                              \
457  vnet/dhcp/proxy_error.def
458
459 ########################################
460 # ipv6 segment routing
461 ########################################
462
463 if WITH_IPV6SR
464 libvnet_la_SOURCES +=                           \
465  vnet/sr/sr.c
466 endif
467  
468 nobase_include_HEADERS +=                       \
469  vnet/sr/sr_packet.h                            \
470  vnet/sr/sr_error.def                           \
471  vnet/sr/sr.h
472
473 ########################################
474 # CGN
475 #########################################
476
477 if WITH_VCGN
478 libvnet_la_SOURCES +=                                           \
479  vnet/vcgn/cnat_bulk_port.c                                     \
480  vnet/vcgn/cnat_config.c                                        \
481  vnet/vcgn/cnat_db_scanner.c                                    \
482  vnet/vcgn/cnat_db_v2.c                                         \
483  vnet/vcgn/cnat_debug_msg_handler.c                             \
484  vnet/vcgn/cnat_cli_handler.c                                   \
485  vnet/vcgn/cnat_global.c                                        \
486  vnet/vcgn/cnat_ipv4_udp_inside_input.c                         \
487  vnet/vcgn/cnat_ipv4_udp_inside_input_exceptions.c              \
488  vnet/vcgn/cnat_ipv4_udp_outside_input.c                        \
489  vnet/vcgn/cnat_ipv4_tcp_inside_input.c                         \
490  vnet/vcgn/cnat_ipv4_tcp_inside_input_exceptions.c              \
491  vnet/vcgn/cnat_ipv4_tcp_outside_input.c                        \
492  vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c                  \
493  vnet/vcgn/cnat_ipv4_icmp_query_inside_input_exception.c        \
494  vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c                 \
495  vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c                  \
496  vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c                 \
497  vnet/vcgn/cnat_logging.c                                       \
498  vnet/vcgn/cnat_ports.c                                         \
499  vnet/vcgn/cnat_util.c                                          \
500  vnet/vcgn/cnat_show.c                                          \
501  vnet/vcgn/cnat_syslog.c                                        \
502  vnet/vcgn/cnat_v4_functions.c                                  \
503  vnet/vcgn/index_list.c                                         \
504  vnet/vcgn/spp_platform_trace_log.c                             \
505  vnet/vcgn/vcgn_classify.c
506 endif
507
508 ########################################
509 # DHCPv6 proxy
510 ########################################
511 libvnet_la_SOURCES +=                           \
512  vnet/dhcpv6/proxy_node.c
513  
514 nobase_include_HEADERS +=                       \
515  vnet/dhcpv6/packet.h                           \
516  vnet/dhcpv6/proxy.h                            \
517  vnet/dhcpv6/proxy_error.def
518
519 ########################################
520 # IPFIX / netflow v10 
521 ########################################
522 libvnet_la_SOURCES +=                           \
523  vnet/flow/flow_report.c
524
525 nobase_include_HEADERS +=                       \
526  vnet/flow/flow_report.h                        \
527  vnet/flow/ipfix_info_elements.h                \
528  vnet/flow/ipfix_packet.h
529
530 ########################################
531 # IPFIX sample code
532 ########################################
533
534 libvnet_la_SOURCES +=                           \
535   vnet/flow/flow_report_sample.c
536
537 nobase_include_HEADERS +=                       \
538   vnet/flow/flow_report_sample.h
539
540 ########################################
541 # lawful intercept
542 ########################################
543
544 libvnet_la_SOURCES +=                           \
545   vnet/lawful-intercept/lawful_intercept.c      \
546   vnet/lawful-intercept/node.c
547
548 nobase_include_HEADERS +=                       \
549   vnet/dpdk_replication.h                       \
550   vnet/lawful-intercept/lawful_intercept.h
551
552 ########################################
553 # Packet generator
554 ########################################
555
556 libvnet_la_SOURCES +=                           \
557   vnet/pg/cli.c                                 \
558   vnet/pg/edit.c                                \
559   vnet/pg/init.c                                \
560   vnet/pg/input.c                               \
561   vnet/pg/output.c                              \
562   vnet/pg/stream.c
563
564 nobase_include_HEADERS +=                       \
565   vnet/pg/pg.h                                  \
566   vnet/pg/edit.h
567
568 ########################################
569 # Intel DPDK
570 ########################################
571 if WITH_DPDK
572 libvnet_la_SOURCES +=                           \
573   vnet/devices/dpdk/dpdk_priv.h         \
574   vnet/devices/dpdk/device.c            \
575   vnet/devices/dpdk/format.c            \
576   vnet/devices/dpdk/init.c                      \
577   vnet/devices/dpdk/node.c                      \
578   vnet/devices/dpdk/threads.c       \
579   vnet/devices/dpdk/vhost_user.c    \
580   vnet/devices/dpdk/cli.c
581
582 nobase_include_HEADERS +=                       \
583   vnet/devices/dpdk/dpdk.h                      \
584   vnet/devices/dpdk/threads.h
585 endif
586
587 ########################################
588 # virtio
589 ########################################
590
591 if WITH_DPDK
592 libvnet_la_SOURCES +=       \
593   vnet/devices/virtio/vhost-user.c
594
595 nobase_include_HEADERS +=     \
596   vnet/devices/virtio/vhost-user.h
597 endif WITH_DPDK
598
599 ########################################
600 # ssvm ethernet
601 ########################################
602 libvnet_la_SOURCES +=                           \
603   vnet/devices/ssvm/ssvm_eth.c                  \
604   vnet/devices/ssvm/node.c
605
606 nobase_include_HEADERS +=                       \
607   vnet/devices/ssvm/ssvm_eth.h
608
609 ########################################
610 # Unix kernel related
611 ########################################
612
613 # FIXME: vnet/unix/hgshm.c 
614
615 libvnet_la_SOURCES +=                           \
616   vnet/unix/gdb_funcs.c                         \
617   vnet/unix/pcap.c                              \
618   vnet/unix/tapcli.c                            \
619   vnet/unix/tuntap.c
620
621 nobase_include_HEADERS +=                       \
622   vnet/unix/pcap.h                              \
623   vnet/unix/tuntap.h                            \
624   vnet/unix/tapcli.h
625
626 lib_LTLIBRARIES = libvnet.la 
627
628 dpdk_libs = 
629
630 if WITH_DPDK
631 dpdk_libs += -l:libdpdk.a
632 endif
633
634 pcap2pg_SOURCES =                               \
635   vnet/unix/pcap2pg.c                           \
636   vnet/unix/pcap.h
637
638 pcap2pg_LDFLAGS = -static
639 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
640
641 noinst_PROGRAMS += pcap2pg