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
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/policy_encap.c \
458 nobase_include_HEADERS += \
460 vnet/mpls/mpls_types.h \
465 ########################################
466 # Tunnel protocol: vxlan-gpe
467 ########################################
469 libvnet_la_SOURCES += \
470 vnet/vxlan-gpe/vxlan_gpe.c \
471 vnet/vxlan-gpe/encap.c \
472 vnet/vxlan-gpe/decap.c
474 nobase_include_HEADERS += \
475 vnet/vxlan-gpe/vxlan_gpe.h \
476 vnet/vxlan-gpe/vxlan_gpe_packet.h \
477 vnet/vxlan-gpe/vxlan_gpe_error.def
479 ########################################
480 # Tunnel protocol: ipsec+gre
481 ########################################
482 libvnet_la_SOURCES += \
483 vnet/ipsec-gre/ipsec_gre.c \
484 vnet/ipsec-gre/node.c \
485 vnet/ipsec-gre/interface.c
487 nobase_include_HEADERS += \
488 vnet/ipsec-gre/ipsec_gre.h \
489 vnet/ipsec-gre/error.def
491 ########################################
492 # LISP control plane: lisp-cp
493 ########################################
495 libvnet_la_SOURCES += \
496 vnet/lisp-cp/lisp_types.c \
497 vnet/lisp-cp/lisp_cp_dpo.c \
498 vnet/lisp-cp/control.c \
499 vnet/lisp-cp/gid_dictionary.c \
500 vnet/lisp-cp/lisp_msg_serdes.c \
501 vnet/lisp-cp/packets.c
503 nobase_include_HEADERS += \
504 vnet/lisp-cp/lisp_types.h \
505 vnet/lisp-cp/packets.h \
506 vnet/lisp-cp/gid_dictionary.h \
507 vnet/lisp-cp/lisp_cp_messages.h \
508 vnet/lisp-cp/lisp_msg_serdes.h \
509 vnet/lisp-cp/control.h
513 LDS = -lvppinfra -l:libvlib.a $(dpdk_libs) -l:libvlibmemory.a \
514 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
516 TESTS += test_cp_serdes test_lisp_types
518 test_cp_serdes_SOURCES = \
519 test/lisp-cp/test_cp_serdes.c \
520 vnet/lisp-cp/lisp_msg_serdes.c \
521 vnet/lisp-cp/lisp_types.c \
522 vnet/lisp-cp/packets.c \
523 vnet/ip/ip_checksum.c
525 test_lisp_types_SOURCES = \
526 test/lisp-cp/test_lisp_types.c \
527 vnet/lisp-cp/lisp_types.c
529 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
530 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
532 test_cp_serdes_LDADD = libvnet.la $(LDS)
533 test_lisp_types_LDADD = libvnet.la $(LDS)
535 test_cp_serdes_LDFLAGS = -static
536 test_lisp_types_LDFLAGS = -static
539 ########################################
540 # Tunnel protocol: lisp-gpe
541 ########################################
543 libvnet_la_SOURCES += \
544 vnet/lisp-gpe/lisp_gpe.c \
545 vnet/lisp-gpe/lisp_gpe_sub_interface.c \
546 vnet/lisp-gpe/lisp_gpe_adjacency.c \
547 vnet/lisp-gpe/lisp_gpe_tunnel.c \
548 vnet/lisp-gpe/lisp_gpe_fwd_entry.c \
549 vnet/lisp-gpe/lisp_gpe_tenant.c \
550 vnet/lisp-gpe/interface.c \
551 vnet/lisp-gpe/decap.c
553 nobase_include_HEADERS += \
554 vnet/lisp-gpe/lisp_gpe.h \
555 vnet/lisp-gpe/lisp_gpe_fwd_entry.h \
556 vnet/lisp-gpe/lisp_gpe_tenant.h \
557 vnet/lisp-gpe/lisp_gpe_packet.h \
558 vnet/lisp-gpe/lisp_gpe_error.def
563 test_test_SOURCES = test/lisp-gpe/test.c
565 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
567 test_test_LDADD = $(LIBOBJS)
569 noinst_PROGRAMS += $(TESTS)
570 check_PROGRAMS = $(TESTS)
573 ########################################
575 ########################################
576 libvnet_la_SOURCES += \
580 nobase_include_HEADERS += \
583 ########################################
585 ########################################
586 libvnet_la_SOURCES += \
587 vnet/dhcp/proxy_node.c \
590 nobase_include_HEADERS += \
593 vnet/dhcp/proxy_error.def
595 ########################################
596 # ipv6 segment routing
597 ########################################
600 libvnet_la_SOURCES += \
602 vnet/sr/sr_replicate.c
605 nobase_include_HEADERS += \
606 vnet/sr/sr_packet.h \
607 vnet/sr/sr_error.def \
610 ########################################
612 ########################################
613 libvnet_la_SOURCES += \
614 vnet/dhcpv6/proxy_node.c
616 nobase_include_HEADERS += \
617 vnet/dhcpv6/packet.h \
618 vnet/dhcpv6/proxy.h \
619 vnet/dhcpv6/proxy_error.def
621 ########################################
622 # IPFIX / netflow v10
623 ########################################
624 libvnet_la_SOURCES += \
625 vnet/flow/flow_report.c
627 nobase_include_HEADERS += \
628 vnet/flow/flow_report.h \
629 vnet/flow/ipfix_info_elements.h \
630 vnet/flow/ipfix_packet.h
632 ########################################
633 # IPFIX classify code
634 ########################################
636 libvnet_la_SOURCES += \
637 vnet/flow/flow_report_classify.c
639 nobase_include_HEADERS += \
640 vnet/flow/flow_report_classify.h
642 ########################################
644 ########################################
646 libvnet_la_SOURCES += \
647 vnet/lawful-intercept/lawful_intercept.c \
648 vnet/lawful-intercept/node.c
650 nobase_include_HEADERS += \
651 vnet/lawful-intercept/lawful_intercept.h
653 ########################################
654 # SPAN (port mirroring)
655 ########################################
657 libvnet_la_SOURCES += \
661 nobase_include_HEADERS += \
664 ########################################
666 ########################################
668 libvnet_la_SOURCES += \
676 nobase_include_HEADERS += \
680 ########################################
682 ########################################
684 libvnet_la_SOURCES += \
685 vnet/devices/dpdk/dpdk_priv.h \
686 vnet/devices/dpdk/device.c \
687 vnet/devices/dpdk/format.c \
688 vnet/devices/dpdk/init.c \
689 vnet/devices/dpdk/node.c \
690 vnet/devices/dpdk/hqos.c \
691 vnet/devices/dpdk/cli.c
693 nobase_include_HEADERS += \
694 vnet/devices/dpdk/dpdk.h
696 libvnet_la_SOURCES += \
697 vnet/devices/nic/ixge.c \
698 vnet/devices/nic/ixge.h \
699 vnet/devices/nic/sfp.c \
700 vnet/devices/nic/sfp.h
703 ########################################
705 ########################################
707 libvnet_la_SOURCES += \
708 vnet/devices/virtio/vhost-user.c
710 nobase_include_HEADERS += \
711 vnet/devices/virtio/vhost-user.h
713 ########################################
715 ########################################
716 libvnet_la_SOURCES += \
717 vnet/devices/ssvm/ssvm_eth.c \
718 vnet/devices/ssvm/node.c
720 nobase_include_HEADERS += \
721 vnet/devices/ssvm/ssvm_eth.h
723 ########################################
724 # Linux packet interface
725 ########################################
727 libvnet_la_SOURCES += \
728 vnet/devices/af_packet/af_packet.c \
729 vnet/devices/af_packet/device.c \
730 vnet/devices/af_packet/node.c \
731 vnet/devices/af_packet/cli.c
733 nobase_include_HEADERS += \
734 vnet/devices/af_packet/af_packet.h
736 ########################################
738 ########################################
740 libvnet_la_SOURCES += \
741 vnet/devices/netmap/netmap.c \
742 vnet/devices/netmap/device.c \
743 vnet/devices/netmap/node.c \
744 vnet/devices/netmap/cli.c
746 nobase_include_HEADERS += \
747 vnet/devices/netmap/netmap.h
750 ########################################
751 # Driver feature graph arc support
752 ########################################
754 libvnet_la_SOURCES += \
755 vnet/feature/feature.c \
756 vnet/feature/registration.c
758 nobase_include_HEADERS += \
759 vnet/feature/feature.h
761 ########################################
762 # Unix kernel related
763 ########################################
765 # FIXME: vnet/unix/hgshm.c
767 libvnet_la_SOURCES += \
768 vnet/unix/gdb_funcs.c \
773 nobase_include_HEADERS += \
778 ########################################
780 ########################################
782 libvnet_la_SOURCES += \
784 vnet/fib/fib_test.c \
787 vnet/fib/mpls_fib.c \
788 vnet/fib/fib_table.c \
789 vnet/fib/fib_walk.c \
790 vnet/fib/fib_types.c \
791 vnet/fib/fib_node.c \
792 vnet/fib/fib_node_list.c \
793 vnet/fib/fib_entry.c \
794 vnet/fib/fib_entry_src.c \
795 vnet/fib/fib_entry_src_rr.c \
796 vnet/fib/fib_entry_src_interface.c \
797 vnet/fib/fib_entry_src_default_route.c \
798 vnet/fib/fib_entry_src_special.c \
799 vnet/fib/fib_entry_src_api.c \
800 vnet/fib/fib_entry_src_adj.c \
801 vnet/fib/fib_entry_src_mpls.c \
802 vnet/fib/fib_entry_src_lisp.c \
803 vnet/fib/fib_entry_cover.c \
804 vnet/fib/fib_path_list.c \
805 vnet/fib/fib_path.c \
806 vnet/fib/fib_path_ext.c \
807 vnet/fib/fib_urpf_list.c \
808 vnet/fib/fib_attached_export.c
810 nobase_include_HEADERS += \
814 vnet/fib/fib_types.h \
815 vnet/fib/fib_table.h \
816 vnet/fib/fib_node.h \
817 vnet/fib/fib_node_list.h \
820 ########################################
822 ########################################
824 libvnet_la_SOURCES += \
826 vnet/adj/adj_rewrite.c \
827 vnet/adj/adj_glean.c \
828 vnet/adj/adj_midchain.c \
832 nobase_include_HEADERS += \
834 vnet/adj/adj_types.h \
835 vnet/adj/adj_rewrite.h \
836 vnet/adj/adj_glean.h \
839 ########################################
841 ########################################
843 libvnet_la_SOURCES += \
845 vnet/dpo/drop_dpo.c \
846 vnet/dpo/ip_null_dpo.c \
847 vnet/dpo/punt_dpo.c \
848 vnet/dpo/receive_dpo.c \
849 vnet/dpo/load_balance.c \
850 vnet/dpo/load_balance_map.c \
851 vnet/dpo/lookup_dpo.c \
852 vnet/dpo/classify_dpo.c \
853 vnet/dpo/mpls_label_dpo.c
855 nobase_include_HEADERS += \
856 vnet/dpo/load_balance.h \
857 vnet/dpo/drop_dpo.h \
858 vnet/dpo/lookup_dpo.h \
859 vnet/dpo/punt_dpo.h \
860 vnet/dpo/classify_dpo.h \
861 vnet/dpo/receive_dpo.h \
862 vnet/dpo/ip_null_dpo.h \
865 ########################################
866 # Plugin client library
867 ########################################
869 libvnetplugin_la_SOURCES += \
872 nobase_include_HEADERS += \
875 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
878 vnet/unix/pcap2pg.c \
881 pcap2pg_LDFLAGS = -static
882 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
884 noinst_PROGRAMS += pcap2pg
886 # Set the suffix list
887 SUFFIXES = .api.h .api
889 # install the API definition, so we can produce java bindings, etc.
891 apidir = $(prefix)/vpp-api
892 api_DATA = vnet/interface.api
894 # The actual %.api.h rule is in .../build-data/packages/suffix-rules.mk
895 # and requires a symbolic link at the top of the vnet source tree
897 include $(top_srcdir)/suffix-rules.mk