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@ @IPSEC@ @IPV6SR@
19 libvnetplugin_la_SOURCES =
20 nobase_include_HEADERS =
26 dpdk_libs += -l:libdpdk.a
29 ########################################
31 ########################################
32 libvnet_la_SOURCES += \
36 vnet/interface_cli.c \
37 vnet/interface_format.c \
38 vnet/interface_output.c \
43 nobase_include_HEADERS += \
50 vnet/interface_funcs.h \
57 ########################################
59 ########################################
61 libvnet_la_SOURCES += \
62 vnet/policer/node_funcs.c \
63 vnet/policer/policer.c \
66 nobase_include_HEADERS += \
67 vnet/policer/police.h \
68 vnet/policer/policer.h \
69 vnet/policer/fix_types.h \
72 ########################################
74 ########################################
76 libvnet_la_SOURCES += \
79 vnet/cop/ip4_whitelist.c \
80 vnet/cop/ip6_whitelist.c
82 nobase_include_HEADERS += \
85 ########################################
86 # Layer 2 protocols go here
87 ########################################
89 ########################################
90 # Layer 2 protocol: Ethernet
91 ########################################
92 libvnet_la_SOURCES += \
94 vnet/ethernet/format.c \
95 vnet/ethernet/init.c \
96 vnet/ethernet/interface.c \
97 vnet/ethernet/node.c \
100 nobase_include_HEADERS += \
101 vnet/ethernet/arp_packet.h \
102 vnet/ethernet/error.def \
103 vnet/ethernet/ethernet.h \
104 vnet/ethernet/packet.h \
105 vnet/ethernet/types.def
107 ########################################
108 # Layer 2 protocol: Ethernet bridging
109 ########################################
110 libvnet_la_SOURCES += \
111 vnet/l2/feat_bitmap.c \
114 vnet/l2/l2_input_classify.c \
115 vnet/l2/l2_output_classify.c \
116 vnet/l2/l2_efp_filter.c \
120 vnet/l2/l2_input_acl.c \
122 vnet/l2/l2_input_vtr.c \
124 vnet/l2/l2_output_acl.c \
125 vnet/l2/l2_output.c \
131 nobase_include_HEADERS += \
132 vnet/l2/feat_bitmap.h \
134 vnet/l2/l2_output.h \
136 vnet/l2/l2_input_vtr.h \
137 vnet/l2/l2_efp_filter.h \
145 vnet/l2/l2_classify.h
147 ########################################
148 # Layer 2 protocol: SRP
149 ########################################
150 libvnet_la_SOURCES += \
152 vnet/srp/interface.c \
156 nobase_include_HEADERS += \
160 ########################################
161 # Layer 2 protocol: PPP
162 ########################################
163 libvnet_la_SOURCES += \
168 nobase_include_HEADERS += \
173 ########################################
174 # Layer 2 protocol: HDLC
175 ########################################
176 libvnet_la_SOURCES += \
181 nobase_include_HEADERS += \
182 vnet/hdlc/error.def \
186 ########################################
187 # Layer 2 protocol: LLC
188 ########################################
189 libvnet_la_SOURCES += \
194 nobase_include_HEADERS += \
197 ########################################
198 # Layer 2 protocol: SNAP
199 ########################################
200 libvnet_la_SOURCES += \
205 nobase_include_HEADERS += \
208 ########################################
210 ########################################
211 libvnet_la_SOURCES += \
216 nobase_include_HEADERS += \
218 vnet/vxlan/vxlan_packet.h \
219 vnet/vxlan/vxlan_error.def
221 ########################################
223 ########################################
224 libvnet_la_SOURCES += \
225 vnet/cdp/cdp_input.c \
226 vnet/cdp/cdp_node.c \
227 vnet/cdp/cdp_periodic.c
229 nobase_include_HEADERS += \
230 vnet/cdp/cdp_protocol.h
232 ########################################
234 ########################################
235 libvnet_la_SOURCES += \
236 vnet/lldp/lldp_input.c \
237 vnet/lldp/lldp_node.c \
238 vnet/lldp/lldp_output.c \
241 nobase_include_HEADERS += \
242 vnet/lldp/lldp_protocol.h
244 ########################################
245 # Layer 2/3 "classify"
246 ########################################
247 libvnet_la_SOURCES += \
248 vnet/classify/vnet_classify.c \
249 vnet/classify/ip_classify.c \
250 vnet/classify/input_acl.c \
251 vnet/classify/policer_classify.c \
252 vnet/classify/vnet_classify.h
254 nobase_include_HEADERS += \
255 vnet/classify/vnet_classify.h \
256 vnet/classify/input_acl.h \
257 vnet/classify/policer_classify.h
259 ########################################
260 # Layer 3 protocols go here
261 ########################################
263 ########################################
264 # Layer 3 protocol: IP v4/v6
265 ########################################
266 libvnet_la_SOURCES += \
270 vnet/ip/ip_feature_registration.c \
273 vnet/ip/ip4_format.c \
274 vnet/ip/ip4_forward.c \
275 vnet/ip/ip4_input.c \
276 vnet/ip/ip4_mtrie.c \
278 vnet/ip/ip4_source_check.c \
279 vnet/ip/ip4_source_and_port_range_check.c \
280 vnet/ip/ip6_format.c \
281 vnet/ip/ip6_forward.c \
282 vnet/ip/ip6_hop_by_hop.c \
283 vnet/ip/ip6_input.c \
284 vnet/ip/ip6_neighbor.c \
286 vnet/ip/ip_checksum.c \
290 vnet/ip/udp_format.c \
292 vnet/ip/udp_local.c \
295 vnet/ip/ip_input_acl.c \
298 nobase_include_HEADERS += \
300 vnet/ip/icmp46_packet.h \
303 vnet/ip/igmp_packet.h \
305 vnet/ip/ip_feature_registration.h \
306 vnet/ip/ip_source_and_port_range_check.h \
308 vnet/ip/ip4_mtrie.h \
309 vnet/ip/ip4_error.h \
310 vnet/ip/ip4_packet.h \
312 vnet/ip/ip6_error.h \
313 vnet/ip/ip6_hop_by_hop.h \
314 vnet/ip/ip6_hop_by_hop_packet.h \
315 vnet/ip/ip6_packet.h \
317 vnet/ip/ip_packet.h \
319 vnet/ip/protocols.def \
320 vnet/ip/tcp_packet.h \
322 vnet/ip/udp_error.def \
323 vnet/ip/udp_packet.h \
324 vnet/ip/punt_error.def \
327 ########################################
328 # Layer 3 protocol: IPSec
329 ########################################
331 libvnet_la_SOURCES += \
333 vnet/ipsec/ipsec_cli.c \
334 vnet/ipsec/ipsec_format.c \
335 vnet/ipsec/ipsec_input.c \
336 vnet/ipsec/ipsec_if.c \
337 vnet/ipsec/ipsec_if_in.c \
338 vnet/ipsec/ipsec_if_out.c \
339 vnet/ipsec/esp_encrypt.c \
340 vnet/ipsec/esp_decrypt.c \
342 vnet/ipsec/ikev2_crypto.c \
343 vnet/ipsec/ikev2_cli.c \
344 vnet/ipsec/ikev2_payload.c \
345 vnet/ipsec/ikev2_format.c
348 libvnet_la_SOURCES += \
349 vnet/ipsec/ipsec_output.c
351 nobase_include_HEADERS += \
355 vnet/ipsec/ikev2_priv.h
357 ########################################
358 # Layer 3 protocol: osi
359 ########################################
360 libvnet_la_SOURCES += \
365 nobase_include_HEADERS += \
368 ########################################
369 # Layer 3 protocol: MAP
370 ########################################
371 libvnet_la_SOURCES += \
376 vnet/map/ip4_map_t.c \
379 nobase_include_HEADERS += \
387 test_map_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
389 test_map_LDADD = libvnet.la -lvppinfra -lvlib \
390 -lpthread -lvlibmemory -lvlibapi -lvlib_unix \
393 test_map_LDFLAGS = -static
397 ########################################
398 # Tunnel protocol: gre
399 ########################################
400 libvnet_la_SOURCES += \
403 vnet/gre/interface.c \
406 nobase_include_HEADERS += \
411 ########################################
412 # Tunnel protocol: l2tpv3
413 ########################################
414 libvnet_la_SOURCES += \
420 nobase_include_HEADERS += \
424 ########################################
425 # Tunnel protocol: gre+mpls
426 ########################################
427 libvnet_la_SOURCES += \
429 vnet/mpls/mpls_lookup.c \
430 vnet/mpls/mpls_output.c \
431 vnet/mpls/mpls_features.c \
433 vnet/mpls/interface.c \
434 vnet/mpls/policy_encap.c \
437 nobase_include_HEADERS += \
439 vnet/mpls/mpls_types.h \
444 ########################################
445 # Tunnel protocol: vxlan-gpe
446 ########################################
448 libvnet_la_SOURCES += \
449 vnet/vxlan-gpe/vxlan_gpe.c \
450 vnet/vxlan-gpe/encap.c \
451 vnet/vxlan-gpe/decap.c
453 nobase_include_HEADERS += \
454 vnet/vxlan-gpe/vxlan_gpe.h \
455 vnet/vxlan-gpe/vxlan_gpe_packet.h \
456 vnet/vxlan-gpe/vxlan_gpe_error.def
458 ########################################
459 # Tunnel protocol: ipsec+gre
460 ########################################
461 libvnet_la_SOURCES += \
462 vnet/ipsec-gre/ipsec_gre.c \
463 vnet/ipsec-gre/node.c \
464 vnet/ipsec-gre/interface.c
466 nobase_include_HEADERS += \
467 vnet/ipsec-gre/ipsec_gre.h \
468 vnet/ipsec-gre/error.def
470 ########################################
471 # LISP control plane: lisp-cp
472 ########################################
474 libvnet_la_SOURCES += \
475 vnet/lisp-cp/lisp_types.c \
476 vnet/lisp-cp/lisp_cp_dpo.c \
477 vnet/lisp-cp/control.c \
478 vnet/lisp-cp/gid_dictionary.c \
479 vnet/lisp-cp/lisp_msg_serdes.c \
480 vnet/lisp-cp/packets.c
482 nobase_include_HEADERS += \
483 vnet/lisp-cp/lisp_types.h \
484 vnet/lisp-cp/packets.h \
485 vnet/lisp-cp/gid_dictionary.h \
486 vnet/lisp-cp/lisp_cp_messages.h \
487 vnet/lisp-cp/lisp_msg_serdes.h \
488 vnet/lisp-cp/control.h
492 LDS = -lvppinfra -l:libvlib.a $(dpdk_libs) -l:libvlibmemory.a \
493 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
495 TESTS += test_cp_serdes test_lisp_types
497 test_cp_serdes_SOURCES = \
498 test/lisp-cp/test_cp_serdes.c \
499 vnet/lisp-cp/lisp_msg_serdes.c \
500 vnet/lisp-cp/lisp_types.c \
501 vnet/lisp-cp/packets.c \
502 vnet/ip/ip_checksum.c
504 test_lisp_types_SOURCES = \
505 test/lisp-cp/test_lisp_types.c \
506 vnet/lisp-cp/lisp_types.c
508 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
509 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
511 test_cp_serdes_LDADD = libvnet.la $(LDS)
512 test_lisp_types_LDADD = libvnet.la $(LDS)
514 test_cp_serdes_LDFLAGS = -static
515 test_lisp_types_LDFLAGS = -static
518 ########################################
519 # Tunnel protocol: lisp-gpe
520 ########################################
522 libvnet_la_SOURCES += \
523 vnet/lisp-gpe/lisp_gpe.c \
524 vnet/lisp-gpe/lisp_gpe_sub_interface.c \
525 vnet/lisp-gpe/lisp_gpe_adjacency.c \
526 vnet/lisp-gpe/lisp_gpe_tunnel.c \
527 vnet/lisp-gpe/lisp_gpe_fwd_entry.c \
528 vnet/lisp-gpe/lisp_gpe_tenant.c \
529 vnet/lisp-gpe/interface.c \
530 vnet/lisp-gpe/decap.c
532 nobase_include_HEADERS += \
533 vnet/lisp-gpe/lisp_gpe.h \
534 vnet/lisp-gpe/lisp_gpe_fwd_entry.h \
535 vnet/lisp-gpe/lisp_gpe_tenant.h \
536 vnet/lisp-gpe/lisp_gpe_packet.h \
537 vnet/lisp-gpe/lisp_gpe_error.def
542 test_test_SOURCES = test/lisp-gpe/test.c
544 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
546 test_test_LDADD = $(LIBOBJS)
548 noinst_PROGRAMS += $(TESTS)
549 check_PROGRAMS = $(TESTS)
552 ########################################
554 ########################################
555 libvnet_la_SOURCES += \
559 nobase_include_HEADERS += \
562 ########################################
564 ########################################
565 libvnet_la_SOURCES += \
566 vnet/dhcp/proxy_node.c \
569 nobase_include_HEADERS += \
572 vnet/dhcp/proxy_error.def
574 ########################################
575 # ipv6 segment routing
576 ########################################
579 libvnet_la_SOURCES += \
581 vnet/sr/sr_replicate.c
584 nobase_include_HEADERS += \
585 vnet/sr/sr_packet.h \
586 vnet/sr/sr_error.def \
589 ########################################
591 ########################################
592 libvnet_la_SOURCES += \
593 vnet/dhcpv6/proxy_node.c
595 nobase_include_HEADERS += \
596 vnet/dhcpv6/packet.h \
597 vnet/dhcpv6/proxy.h \
598 vnet/dhcpv6/proxy_error.def
600 ########################################
601 # IPFIX / netflow v10
602 ########################################
603 libvnet_la_SOURCES += \
604 vnet/flow/flow_report.c
606 nobase_include_HEADERS += \
607 vnet/flow/flow_report.h \
608 vnet/flow/ipfix_info_elements.h \
609 vnet/flow/ipfix_packet.h
611 ########################################
612 # IPFIX classify code
613 ########################################
615 libvnet_la_SOURCES += \
616 vnet/flow/flow_report_classify.c
618 nobase_include_HEADERS += \
619 vnet/flow/flow_report_classify.h
621 ########################################
623 ########################################
625 libvnet_la_SOURCES += \
626 vnet/lawful-intercept/lawful_intercept.c \
627 vnet/lawful-intercept/node.c
629 nobase_include_HEADERS += \
630 vnet/dpdk_replication.h \
631 vnet/lawful-intercept/lawful_intercept.h
633 ########################################
635 ########################################
637 libvnet_la_SOURCES += \
645 nobase_include_HEADERS += \
649 ########################################
651 ########################################
653 libvnet_la_SOURCES += \
654 vnet/devices/dpdk/dpdk_priv.h \
655 vnet/devices/dpdk/device.c \
656 vnet/devices/dpdk/format.c \
657 vnet/devices/dpdk/init.c \
658 vnet/devices/dpdk/node.c \
659 vnet/devices/dpdk/hqos.c \
660 vnet/devices/dpdk/vhost_user.c \
661 vnet/devices/dpdk/cli.c
663 nobase_include_HEADERS += \
664 vnet/devices/dpdk/dpdk.h
666 libvnet_la_SOURCES += \
667 vnet/devices/nic/ixge.c \
668 vnet/devices/nic/ixge.h \
669 vnet/devices/nic/sfp.c \
670 vnet/devices/nic/sfp.h
673 ########################################
675 ########################################
677 libvnet_la_SOURCES += \
678 vnet/devices/virtio/vhost-user.c
680 nobase_include_HEADERS += \
681 vnet/devices/virtio/vhost-user.h
683 ########################################
685 ########################################
686 libvnet_la_SOURCES += \
687 vnet/devices/ssvm/ssvm_eth.c \
688 vnet/devices/ssvm/node.c
690 nobase_include_HEADERS += \
691 vnet/devices/ssvm/ssvm_eth.h
693 ########################################
694 # Linux packet interface
695 ########################################
697 libvnet_la_SOURCES += \
698 vnet/devices/af_packet/af_packet.c \
699 vnet/devices/af_packet/device.c \
700 vnet/devices/af_packet/node.c \
701 vnet/devices/af_packet/cli.c
703 nobase_include_HEADERS += \
704 vnet/devices/af_packet/af_packet.h
706 ########################################
708 ########################################
710 libvnet_la_SOURCES += \
711 vnet/devices/netmap/netmap.c \
712 vnet/devices/netmap/device.c \
713 vnet/devices/netmap/node.c \
714 vnet/devices/netmap/cli.c
716 nobase_include_HEADERS += \
717 vnet/devices/netmap/netmap.h
720 ########################################
721 # Unix kernel related
722 ########################################
724 # FIXME: vnet/unix/hgshm.c
726 libvnet_la_SOURCES += \
727 vnet/unix/gdb_funcs.c \
732 nobase_include_HEADERS += \
737 ########################################
739 ########################################
741 libvnet_la_SOURCES += \
743 vnet/fib/fib_test.c \
746 vnet/fib/mpls_fib.c \
747 vnet/fib/fib_table.c \
748 vnet/fib/fib_walk.c \
749 vnet/fib/fib_types.c \
750 vnet/fib/fib_node.c \
751 vnet/fib/fib_node_list.c \
752 vnet/fib/fib_entry.c \
753 vnet/fib/fib_entry_src.c \
754 vnet/fib/fib_entry_src_rr.c \
755 vnet/fib/fib_entry_src_interface.c \
756 vnet/fib/fib_entry_src_default_route.c \
757 vnet/fib/fib_entry_src_special.c \
758 vnet/fib/fib_entry_src_api.c \
759 vnet/fib/fib_entry_src_adj.c \
760 vnet/fib/fib_entry_src_mpls.c \
761 vnet/fib/fib_entry_src_lisp.c \
762 vnet/fib/fib_entry_cover.c \
763 vnet/fib/fib_path_list.c \
764 vnet/fib/fib_path.c \
765 vnet/fib/fib_path_ext.c \
766 vnet/fib/fib_urpf_list.c \
767 vnet/fib/fib_attached_export.c
769 nobase_include_HEADERS += \
773 vnet/fib/fib_types.h \
774 vnet/fib/fib_table.h \
775 vnet/fib/fib_node.h \
776 vnet/fib/fib_node_list.h \
779 ########################################
781 ########################################
783 libvnet_la_SOURCES += \
785 vnet/adj/adj_rewrite.c \
786 vnet/adj/adj_glean.c \
787 vnet/adj/adj_midchain.c \
791 nobase_include_HEADERS += \
793 vnet/adj/adj_types.h \
794 vnet/adj/adj_rewrite.h \
795 vnet/adj/adj_glean.h \
798 ########################################
800 ########################################
802 libvnet_la_SOURCES += \
804 vnet/dpo/drop_dpo.c \
805 vnet/dpo/punt_dpo.c \
806 vnet/dpo/receive_dpo.c \
807 vnet/dpo/load_balance.c \
808 vnet/dpo/load_balance_map.c \
809 vnet/dpo/lookup_dpo.c \
810 vnet/dpo/classify_dpo.c \
811 vnet/dpo/mpls_label_dpo.c
813 nobase_include_HEADERS += \
814 vnet/dpo/load_balance.h \
815 vnet/dpo/drop_dpo.h \
816 vnet/dpo/lookup_dpo.h \
817 vnet/dpo/punt_dpo.h \
818 vnet/dpo/classify_dpo.h \
819 vnet/dpo/receive_dpo.h \
822 ########################################
823 # Plugin client library
824 ########################################
826 libvnetplugin_la_SOURCES += \
829 nobase_include_HEADERS += \
832 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
835 vnet/unix/pcap2pg.c \
838 pcap2pg_LDFLAGS = -static
839 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
841 noinst_PROGRAMS += pcap2pg