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@
19 vnet/interface.api.h \
20 vnet/interface.api.json \
24 vnet/map/map.api.json \
25 vnet/span/span.api.h \
26 vnet/span/span.api.json
29 libvnetplugin_la_SOURCES =
30 nobase_include_HEADERS =
36 dpdk_libs += -l:libdpdk.a
39 ########################################
41 ########################################
42 libvnet_la_SOURCES += \
44 vnet/devices/devices.c \
47 vnet/interface_api.c \
48 vnet/interface_cli.c \
49 vnet/interface_format.c \
50 vnet/interface_output.c \
55 nobase_include_HEADERS += \
59 vnet/devices/devices.h \
63 vnet/interface.api.h \
64 vnet/interface_funcs.h \
70 vnet/vnet_all_api_h.h \
73 ########################################
75 ########################################
77 libvnet_la_SOURCES += \
78 vnet/policer/node_funcs.c \
79 vnet/policer/policer.c \
82 nobase_include_HEADERS += \
83 vnet/policer/police.h \
84 vnet/policer/policer.h \
87 ########################################
89 ########################################
91 libvnet_la_SOURCES += \
94 vnet/cop/ip4_whitelist.c \
95 vnet/cop/ip6_whitelist.c
97 nobase_include_HEADERS += \
100 ########################################
101 # Layer 2 protocols go here
102 ########################################
104 ########################################
105 # Layer 2 protocol: Ethernet
106 ########################################
107 libvnet_la_SOURCES += \
108 vnet/ethernet/arp.c \
109 vnet/ethernet/format.c \
110 vnet/ethernet/init.c \
111 vnet/ethernet/interface.c \
112 vnet/ethernet/node.c \
115 nobase_include_HEADERS += \
116 vnet/ethernet/arp_packet.h \
117 vnet/ethernet/error.def \
118 vnet/ethernet/ethernet.h \
119 vnet/ethernet/packet.h \
120 vnet/ethernet/types.def
122 ########################################
123 # Layer 2 protocol: Ethernet bridging
124 ########################################
125 libvnet_la_SOURCES += \
126 vnet/l2/feat_bitmap.c \
130 vnet/l2/l2_input_classify.c \
131 vnet/l2/l2_output_classify.c \
132 vnet/l2/l2_efp_filter.c \
136 vnet/l2/l2_input_acl.c \
138 vnet/l2/l2_input_vtr.c \
140 vnet/l2/l2_output_acl.c \
141 vnet/l2/l2_output.c \
147 nobase_include_HEADERS += \
148 vnet/l2/feat_bitmap.h \
150 vnet/l2/l2_output.h \
152 vnet/l2/l2_input_vtr.h \
153 vnet/l2/l2_efp_filter.h \
161 vnet/l2/l2_classify.h \
164 ########################################
165 # Layer 2 protocol: SRP
166 ########################################
167 libvnet_la_SOURCES += \
169 vnet/srp/interface.c \
173 nobase_include_HEADERS += \
177 ########################################
178 # Layer 2 protocol: PPP
179 ########################################
180 libvnet_la_SOURCES += \
185 nobase_include_HEADERS += \
190 ########################################
191 # Layer 2 protocol: HDLC
192 ########################################
193 libvnet_la_SOURCES += \
198 nobase_include_HEADERS += \
199 vnet/hdlc/error.def \
203 ########################################
204 # Layer 2 protocol: LLC
205 ########################################
206 libvnet_la_SOURCES += \
211 nobase_include_HEADERS += \
214 ########################################
215 # Layer 2 protocol: SNAP
216 ########################################
217 libvnet_la_SOURCES += \
222 nobase_include_HEADERS += \
225 ########################################
227 ########################################
228 libvnet_la_SOURCES += \
233 nobase_include_HEADERS += \
235 vnet/vxlan/vxlan_packet.h \
236 vnet/vxlan/vxlan_error.def
238 ########################################
240 ########################################
241 libvnet_la_SOURCES += \
242 vnet/cdp/cdp_input.c \
243 vnet/cdp/cdp_node.c \
244 vnet/cdp/cdp_periodic.c
246 nobase_include_HEADERS += \
247 vnet/cdp/cdp_protocol.h
249 ########################################
251 ########################################
252 libvnet_la_SOURCES += \
253 vnet/lldp/lldp_input.c \
254 vnet/lldp/lldp_node.c \
255 vnet/lldp/lldp_output.c \
258 nobase_include_HEADERS += \
259 vnet/lldp/lldp_protocol.h
261 ########################################
262 # Layer 2/3 "classify"
263 ########################################
264 libvnet_la_SOURCES += \
265 vnet/classify/vnet_classify.c \
266 vnet/classify/ip_classify.c \
267 vnet/classify/input_acl.c \
268 vnet/classify/policer_classify.c \
269 vnet/classify/flow_classify.c \
270 vnet/classify/flow_classify_node.c \
271 vnet/classify/vnet_classify.h
273 nobase_include_HEADERS += \
274 vnet/classify/vnet_classify.h \
275 vnet/classify/input_acl.h \
276 vnet/classify/policer_classify.h \
277 vnet/classify/flow_classify.h
279 ########################################
280 # Layer 3 protocols go here
281 ########################################
283 ########################################
284 # Layer 3 protocol: IP v4/v6
285 ########################################
286 libvnet_la_SOURCES += \
291 vnet/ip/ip4_format.c \
292 vnet/ip/ip4_forward.c \
293 vnet/ip/ip4_input.c \
294 vnet/ip/ip4_mtrie.c \
296 vnet/ip/ip4_source_and_port_range_check.c \
297 vnet/ip/ip4_source_check.c \
298 vnet/ip/ip6_format.c \
299 vnet/ip/ip6_forward.c \
300 vnet/ip/ip6_hop_by_hop.c \
301 vnet/ip/ip6_input.c \
302 vnet/ip/ip6_neighbor.c \
304 vnet/ip/ip_checksum.c \
308 vnet/ip/ip_input_acl.c \
312 vnet/ip/udp_format.c \
314 vnet/ip/udp_local.c \
317 nobase_include_HEADERS += \
319 vnet/ip/icmp46_packet.h \
322 vnet/ip/igmp_packet.h \
323 vnet/ip/ip4_error.h \
325 vnet/ip/ip4_mtrie.h \
326 vnet/ip/ip4_packet.h \
327 vnet/ip/ip6_error.h \
329 vnet/ip/ip6_hop_by_hop.h \
330 vnet/ip/ip6_hop_by_hop_packet.h \
331 vnet/ip/ip6_packet.h \
332 vnet/ip/ip6_neighbor.h \
334 vnet/ip/ip_packet.h \
335 vnet/ip/ip_source_and_port_range_check.h \
338 vnet/ip/protocols.def \
339 vnet/ip/punt_error.def \
341 vnet/ip/tcp_packet.h \
342 vnet/ip/udp_error.def \
346 ########################################
347 # Layer 3 protocol: IPSec
348 ########################################
350 libvnet_la_SOURCES += \
352 vnet/ipsec/ipsec_cli.c \
353 vnet/ipsec/ipsec_format.c \
354 vnet/ipsec/ipsec_input.c \
355 vnet/ipsec/ipsec_if.c \
356 vnet/ipsec/ipsec_if_in.c \
357 vnet/ipsec/ipsec_if_out.c \
358 vnet/ipsec/esp_encrypt.c \
359 vnet/ipsec/esp_decrypt.c \
361 vnet/ipsec/ikev2_crypto.c \
362 vnet/ipsec/ikev2_cli.c \
363 vnet/ipsec/ikev2_payload.c \
364 vnet/ipsec/ikev2_format.c
366 libvnet_la_SOURCES += \
367 vnet/devices/dpdk/ipsec/esp_encrypt.c \
368 vnet/devices/dpdk/ipsec/esp_decrypt.c \
369 vnet/devices/dpdk/ipsec/crypto_node.c \
370 vnet/devices/dpdk/ipsec/cli.c \
371 vnet/devices/dpdk/ipsec/ipsec.c
375 libvnet_la_SOURCES += \
376 vnet/ipsec/ipsec_output.c
378 nobase_include_HEADERS += \
382 vnet/ipsec/ikev2_priv.h
384 nobase_include_HEADERS += \
385 vnet/devices/dpdk/ipsec/ipsec.h \
386 vnet/devices/dpdk/ipsec/esp.h
389 ########################################
390 # Layer 3 protocol: osi
391 ########################################
392 libvnet_la_SOURCES += \
397 nobase_include_HEADERS += \
400 ########################################
401 # Layer 3 protocol: MAP
402 ########################################
403 libvnet_la_SOURCES += \
408 vnet/map/ip4_map_t.c \
409 vnet/map/ip6_map_t.c \
412 nobase_include_HEADERS += \
421 test_map_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
423 test_map_LDADD = libvnet.la -lvppinfra -lvlib \
424 -lpthread -lvlibmemory -lvlibapi -lvlib_unix \
427 test_map_LDFLAGS = -static
431 ########################################
432 # Tunnel protocol: gre
433 ########################################
434 libvnet_la_SOURCES += \
437 vnet/gre/interface.c \
440 nobase_include_HEADERS += \
445 ########################################
446 # Tunnel protocol: l2tpv3
447 ########################################
448 libvnet_la_SOURCES += \
454 nobase_include_HEADERS += \
458 ########################################
459 # Tunnel protocol: gre+mpls
460 ########################################
461 libvnet_la_SOURCES += \
463 vnet/mpls/mpls_lookup.c \
464 vnet/mpls/mpls_output.c \
465 vnet/mpls/mpls_features.c \
467 vnet/mpls/interface.c \
468 vnet/mpls/mpls_tunnel.c \
471 nobase_include_HEADERS += \
473 vnet/mpls/mpls_types.h \
474 vnet/mpls/mpls_tunnel.h \
479 ########################################
480 # Tunnel protocol: vxlan-gpe
481 ########################################
483 libvnet_la_SOURCES += \
484 vnet/vxlan-gpe/vxlan_gpe.c \
485 vnet/vxlan-gpe/encap.c \
486 vnet/vxlan-gpe/decap.c
488 nobase_include_HEADERS += \
489 vnet/vxlan-gpe/vxlan_gpe.h \
490 vnet/vxlan-gpe/vxlan_gpe_packet.h \
491 vnet/vxlan-gpe/vxlan_gpe_error.def
493 ########################################
494 # Tunnel protocol: ipsec+gre
495 ########################################
496 libvnet_la_SOURCES += \
497 vnet/ipsec-gre/ipsec_gre.c \
498 vnet/ipsec-gre/node.c \
499 vnet/ipsec-gre/interface.c
501 nobase_include_HEADERS += \
502 vnet/ipsec-gre/ipsec_gre.h \
503 vnet/ipsec-gre/error.def
505 ########################################
506 # LISP control plane: lisp-cp
507 ########################################
509 libvnet_la_SOURCES += \
510 vnet/lisp-cp/lisp_types.c \
511 vnet/lisp-cp/lisp_cp_dpo.c \
512 vnet/lisp-cp/control.c \
513 vnet/lisp-cp/gid_dictionary.c \
514 vnet/lisp-cp/lisp_msg_serdes.c \
515 vnet/lisp-cp/packets.c
517 nobase_include_HEADERS += \
518 vnet/lisp-cp/lisp_types.h \
519 vnet/lisp-cp/packets.h \
520 vnet/lisp-cp/gid_dictionary.h \
521 vnet/lisp-cp/lisp_cp_messages.h \
522 vnet/lisp-cp/lisp_msg_serdes.h \
523 vnet/lisp-cp/control.h
527 LDS = -lvppinfra -l:libvlib.a $(dpdk_libs) -l:libvlibmemory.a \
528 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
530 TESTS += test_cp_serdes test_lisp_types
532 test_cp_serdes_SOURCES = \
533 test/lisp-cp/test_cp_serdes.c \
534 vnet/lisp-cp/lisp_msg_serdes.c \
535 vnet/lisp-cp/lisp_types.c \
536 vnet/lisp-cp/packets.c \
537 vnet/ip/ip_checksum.c
539 test_lisp_types_SOURCES = \
540 test/lisp-cp/test_lisp_types.c \
541 vnet/lisp-cp/lisp_types.c
543 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
544 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
546 test_cp_serdes_LDADD = libvnet.la $(LDS)
547 test_lisp_types_LDADD = libvnet.la $(LDS)
549 test_cp_serdes_LDFLAGS = -static
550 test_lisp_types_LDFLAGS = -static
553 ########################################
554 # Tunnel protocol: lisp-gpe
555 ########################################
557 libvnet_la_SOURCES += \
558 vnet/lisp-gpe/lisp_gpe.c \
559 vnet/lisp-gpe/lisp_gpe_sub_interface.c \
560 vnet/lisp-gpe/lisp_gpe_adjacency.c \
561 vnet/lisp-gpe/lisp_gpe_tunnel.c \
562 vnet/lisp-gpe/lisp_gpe_fwd_entry.c \
563 vnet/lisp-gpe/lisp_gpe_tenant.c \
564 vnet/lisp-gpe/interface.c \
565 vnet/lisp-gpe/decap.c
567 nobase_include_HEADERS += \
568 vnet/lisp-gpe/lisp_gpe.h \
569 vnet/lisp-gpe/lisp_gpe_fwd_entry.h \
570 vnet/lisp-gpe/lisp_gpe_tenant.h \
571 vnet/lisp-gpe/lisp_gpe_packet.h \
572 vnet/lisp-gpe/lisp_gpe_error.def
577 test_test_SOURCES = test/lisp-gpe/test.c
579 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
581 test_test_LDADD = $(LIBOBJS)
583 noinst_PROGRAMS += $(TESTS)
584 check_PROGRAMS = $(TESTS)
587 ########################################
589 ########################################
590 libvnet_la_SOURCES += \
594 nobase_include_HEADERS += \
597 ########################################
599 ########################################
600 libvnet_la_SOURCES += \
601 vnet/dhcp/proxy_node.c \
604 nobase_include_HEADERS += \
607 vnet/dhcp/proxy_error.def
609 ########################################
610 # ipv6 segment routing
611 ########################################
614 libvnet_la_SOURCES += \
616 vnet/sr/sr_replicate.c
619 nobase_include_HEADERS += \
620 vnet/sr/sr_packet.h \
621 vnet/sr/sr_error.def \
624 ########################################
626 ########################################
627 libvnet_la_SOURCES += \
628 vnet/dhcpv6/proxy_node.c
630 nobase_include_HEADERS += \
631 vnet/dhcpv6/packet.h \
632 vnet/dhcpv6/proxy.h \
633 vnet/dhcpv6/proxy_error.def
635 ########################################
636 # IPFIX / netflow v10
637 ########################################
638 libvnet_la_SOURCES += \
639 vnet/flow/flow_report.c
641 nobase_include_HEADERS += \
642 vnet/flow/flow_report.h \
643 vnet/flow/ipfix_info_elements.h \
644 vnet/flow/ipfix_packet.h
646 ########################################
647 # IPFIX classify code
648 ########################################
650 libvnet_la_SOURCES += \
651 vnet/flow/flow_report_classify.c
653 nobase_include_HEADERS += \
654 vnet/flow/flow_report_classify.h
656 ########################################
658 ########################################
660 libvnet_la_SOURCES += \
661 vnet/lawful-intercept/lawful_intercept.c \
662 vnet/lawful-intercept/node.c
664 nobase_include_HEADERS += \
665 vnet/lawful-intercept/lawful_intercept.h
667 ########################################
668 # SPAN (port mirroring)
669 ########################################
671 libvnet_la_SOURCES += \
672 vnet/span/span_api.c \
676 nobase_include_HEADERS += \
677 vnet/span/span.api.h \
680 ########################################
682 ########################################
684 libvnet_la_SOURCES += \
692 nobase_include_HEADERS += \
696 ########################################
698 ########################################
700 libvnet_la_SOURCES += \
701 vnet/devices/dpdk/dpdk_priv.h \
702 vnet/devices/dpdk/device.c \
703 vnet/devices/dpdk/format.c \
704 vnet/devices/dpdk/init.c \
705 vnet/devices/dpdk/node.c \
706 vnet/devices/dpdk/hqos.c \
707 vnet/devices/dpdk/cli.c
709 nobase_include_HEADERS += \
710 vnet/devices/dpdk/dpdk.h
712 libvnet_la_SOURCES += \
713 vnet/devices/nic/ixge.c \
714 vnet/devices/nic/ixge.h \
715 vnet/devices/nic/sfp.c \
716 vnet/devices/nic/sfp.h
719 ########################################
721 ########################################
723 libvnet_la_SOURCES += \
724 vnet/devices/virtio/vhost-user.c
726 nobase_include_HEADERS += \
727 vnet/devices/virtio/vhost-user.h
729 ########################################
731 ########################################
732 libvnet_la_SOURCES += \
733 vnet/devices/ssvm/ssvm_eth.c \
734 vnet/devices/ssvm/node.c
736 nobase_include_HEADERS += \
737 vnet/devices/ssvm/ssvm_eth.h
739 ########################################
740 # Linux packet interface
741 ########################################
743 libvnet_la_SOURCES += \
744 vnet/devices/af_packet/af_packet.c \
745 vnet/devices/af_packet/device.c \
746 vnet/devices/af_packet/node.c \
747 vnet/devices/af_packet/cli.c
749 nobase_include_HEADERS += \
750 vnet/devices/af_packet/af_packet.h
752 ########################################
754 ########################################
756 libvnet_la_SOURCES += \
757 vnet/devices/netmap/netmap.c \
758 vnet/devices/netmap/device.c \
759 vnet/devices/netmap/node.c \
760 vnet/devices/netmap/cli.c
762 nobase_include_HEADERS += \
763 vnet/devices/netmap/netmap.h
766 ########################################
767 # Driver feature graph arc support
768 ########################################
770 libvnet_la_SOURCES += \
771 vnet/feature/feature.c \
772 vnet/feature/registration.c
774 nobase_include_HEADERS += \
775 vnet/feature/feature.h
777 ########################################
778 # Unix kernel related
779 ########################################
781 # FIXME: vnet/unix/hgshm.c
783 libvnet_la_SOURCES += \
784 vnet/unix/gdb_funcs.c \
789 nobase_include_HEADERS += \
794 ########################################
796 ########################################
798 libvnet_la_SOURCES += \
800 vnet/fib/fib_test.c \
803 vnet/fib/mpls_fib.c \
804 vnet/fib/fib_table.c \
805 vnet/fib/fib_walk.c \
806 vnet/fib/fib_types.c \
807 vnet/fib/fib_node.c \
808 vnet/fib/fib_node_list.c \
809 vnet/fib/fib_entry.c \
810 vnet/fib/fib_entry_src.c \
811 vnet/fib/fib_entry_src_rr.c \
812 vnet/fib/fib_entry_src_interface.c \
813 vnet/fib/fib_entry_src_default_route.c \
814 vnet/fib/fib_entry_src_special.c \
815 vnet/fib/fib_entry_src_api.c \
816 vnet/fib/fib_entry_src_adj.c \
817 vnet/fib/fib_entry_src_mpls.c \
818 vnet/fib/fib_entry_src_lisp.c \
819 vnet/fib/fib_entry_cover.c \
820 vnet/fib/fib_entry_delegate.c \
821 vnet/fib/fib_path_list.c \
822 vnet/fib/fib_path.c \
823 vnet/fib/fib_path_ext.c \
824 vnet/fib/fib_urpf_list.c \
825 vnet/fib/fib_attached_export.c
827 nobase_include_HEADERS += \
831 vnet/fib/fib_types.h \
832 vnet/fib/fib_table.h \
833 vnet/fib/fib_node.h \
834 vnet/fib/fib_node_list.h \
835 vnet/fib/fib_entry.h \
836 vnet/fib/fib_entry_delegate.h
838 ########################################
840 ########################################
842 libvnet_la_SOURCES += \
844 vnet/adj/adj_rewrite.c \
845 vnet/adj/adj_glean.c \
846 vnet/adj/adj_midchain.c \
850 nobase_include_HEADERS += \
852 vnet/adj/adj_types.h \
853 vnet/adj/adj_rewrite.h \
854 vnet/adj/adj_glean.h \
857 ########################################
859 ########################################
861 libvnet_la_SOURCES += \
863 vnet/dpo/drop_dpo.c \
864 vnet/dpo/ip_null_dpo.c \
865 vnet/dpo/punt_dpo.c \
866 vnet/dpo/receive_dpo.c \
867 vnet/dpo/load_balance.c \
868 vnet/dpo/load_balance_map.c \
869 vnet/dpo/lookup_dpo.c \
870 vnet/dpo/classify_dpo.c \
871 vnet/dpo/mpls_label_dpo.c
873 nobase_include_HEADERS += \
874 vnet/dpo/load_balance.h \
875 vnet/dpo/drop_dpo.h \
876 vnet/dpo/lookup_dpo.h \
877 vnet/dpo/punt_dpo.h \
878 vnet/dpo/classify_dpo.h \
879 vnet/dpo/receive_dpo.h \
880 vnet/dpo/ip_null_dpo.h \
883 ########################################
884 # Plugin client library
885 ########################################
887 libvnetplugin_la_SOURCES += \
890 nobase_include_HEADERS += \
893 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
896 vnet/unix/pcap2pg.c \
899 pcap2pg_LDFLAGS = -static
900 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
902 noinst_PROGRAMS += pcap2pg
904 # Set the suffix list
905 SUFFIXES = .api.h .api .api.json
907 # install the API definition, so we can produce java bindings, etc.
909 apidir = $(prefix)/vnet
911 vnet/interface.api.json \
912 vnet/l2/l2.api.json \
913 vnet/map/map.api.json
915 # The actual %.api.h rule is in .../build-data/packages/suffix-rules.mk
916 # and requires a symbolic link at the top of the vnet source tree
918 include $(top_srcdir)/suffix-rules.mk