Per-interface, per-address-family fast packet filter
[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 libvnetplugin_la_SOURCES =
20 nobase_include_HEADERS =
21 noinst_PROGRAMS =
22
23 ########################################
24 # Generic stuff
25 ########################################
26 libvnet_la_SOURCES +=                                   \
27   vnet/config.c                                         \
28   vnet/interface.c                                      \
29   vnet/interface_cli.c                                  \
30   vnet/interface_format.c                               \
31   vnet/interface_output.c                               \
32   vnet/misc.c                                           \
33   vnet/replication.c                                    \
34   vnet/rewrite.c                                
35
36 nobase_include_HEADERS +=                       \
37   vnet/api_errno.h                              \
38   vnet/buffer.h                                 \
39   vnet/config.h                                 \
40   vnet/global_funcs.h                           \
41   vnet/interface.h                              \
42   vnet/interface_funcs.h                        \
43   vnet/l3_types.h                               \
44   vnet/pipeline.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_output.c                      \
303  vnet/ipsec/ipsec_input.c                       \
304  vnet/ipsec/ipsec_if.c                          \
305  vnet/ipsec/ipsec_if_in.c                       \
306  vnet/ipsec/ipsec_if_out.c                      \
307  vnet/ipsec/esp_encrypt.c                       \
308  vnet/ipsec/esp_decrypt.c                       \
309  vnet/ipsec/ikev2.c                             \
310  vnet/ipsec/ikev2_crypto.c                      \
311  vnet/ipsec/ikev2_cli.c                         \
312  vnet/ipsec/ikev2_payload.c                     \
313  vnet/ipsec/ikev2_format.c
314 endif 
315
316 nobase_include_HEADERS +=                       \
317  vnet/ipsec/ipsec.h                             \
318  vnet/ipsec/esp.h                               \
319  vnet/ipsec/ikev2.h                             \
320  vnet/ipsec/ikev2_priv.h
321
322 ########################################
323 # Layer 3 protocol: osi
324 ########################################
325 libvnet_la_SOURCES +=                           \
326  vnet/osi/node.c                                \
327  vnet/osi/osi.c                                 \
328  vnet/osi/pg.c
329
330 nobase_include_HEADERS +=                       \
331  vnet/osi/osi.h
332
333 ########################################
334 # Layer 3 protocol: MAP
335 ########################################
336 libvnet_la_SOURCES +=                           \
337  vnet/map/map.c                                 \
338  vnet/map/ip4_map.c                             \
339  vnet/map/ip6_map.c                             \
340  vnet/map/sixrd.c                               \
341  vnet/map/ip4_sixrd.c                           \
342  vnet/map/ip6_sixrd.c                           \
343  vnet/map/ip4_map_t.c                           \
344  vnet/map/ip6_map_t.c
345
346 nobase_include_HEADERS +=                       \
347  vnet/map/map.h                                 \
348  vnet/map/sixrd.h
349
350 ########################################
351 # Tunnel protocol: gre
352 ########################################
353 libvnet_la_SOURCES +=                           \
354  vnet/gre/gre.c                                 \
355  vnet/gre/node.c                                \
356  vnet/gre/interface.c                           \
357  vnet/gre/pg.c
358  
359 nobase_include_HEADERS +=                       \
360  vnet/gre/gre.h                                 \
361  vnet/gre/packet.h                              \
362  vnet/gre/error.def
363
364 ########################################
365 # Tunnel protocol: l2tpv3
366 ########################################
367 libvnet_la_SOURCES +=                           \
368  vnet/l2tp/l2tp.c                               \
369  vnet/l2tp/encap.c                              \
370  vnet/l2tp/decap.c                              \
371  vnet/l2tp/pg.c
372  
373 nobase_include_HEADERS +=                       \
374  vnet/l2tp/l2tp.h                               \
375  vnet/l2tp/packet.h                             
376
377 ########################################
378 # Tunnel protocol: gre+mpls
379 ########################################
380 libvnet_la_SOURCES +=                           \
381  vnet/mpls-gre/mpls.c                           \
382  vnet/mpls-gre/node.c                           \
383  vnet/mpls-gre/interface.c                      \
384  vnet/mpls-gre/policy_encap.c                   \
385  vnet/mpls-gre/pg.c
386  
387 nobase_include_HEADERS +=                       \
388  vnet/mpls-gre/mpls.h                           \
389  vnet/mpls-gre/packet.h                         \
390  vnet/mpls-gre/error.def
391
392
393 ########################################
394 # Tunnel protocol: nsh-gre
395 ########################################
396
397 libvnet_la_SOURCES +=                           \
398  vnet/nsh-gre/nsh_gre.c                         \
399  vnet/nsh-gre/encap.c                           \
400  vnet/nsh-gre/decap.c
401
402 nobase_include_HEADERS +=                       \
403  vnet/nsh-gre/nsh_gre.h                         \
404  vnet/nsh-gre/nsh_gre_packet.h                  \
405  vnet/nsh-gre/nsh_gre_error.def
406
407 ########################################
408 # Tunnel protocol: nsh-vxlan-gpe
409 ########################################
410
411 libvnet_la_SOURCES +=                           \
412  vnet/nsh-vxlan-gpe/nsh_vxlan_gpe.c             \
413  vnet/nsh-vxlan-gpe/encap.c                     \
414  vnet/nsh-vxlan-gpe/decap.c
415
416 nobase_include_HEADERS +=                       \
417  vnet/nsh-vxlan-gpe/nsh_vxlan_gpe.h             \
418  vnet/nsh-vxlan-gpe/vxlan_gpe_packet.h          \
419  vnet/nsh-vxlan-gpe/nsh_vxlan_gpe_error.def
420
421 ########################################
422 # Tunnel protocol: lisp-gpe
423 ########################################
424
425 libvnet_la_SOURCES +=                           \
426  vnet/lisp-gpe/lisp_gpe.c                       \
427  vnet/lisp-gpe/encap.c                          \
428  vnet/lisp-gpe/decap.c
429
430 nobase_include_HEADERS +=                       \
431  vnet/lisp-gpe/lisp_gpe.h                       \
432  vnet/lisp-gpe/lisp_gpe_packet.h                \
433  vnet/lisp-gpe/lisp_gpe_error.def
434
435 ########################################
436 # DHCP client
437 ########################################
438 libvnet_la_SOURCES +=                           \
439  vnet/dhcp/client.c                             \
440  vnet/dhcp/client.h     
441
442 nobase_include_HEADERS +=                       \
443  vnet/dhcp/client.h     
444
445 ########################################
446 # DHCP proxy
447 ########################################
448 libvnet_la_SOURCES +=                           \
449  vnet/dhcp/proxy_node.c                         \
450  vnet/dhcp/proxy.h
451  
452 nobase_include_HEADERS +=                       \
453  vnet/dhcp/packet.h                             \
454  vnet/dhcp/proxy.h                              \
455  vnet/dhcp/proxy_error.def
456
457 ########################################
458 # ipv6 segment routing
459 ########################################
460
461 if WITH_IPV6SR
462 libvnet_la_SOURCES +=                           \
463  vnet/sr/sr.c
464 endif
465  
466 nobase_include_HEADERS +=                       \
467  vnet/sr/sr_packet.h                            \
468  vnet/sr/sr_error.def                           \
469  vnet/sr/sr.h
470
471 ########################################
472 # CGN
473 #########################################
474
475 if WITH_VCGN
476 libvnet_la_SOURCES +=                                           \
477  vnet/vcgn/cnat_bulk_port.c                                     \
478  vnet/vcgn/cnat_config.c                                        \
479  vnet/vcgn/cnat_db_scanner.c                                    \
480  vnet/vcgn/cnat_db_v2.c                                         \
481  vnet/vcgn/cnat_debug_msg_handler.c                             \
482  vnet/vcgn/cnat_cli_handler.c                                   \
483  vnet/vcgn/cnat_global.c                                        \
484  vnet/vcgn/cnat_ipv4_udp_inside_input.c                         \
485  vnet/vcgn/cnat_ipv4_udp_inside_input_exceptions.c              \
486  vnet/vcgn/cnat_ipv4_udp_outside_input.c                        \
487  vnet/vcgn/cnat_ipv4_tcp_inside_input.c                         \
488  vnet/vcgn/cnat_ipv4_tcp_inside_input_exceptions.c              \
489  vnet/vcgn/cnat_ipv4_tcp_outside_input.c                        \
490  vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c                  \
491  vnet/vcgn/cnat_ipv4_icmp_query_inside_input_exception.c        \
492  vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c                 \
493  vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c                  \
494  vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c                 \
495  vnet/vcgn/cnat_logging.c                                       \
496  vnet/vcgn/cnat_ports.c                                         \
497  vnet/vcgn/cnat_util.c                                          \
498  vnet/vcgn/cnat_show.c                                          \
499  vnet/vcgn/cnat_syslog.c                                        \
500  vnet/vcgn/cnat_v4_functions.c                                  \
501  vnet/vcgn/index_list.c                                         \
502  vnet/vcgn/spp_platform_trace_log.c                             \
503  vnet/vcgn/vcgn_classify.c
504 endif
505
506 ########################################
507 # DHCPv6 proxy
508 ########################################
509 libvnet_la_SOURCES +=                           \
510  vnet/dhcpv6/proxy_node.c
511  
512 nobase_include_HEADERS +=                       \
513  vnet/dhcpv6/packet.h                           \
514  vnet/dhcpv6/proxy.h                            \
515  vnet/dhcpv6/proxy_error.def
516
517 ########################################
518 # IPFIX / netflow v10 
519 ########################################
520 libvnet_la_SOURCES +=                           \
521  vnet/flow/flow_report.c
522
523 nobase_include_HEADERS +=                       \
524  vnet/flow/flow_report.h                        \
525  vnet/flow/ipfix_info_elements.h                \
526  vnet/flow/ipfix_packet.h
527
528 ########################################
529 # IPFIX sample code
530 ########################################
531
532 libvnet_la_SOURCES +=                           \
533   vnet/flow/flow_report_sample.c
534
535 nobase_include_HEADERS +=                       \
536   vnet/flow/flow_report_sample.h
537
538 ########################################
539 # lawful intercept
540 ########################################
541
542 libvnet_la_SOURCES +=                           \
543   vnet/lawful-intercept/lawful_intercept.c      \
544   vnet/lawful-intercept/node.c
545
546 nobase_include_HEADERS +=                       \
547   vnet/dpdk_replication.h                       \
548   vnet/lawful-intercept/lawful_intercept.h
549
550 ########################################
551 # Packet generator
552 ########################################
553
554 libvnet_la_SOURCES +=                           \
555   vnet/pg/cli.c                                 \
556   vnet/pg/edit.c                                \
557   vnet/pg/init.c                                \
558   vnet/pg/input.c                               \
559   vnet/pg/output.c                              \
560   vnet/pg/stream.c
561
562 nobase_include_HEADERS +=                       \
563   vnet/pg/pg.h                                  \
564   vnet/pg/edit.h
565
566 ########################################
567 # Intel DPDK
568 ########################################
569 if WITH_DPDK
570 libvnet_la_SOURCES +=                           \
571   vnet/devices/dpdk/dpdk_priv.h         \
572   vnet/devices/dpdk/device.c            \
573   vnet/devices/dpdk/init.c                      \
574   vnet/devices/dpdk/node.c                      \
575   vnet/devices/dpdk/threads.c       \
576   vnet/devices/dpdk/vhost_user.c    \
577   vnet/devices/dpdk/cli.c
578
579 nobase_include_HEADERS +=                       \
580   vnet/devices/dpdk/dpdk.h                      \
581   vnet/devices/dpdk/threads.h
582 endif
583
584 ########################################
585 # virtio
586 ########################################
587
588 if WITH_DPDK
589 libvnet_la_SOURCES +=       \
590   vnet/devices/virtio/vhost-user.c
591
592 nobase_include_HEADERS +=     \
593   vnet/devices/virtio/vhost-user.h
594 endif WITH_DPDK
595
596 ########################################
597 # ssvm ethernet
598 ########################################
599 libvnet_la_SOURCES +=                           \
600   vnet/devices/ssvm/ssvm_eth.c                  \
601   vnet/devices/ssvm/node.c
602
603 nobase_include_HEADERS +=                       \
604   vnet/devices/ssvm/ssvm_eth.h
605
606 ########################################
607 # Unix kernel related
608 ########################################
609
610 # FIXME: vnet/unix/hgshm.c 
611
612 libvnet_la_SOURCES +=                           \
613   vnet/unix/gdb_funcs.c                         \
614   vnet/unix/pcap.c                              \
615   vnet/unix/tapcli.c                            \
616   vnet/unix/tuntap.c
617
618 nobase_include_HEADERS +=                       \
619   vnet/unix/pcap.h                              \
620   vnet/unix/tuntap.h                            \
621   vnet/unix/tapcli.h
622
623 ########################################
624 # Plugin client library
625 ########################################
626
627 libvnetplugin_la_SOURCES +=                     \
628   vnet/plugin/p1.c
629
630 nobase_include_HEADERS +=                       \
631   vnet/plugin/plugin.h
632
633 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
634
635 dpdk_libs = 
636
637 if WITH_DPDK
638 dpdk_libs += -l:libdpdk.a
639 endif
640
641 pcap2pg_SOURCES =                               \
642   vnet/unix/pcap2pg.c                           \
643   vnet/unix/pcap.h
644
645 pcap2pg_LDFLAGS = -static
646 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
647
648 noinst_PROGRAMS += pcap2pg