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