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 @DPDK@ @VIRL@ @IPSEC@ @VCGN@ @IPV6SR@
19 libvnetplugin_la_SOURCES =
20 nobase_include_HEADERS =
24 ########################################
26 ########################################
27 libvnet_la_SOURCES += \
31 vnet/interface_cli.c \
32 vnet/interface_format.c \
33 vnet/interface_output.c \
38 nobase_include_HEADERS += \
45 vnet/interface_funcs.h \
52 ########################################
54 ########################################
56 libvnet_la_SOURCES += \
57 vnet/policer/node_funcs.c \
58 vnet/policer/policer.c \
61 nobase_include_HEADERS += \
62 vnet/policer/police.h \
63 vnet/policer/policer.h \
64 vnet/policer/fix_types.h \
67 ########################################
69 ########################################
71 libvnet_la_SOURCES += \
74 vnet/cop/ip4_whitelist.c \
75 vnet/cop/ip6_whitelist.c
77 nobase_include_HEADERS += \
80 ########################################
81 # Layer 2 protocols go here
82 ########################################
84 ########################################
85 # Layer 2 protocol: Ethernet
86 ########################################
87 libvnet_la_SOURCES += \
89 vnet/ethernet/format.c \
90 vnet/ethernet/init.c \
91 vnet/ethernet/interface.c \
92 vnet/ethernet/node.c \
95 nobase_include_HEADERS += \
96 vnet/ethernet/arp_packet.h \
97 vnet/ethernet/error.def \
98 vnet/ethernet/ethernet.h \
99 vnet/ethernet/packet.h \
100 vnet/ethernet/types.def
102 ########################################
103 # Layer 2 protocol: Ethernet bridging
104 ########################################
105 libvnet_la_SOURCES += \
106 vnet/l2/feat_bitmap.c \
109 vnet/l2/l2_classify.c \
110 vnet/l2/l2_efp_filter.c \
114 vnet/l2/l2_input_acl.c \
116 vnet/l2/l2_input_vtr.c \
118 vnet/l2/l2_output_acl.c \
119 vnet/l2/l2_output.c \
125 nobase_include_HEADERS += \
126 vnet/l2/feat_bitmap.h \
128 vnet/l2/l2_output.h \
130 vnet/l2/l2_input_vtr.h \
131 vnet/l2/l2_efp_filter.h \
139 vnet/l2/l2_classify.h
141 ########################################
142 # Layer 2 protocol: SRP
143 ########################################
144 libvnet_la_SOURCES += \
146 vnet/srp/interface.c \
150 nobase_include_HEADERS += \
154 ########################################
155 # Layer 2 protocol: PPP
156 ########################################
157 libvnet_la_SOURCES += \
162 nobase_include_HEADERS += \
167 ########################################
168 # Layer 2 protocol: HDLC
169 ########################################
170 libvnet_la_SOURCES += \
175 nobase_include_HEADERS += \
176 vnet/hdlc/error.def \
180 ########################################
181 # Layer 2 protocol: LLC
182 ########################################
183 libvnet_la_SOURCES += \
188 nobase_include_HEADERS += \
191 ########################################
192 # Layer 2 protocol: SNAP
193 ########################################
194 libvnet_la_SOURCES += \
199 nobase_include_HEADERS += \
202 ########################################
204 ########################################
205 libvnet_la_SOURCES += \
210 nobase_include_HEADERS += \
212 vnet/vxlan/vxlan_packet.h \
213 vnet/vxlan/vxlan_error.def
215 ########################################
217 ########################################
218 libvnet_la_SOURCES += \
219 vnet/cdp/cdp_input.c \
220 vnet/cdp/cdp_node.c \
221 vnet/cdp/cdp_periodic.c
223 nobase_include_HEADERS += \
224 vnet/cdp/cdp_protocol.h
226 ########################################
227 # Layer 2/3 "classify"
228 ########################################
229 libvnet_la_SOURCES += \
230 vnet/classify/vnet_classify.c \
231 vnet/classify/ip_classify.c \
232 vnet/classify/input_acl.c \
233 vnet/classify/vnet_classify.h
235 nobase_include_HEADERS += \
236 vnet/classify/vnet_classify.h \
237 vnet/classify/input_acl.h
239 ########################################
240 # Layer 3 protocols go here
241 ########################################
243 ########################################
244 # Layer 3 protocol: IP v4/v6
245 ########################################
246 libvnet_la_SOURCES += \
247 vnet/ip/adj_alloc.c \
252 vnet/ip/ip4_format.c \
253 vnet/ip/ip4_forward.c \
254 vnet/ip/ip4_input.c \
255 vnet/ip/ip4_mtrie.c \
257 vnet/ip/ip4_source_check.c \
258 vnet/ip/ip6_format.c \
259 vnet/ip/ip6_forward.c \
260 vnet/ip/ip6_hop_by_hop.c \
261 vnet/ip/ip6_input.c \
262 vnet/ip/ip6_neighbor.c \
264 vnet/ip/ip_checksum.c \
268 vnet/ip/udp_format.c \
270 vnet/ip/udp_local.c \
272 vnet/ip/ip_input_acl.c \
275 nobase_include_HEADERS += \
276 vnet/ip/adj_alloc.h \
278 vnet/ip/icmp46_packet.h \
281 vnet/ip/igmp_packet.h \
284 vnet/ip/ip4_mtrie.h \
285 vnet/ip/ip4_error.h \
286 vnet/ip/ip4_packet.h \
288 vnet/ip/ip6_error.h \
289 vnet/ip/ip6_hop_by_hop.h \
290 vnet/ip/ip6_hop_by_hop_packet.h \
291 vnet/ip/ip6_packet.h \
293 vnet/ip/ip_packet.h \
295 vnet/ip/protocols.def \
296 vnet/ip/tcp_packet.h \
298 vnet/ip/udp_error.def \
301 ########################################
302 # Layer 3 protocol: IPSec
303 ########################################
305 libvnet_la_SOURCES += \
307 vnet/ipsec/ipsec_cli.c \
308 vnet/ipsec/ipsec_format.c \
309 vnet/ipsec/ipsec_input.c \
310 vnet/ipsec/ipsec_if.c \
311 vnet/ipsec/ipsec_if_in.c \
312 vnet/ipsec/ipsec_if_out.c \
313 vnet/ipsec/esp_encrypt.c \
314 vnet/ipsec/esp_decrypt.c \
316 vnet/ipsec/ikev2_crypto.c \
317 vnet/ipsec/ikev2_cli.c \
318 vnet/ipsec/ikev2_payload.c \
319 vnet/ipsec/ikev2_format.c
322 libvnet_la_SOURCES += \
323 vnet/ipsec/ipsec_output.c
325 nobase_include_HEADERS += \
329 vnet/ipsec/ikev2_priv.h
331 ########################################
332 # Layer 3 protocol: osi
333 ########################################
334 libvnet_la_SOURCES += \
339 nobase_include_HEADERS += \
342 ########################################
343 # Layer 3 protocol: MAP
344 ########################################
345 libvnet_la_SOURCES += \
350 vnet/map/ip4_sixrd.c \
351 vnet/map/ip6_sixrd.c \
352 vnet/map/ip4_map_t.c \
355 nobase_include_HEADERS += \
359 ########################################
360 # Tunnel protocol: gre
361 ########################################
362 libvnet_la_SOURCES += \
365 vnet/gre/interface.c \
368 nobase_include_HEADERS += \
373 ########################################
374 # Tunnel protocol: l2tpv3
375 ########################################
376 libvnet_la_SOURCES += \
382 nobase_include_HEADERS += \
386 ########################################
387 # Tunnel protocol: gre+mpls
388 ########################################
389 libvnet_la_SOURCES += \
390 vnet/mpls-gre/mpls.c \
391 vnet/mpls-gre/node.c \
392 vnet/mpls-gre/interface.c \
393 vnet/mpls-gre/policy_encap.c \
396 nobase_include_HEADERS += \
397 vnet/mpls-gre/mpls.h \
398 vnet/mpls-gre/packet.h \
399 vnet/mpls-gre/error.def
402 ########################################
403 # Tunnel protocol: vxlan-gpe
404 ########################################
406 libvnet_la_SOURCES += \
407 vnet/vxlan-gpe/vxlan_gpe.c \
408 vnet/vxlan-gpe/encap.c \
409 vnet/vxlan-gpe/decap.c
411 nobase_include_HEADERS += \
412 vnet/vxlan-gpe/vxlan_gpe.h \
413 vnet/vxlan-gpe/vxlan_gpe_packet.h \
414 vnet/vxlan-gpe/vxlan_gpe_error.def
416 ########################################
417 # LISP control plane: lisp-cp
418 ########################################
420 libvnet_la_SOURCES += \
421 vnet/lisp-cp/lisp_types.c \
422 vnet/lisp-cp/control.c \
423 vnet/lisp-cp/gid_dictionary.c \
424 vnet/lisp-cp/lisp_msg_serdes.c \
425 vnet/lisp-cp/packets.c
427 nobase_include_HEADERS += \
428 vnet/lisp-cp/lisp_types.h \
429 vnet/lisp-cp/packets.h \
430 vnet/lisp-cp/gid_dictionary.h \
431 vnet/lisp-cp/lisp_cp_messages.h \
432 vnet/lisp-cp/lisp_msg_serdes.h \
433 vnet/lisp-cp/control.h
437 LDS = -lvppinfra -l:libvlib.a -l:libdpdk.a -l:libvlibmemory.a \
438 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
440 TESTS += test_cp_serdes test_lisp_types
442 test_cp_serdes_SOURCES = \
443 test/lisp-cp/test_cp_serdes.c \
444 vnet/lisp-cp/lisp_msg_serdes.c \
445 vnet/lisp-cp/lisp_types.c \
446 vnet/lisp-cp/packets.c \
447 vnet/ip/ip_checksum.c
449 test_lisp_types_SOURCES = \
450 test/lisp-cp/test_lisp_types.c \
451 vnet/lisp-cp/lisp_types.c
453 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
454 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
456 test_cp_serdes_LDADD = libvnet.la $(LDS)
457 test_lisp_types_LDADD = libvnet.la $(LDS)
459 test_cp_serdes_LDFLAGS = -static
460 test_lisp_types_LDFLAGS = -static
463 ########################################
464 # Tunnel protocol: lisp-gpe
465 ########################################
467 libvnet_la_SOURCES += \
468 vnet/lisp-gpe/lisp_gpe.c \
469 vnet/lisp-gpe/interface.c \
470 vnet/lisp-gpe/ip_forward.c \
471 vnet/lisp-gpe/decap.c
473 nobase_include_HEADERS += \
474 vnet/lisp-gpe/lisp_gpe.h \
475 vnet/lisp-gpe/lisp_gpe_packet.h \
476 vnet/lisp-gpe/lisp_gpe_error.def
481 test_test_SOURCES = test/lisp-gpe/test.c
483 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
485 test_test_LDADD = $(LIBOBJS)
487 noinst_PROGRAMS += $(TESTS)
488 check_PROGRAMS = $(TESTS)
491 ########################################
493 ########################################
494 libvnet_la_SOURCES += \
498 nobase_include_HEADERS += \
501 ########################################
503 ########################################
504 libvnet_la_SOURCES += \
505 vnet/dhcp/proxy_node.c \
508 nobase_include_HEADERS += \
511 vnet/dhcp/proxy_error.def
513 ########################################
514 # ipv6 segment routing
515 ########################################
518 libvnet_la_SOURCES += \
520 vnet/sr/sr_replicate.c
523 nobase_include_HEADERS += \
524 vnet/sr/sr_packet.h \
525 vnet/sr/sr_error.def \
528 ########################################
530 #########################################
533 libvnet_la_SOURCES += \
534 vnet/vcgn/cnat_bulk_port.c \
535 vnet/vcgn/cnat_config.c \
536 vnet/vcgn/cnat_db_scanner.c \
537 vnet/vcgn/cnat_db_v2.c \
538 vnet/vcgn/cnat_debug_msg_handler.c \
539 vnet/vcgn/cnat_cli_handler.c \
540 vnet/vcgn/cnat_global.c \
541 vnet/vcgn/cnat_ipv4_udp_inside_input.c \
542 vnet/vcgn/cnat_ipv4_udp_inside_input_exceptions.c \
543 vnet/vcgn/cnat_ipv4_udp_outside_input.c \
544 vnet/vcgn/cnat_ipv4_tcp_inside_input.c \
545 vnet/vcgn/cnat_ipv4_tcp_inside_input_exceptions.c \
546 vnet/vcgn/cnat_ipv4_tcp_outside_input.c \
547 vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c \
548 vnet/vcgn/cnat_ipv4_icmp_query_inside_input_exception.c \
549 vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c \
550 vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c \
551 vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c \
552 vnet/vcgn/cnat_logging.c \
553 vnet/vcgn/cnat_ports.c \
554 vnet/vcgn/cnat_util.c \
555 vnet/vcgn/cnat_show.c \
556 vnet/vcgn/cnat_syslog.c \
557 vnet/vcgn/cnat_v4_functions.c \
558 vnet/vcgn/index_list.c \
559 vnet/vcgn/spp_platform_trace_log.c \
560 vnet/vcgn/vcgn_classify.c
563 ########################################
565 ########################################
566 libvnet_la_SOURCES += \
567 vnet/dhcpv6/proxy_node.c
569 nobase_include_HEADERS += \
570 vnet/dhcpv6/packet.h \
571 vnet/dhcpv6/proxy.h \
572 vnet/dhcpv6/proxy_error.def
574 ########################################
575 # IPFIX / netflow v10
576 ########################################
577 libvnet_la_SOURCES += \
578 vnet/flow/flow_report.c
580 nobase_include_HEADERS += \
581 vnet/flow/flow_report.h \
582 vnet/flow/ipfix_info_elements.h \
583 vnet/flow/ipfix_packet.h
585 ########################################
587 ########################################
589 libvnet_la_SOURCES += \
590 vnet/flow/flow_report_sample.c
592 nobase_include_HEADERS += \
593 vnet/flow/flow_report_sample.h
595 ########################################
597 ########################################
599 libvnet_la_SOURCES += \
600 vnet/lawful-intercept/lawful_intercept.c \
601 vnet/lawful-intercept/node.c
603 nobase_include_HEADERS += \
604 vnet/dpdk_replication.h \
605 vnet/lawful-intercept/lawful_intercept.h
607 ########################################
609 ########################################
611 libvnet_la_SOURCES += \
619 nobase_include_HEADERS += \
623 ########################################
625 ########################################
627 libvnet_la_SOURCES += \
628 vnet/devices/dpdk/dpdk_priv.h \
629 vnet/devices/dpdk/device.c \
630 vnet/devices/dpdk/format.c \
631 vnet/devices/dpdk/init.c \
632 vnet/devices/dpdk/node.c \
633 vnet/devices/dpdk/threads.c \
634 vnet/devices/dpdk/vhost_user.c \
635 vnet/devices/dpdk/cli.c
637 nobase_include_HEADERS += \
638 vnet/devices/dpdk/dpdk.h \
639 vnet/devices/dpdk/threads.h
641 libvnet_la_SOURCES += \
642 vnet/devices/nic/ixge.c \
643 vnet/devices/nic/ixge.h \
644 vnet/devices/nic/sfp.c \
645 vnet/devices/nic/sfp.h
648 ########################################
650 ########################################
653 libvnet_la_SOURCES += \
654 vnet/devices/virtio/vhost-user.c
656 nobase_include_HEADERS += \
657 vnet/devices/virtio/vhost-user.h
660 ########################################
662 ########################################
663 libvnet_la_SOURCES += \
664 vnet/devices/ssvm/ssvm_eth.c \
665 vnet/devices/ssvm/node.c
667 nobase_include_HEADERS += \
668 vnet/devices/ssvm/ssvm_eth.h
670 ########################################
671 # Linux packet interface
672 ########################################
674 libvnet_la_SOURCES += \
675 vnet/devices/af_packet/af_packet.c \
676 vnet/devices/af_packet/device.c \
677 vnet/devices/af_packet/node.c \
678 vnet/devices/af_packet/cli.c
680 nobase_include_HEADERS += \
681 vnet/devices/af_packet/af_packet.h
683 ########################################
685 ########################################
687 libvnet_la_SOURCES += \
688 vnet/devices/netmap/netmap.c \
689 vnet/devices/netmap/device.c \
690 vnet/devices/netmap/node.c \
691 vnet/devices/netmap/cli.c
693 nobase_include_HEADERS += \
694 vnet/devices/netmap/netmap.h
697 ########################################
698 # Unix kernel related
699 ########################################
701 # FIXME: vnet/unix/hgshm.c
703 libvnet_la_SOURCES += \
704 vnet/unix/gdb_funcs.c \
709 nobase_include_HEADERS += \
714 ########################################
715 # Plugin client library
716 ########################################
718 libvnetplugin_la_SOURCES += \
721 nobase_include_HEADERS += \
724 ########################################
725 # Service Chain verification util
726 ########################################
727 libvnet_la_SOURCES += \
728 vnet/lib-scv/scv_util.c
730 nobase_include_HEADERS += \
731 vnet/lib-scv/scv_util.h \
732 vnet/lib-scv/math64.h
734 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
739 dpdk_libs += -l:libdpdk.a
743 vnet/unix/pcap2pg.c \
746 pcap2pg_LDFLAGS = -static
747 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
749 noinst_PROGRAMS += pcap2pg