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 \
27 libvnetplugin_la_SOURCES =
28 nobase_include_HEADERS =
34 dpdk_libs += -l:libdpdk.a
37 ########################################
39 ########################################
40 libvnet_la_SOURCES += \
42 vnet/devices/devices.c \
45 vnet/interface_api.c \
46 vnet/interface_cli.c \
47 vnet/interface_format.c \
48 vnet/interface_output.c \
53 nobase_include_HEADERS += \
57 vnet/devices/devices.h \
61 vnet/interface.api.h \
62 vnet/interface_funcs.h \
68 vnet/vnet_all_api_h.h \
71 ########################################
73 ########################################
75 libvnet_la_SOURCES += \
76 vnet/policer/node_funcs.c \
77 vnet/policer/policer.c \
80 nobase_include_HEADERS += \
81 vnet/policer/police.h \
82 vnet/policer/policer.h \
85 ########################################
87 ########################################
89 libvnet_la_SOURCES += \
92 vnet/cop/ip4_whitelist.c \
93 vnet/cop/ip6_whitelist.c
95 nobase_include_HEADERS += \
98 ########################################
99 # Layer 2 protocols go here
100 ########################################
102 ########################################
103 # Layer 2 protocol: Ethernet
104 ########################################
105 libvnet_la_SOURCES += \
106 vnet/ethernet/arp.c \
107 vnet/ethernet/format.c \
108 vnet/ethernet/init.c \
109 vnet/ethernet/interface.c \
110 vnet/ethernet/node.c \
113 nobase_include_HEADERS += \
114 vnet/ethernet/arp_packet.h \
115 vnet/ethernet/error.def \
116 vnet/ethernet/ethernet.h \
117 vnet/ethernet/packet.h \
118 vnet/ethernet/types.def
120 ########################################
121 # Layer 2 protocol: Ethernet bridging
122 ########################################
123 libvnet_la_SOURCES += \
124 vnet/l2/feat_bitmap.c \
128 vnet/l2/l2_input_classify.c \
129 vnet/l2/l2_output_classify.c \
130 vnet/l2/l2_efp_filter.c \
134 vnet/l2/l2_input_acl.c \
136 vnet/l2/l2_input_vtr.c \
138 vnet/l2/l2_output_acl.c \
139 vnet/l2/l2_output.c \
145 nobase_include_HEADERS += \
146 vnet/l2/feat_bitmap.h \
148 vnet/l2/l2_output.h \
150 vnet/l2/l2_input_vtr.h \
151 vnet/l2/l2_efp_filter.h \
159 vnet/l2/l2_classify.h \
162 ########################################
163 # Layer 2 protocol: SRP
164 ########################################
165 libvnet_la_SOURCES += \
167 vnet/srp/interface.c \
171 nobase_include_HEADERS += \
175 ########################################
176 # Layer 2 protocol: PPP
177 ########################################
178 libvnet_la_SOURCES += \
183 nobase_include_HEADERS += \
188 ########################################
189 # Layer 2 protocol: HDLC
190 ########################################
191 libvnet_la_SOURCES += \
196 nobase_include_HEADERS += \
197 vnet/hdlc/error.def \
201 ########################################
202 # Layer 2 protocol: LLC
203 ########################################
204 libvnet_la_SOURCES += \
209 nobase_include_HEADERS += \
212 ########################################
213 # Layer 2 protocol: SNAP
214 ########################################
215 libvnet_la_SOURCES += \
220 nobase_include_HEADERS += \
223 ########################################
225 ########################################
226 libvnet_la_SOURCES += \
231 nobase_include_HEADERS += \
233 vnet/vxlan/vxlan_packet.h \
234 vnet/vxlan/vxlan_error.def
236 ########################################
238 ########################################
239 libvnet_la_SOURCES += \
240 vnet/cdp/cdp_input.c \
241 vnet/cdp/cdp_node.c \
242 vnet/cdp/cdp_periodic.c
244 nobase_include_HEADERS += \
245 vnet/cdp/cdp_protocol.h
247 ########################################
249 ########################################
250 libvnet_la_SOURCES += \
251 vnet/lldp/lldp_input.c \
252 vnet/lldp/lldp_node.c \
253 vnet/lldp/lldp_output.c \
256 nobase_include_HEADERS += \
257 vnet/lldp/lldp_protocol.h
259 ########################################
260 # Layer 2/3 "classify"
261 ########################################
262 libvnet_la_SOURCES += \
263 vnet/classify/vnet_classify.c \
264 vnet/classify/ip_classify.c \
265 vnet/classify/input_acl.c \
266 vnet/classify/policer_classify.c \
267 vnet/classify/flow_classify.c \
268 vnet/classify/flow_classify_node.c \
269 vnet/classify/vnet_classify.h
271 nobase_include_HEADERS += \
272 vnet/classify/vnet_classify.h \
273 vnet/classify/input_acl.h \
274 vnet/classify/policer_classify.h \
275 vnet/classify/flow_classify.h
277 ########################################
278 # Layer 3 protocols go here
279 ########################################
281 ########################################
282 # Layer 3 protocol: IP v4/v6
283 ########################################
284 libvnet_la_SOURCES += \
289 vnet/ip/ip4_format.c \
290 vnet/ip/ip4_forward.c \
291 vnet/ip/ip4_input.c \
292 vnet/ip/ip4_mtrie.c \
294 vnet/ip/ip4_source_and_port_range_check.c \
295 vnet/ip/ip4_source_check.c \
296 vnet/ip/ip6_format.c \
297 vnet/ip/ip6_forward.c \
298 vnet/ip/ip6_hop_by_hop.c \
299 vnet/ip/ip6_input.c \
300 vnet/ip/ip6_neighbor.c \
302 vnet/ip/ip_checksum.c \
306 vnet/ip/ip_input_acl.c \
310 vnet/ip/udp_format.c \
312 vnet/ip/udp_local.c \
315 nobase_include_HEADERS += \
317 vnet/ip/icmp46_packet.h \
320 vnet/ip/igmp_packet.h \
321 vnet/ip/ip4_error.h \
323 vnet/ip/ip4_mtrie.h \
324 vnet/ip/ip4_packet.h \
325 vnet/ip/ip6_error.h \
327 vnet/ip/ip6_hop_by_hop.h \
328 vnet/ip/ip6_hop_by_hop_packet.h \
329 vnet/ip/ip6_packet.h \
330 vnet/ip/ip6_neighbor.h \
332 vnet/ip/ip_packet.h \
333 vnet/ip/ip_source_and_port_range_check.h \
336 vnet/ip/protocols.def \
337 vnet/ip/punt_error.def \
339 vnet/ip/tcp_packet.h \
340 vnet/ip/udp_error.def \
344 ########################################
345 # Layer 3 protocol: IPSec
346 ########################################
348 libvnet_la_SOURCES += \
350 vnet/ipsec/ipsec_cli.c \
351 vnet/ipsec/ipsec_format.c \
352 vnet/ipsec/ipsec_input.c \
353 vnet/ipsec/ipsec_if.c \
354 vnet/ipsec/ipsec_if_in.c \
355 vnet/ipsec/ipsec_if_out.c \
356 vnet/ipsec/esp_encrypt.c \
357 vnet/ipsec/esp_decrypt.c \
359 vnet/ipsec/ikev2_crypto.c \
360 vnet/ipsec/ikev2_cli.c \
361 vnet/ipsec/ikev2_payload.c \
362 vnet/ipsec/ikev2_format.c
364 libvnet_la_SOURCES += \
365 vnet/devices/dpdk/ipsec/esp_encrypt.c \
366 vnet/devices/dpdk/ipsec/esp_decrypt.c \
367 vnet/devices/dpdk/ipsec/crypto_node.c \
368 vnet/devices/dpdk/ipsec/cli.c \
369 vnet/devices/dpdk/ipsec/ipsec.c
373 libvnet_la_SOURCES += \
374 vnet/ipsec/ipsec_output.c
376 nobase_include_HEADERS += \
380 vnet/ipsec/ikev2_priv.h
382 nobase_include_HEADERS += \
383 vnet/devices/dpdk/ipsec/ipsec.h \
384 vnet/devices/dpdk/ipsec/esp.h
387 ########################################
388 # Layer 3 protocol: osi
389 ########################################
390 libvnet_la_SOURCES += \
395 nobase_include_HEADERS += \
398 ########################################
399 # Layer 3 protocol: MAP
400 ########################################
401 libvnet_la_SOURCES += \
406 vnet/map/ip4_map_t.c \
407 vnet/map/ip6_map_t.c \
410 nobase_include_HEADERS += \
419 test_map_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
421 test_map_LDADD = libvnet.la -lvppinfra -lvlib \
422 -lpthread -lvlibmemory -lvlibapi -lvlib_unix \
425 test_map_LDFLAGS = -static
429 ########################################
430 # Tunnel protocol: gre
431 ########################################
432 libvnet_la_SOURCES += \
435 vnet/gre/interface.c \
438 nobase_include_HEADERS += \
443 ########################################
444 # Tunnel protocol: l2tpv3
445 ########################################
446 libvnet_la_SOURCES += \
452 nobase_include_HEADERS += \
456 ########################################
457 # Tunnel protocol: gre+mpls
458 ########################################
459 libvnet_la_SOURCES += \
461 vnet/mpls/mpls_lookup.c \
462 vnet/mpls/mpls_output.c \
463 vnet/mpls/mpls_features.c \
465 vnet/mpls/interface.c \
466 vnet/mpls/mpls_tunnel.c \
469 nobase_include_HEADERS += \
471 vnet/mpls/mpls_types.h \
472 vnet/mpls/mpls_tunnel.h \
477 ########################################
478 # Tunnel protocol: vxlan-gpe
479 ########################################
481 libvnet_la_SOURCES += \
482 vnet/vxlan-gpe/vxlan_gpe.c \
483 vnet/vxlan-gpe/encap.c \
484 vnet/vxlan-gpe/decap.c
486 nobase_include_HEADERS += \
487 vnet/vxlan-gpe/vxlan_gpe.h \
488 vnet/vxlan-gpe/vxlan_gpe_packet.h \
489 vnet/vxlan-gpe/vxlan_gpe_error.def
491 ########################################
492 # Tunnel protocol: ipsec+gre
493 ########################################
494 libvnet_la_SOURCES += \
495 vnet/ipsec-gre/ipsec_gre.c \
496 vnet/ipsec-gre/node.c \
497 vnet/ipsec-gre/interface.c
499 nobase_include_HEADERS += \
500 vnet/ipsec-gre/ipsec_gre.h \
501 vnet/ipsec-gre/error.def
503 ########################################
504 # LISP control plane: lisp-cp
505 ########################################
507 libvnet_la_SOURCES += \
508 vnet/lisp-cp/lisp_types.c \
509 vnet/lisp-cp/lisp_cp_dpo.c \
510 vnet/lisp-cp/control.c \
511 vnet/lisp-cp/gid_dictionary.c \
512 vnet/lisp-cp/lisp_msg_serdes.c \
513 vnet/lisp-cp/packets.c
515 nobase_include_HEADERS += \
516 vnet/lisp-cp/lisp_types.h \
517 vnet/lisp-cp/packets.h \
518 vnet/lisp-cp/gid_dictionary.h \
519 vnet/lisp-cp/lisp_cp_messages.h \
520 vnet/lisp-cp/lisp_msg_serdes.h \
521 vnet/lisp-cp/control.h
525 LDS = -lvppinfra -l:libvlib.a $(dpdk_libs) -l:libvlibmemory.a \
526 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
528 TESTS += test_cp_serdes test_lisp_types
530 test_cp_serdes_SOURCES = \
531 test/lisp-cp/test_cp_serdes.c \
532 vnet/lisp-cp/lisp_msg_serdes.c \
533 vnet/lisp-cp/lisp_types.c \
534 vnet/lisp-cp/packets.c \
535 vnet/ip/ip_checksum.c
537 test_lisp_types_SOURCES = \
538 test/lisp-cp/test_lisp_types.c \
539 vnet/lisp-cp/lisp_types.c
541 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
542 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
544 test_cp_serdes_LDADD = libvnet.la $(LDS)
545 test_lisp_types_LDADD = libvnet.la $(LDS)
547 test_cp_serdes_LDFLAGS = -static
548 test_lisp_types_LDFLAGS = -static
551 ########################################
552 # Tunnel protocol: lisp-gpe
553 ########################################
555 libvnet_la_SOURCES += \
556 vnet/lisp-gpe/lisp_gpe.c \
557 vnet/lisp-gpe/lisp_gpe_sub_interface.c \
558 vnet/lisp-gpe/lisp_gpe_adjacency.c \
559 vnet/lisp-gpe/lisp_gpe_tunnel.c \
560 vnet/lisp-gpe/lisp_gpe_fwd_entry.c \
561 vnet/lisp-gpe/lisp_gpe_tenant.c \
562 vnet/lisp-gpe/interface.c \
563 vnet/lisp-gpe/decap.c
565 nobase_include_HEADERS += \
566 vnet/lisp-gpe/lisp_gpe.h \
567 vnet/lisp-gpe/lisp_gpe_fwd_entry.h \
568 vnet/lisp-gpe/lisp_gpe_tenant.h \
569 vnet/lisp-gpe/lisp_gpe_packet.h \
570 vnet/lisp-gpe/lisp_gpe_error.def
575 test_test_SOURCES = test/lisp-gpe/test.c
577 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
579 test_test_LDADD = $(LIBOBJS)
581 noinst_PROGRAMS += $(TESTS)
582 check_PROGRAMS = $(TESTS)
585 ########################################
587 ########################################
588 libvnet_la_SOURCES += \
592 nobase_include_HEADERS += \
595 ########################################
597 ########################################
598 libvnet_la_SOURCES += \
599 vnet/dhcp/proxy_node.c \
602 nobase_include_HEADERS += \
605 vnet/dhcp/proxy_error.def
607 ########################################
608 # ipv6 segment routing
609 ########################################
612 libvnet_la_SOURCES += \
614 vnet/sr/sr_replicate.c
617 nobase_include_HEADERS += \
618 vnet/sr/sr_packet.h \
619 vnet/sr/sr_error.def \
622 ########################################
624 ########################################
625 libvnet_la_SOURCES += \
626 vnet/dhcpv6/proxy_node.c
628 nobase_include_HEADERS += \
629 vnet/dhcpv6/packet.h \
630 vnet/dhcpv6/proxy.h \
631 vnet/dhcpv6/proxy_error.def
633 ########################################
634 # IPFIX / netflow v10
635 ########################################
636 libvnet_la_SOURCES += \
637 vnet/flow/flow_report.c
639 nobase_include_HEADERS += \
640 vnet/flow/flow_report.h \
641 vnet/flow/ipfix_info_elements.h \
642 vnet/flow/ipfix_packet.h
644 ########################################
645 # IPFIX classify code
646 ########################################
648 libvnet_la_SOURCES += \
649 vnet/flow/flow_report_classify.c
651 nobase_include_HEADERS += \
652 vnet/flow/flow_report_classify.h
654 ########################################
656 ########################################
658 libvnet_la_SOURCES += \
659 vnet/lawful-intercept/lawful_intercept.c \
660 vnet/lawful-intercept/node.c
662 nobase_include_HEADERS += \
663 vnet/lawful-intercept/lawful_intercept.h
665 ########################################
666 # SPAN (port mirroring)
667 ########################################
669 libvnet_la_SOURCES += \
673 nobase_include_HEADERS += \
676 ########################################
678 ########################################
680 libvnet_la_SOURCES += \
688 nobase_include_HEADERS += \
692 ########################################
694 ########################################
696 libvnet_la_SOURCES += \
697 vnet/devices/dpdk/dpdk_priv.h \
698 vnet/devices/dpdk/device.c \
699 vnet/devices/dpdk/format.c \
700 vnet/devices/dpdk/init.c \
701 vnet/devices/dpdk/node.c \
702 vnet/devices/dpdk/hqos.c \
703 vnet/devices/dpdk/cli.c
705 nobase_include_HEADERS += \
706 vnet/devices/dpdk/dpdk.h
708 libvnet_la_SOURCES += \
709 vnet/devices/nic/ixge.c \
710 vnet/devices/nic/ixge.h \
711 vnet/devices/nic/sfp.c \
712 vnet/devices/nic/sfp.h
715 ########################################
717 ########################################
719 libvnet_la_SOURCES += \
720 vnet/devices/virtio/vhost-user.c
722 nobase_include_HEADERS += \
723 vnet/devices/virtio/vhost-user.h
725 ########################################
727 ########################################
728 libvnet_la_SOURCES += \
729 vnet/devices/ssvm/ssvm_eth.c \
730 vnet/devices/ssvm/node.c
732 nobase_include_HEADERS += \
733 vnet/devices/ssvm/ssvm_eth.h
735 ########################################
736 # Linux packet interface
737 ########################################
739 libvnet_la_SOURCES += \
740 vnet/devices/af_packet/af_packet.c \
741 vnet/devices/af_packet/device.c \
742 vnet/devices/af_packet/node.c \
743 vnet/devices/af_packet/cli.c
745 nobase_include_HEADERS += \
746 vnet/devices/af_packet/af_packet.h
748 ########################################
750 ########################################
752 libvnet_la_SOURCES += \
753 vnet/devices/netmap/netmap.c \
754 vnet/devices/netmap/device.c \
755 vnet/devices/netmap/node.c \
756 vnet/devices/netmap/cli.c
758 nobase_include_HEADERS += \
759 vnet/devices/netmap/netmap.h
762 ########################################
763 # Driver feature graph arc support
764 ########################################
766 libvnet_la_SOURCES += \
767 vnet/feature/feature.c \
768 vnet/feature/registration.c
770 nobase_include_HEADERS += \
771 vnet/feature/feature.h
773 ########################################
774 # Unix kernel related
775 ########################################
777 # FIXME: vnet/unix/hgshm.c
779 libvnet_la_SOURCES += \
780 vnet/unix/gdb_funcs.c \
785 nobase_include_HEADERS += \
790 ########################################
792 ########################################
794 libvnet_la_SOURCES += \
796 vnet/fib/fib_test.c \
799 vnet/fib/mpls_fib.c \
800 vnet/fib/fib_table.c \
801 vnet/fib/fib_walk.c \
802 vnet/fib/fib_types.c \
803 vnet/fib/fib_node.c \
804 vnet/fib/fib_node_list.c \
805 vnet/fib/fib_entry.c \
806 vnet/fib/fib_entry_src.c \
807 vnet/fib/fib_entry_src_rr.c \
808 vnet/fib/fib_entry_src_interface.c \
809 vnet/fib/fib_entry_src_default_route.c \
810 vnet/fib/fib_entry_src_special.c \
811 vnet/fib/fib_entry_src_api.c \
812 vnet/fib/fib_entry_src_adj.c \
813 vnet/fib/fib_entry_src_mpls.c \
814 vnet/fib/fib_entry_src_lisp.c \
815 vnet/fib/fib_entry_cover.c \
816 vnet/fib/fib_entry_delegate.c \
817 vnet/fib/fib_path_list.c \
818 vnet/fib/fib_path.c \
819 vnet/fib/fib_path_ext.c \
820 vnet/fib/fib_urpf_list.c \
821 vnet/fib/fib_attached_export.c
823 nobase_include_HEADERS += \
827 vnet/fib/fib_types.h \
828 vnet/fib/fib_table.h \
829 vnet/fib/fib_node.h \
830 vnet/fib/fib_node_list.h \
831 vnet/fib/fib_entry.h \
832 vnet/fib/fib_entry_delegate.h
834 ########################################
836 ########################################
838 libvnet_la_SOURCES += \
840 vnet/adj/adj_rewrite.c \
841 vnet/adj/adj_glean.c \
842 vnet/adj/adj_midchain.c \
846 nobase_include_HEADERS += \
848 vnet/adj/adj_types.h \
849 vnet/adj/adj_rewrite.h \
850 vnet/adj/adj_glean.h \
853 ########################################
855 ########################################
857 libvnet_la_SOURCES += \
859 vnet/dpo/drop_dpo.c \
860 vnet/dpo/ip_null_dpo.c \
861 vnet/dpo/punt_dpo.c \
862 vnet/dpo/receive_dpo.c \
863 vnet/dpo/load_balance.c \
864 vnet/dpo/load_balance_map.c \
865 vnet/dpo/lookup_dpo.c \
866 vnet/dpo/classify_dpo.c \
867 vnet/dpo/mpls_label_dpo.c
869 nobase_include_HEADERS += \
870 vnet/dpo/load_balance.h \
871 vnet/dpo/drop_dpo.h \
872 vnet/dpo/lookup_dpo.h \
873 vnet/dpo/punt_dpo.h \
874 vnet/dpo/classify_dpo.h \
875 vnet/dpo/receive_dpo.h \
876 vnet/dpo/ip_null_dpo.h \
879 ########################################
880 # Plugin client library
881 ########################################
883 libvnetplugin_la_SOURCES += \
886 nobase_include_HEADERS += \
889 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
892 vnet/unix/pcap2pg.c \
895 pcap2pg_LDFLAGS = -static
896 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
898 noinst_PROGRAMS += pcap2pg
900 # Set the suffix list
901 SUFFIXES = .api.h .api .api.json
903 # install the API definition, so we can produce java bindings, etc.
905 apidir = $(prefix)/vnet
907 vnet/interface.api.json \
908 vnet/l2/l2.api.json \
909 vnet/map/map.api.json
911 # The actual %.api.h rule is in .../build-data/packages/suffix-rules.mk
912 # and requires a symbolic link at the top of the vnet source tree
914 include $(top_srcdir)/suffix-rules.mk