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 \
325 vnet/ip/ip6_neighbor.h \
327 vnet/ip/ip_packet.h \
328 vnet/ip/ip_source_and_port_range_check.h \
331 vnet/ip/protocols.def \
332 vnet/ip/punt_error.def \
334 vnet/ip/tcp_packet.h \
335 vnet/ip/udp_error.def \
339 ########################################
340 # Layer 3 protocol: IPSec
341 ########################################
343 libvnet_la_SOURCES += \
345 vnet/ipsec/ipsec_cli.c \
346 vnet/ipsec/ipsec_format.c \
347 vnet/ipsec/ipsec_input.c \
348 vnet/ipsec/ipsec_if.c \
349 vnet/ipsec/ipsec_if_in.c \
350 vnet/ipsec/ipsec_if_out.c \
351 vnet/ipsec/esp_encrypt.c \
352 vnet/ipsec/esp_decrypt.c \
354 vnet/ipsec/ikev2_crypto.c \
355 vnet/ipsec/ikev2_cli.c \
356 vnet/ipsec/ikev2_payload.c \
357 vnet/ipsec/ikev2_format.c
359 libvnet_la_SOURCES += \
360 vnet/devices/dpdk/ipsec/esp_encrypt.c \
361 vnet/devices/dpdk/ipsec/esp_decrypt.c \
362 vnet/devices/dpdk/ipsec/crypto_node.c \
363 vnet/devices/dpdk/ipsec/cli.c \
364 vnet/devices/dpdk/ipsec/ipsec.c
368 libvnet_la_SOURCES += \
369 vnet/ipsec/ipsec_output.c
371 nobase_include_HEADERS += \
375 vnet/ipsec/ikev2_priv.h
377 nobase_include_HEADERS += \
378 vnet/devices/dpdk/ipsec/ipsec.h \
379 vnet/devices/dpdk/ipsec/esp.h
382 ########################################
383 # Layer 3 protocol: osi
384 ########################################
385 libvnet_la_SOURCES += \
390 nobase_include_HEADERS += \
393 ########################################
394 # Layer 3 protocol: MAP
395 ########################################
396 libvnet_la_SOURCES += \
401 vnet/map/ip4_map_t.c \
404 nobase_include_HEADERS += \
412 test_map_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
414 test_map_LDADD = libvnet.la -lvppinfra -lvlib \
415 -lpthread -lvlibmemory -lvlibapi -lvlib_unix \
418 test_map_LDFLAGS = -static
422 ########################################
423 # Tunnel protocol: gre
424 ########################################
425 libvnet_la_SOURCES += \
428 vnet/gre/interface.c \
431 nobase_include_HEADERS += \
436 ########################################
437 # Tunnel protocol: l2tpv3
438 ########################################
439 libvnet_la_SOURCES += \
445 nobase_include_HEADERS += \
449 ########################################
450 # Tunnel protocol: gre+mpls
451 ########################################
452 libvnet_la_SOURCES += \
454 vnet/mpls/mpls_lookup.c \
455 vnet/mpls/mpls_output.c \
456 vnet/mpls/mpls_features.c \
458 vnet/mpls/interface.c \
459 vnet/mpls/mpls_tunnel.c \
462 nobase_include_HEADERS += \
464 vnet/mpls/mpls_types.h \
465 vnet/mpls/mpls_tunnel.h \
470 ########################################
471 # Tunnel protocol: vxlan-gpe
472 ########################################
474 libvnet_la_SOURCES += \
475 vnet/vxlan-gpe/vxlan_gpe.c \
476 vnet/vxlan-gpe/encap.c \
477 vnet/vxlan-gpe/decap.c
479 nobase_include_HEADERS += \
480 vnet/vxlan-gpe/vxlan_gpe.h \
481 vnet/vxlan-gpe/vxlan_gpe_packet.h \
482 vnet/vxlan-gpe/vxlan_gpe_error.def
484 ########################################
485 # Tunnel protocol: ipsec+gre
486 ########################################
487 libvnet_la_SOURCES += \
488 vnet/ipsec-gre/ipsec_gre.c \
489 vnet/ipsec-gre/node.c \
490 vnet/ipsec-gre/interface.c
492 nobase_include_HEADERS += \
493 vnet/ipsec-gre/ipsec_gre.h \
494 vnet/ipsec-gre/error.def
496 ########################################
497 # LISP control plane: lisp-cp
498 ########################################
500 libvnet_la_SOURCES += \
501 vnet/lisp-cp/lisp_types.c \
502 vnet/lisp-cp/lisp_cp_dpo.c \
503 vnet/lisp-cp/control.c \
504 vnet/lisp-cp/gid_dictionary.c \
505 vnet/lisp-cp/lisp_msg_serdes.c \
506 vnet/lisp-cp/packets.c
508 nobase_include_HEADERS += \
509 vnet/lisp-cp/lisp_types.h \
510 vnet/lisp-cp/packets.h \
511 vnet/lisp-cp/gid_dictionary.h \
512 vnet/lisp-cp/lisp_cp_messages.h \
513 vnet/lisp-cp/lisp_msg_serdes.h \
514 vnet/lisp-cp/control.h
518 LDS = -lvppinfra -l:libvlib.a $(dpdk_libs) -l:libvlibmemory.a \
519 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
521 TESTS += test_cp_serdes test_lisp_types
523 test_cp_serdes_SOURCES = \
524 test/lisp-cp/test_cp_serdes.c \
525 vnet/lisp-cp/lisp_msg_serdes.c \
526 vnet/lisp-cp/lisp_types.c \
527 vnet/lisp-cp/packets.c \
528 vnet/ip/ip_checksum.c
530 test_lisp_types_SOURCES = \
531 test/lisp-cp/test_lisp_types.c \
532 vnet/lisp-cp/lisp_types.c
534 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
535 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
537 test_cp_serdes_LDADD = libvnet.la $(LDS)
538 test_lisp_types_LDADD = libvnet.la $(LDS)
540 test_cp_serdes_LDFLAGS = -static
541 test_lisp_types_LDFLAGS = -static
544 ########################################
545 # Tunnel protocol: lisp-gpe
546 ########################################
548 libvnet_la_SOURCES += \
549 vnet/lisp-gpe/lisp_gpe.c \
550 vnet/lisp-gpe/lisp_gpe_sub_interface.c \
551 vnet/lisp-gpe/lisp_gpe_adjacency.c \
552 vnet/lisp-gpe/lisp_gpe_tunnel.c \
553 vnet/lisp-gpe/lisp_gpe_fwd_entry.c \
554 vnet/lisp-gpe/lisp_gpe_tenant.c \
555 vnet/lisp-gpe/interface.c \
556 vnet/lisp-gpe/decap.c
558 nobase_include_HEADERS += \
559 vnet/lisp-gpe/lisp_gpe.h \
560 vnet/lisp-gpe/lisp_gpe_fwd_entry.h \
561 vnet/lisp-gpe/lisp_gpe_tenant.h \
562 vnet/lisp-gpe/lisp_gpe_packet.h \
563 vnet/lisp-gpe/lisp_gpe_error.def
568 test_test_SOURCES = test/lisp-gpe/test.c
570 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
572 test_test_LDADD = $(LIBOBJS)
574 noinst_PROGRAMS += $(TESTS)
575 check_PROGRAMS = $(TESTS)
578 ########################################
580 ########################################
581 libvnet_la_SOURCES += \
585 nobase_include_HEADERS += \
588 ########################################
590 ########################################
591 libvnet_la_SOURCES += \
592 vnet/dhcp/proxy_node.c \
595 nobase_include_HEADERS += \
598 vnet/dhcp/proxy_error.def
600 ########################################
601 # ipv6 segment routing
602 ########################################
605 libvnet_la_SOURCES += \
607 vnet/sr/sr_replicate.c
610 nobase_include_HEADERS += \
611 vnet/sr/sr_packet.h \
612 vnet/sr/sr_error.def \
615 ########################################
617 ########################################
618 libvnet_la_SOURCES += \
619 vnet/dhcpv6/proxy_node.c
621 nobase_include_HEADERS += \
622 vnet/dhcpv6/packet.h \
623 vnet/dhcpv6/proxy.h \
624 vnet/dhcpv6/proxy_error.def
626 ########################################
627 # IPFIX / netflow v10
628 ########################################
629 libvnet_la_SOURCES += \
630 vnet/flow/flow_report.c
632 nobase_include_HEADERS += \
633 vnet/flow/flow_report.h \
634 vnet/flow/ipfix_info_elements.h \
635 vnet/flow/ipfix_packet.h
637 ########################################
638 # IPFIX classify code
639 ########################################
641 libvnet_la_SOURCES += \
642 vnet/flow/flow_report_classify.c
644 nobase_include_HEADERS += \
645 vnet/flow/flow_report_classify.h
647 ########################################
649 ########################################
651 libvnet_la_SOURCES += \
652 vnet/lawful-intercept/lawful_intercept.c \
653 vnet/lawful-intercept/node.c
655 nobase_include_HEADERS += \
656 vnet/lawful-intercept/lawful_intercept.h
658 ########################################
659 # SPAN (port mirroring)
660 ########################################
662 libvnet_la_SOURCES += \
666 nobase_include_HEADERS += \
669 ########################################
671 ########################################
673 libvnet_la_SOURCES += \
681 nobase_include_HEADERS += \
685 ########################################
687 ########################################
689 libvnet_la_SOURCES += \
690 vnet/devices/dpdk/dpdk_priv.h \
691 vnet/devices/dpdk/device.c \
692 vnet/devices/dpdk/format.c \
693 vnet/devices/dpdk/init.c \
694 vnet/devices/dpdk/node.c \
695 vnet/devices/dpdk/hqos.c \
696 vnet/devices/dpdk/cli.c
698 nobase_include_HEADERS += \
699 vnet/devices/dpdk/dpdk.h
701 libvnet_la_SOURCES += \
702 vnet/devices/nic/ixge.c \
703 vnet/devices/nic/ixge.h \
704 vnet/devices/nic/sfp.c \
705 vnet/devices/nic/sfp.h
708 ########################################
710 ########################################
712 libvnet_la_SOURCES += \
713 vnet/devices/virtio/vhost-user.c
715 nobase_include_HEADERS += \
716 vnet/devices/virtio/vhost-user.h
718 ########################################
720 ########################################
721 libvnet_la_SOURCES += \
722 vnet/devices/ssvm/ssvm_eth.c \
723 vnet/devices/ssvm/node.c
725 nobase_include_HEADERS += \
726 vnet/devices/ssvm/ssvm_eth.h
728 ########################################
729 # Linux packet interface
730 ########################################
732 libvnet_la_SOURCES += \
733 vnet/devices/af_packet/af_packet.c \
734 vnet/devices/af_packet/device.c \
735 vnet/devices/af_packet/node.c \
736 vnet/devices/af_packet/cli.c
738 nobase_include_HEADERS += \
739 vnet/devices/af_packet/af_packet.h
741 ########################################
743 ########################################
745 libvnet_la_SOURCES += \
746 vnet/devices/netmap/netmap.c \
747 vnet/devices/netmap/device.c \
748 vnet/devices/netmap/node.c \
749 vnet/devices/netmap/cli.c
751 nobase_include_HEADERS += \
752 vnet/devices/netmap/netmap.h
755 ########################################
756 # Driver feature graph arc support
757 ########################################
759 libvnet_la_SOURCES += \
760 vnet/feature/feature.c \
761 vnet/feature/registration.c
763 nobase_include_HEADERS += \
764 vnet/feature/feature.h
766 ########################################
767 # Unix kernel related
768 ########################################
770 # FIXME: vnet/unix/hgshm.c
772 libvnet_la_SOURCES += \
773 vnet/unix/gdb_funcs.c \
778 nobase_include_HEADERS += \
783 ########################################
785 ########################################
787 libvnet_la_SOURCES += \
789 vnet/fib/fib_test.c \
792 vnet/fib/mpls_fib.c \
793 vnet/fib/fib_table.c \
794 vnet/fib/fib_walk.c \
795 vnet/fib/fib_types.c \
796 vnet/fib/fib_node.c \
797 vnet/fib/fib_node_list.c \
798 vnet/fib/fib_entry.c \
799 vnet/fib/fib_entry_src.c \
800 vnet/fib/fib_entry_src_rr.c \
801 vnet/fib/fib_entry_src_interface.c \
802 vnet/fib/fib_entry_src_default_route.c \
803 vnet/fib/fib_entry_src_special.c \
804 vnet/fib/fib_entry_src_api.c \
805 vnet/fib/fib_entry_src_adj.c \
806 vnet/fib/fib_entry_src_mpls.c \
807 vnet/fib/fib_entry_src_lisp.c \
808 vnet/fib/fib_entry_cover.c \
809 vnet/fib/fib_entry_delegate.c \
810 vnet/fib/fib_path_list.c \
811 vnet/fib/fib_path.c \
812 vnet/fib/fib_path_ext.c \
813 vnet/fib/fib_urpf_list.c \
814 vnet/fib/fib_attached_export.c
816 nobase_include_HEADERS += \
820 vnet/fib/fib_types.h \
821 vnet/fib/fib_table.h \
822 vnet/fib/fib_node.h \
823 vnet/fib/fib_node_list.h \
824 vnet/fib/fib_entry.h \
825 vnet/fib/fib_entry_delegate.h
827 ########################################
829 ########################################
831 libvnet_la_SOURCES += \
833 vnet/adj/adj_rewrite.c \
834 vnet/adj/adj_glean.c \
835 vnet/adj/adj_midchain.c \
839 nobase_include_HEADERS += \
841 vnet/adj/adj_types.h \
842 vnet/adj/adj_rewrite.h \
843 vnet/adj/adj_glean.h \
846 ########################################
848 ########################################
850 libvnet_la_SOURCES += \
852 vnet/dpo/drop_dpo.c \
853 vnet/dpo/ip_null_dpo.c \
854 vnet/dpo/punt_dpo.c \
855 vnet/dpo/receive_dpo.c \
856 vnet/dpo/load_balance.c \
857 vnet/dpo/load_balance_map.c \
858 vnet/dpo/lookup_dpo.c \
859 vnet/dpo/classify_dpo.c \
860 vnet/dpo/mpls_label_dpo.c
862 nobase_include_HEADERS += \
863 vnet/dpo/load_balance.h \
864 vnet/dpo/drop_dpo.h \
865 vnet/dpo/lookup_dpo.h \
866 vnet/dpo/punt_dpo.h \
867 vnet/dpo/classify_dpo.h \
868 vnet/dpo/receive_dpo.h \
869 vnet/dpo/ip_null_dpo.h \
872 ########################################
873 # Plugin client library
874 ########################################
876 libvnetplugin_la_SOURCES += \
879 nobase_include_HEADERS += \
882 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
885 vnet/unix/pcap2pg.c \
888 pcap2pg_LDFLAGS = -static
889 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
891 noinst_PROGRAMS += pcap2pg
893 # Set the suffix list
894 SUFFIXES = .api.h .api .api.json
896 # install the API definition, so we can produce java bindings, etc.
898 apidir = $(prefix)/vnet
899 api_DATA = vnet/interface.api.json vnet/l2/l2.api.json
901 # The actual %.api.h rule is in .../build-data/packages/suffix-rules.mk
902 # and requires a symbolic link at the top of the vnet source tree
904 include $(top_srcdir)/suffix-rules.mk