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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 AUTOMAKE_OPTIONS = foreign subdir-objects
16 AM_CFLAGS = -Wall -Werror @DPDK@ @DPDK_CRYPTO@ @IPSEC@ @IPV6SR@
18 BUILT_SOURCES = vnet/interface.api.h vnet/interface.api.json vnet/l2/l2.api.h \
22 libvnetplugin_la_SOURCES =
23 nobase_include_HEADERS =
29 dpdk_libs += -l:libdpdk.a
32 ########################################
34 ########################################
35 libvnet_la_SOURCES += \
37 vnet/devices/devices.c \
40 vnet/interface_api.c \
41 vnet/interface_cli.c \
42 vnet/interface_format.c \
43 vnet/interface_output.c \
48 nobase_include_HEADERS += \
52 vnet/devices/devices.h \
56 vnet/interface.api.h \
57 vnet/interface_funcs.h \
63 vnet/vnet_all_api_h.h \
66 ########################################
68 ########################################
70 libvnet_la_SOURCES += \
71 vnet/policer/node_funcs.c \
72 vnet/policer/policer.c \
75 nobase_include_HEADERS += \
76 vnet/policer/police.h \
77 vnet/policer/policer.h \
80 ########################################
82 ########################################
84 libvnet_la_SOURCES += \
87 vnet/cop/ip4_whitelist.c \
88 vnet/cop/ip6_whitelist.c
90 nobase_include_HEADERS += \
93 ########################################
94 # Layer 2 protocols go here
95 ########################################
97 ########################################
98 # Layer 2 protocol: Ethernet
99 ########################################
100 libvnet_la_SOURCES += \
101 vnet/ethernet/arp.c \
102 vnet/ethernet/format.c \
103 vnet/ethernet/init.c \
104 vnet/ethernet/interface.c \
105 vnet/ethernet/node.c \
108 nobase_include_HEADERS += \
109 vnet/ethernet/arp_packet.h \
110 vnet/ethernet/error.def \
111 vnet/ethernet/ethernet.h \
112 vnet/ethernet/packet.h \
113 vnet/ethernet/types.def
115 ########################################
116 # Layer 2 protocol: Ethernet bridging
117 ########################################
118 libvnet_la_SOURCES += \
119 vnet/l2/feat_bitmap.c \
123 vnet/l2/l2_input_classify.c \
124 vnet/l2/l2_output_classify.c \
125 vnet/l2/l2_efp_filter.c \
129 vnet/l2/l2_input_acl.c \
131 vnet/l2/l2_input_vtr.c \
133 vnet/l2/l2_output_acl.c \
134 vnet/l2/l2_output.c \
140 nobase_include_HEADERS += \
141 vnet/l2/feat_bitmap.h \
143 vnet/l2/l2_output.h \
145 vnet/l2/l2_input_vtr.h \
146 vnet/l2/l2_efp_filter.h \
154 vnet/l2/l2_classify.h \
157 ########################################
158 # Layer 2 protocol: SRP
159 ########################################
160 libvnet_la_SOURCES += \
162 vnet/srp/interface.c \
166 nobase_include_HEADERS += \
170 ########################################
171 # Layer 2 protocol: PPP
172 ########################################
173 libvnet_la_SOURCES += \
178 nobase_include_HEADERS += \
183 ########################################
184 # Layer 2 protocol: HDLC
185 ########################################
186 libvnet_la_SOURCES += \
191 nobase_include_HEADERS += \
192 vnet/hdlc/error.def \
196 ########################################
197 # Layer 2 protocol: LLC
198 ########################################
199 libvnet_la_SOURCES += \
204 nobase_include_HEADERS += \
207 ########################################
208 # Layer 2 protocol: SNAP
209 ########################################
210 libvnet_la_SOURCES += \
215 nobase_include_HEADERS += \
218 ########################################
220 ########################################
221 libvnet_la_SOURCES += \
226 nobase_include_HEADERS += \
228 vnet/vxlan/vxlan_packet.h \
229 vnet/vxlan/vxlan_error.def
231 ########################################
233 ########################################
234 libvnet_la_SOURCES += \
235 vnet/cdp/cdp_input.c \
236 vnet/cdp/cdp_node.c \
237 vnet/cdp/cdp_periodic.c
239 nobase_include_HEADERS += \
240 vnet/cdp/cdp_protocol.h
242 ########################################
244 ########################################
245 libvnet_la_SOURCES += \
246 vnet/lldp/lldp_input.c \
247 vnet/lldp/lldp_node.c \
248 vnet/lldp/lldp_output.c \
251 nobase_include_HEADERS += \
252 vnet/lldp/lldp_protocol.h
254 ########################################
255 # Layer 2/3 "classify"
256 ########################################
257 libvnet_la_SOURCES += \
258 vnet/classify/vnet_classify.c \
259 vnet/classify/ip_classify.c \
260 vnet/classify/input_acl.c \
261 vnet/classify/policer_classify.c \
262 vnet/classify/flow_classify.c \
263 vnet/classify/flow_classify_node.c \
264 vnet/classify/vnet_classify.h
266 nobase_include_HEADERS += \
267 vnet/classify/vnet_classify.h \
268 vnet/classify/input_acl.h \
269 vnet/classify/policer_classify.h \
270 vnet/classify/flow_classify.h
272 ########################################
273 # Layer 3 protocols go here
274 ########################################
276 ########################################
277 # Layer 3 protocol: IP v4/v6
278 ########################################
279 libvnet_la_SOURCES += \
284 vnet/ip/ip4_format.c \
285 vnet/ip/ip4_forward.c \
286 vnet/ip/ip4_input.c \
287 vnet/ip/ip4_mtrie.c \
289 vnet/ip/ip4_source_and_port_range_check.c \
290 vnet/ip/ip4_source_check.c \
291 vnet/ip/ip6_format.c \
292 vnet/ip/ip6_forward.c \
293 vnet/ip/ip6_hop_by_hop.c \
294 vnet/ip/ip6_input.c \
295 vnet/ip/ip6_neighbor.c \
297 vnet/ip/ip_checksum.c \
301 vnet/ip/ip_input_acl.c \
305 vnet/ip/udp_format.c \
307 vnet/ip/udp_local.c \
310 nobase_include_HEADERS += \
312 vnet/ip/icmp46_packet.h \
315 vnet/ip/igmp_packet.h \
316 vnet/ip/ip4_error.h \
318 vnet/ip/ip4_mtrie.h \
319 vnet/ip/ip4_packet.h \
320 vnet/ip/ip6_error.h \
322 vnet/ip/ip6_hop_by_hop.h \
323 vnet/ip/ip6_hop_by_hop_packet.h \
324 vnet/ip/ip6_packet.h \
326 vnet/ip/ip_packet.h \
327 vnet/ip/ip_source_and_port_range_check.h \
330 vnet/ip/protocols.def \
331 vnet/ip/punt_error.def \
333 vnet/ip/tcp_packet.h \
334 vnet/ip/udp_error.def \
338 ########################################
339 # Layer 3 protocol: IPSec
340 ########################################
342 libvnet_la_SOURCES += \
344 vnet/ipsec/ipsec_cli.c \
345 vnet/ipsec/ipsec_format.c \
346 vnet/ipsec/ipsec_input.c \
347 vnet/ipsec/ipsec_if.c \
348 vnet/ipsec/ipsec_if_in.c \
349 vnet/ipsec/ipsec_if_out.c \
350 vnet/ipsec/esp_encrypt.c \
351 vnet/ipsec/esp_decrypt.c \
353 vnet/ipsec/ikev2_crypto.c \
354 vnet/ipsec/ikev2_cli.c \
355 vnet/ipsec/ikev2_payload.c \
356 vnet/ipsec/ikev2_format.c
358 libvnet_la_SOURCES += \
359 vnet/devices/dpdk/ipsec/esp_encrypt.c \
360 vnet/devices/dpdk/ipsec/esp_decrypt.c \
361 vnet/devices/dpdk/ipsec/crypto_node.c \
362 vnet/devices/dpdk/ipsec/cli.c \
363 vnet/devices/dpdk/ipsec/ipsec.c
367 libvnet_la_SOURCES += \
368 vnet/ipsec/ipsec_output.c
370 nobase_include_HEADERS += \
374 vnet/ipsec/ikev2_priv.h
376 nobase_include_HEADERS += \
377 vnet/devices/dpdk/ipsec/ipsec.h \
378 vnet/devices/dpdk/ipsec/esp.h
381 ########################################
382 # Layer 3 protocol: osi
383 ########################################
384 libvnet_la_SOURCES += \
389 nobase_include_HEADERS += \
392 ########################################
393 # Layer 3 protocol: MAP
394 ########################################
395 libvnet_la_SOURCES += \
400 vnet/map/ip4_map_t.c \
403 nobase_include_HEADERS += \
411 test_map_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
413 test_map_LDADD = libvnet.la -lvppinfra -lvlib \
414 -lpthread -lvlibmemory -lvlibapi -lvlib_unix \
417 test_map_LDFLAGS = -static
421 ########################################
422 # Tunnel protocol: gre
423 ########################################
424 libvnet_la_SOURCES += \
427 vnet/gre/interface.c \
430 nobase_include_HEADERS += \
435 ########################################
436 # Tunnel protocol: l2tpv3
437 ########################################
438 libvnet_la_SOURCES += \
444 nobase_include_HEADERS += \
448 ########################################
449 # Tunnel protocol: gre+mpls
450 ########################################
451 libvnet_la_SOURCES += \
453 vnet/mpls/mpls_lookup.c \
454 vnet/mpls/mpls_output.c \
455 vnet/mpls/mpls_features.c \
457 vnet/mpls/interface.c \
458 vnet/mpls/mpls_tunnel.c \
461 nobase_include_HEADERS += \
463 vnet/mpls/mpls_types.h \
464 vnet/mpls/mpls_tunnel.h \
469 ########################################
470 # Tunnel protocol: vxlan-gpe
471 ########################################
473 libvnet_la_SOURCES += \
474 vnet/vxlan-gpe/vxlan_gpe.c \
475 vnet/vxlan-gpe/encap.c \
476 vnet/vxlan-gpe/decap.c
478 nobase_include_HEADERS += \
479 vnet/vxlan-gpe/vxlan_gpe.h \
480 vnet/vxlan-gpe/vxlan_gpe_packet.h \
481 vnet/vxlan-gpe/vxlan_gpe_error.def
483 ########################################
484 # Tunnel protocol: ipsec+gre
485 ########################################
486 libvnet_la_SOURCES += \
487 vnet/ipsec-gre/ipsec_gre.c \
488 vnet/ipsec-gre/node.c \
489 vnet/ipsec-gre/interface.c
491 nobase_include_HEADERS += \
492 vnet/ipsec-gre/ipsec_gre.h \
493 vnet/ipsec-gre/error.def
495 ########################################
496 # LISP control plane: lisp-cp
497 ########################################
499 libvnet_la_SOURCES += \
500 vnet/lisp-cp/lisp_types.c \
501 vnet/lisp-cp/lisp_cp_dpo.c \
502 vnet/lisp-cp/control.c \
503 vnet/lisp-cp/gid_dictionary.c \
504 vnet/lisp-cp/lisp_msg_serdes.c \
505 vnet/lisp-cp/packets.c
507 nobase_include_HEADERS += \
508 vnet/lisp-cp/lisp_types.h \
509 vnet/lisp-cp/packets.h \
510 vnet/lisp-cp/gid_dictionary.h \
511 vnet/lisp-cp/lisp_cp_messages.h \
512 vnet/lisp-cp/lisp_msg_serdes.h \
513 vnet/lisp-cp/control.h
517 LDS = -lvppinfra -l:libvlib.a $(dpdk_libs) -l:libvlibmemory.a \
518 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
520 TESTS += test_cp_serdes test_lisp_types
522 test_cp_serdes_SOURCES = \
523 test/lisp-cp/test_cp_serdes.c \
524 vnet/lisp-cp/lisp_msg_serdes.c \
525 vnet/lisp-cp/lisp_types.c \
526 vnet/lisp-cp/packets.c \
527 vnet/ip/ip_checksum.c
529 test_lisp_types_SOURCES = \
530 test/lisp-cp/test_lisp_types.c \
531 vnet/lisp-cp/lisp_types.c
533 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
534 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
536 test_cp_serdes_LDADD = libvnet.la $(LDS)
537 test_lisp_types_LDADD = libvnet.la $(LDS)
539 test_cp_serdes_LDFLAGS = -static
540 test_lisp_types_LDFLAGS = -static
543 ########################################
544 # Tunnel protocol: lisp-gpe
545 ########################################
547 libvnet_la_SOURCES += \
548 vnet/lisp-gpe/lisp_gpe.c \
549 vnet/lisp-gpe/lisp_gpe_sub_interface.c \
550 vnet/lisp-gpe/lisp_gpe_adjacency.c \
551 vnet/lisp-gpe/lisp_gpe_tunnel.c \
552 vnet/lisp-gpe/lisp_gpe_fwd_entry.c \
553 vnet/lisp-gpe/lisp_gpe_tenant.c \
554 vnet/lisp-gpe/interface.c \
555 vnet/lisp-gpe/decap.c
557 nobase_include_HEADERS += \
558 vnet/lisp-gpe/lisp_gpe.h \
559 vnet/lisp-gpe/lisp_gpe_fwd_entry.h \
560 vnet/lisp-gpe/lisp_gpe_tenant.h \
561 vnet/lisp-gpe/lisp_gpe_packet.h \
562 vnet/lisp-gpe/lisp_gpe_error.def
567 test_test_SOURCES = test/lisp-gpe/test.c
569 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
571 test_test_LDADD = $(LIBOBJS)
573 noinst_PROGRAMS += $(TESTS)
574 check_PROGRAMS = $(TESTS)
577 ########################################
579 ########################################
580 libvnet_la_SOURCES += \
584 nobase_include_HEADERS += \
587 ########################################
589 ########################################
590 libvnet_la_SOURCES += \
591 vnet/dhcp/proxy_node.c \
594 nobase_include_HEADERS += \
597 vnet/dhcp/proxy_error.def
599 ########################################
600 # ipv6 segment routing
601 ########################################
604 libvnet_la_SOURCES += \
606 vnet/sr/sr_replicate.c
609 nobase_include_HEADERS += \
610 vnet/sr/sr_packet.h \
611 vnet/sr/sr_error.def \
614 ########################################
616 ########################################
617 libvnet_la_SOURCES += \
618 vnet/dhcpv6/proxy_node.c
620 nobase_include_HEADERS += \
621 vnet/dhcpv6/packet.h \
622 vnet/dhcpv6/proxy.h \
623 vnet/dhcpv6/proxy_error.def
625 ########################################
626 # IPFIX / netflow v10
627 ########################################
628 libvnet_la_SOURCES += \
629 vnet/flow/flow_report.c
631 nobase_include_HEADERS += \
632 vnet/flow/flow_report.h \
633 vnet/flow/ipfix_info_elements.h \
634 vnet/flow/ipfix_packet.h
636 ########################################
637 # IPFIX classify code
638 ########################################
640 libvnet_la_SOURCES += \
641 vnet/flow/flow_report_classify.c
643 nobase_include_HEADERS += \
644 vnet/flow/flow_report_classify.h
646 ########################################
648 ########################################
650 libvnet_la_SOURCES += \
651 vnet/lawful-intercept/lawful_intercept.c \
652 vnet/lawful-intercept/node.c
654 nobase_include_HEADERS += \
655 vnet/lawful-intercept/lawful_intercept.h
657 ########################################
658 # SPAN (port mirroring)
659 ########################################
661 libvnet_la_SOURCES += \
665 nobase_include_HEADERS += \
668 ########################################
670 ########################################
672 libvnet_la_SOURCES += \
680 nobase_include_HEADERS += \
684 ########################################
686 ########################################
688 libvnet_la_SOURCES += \
689 vnet/devices/dpdk/dpdk_priv.h \
690 vnet/devices/dpdk/device.c \
691 vnet/devices/dpdk/format.c \
692 vnet/devices/dpdk/init.c \
693 vnet/devices/dpdk/node.c \
694 vnet/devices/dpdk/hqos.c \
695 vnet/devices/dpdk/cli.c
697 nobase_include_HEADERS += \
698 vnet/devices/dpdk/dpdk.h
700 libvnet_la_SOURCES += \
701 vnet/devices/nic/ixge.c \
702 vnet/devices/nic/ixge.h \
703 vnet/devices/nic/sfp.c \
704 vnet/devices/nic/sfp.h
707 ########################################
709 ########################################
711 libvnet_la_SOURCES += \
712 vnet/devices/virtio/vhost-user.c
714 nobase_include_HEADERS += \
715 vnet/devices/virtio/vhost-user.h
717 ########################################
719 ########################################
720 libvnet_la_SOURCES += \
721 vnet/devices/ssvm/ssvm_eth.c \
722 vnet/devices/ssvm/node.c
724 nobase_include_HEADERS += \
725 vnet/devices/ssvm/ssvm_eth.h
727 ########################################
728 # Linux packet interface
729 ########################################
731 libvnet_la_SOURCES += \
732 vnet/devices/af_packet/af_packet.c \
733 vnet/devices/af_packet/device.c \
734 vnet/devices/af_packet/node.c \
735 vnet/devices/af_packet/cli.c
737 nobase_include_HEADERS += \
738 vnet/devices/af_packet/af_packet.h
740 ########################################
742 ########################################
744 libvnet_la_SOURCES += \
745 vnet/devices/netmap/netmap.c \
746 vnet/devices/netmap/device.c \
747 vnet/devices/netmap/node.c \
748 vnet/devices/netmap/cli.c
750 nobase_include_HEADERS += \
751 vnet/devices/netmap/netmap.h
754 ########################################
755 # Driver feature graph arc support
756 ########################################
758 libvnet_la_SOURCES += \
759 vnet/feature/feature.c \
760 vnet/feature/registration.c
762 nobase_include_HEADERS += \
763 vnet/feature/feature.h
765 ########################################
766 # Unix kernel related
767 ########################################
769 # FIXME: vnet/unix/hgshm.c
771 libvnet_la_SOURCES += \
772 vnet/unix/gdb_funcs.c \
777 nobase_include_HEADERS += \
782 ########################################
784 ########################################
786 libvnet_la_SOURCES += \
788 vnet/fib/fib_test.c \
791 vnet/fib/mpls_fib.c \
792 vnet/fib/fib_table.c \
793 vnet/fib/fib_walk.c \
794 vnet/fib/fib_types.c \
795 vnet/fib/fib_node.c \
796 vnet/fib/fib_node_list.c \
797 vnet/fib/fib_entry.c \
798 vnet/fib/fib_entry_src.c \
799 vnet/fib/fib_entry_src_rr.c \
800 vnet/fib/fib_entry_src_interface.c \
801 vnet/fib/fib_entry_src_default_route.c \
802 vnet/fib/fib_entry_src_special.c \
803 vnet/fib/fib_entry_src_api.c \
804 vnet/fib/fib_entry_src_adj.c \
805 vnet/fib/fib_entry_src_mpls.c \
806 vnet/fib/fib_entry_src_lisp.c \
807 vnet/fib/fib_entry_cover.c \
808 vnet/fib/fib_entry_delegate.c \
809 vnet/fib/fib_path_list.c \
810 vnet/fib/fib_path.c \
811 vnet/fib/fib_path_ext.c \
812 vnet/fib/fib_urpf_list.c \
813 vnet/fib/fib_attached_export.c
815 nobase_include_HEADERS += \
819 vnet/fib/fib_types.h \
820 vnet/fib/fib_table.h \
821 vnet/fib/fib_node.h \
822 vnet/fib/fib_node_list.h \
823 vnet/fib/fib_entry.h \
824 vnet/fib/fib_entry_delegate.h
826 ########################################
828 ########################################
830 libvnet_la_SOURCES += \
832 vnet/adj/adj_rewrite.c \
833 vnet/adj/adj_glean.c \
834 vnet/adj/adj_midchain.c \
838 nobase_include_HEADERS += \
840 vnet/adj/adj_types.h \
841 vnet/adj/adj_rewrite.h \
842 vnet/adj/adj_glean.h \
845 ########################################
847 ########################################
849 libvnet_la_SOURCES += \
851 vnet/dpo/drop_dpo.c \
852 vnet/dpo/ip_null_dpo.c \
853 vnet/dpo/punt_dpo.c \
854 vnet/dpo/receive_dpo.c \
855 vnet/dpo/load_balance.c \
856 vnet/dpo/load_balance_map.c \
857 vnet/dpo/lookup_dpo.c \
858 vnet/dpo/classify_dpo.c \
859 vnet/dpo/mpls_label_dpo.c
861 nobase_include_HEADERS += \
862 vnet/dpo/load_balance.h \
863 vnet/dpo/drop_dpo.h \
864 vnet/dpo/lookup_dpo.h \
865 vnet/dpo/punt_dpo.h \
866 vnet/dpo/classify_dpo.h \
867 vnet/dpo/receive_dpo.h \
868 vnet/dpo/ip_null_dpo.h \
871 ########################################
872 # Plugin client library
873 ########################################
875 libvnetplugin_la_SOURCES += \
878 nobase_include_HEADERS += \
881 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
884 vnet/unix/pcap2pg.c \
887 pcap2pg_LDFLAGS = -static
888 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
890 noinst_PROGRAMS += pcap2pg
892 # Set the suffix list
893 SUFFIXES = .api.h .api .api.json
895 # install the API definition, so we can produce java bindings, etc.
897 apidir = $(prefix)/vnet
898 api_DATA = vnet/interface.api.json vnet/l2/l2.api.json
900 # The actual %.api.h rule is in .../build-data/packages/suffix-rules.mk
901 # and requires a symbolic link at the top of the vnet source tree
903 include $(top_srcdir)/suffix-rules.mk