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
21 libvnetplugin_la_SOURCES =
22 nobase_include_HEADERS =
28 dpdk_libs += -l:libdpdk.a
31 ########################################
33 ########################################
34 libvnet_la_SOURCES += \
36 vnet/devices/devices.c \
39 vnet/interface_api.c \
40 vnet/interface_cli.c \
41 vnet/interface_format.c \
42 vnet/interface_output.c \
47 nobase_include_HEADERS += \
51 vnet/devices/devices.h \
55 vnet/interface.api.h \
56 vnet/interface_funcs.h \
62 vnet/vnet_all_api_h.h \
65 ########################################
67 ########################################
69 libvnet_la_SOURCES += \
70 vnet/policer/node_funcs.c \
71 vnet/policer/policer.c \
74 nobase_include_HEADERS += \
75 vnet/policer/police.h \
76 vnet/policer/policer.h \
79 ########################################
81 ########################################
83 libvnet_la_SOURCES += \
86 vnet/cop/ip4_whitelist.c \
87 vnet/cop/ip6_whitelist.c
89 nobase_include_HEADERS += \
92 ########################################
93 # Layer 2 protocols go here
94 ########################################
96 ########################################
97 # Layer 2 protocol: Ethernet
98 ########################################
99 libvnet_la_SOURCES += \
100 vnet/ethernet/arp.c \
101 vnet/ethernet/format.c \
102 vnet/ethernet/init.c \
103 vnet/ethernet/interface.c \
104 vnet/ethernet/node.c \
107 nobase_include_HEADERS += \
108 vnet/ethernet/arp_packet.h \
109 vnet/ethernet/error.def \
110 vnet/ethernet/ethernet.h \
111 vnet/ethernet/packet.h \
112 vnet/ethernet/types.def
114 ########################################
115 # Layer 2 protocol: Ethernet bridging
116 ########################################
117 libvnet_la_SOURCES += \
118 vnet/l2/feat_bitmap.c \
121 vnet/l2/l2_input_classify.c \
122 vnet/l2/l2_output_classify.c \
123 vnet/l2/l2_efp_filter.c \
127 vnet/l2/l2_input_acl.c \
129 vnet/l2/l2_input_vtr.c \
131 vnet/l2/l2_output_acl.c \
132 vnet/l2/l2_output.c \
138 nobase_include_HEADERS += \
139 vnet/l2/feat_bitmap.h \
141 vnet/l2/l2_output.h \
143 vnet/l2/l2_input_vtr.h \
144 vnet/l2/l2_efp_filter.h \
152 vnet/l2/l2_classify.h
154 ########################################
155 # Layer 2 protocol: SRP
156 ########################################
157 libvnet_la_SOURCES += \
159 vnet/srp/interface.c \
163 nobase_include_HEADERS += \
167 ########################################
168 # Layer 2 protocol: PPP
169 ########################################
170 libvnet_la_SOURCES += \
175 nobase_include_HEADERS += \
180 ########################################
181 # Layer 2 protocol: HDLC
182 ########################################
183 libvnet_la_SOURCES += \
188 nobase_include_HEADERS += \
189 vnet/hdlc/error.def \
193 ########################################
194 # Layer 2 protocol: LLC
195 ########################################
196 libvnet_la_SOURCES += \
201 nobase_include_HEADERS += \
204 ########################################
205 # Layer 2 protocol: SNAP
206 ########################################
207 libvnet_la_SOURCES += \
212 nobase_include_HEADERS += \
215 ########################################
217 ########################################
218 libvnet_la_SOURCES += \
223 nobase_include_HEADERS += \
225 vnet/vxlan/vxlan_packet.h \
226 vnet/vxlan/vxlan_error.def
228 ########################################
230 ########################################
231 libvnet_la_SOURCES += \
232 vnet/cdp/cdp_input.c \
233 vnet/cdp/cdp_node.c \
234 vnet/cdp/cdp_periodic.c
236 nobase_include_HEADERS += \
237 vnet/cdp/cdp_protocol.h
239 ########################################
241 ########################################
242 libvnet_la_SOURCES += \
243 vnet/lldp/lldp_input.c \
244 vnet/lldp/lldp_node.c \
245 vnet/lldp/lldp_output.c \
248 nobase_include_HEADERS += \
249 vnet/lldp/lldp_protocol.h
251 ########################################
252 # Layer 2/3 "classify"
253 ########################################
254 libvnet_la_SOURCES += \
255 vnet/classify/vnet_classify.c \
256 vnet/classify/ip_classify.c \
257 vnet/classify/input_acl.c \
258 vnet/classify/policer_classify.c \
259 vnet/classify/flow_classify.c \
260 vnet/classify/flow_classify_node.c \
261 vnet/classify/vnet_classify.h
263 nobase_include_HEADERS += \
264 vnet/classify/vnet_classify.h \
265 vnet/classify/input_acl.h \
266 vnet/classify/policer_classify.h \
267 vnet/classify/flow_classify.h
269 ########################################
270 # Layer 3 protocols go here
271 ########################################
273 ########################################
274 # Layer 3 protocol: IP v4/v6
275 ########################################
276 libvnet_la_SOURCES += \
281 vnet/ip/ip4_format.c \
282 vnet/ip/ip4_forward.c \
283 vnet/ip/ip4_input.c \
284 vnet/ip/ip4_mtrie.c \
286 vnet/ip/ip4_source_and_port_range_check.c \
287 vnet/ip/ip4_source_check.c \
288 vnet/ip/ip6_format.c \
289 vnet/ip/ip6_forward.c \
290 vnet/ip/ip6_hop_by_hop.c \
291 vnet/ip/ip6_input.c \
292 vnet/ip/ip6_neighbor.c \
294 vnet/ip/ip_checksum.c \
298 vnet/ip/ip_input_acl.c \
302 vnet/ip/udp_format.c \
304 vnet/ip/udp_local.c \
307 nobase_include_HEADERS += \
309 vnet/ip/icmp46_packet.h \
312 vnet/ip/igmp_packet.h \
313 vnet/ip/ip4_error.h \
315 vnet/ip/ip4_mtrie.h \
316 vnet/ip/ip4_packet.h \
317 vnet/ip/ip6_error.h \
319 vnet/ip/ip6_hop_by_hop.h \
320 vnet/ip/ip6_hop_by_hop_packet.h \
321 vnet/ip/ip6_packet.h \
323 vnet/ip/ip_packet.h \
324 vnet/ip/ip_source_and_port_range_check.h \
327 vnet/ip/protocols.def \
328 vnet/ip/punt_error.def \
330 vnet/ip/tcp_packet.h \
331 vnet/ip/udp_error.def \
335 ########################################
336 # Layer 3 protocol: IPSec
337 ########################################
339 libvnet_la_SOURCES += \
341 vnet/ipsec/ipsec_cli.c \
342 vnet/ipsec/ipsec_format.c \
343 vnet/ipsec/ipsec_input.c \
344 vnet/ipsec/ipsec_if.c \
345 vnet/ipsec/ipsec_if_in.c \
346 vnet/ipsec/ipsec_if_out.c \
347 vnet/ipsec/esp_encrypt.c \
348 vnet/ipsec/esp_decrypt.c \
350 vnet/ipsec/ikev2_crypto.c \
351 vnet/ipsec/ikev2_cli.c \
352 vnet/ipsec/ikev2_payload.c \
353 vnet/ipsec/ikev2_format.c
355 libvnet_la_SOURCES += \
356 vnet/devices/dpdk/ipsec/esp_encrypt.c \
357 vnet/devices/dpdk/ipsec/esp_decrypt.c \
358 vnet/devices/dpdk/ipsec/crypto_node.c \
359 vnet/devices/dpdk/ipsec/cli.c \
360 vnet/devices/dpdk/ipsec/ipsec.c
364 libvnet_la_SOURCES += \
365 vnet/ipsec/ipsec_output.c
367 nobase_include_HEADERS += \
371 vnet/ipsec/ikev2_priv.h
373 nobase_include_HEADERS += \
374 vnet/devices/dpdk/ipsec/ipsec.h \
375 vnet/devices/dpdk/ipsec/esp.h
378 ########################################
379 # Layer 3 protocol: osi
380 ########################################
381 libvnet_la_SOURCES += \
386 nobase_include_HEADERS += \
389 ########################################
390 # Layer 3 protocol: MAP
391 ########################################
392 libvnet_la_SOURCES += \
397 vnet/map/ip4_map_t.c \
400 nobase_include_HEADERS += \
408 test_map_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
410 test_map_LDADD = libvnet.la -lvppinfra -lvlib \
411 -lpthread -lvlibmemory -lvlibapi -lvlib_unix \
414 test_map_LDFLAGS = -static
418 ########################################
419 # Tunnel protocol: gre
420 ########################################
421 libvnet_la_SOURCES += \
424 vnet/gre/interface.c \
427 nobase_include_HEADERS += \
432 ########################################
433 # Tunnel protocol: l2tpv3
434 ########################################
435 libvnet_la_SOURCES += \
441 nobase_include_HEADERS += \
445 ########################################
446 # Tunnel protocol: gre+mpls
447 ########################################
448 libvnet_la_SOURCES += \
450 vnet/mpls/mpls_lookup.c \
451 vnet/mpls/mpls_output.c \
452 vnet/mpls/mpls_features.c \
454 vnet/mpls/interface.c \
455 vnet/mpls/mpls_tunnel.c \
458 nobase_include_HEADERS += \
460 vnet/mpls/mpls_types.h \
461 vnet/mpls/mpls_tunnel.h \
466 ########################################
467 # Tunnel protocol: vxlan-gpe
468 ########################################
470 libvnet_la_SOURCES += \
471 vnet/vxlan-gpe/vxlan_gpe.c \
472 vnet/vxlan-gpe/encap.c \
473 vnet/vxlan-gpe/decap.c
475 nobase_include_HEADERS += \
476 vnet/vxlan-gpe/vxlan_gpe.h \
477 vnet/vxlan-gpe/vxlan_gpe_packet.h \
478 vnet/vxlan-gpe/vxlan_gpe_error.def
480 ########################################
481 # Tunnel protocol: ipsec+gre
482 ########################################
483 libvnet_la_SOURCES += \
484 vnet/ipsec-gre/ipsec_gre.c \
485 vnet/ipsec-gre/node.c \
486 vnet/ipsec-gre/interface.c
488 nobase_include_HEADERS += \
489 vnet/ipsec-gre/ipsec_gre.h \
490 vnet/ipsec-gre/error.def
492 ########################################
493 # LISP control plane: lisp-cp
494 ########################################
496 libvnet_la_SOURCES += \
497 vnet/lisp-cp/lisp_types.c \
498 vnet/lisp-cp/lisp_cp_dpo.c \
499 vnet/lisp-cp/control.c \
500 vnet/lisp-cp/gid_dictionary.c \
501 vnet/lisp-cp/lisp_msg_serdes.c \
502 vnet/lisp-cp/packets.c
504 nobase_include_HEADERS += \
505 vnet/lisp-cp/lisp_types.h \
506 vnet/lisp-cp/packets.h \
507 vnet/lisp-cp/gid_dictionary.h \
508 vnet/lisp-cp/lisp_cp_messages.h \
509 vnet/lisp-cp/lisp_msg_serdes.h \
510 vnet/lisp-cp/control.h
514 LDS = -lvppinfra -l:libvlib.a $(dpdk_libs) -l:libvlibmemory.a \
515 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
517 TESTS += test_cp_serdes test_lisp_types
519 test_cp_serdes_SOURCES = \
520 test/lisp-cp/test_cp_serdes.c \
521 vnet/lisp-cp/lisp_msg_serdes.c \
522 vnet/lisp-cp/lisp_types.c \
523 vnet/lisp-cp/packets.c \
524 vnet/ip/ip_checksum.c
526 test_lisp_types_SOURCES = \
527 test/lisp-cp/test_lisp_types.c \
528 vnet/lisp-cp/lisp_types.c
530 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
531 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
533 test_cp_serdes_LDADD = libvnet.la $(LDS)
534 test_lisp_types_LDADD = libvnet.la $(LDS)
536 test_cp_serdes_LDFLAGS = -static
537 test_lisp_types_LDFLAGS = -static
540 ########################################
541 # Tunnel protocol: lisp-gpe
542 ########################################
544 libvnet_la_SOURCES += \
545 vnet/lisp-gpe/lisp_gpe.c \
546 vnet/lisp-gpe/lisp_gpe_sub_interface.c \
547 vnet/lisp-gpe/lisp_gpe_adjacency.c \
548 vnet/lisp-gpe/lisp_gpe_tunnel.c \
549 vnet/lisp-gpe/lisp_gpe_fwd_entry.c \
550 vnet/lisp-gpe/lisp_gpe_tenant.c \
551 vnet/lisp-gpe/interface.c \
552 vnet/lisp-gpe/decap.c
554 nobase_include_HEADERS += \
555 vnet/lisp-gpe/lisp_gpe.h \
556 vnet/lisp-gpe/lisp_gpe_fwd_entry.h \
557 vnet/lisp-gpe/lisp_gpe_tenant.h \
558 vnet/lisp-gpe/lisp_gpe_packet.h \
559 vnet/lisp-gpe/lisp_gpe_error.def
564 test_test_SOURCES = test/lisp-gpe/test.c
566 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
568 test_test_LDADD = $(LIBOBJS)
570 noinst_PROGRAMS += $(TESTS)
571 check_PROGRAMS = $(TESTS)
574 ########################################
576 ########################################
577 libvnet_la_SOURCES += \
581 nobase_include_HEADERS += \
584 ########################################
586 ########################################
587 libvnet_la_SOURCES += \
588 vnet/dhcp/proxy_node.c \
591 nobase_include_HEADERS += \
594 vnet/dhcp/proxy_error.def
596 ########################################
597 # ipv6 segment routing
598 ########################################
601 libvnet_la_SOURCES += \
603 vnet/sr/sr_replicate.c
606 nobase_include_HEADERS += \
607 vnet/sr/sr_packet.h \
608 vnet/sr/sr_error.def \
611 ########################################
613 ########################################
614 libvnet_la_SOURCES += \
615 vnet/dhcpv6/proxy_node.c
617 nobase_include_HEADERS += \
618 vnet/dhcpv6/packet.h \
619 vnet/dhcpv6/proxy.h \
620 vnet/dhcpv6/proxy_error.def
622 ########################################
623 # IPFIX / netflow v10
624 ########################################
625 libvnet_la_SOURCES += \
626 vnet/flow/flow_report.c
628 nobase_include_HEADERS += \
629 vnet/flow/flow_report.h \
630 vnet/flow/ipfix_info_elements.h \
631 vnet/flow/ipfix_packet.h
633 ########################################
634 # IPFIX classify code
635 ########################################
637 libvnet_la_SOURCES += \
638 vnet/flow/flow_report_classify.c
640 nobase_include_HEADERS += \
641 vnet/flow/flow_report_classify.h
643 ########################################
645 ########################################
647 libvnet_la_SOURCES += \
648 vnet/lawful-intercept/lawful_intercept.c \
649 vnet/lawful-intercept/node.c
651 nobase_include_HEADERS += \
652 vnet/lawful-intercept/lawful_intercept.h
654 ########################################
655 # SPAN (port mirroring)
656 ########################################
658 libvnet_la_SOURCES += \
662 nobase_include_HEADERS += \
665 ########################################
667 ########################################
669 libvnet_la_SOURCES += \
677 nobase_include_HEADERS += \
681 ########################################
683 ########################################
685 libvnet_la_SOURCES += \
686 vnet/devices/dpdk/dpdk_priv.h \
687 vnet/devices/dpdk/device.c \
688 vnet/devices/dpdk/format.c \
689 vnet/devices/dpdk/init.c \
690 vnet/devices/dpdk/node.c \
691 vnet/devices/dpdk/hqos.c \
692 vnet/devices/dpdk/cli.c
694 nobase_include_HEADERS += \
695 vnet/devices/dpdk/dpdk.h
697 libvnet_la_SOURCES += \
698 vnet/devices/nic/ixge.c \
699 vnet/devices/nic/ixge.h \
700 vnet/devices/nic/sfp.c \
701 vnet/devices/nic/sfp.h
704 ########################################
706 ########################################
708 libvnet_la_SOURCES += \
709 vnet/devices/virtio/vhost-user.c
711 nobase_include_HEADERS += \
712 vnet/devices/virtio/vhost-user.h
714 ########################################
716 ########################################
717 libvnet_la_SOURCES += \
718 vnet/devices/ssvm/ssvm_eth.c \
719 vnet/devices/ssvm/node.c
721 nobase_include_HEADERS += \
722 vnet/devices/ssvm/ssvm_eth.h
724 ########################################
725 # Linux packet interface
726 ########################################
728 libvnet_la_SOURCES += \
729 vnet/devices/af_packet/af_packet.c \
730 vnet/devices/af_packet/device.c \
731 vnet/devices/af_packet/node.c \
732 vnet/devices/af_packet/cli.c
734 nobase_include_HEADERS += \
735 vnet/devices/af_packet/af_packet.h
737 ########################################
739 ########################################
741 libvnet_la_SOURCES += \
742 vnet/devices/netmap/netmap.c \
743 vnet/devices/netmap/device.c \
744 vnet/devices/netmap/node.c \
745 vnet/devices/netmap/cli.c
747 nobase_include_HEADERS += \
748 vnet/devices/netmap/netmap.h
751 ########################################
752 # Driver feature graph arc support
753 ########################################
755 libvnet_la_SOURCES += \
756 vnet/feature/feature.c \
757 vnet/feature/registration.c
759 nobase_include_HEADERS += \
760 vnet/feature/feature.h
762 ########################################
763 # Unix kernel related
764 ########################################
766 # FIXME: vnet/unix/hgshm.c
768 libvnet_la_SOURCES += \
769 vnet/unix/gdb_funcs.c \
774 nobase_include_HEADERS += \
779 ########################################
781 ########################################
783 libvnet_la_SOURCES += \
785 vnet/fib/fib_test.c \
788 vnet/fib/mpls_fib.c \
789 vnet/fib/fib_table.c \
790 vnet/fib/fib_walk.c \
791 vnet/fib/fib_types.c \
792 vnet/fib/fib_node.c \
793 vnet/fib/fib_node_list.c \
794 vnet/fib/fib_entry.c \
795 vnet/fib/fib_entry_src.c \
796 vnet/fib/fib_entry_src_rr.c \
797 vnet/fib/fib_entry_src_interface.c \
798 vnet/fib/fib_entry_src_default_route.c \
799 vnet/fib/fib_entry_src_special.c \
800 vnet/fib/fib_entry_src_api.c \
801 vnet/fib/fib_entry_src_adj.c \
802 vnet/fib/fib_entry_src_mpls.c \
803 vnet/fib/fib_entry_src_lisp.c \
804 vnet/fib/fib_entry_cover.c \
805 vnet/fib/fib_entry_delegate.c \
806 vnet/fib/fib_path_list.c \
807 vnet/fib/fib_path.c \
808 vnet/fib/fib_path_ext.c \
809 vnet/fib/fib_urpf_list.c \
810 vnet/fib/fib_attached_export.c
812 nobase_include_HEADERS += \
816 vnet/fib/fib_types.h \
817 vnet/fib/fib_table.h \
818 vnet/fib/fib_node.h \
819 vnet/fib/fib_node_list.h \
820 vnet/fib/fib_entry.h \
821 vnet/fib/fib_entry_delegate.h
823 ########################################
825 ########################################
827 libvnet_la_SOURCES += \
829 vnet/adj/adj_rewrite.c \
830 vnet/adj/adj_glean.c \
831 vnet/adj/adj_midchain.c \
835 nobase_include_HEADERS += \
837 vnet/adj/adj_types.h \
838 vnet/adj/adj_rewrite.h \
839 vnet/adj/adj_glean.h \
842 ########################################
844 ########################################
846 libvnet_la_SOURCES += \
848 vnet/dpo/drop_dpo.c \
849 vnet/dpo/ip_null_dpo.c \
850 vnet/dpo/punt_dpo.c \
851 vnet/dpo/receive_dpo.c \
852 vnet/dpo/load_balance.c \
853 vnet/dpo/load_balance_map.c \
854 vnet/dpo/lookup_dpo.c \
855 vnet/dpo/classify_dpo.c \
856 vnet/dpo/mpls_label_dpo.c
858 nobase_include_HEADERS += \
859 vnet/dpo/load_balance.h \
860 vnet/dpo/drop_dpo.h \
861 vnet/dpo/lookup_dpo.h \
862 vnet/dpo/punt_dpo.h \
863 vnet/dpo/classify_dpo.h \
864 vnet/dpo/receive_dpo.h \
865 vnet/dpo/ip_null_dpo.h \
868 ########################################
869 # Plugin client library
870 ########################################
872 libvnetplugin_la_SOURCES += \
875 nobase_include_HEADERS += \
878 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
881 vnet/unix/pcap2pg.c \
884 pcap2pg_LDFLAGS = -static
885 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
887 noinst_PROGRAMS += pcap2pg
889 # Set the suffix list
890 SUFFIXES = .api.h .api .api.json
892 # install the API definition, so we can produce java bindings, etc.
894 apidir = $(prefix)/vnet
895 api_DATA = vnet/interface.api.json
897 # The actual %.api.h rule is in .../build-data/packages/suffix-rules.mk
898 # and requires a symbolic link at the top of the vnet source tree
900 include $(top_srcdir)/suffix-rules.mk