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 += \
30 vnet/interface_cli.c \
31 vnet/interface_format.c \
32 vnet/interface_output.c \
37 nobase_include_HEADERS += \
43 vnet/interface_funcs.h \
50 ########################################
52 ########################################
54 libvnet_la_SOURCES += \
55 vnet/policer/node_funcs.c \
56 vnet/policer/policer.c \
59 nobase_include_HEADERS += \
60 vnet/policer/police.h \
63 ########################################
65 ########################################
67 libvnet_la_SOURCES += \
70 vnet/cop/ip4_whitelist.c \
71 vnet/cop/ip6_whitelist.c
73 nobase_include_HEADERS += \
76 ########################################
77 # Layer 2 protocols go here
78 ########################################
80 ########################################
81 # Layer 2 protocol: Ethernet
82 ########################################
83 libvnet_la_SOURCES += \
85 vnet/ethernet/format.c \
86 vnet/ethernet/init.c \
87 vnet/ethernet/interface.c \
88 vnet/ethernet/node.c \
91 nobase_include_HEADERS += \
92 vnet/ethernet/arp_packet.h \
93 vnet/ethernet/error.def \
94 vnet/ethernet/ethernet.h \
95 vnet/ethernet/packet.h \
96 vnet/ethernet/types.def
98 ########################################
99 # Layer 2 protocol: Ethernet bridging
100 ########################################
101 libvnet_la_SOURCES += \
102 vnet/l2/feat_bitmap.c \
105 vnet/l2/l2_classify.c \
106 vnet/l2/l2_efp_filter.c \
110 vnet/l2/l2_input_acl.c \
112 vnet/l2/l2_input_vtr.c \
114 vnet/l2/l2_output_acl.c \
115 vnet/l2/l2_output.c \
121 nobase_include_HEADERS += \
122 vnet/l2/feat_bitmap.h \
124 vnet/l2/l2_output.h \
126 vnet/l2/l2_input_vtr.h \
127 vnet/l2/l2_efp_filter.h \
135 vnet/l2/l2_classify.h
137 ########################################
138 # Layer 2 protocol: SRP
139 ########################################
140 libvnet_la_SOURCES += \
142 vnet/srp/interface.c \
146 nobase_include_HEADERS += \
150 ########################################
151 # Layer 2 protocol: PPP
152 ########################################
153 libvnet_la_SOURCES += \
158 nobase_include_HEADERS += \
163 ########################################
164 # Layer 2 protocol: HDLC
165 ########################################
166 libvnet_la_SOURCES += \
171 nobase_include_HEADERS += \
172 vnet/hdlc/error.def \
176 ########################################
177 # Layer 2 protocol: LLC
178 ########################################
179 libvnet_la_SOURCES += \
184 nobase_include_HEADERS += \
187 ########################################
188 # Layer 2 protocol: SNAP
189 ########################################
190 libvnet_la_SOURCES += \
195 nobase_include_HEADERS += \
198 ########################################
200 ########################################
201 libvnet_la_SOURCES += \
206 nobase_include_HEADERS += \
208 vnet/vxlan/vxlan_packet.h \
209 vnet/vxlan/vxlan_error.def
211 ########################################
213 ########################################
214 libvnet_la_SOURCES += \
215 vnet/cdp/cdp_input.c \
216 vnet/cdp/cdp_node.c \
217 vnet/cdp/cdp_periodic.c
219 nobase_include_HEADERS += \
220 vnet/cdp/cdp_protocol.h
222 ########################################
223 # Layer 2/3 "classify"
224 ########################################
225 libvnet_la_SOURCES += \
226 vnet/classify/vnet_classify.c \
227 vnet/classify/ip_classify.c \
228 vnet/classify/input_acl.c \
229 vnet/classify/vnet_classify.h
231 nobase_include_HEADERS += \
232 vnet/classify/vnet_classify.h \
233 vnet/classify/input_acl.h
235 ########################################
236 # Layer 3 protocols go here
237 ########################################
239 ########################################
240 # Layer 3 protocol: IP v4/v6
241 ########################################
242 libvnet_la_SOURCES += \
243 vnet/ip/adj_alloc.c \
248 vnet/ip/ip4_format.c \
249 vnet/ip/ip4_forward.c \
250 vnet/ip/ip4_hop_by_hop.c \
251 vnet/ip/ip4_input.c \
252 vnet/ip/ip4_mtrie.c \
254 vnet/ip/ip4_source_check.c \
255 vnet/ip/ip6_format.c \
256 vnet/ip/ip6_forward.c \
257 vnet/ip/ip6_hop_by_hop.c \
258 vnet/ip/ip6_input.c \
259 vnet/ip/ip6_neighbor.c \
261 vnet/ip/ip_checksum.c \
265 vnet/ip/udp_format.c \
267 vnet/ip/udp_local.c \
269 vnet/ip/ip_input_acl.c \
272 nobase_include_HEADERS += \
273 vnet/ip/adj_alloc.h \
275 vnet/ip/icmp46_packet.h \
278 vnet/ip/igmp_packet.h \
281 vnet/ip/ip4_mtrie.h \
282 vnet/ip/ip4_error.h \
283 vnet/ip/ip4_packet.h \
285 vnet/ip/ip6_error.h \
286 vnet/ip/ip6_hop_by_hop.h \
287 vnet/ip/ip6_hop_by_hop_packet.h \
288 vnet/ip/ip6_packet.h \
290 vnet/ip/ip_packet.h \
292 vnet/ip/protocols.def \
293 vnet/ip/tcp_packet.h \
295 vnet/ip/udp_error.def \
298 ########################################
299 # Layer 3 protocol: IPSec
300 ########################################
302 libvnet_la_SOURCES += \
304 vnet/ipsec/ipsec_cli.c \
305 vnet/ipsec/ipsec_format.c \
306 vnet/ipsec/ipsec_input.c \
307 vnet/ipsec/ipsec_if.c \
308 vnet/ipsec/ipsec_if_in.c \
309 vnet/ipsec/ipsec_if_out.c \
310 vnet/ipsec/esp_encrypt.c \
311 vnet/ipsec/esp_decrypt.c \
313 vnet/ipsec/ikev2_crypto.c \
314 vnet/ipsec/ikev2_cli.c \
315 vnet/ipsec/ikev2_payload.c \
316 vnet/ipsec/ikev2_format.c
319 libvnet_la_SOURCES += \
320 vnet/ipsec/ipsec_output.c
322 nobase_include_HEADERS += \
326 vnet/ipsec/ikev2_priv.h
328 ########################################
329 # Layer 3 protocol: osi
330 ########################################
331 libvnet_la_SOURCES += \
336 nobase_include_HEADERS += \
339 ########################################
340 # Layer 3 protocol: MAP
341 ########################################
342 libvnet_la_SOURCES += \
347 vnet/map/ip4_sixrd.c \
348 vnet/map/ip6_sixrd.c \
349 vnet/map/ip4_map_t.c \
352 nobase_include_HEADERS += \
356 ########################################
357 # Tunnel protocol: gre
358 ########################################
359 libvnet_la_SOURCES += \
362 vnet/gre/interface.c \
365 nobase_include_HEADERS += \
370 ########################################
371 # Tunnel protocol: l2tpv3
372 ########################################
373 libvnet_la_SOURCES += \
379 nobase_include_HEADERS += \
383 ########################################
384 # Tunnel protocol: gre+mpls
385 ########################################
386 libvnet_la_SOURCES += \
387 vnet/mpls-gre/mpls.c \
388 vnet/mpls-gre/node.c \
389 vnet/mpls-gre/interface.c \
390 vnet/mpls-gre/policy_encap.c \
393 nobase_include_HEADERS += \
394 vnet/mpls-gre/mpls.h \
395 vnet/mpls-gre/packet.h \
396 vnet/mpls-gre/error.def
399 ########################################
401 ########################################
403 nobase_include_HEADERS += \
404 vnet/nsh/nsh_packet.h \
405 vnet/nsh/nsh_error.def
408 ########################################
409 # Tunnel protocol: nsh-gre
410 ########################################
412 libvnet_la_SOURCES += \
413 vnet/nsh-gre/nsh_gre.c \
414 vnet/nsh-gre/encap.c \
417 nobase_include_HEADERS += \
418 vnet/nsh-gre/nsh_gre.h
420 ########################################
421 # Tunnel protocol: nsh-vxlan-gpe
422 ########################################
424 libvnet_la_SOURCES += \
425 vnet/nsh-vxlan-gpe/nsh_vxlan_gpe.c \
426 vnet/nsh-vxlan-gpe/encap.c \
427 vnet/nsh-vxlan-gpe/decap.c
429 nobase_include_HEADERS += \
430 vnet/nsh-vxlan-gpe/nsh_vxlan_gpe.h \
431 vnet/nsh-vxlan-gpe/vxlan_gpe_packet.h \
432 vnet/nsh-vxlan-gpe/nsh_vxlan_gpe_error.def
434 ########################################
435 # LISP control plane: lisp-cp
436 ########################################
438 libvnet_la_SOURCES += \
439 vnet/lisp-cp/lisp_types.c \
440 vnet/lisp-cp/control.c \
441 vnet/lisp-cp/gid_dictionary.c \
442 vnet/lisp-cp/lisp_msg_serdes.c \
443 vnet/lisp-cp/packets.c
445 nobase_include_HEADERS += \
446 vnet/lisp-cp/lisp_types.h \
447 vnet/lisp-cp/packets.h \
448 vnet/lisp-cp/gid_dictionary.h \
449 vnet/lisp-cp/lisp_cp_messages.h \
450 vnet/lisp-cp/lisp_msg_serdes.h \
451 vnet/lisp-cp/control.h
455 LDS = -lvppinfra -l:libvlib.a -l:libdpdk.a -l:libvlibmemory.a \
456 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
458 TESTS += test_cp_serdes test_lisp_types
460 test_cp_serdes_SOURCES = \
461 test/lisp-cp/test_cp_serdes.c \
462 vnet/lisp-cp/lisp_msg_serdes.c \
463 vnet/lisp-cp/lisp_types.c \
464 vnet/lisp-cp/packets.c \
465 vnet/ip/ip_checksum.c
467 test_lisp_types_SOURCES = \
468 test/lisp-cp/test_lisp_types.c \
469 vnet/lisp-cp/lisp_types.c
471 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
472 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
474 test_cp_serdes_LDADD = libvnet.la $(LDS)
475 test_lisp_types_LDADD = libvnet.la $(LDS)
477 test_cp_serdes_LDFLAGS = -static
478 test_lisp_types_LDFLAGS = -static
481 ########################################
482 # Tunnel protocol: lisp-gpe
483 ########################################
485 libvnet_la_SOURCES += \
486 vnet/lisp-gpe/lisp_gpe.c \
487 vnet/lisp-gpe/interface.c \
488 vnet/lisp-gpe/ip_forward.c \
489 vnet/lisp-gpe/decap.c
491 nobase_include_HEADERS += \
492 vnet/lisp-gpe/lisp_gpe.h \
493 vnet/lisp-gpe/lisp_gpe_packet.h \
494 vnet/lisp-gpe/lisp_gpe_error.def
499 test_test_SOURCES = test/lisp-gpe/test.c
501 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
503 test_test_LDADD = $(LIBOBJS)
505 noinst_PROGRAMS += $(TESTS)
506 check_PROGRAMS = $(TESTS)
509 ########################################
511 ########################################
512 libvnet_la_SOURCES += \
516 nobase_include_HEADERS += \
519 ########################################
521 ########################################
522 libvnet_la_SOURCES += \
523 vnet/dhcp/proxy_node.c \
526 nobase_include_HEADERS += \
529 vnet/dhcp/proxy_error.def
531 ########################################
532 # ipv6 segment routing
533 ########################################
536 libvnet_la_SOURCES += \
538 vnet/sr/sr_replicate.c
541 nobase_include_HEADERS += \
542 vnet/sr/sr_packet.h \
543 vnet/sr/sr_error.def \
546 ########################################
548 #########################################
551 libvnet_la_SOURCES += \
552 vnet/vcgn/cnat_bulk_port.c \
553 vnet/vcgn/cnat_config.c \
554 vnet/vcgn/cnat_db_scanner.c \
555 vnet/vcgn/cnat_db_v2.c \
556 vnet/vcgn/cnat_debug_msg_handler.c \
557 vnet/vcgn/cnat_cli_handler.c \
558 vnet/vcgn/cnat_global.c \
559 vnet/vcgn/cnat_ipv4_udp_inside_input.c \
560 vnet/vcgn/cnat_ipv4_udp_inside_input_exceptions.c \
561 vnet/vcgn/cnat_ipv4_udp_outside_input.c \
562 vnet/vcgn/cnat_ipv4_tcp_inside_input.c \
563 vnet/vcgn/cnat_ipv4_tcp_inside_input_exceptions.c \
564 vnet/vcgn/cnat_ipv4_tcp_outside_input.c \
565 vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c \
566 vnet/vcgn/cnat_ipv4_icmp_query_inside_input_exception.c \
567 vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c \
568 vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c \
569 vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c \
570 vnet/vcgn/cnat_logging.c \
571 vnet/vcgn/cnat_ports.c \
572 vnet/vcgn/cnat_util.c \
573 vnet/vcgn/cnat_show.c \
574 vnet/vcgn/cnat_syslog.c \
575 vnet/vcgn/cnat_v4_functions.c \
576 vnet/vcgn/index_list.c \
577 vnet/vcgn/spp_platform_trace_log.c \
578 vnet/vcgn/vcgn_classify.c
581 ########################################
583 ########################################
584 libvnet_la_SOURCES += \
585 vnet/dhcpv6/proxy_node.c
587 nobase_include_HEADERS += \
588 vnet/dhcpv6/packet.h \
589 vnet/dhcpv6/proxy.h \
590 vnet/dhcpv6/proxy_error.def
592 ########################################
593 # IPFIX / netflow v10
594 ########################################
595 libvnet_la_SOURCES += \
596 vnet/flow/flow_report.c
598 nobase_include_HEADERS += \
599 vnet/flow/flow_report.h \
600 vnet/flow/ipfix_info_elements.h \
601 vnet/flow/ipfix_packet.h
603 ########################################
605 ########################################
607 libvnet_la_SOURCES += \
608 vnet/flow/flow_report_sample.c
610 nobase_include_HEADERS += \
611 vnet/flow/flow_report_sample.h
613 ########################################
615 ########################################
617 libvnet_la_SOURCES += \
618 vnet/lawful-intercept/lawful_intercept.c \
619 vnet/lawful-intercept/node.c
621 nobase_include_HEADERS += \
622 vnet/dpdk_replication.h \
623 vnet/lawful-intercept/lawful_intercept.h
625 ########################################
627 ########################################
629 libvnet_la_SOURCES += \
637 nobase_include_HEADERS += \
641 ########################################
643 ########################################
645 libvnet_la_SOURCES += \
646 vnet/devices/dpdk/dpdk_priv.h \
647 vnet/devices/dpdk/device.c \
648 vnet/devices/dpdk/format.c \
649 vnet/devices/dpdk/init.c \
650 vnet/devices/dpdk/node.c \
651 vnet/devices/dpdk/threads.c \
652 vnet/devices/dpdk/vhost_user.c \
653 vnet/devices/dpdk/cli.c
655 nobase_include_HEADERS += \
656 vnet/devices/dpdk/dpdk.h \
657 vnet/devices/dpdk/threads.h
660 ########################################
662 ########################################
665 libvnet_la_SOURCES += \
666 vnet/devices/virtio/vhost-user.c
668 nobase_include_HEADERS += \
669 vnet/devices/virtio/vhost-user.h
672 ########################################
674 ########################################
675 libvnet_la_SOURCES += \
676 vnet/devices/ssvm/ssvm_eth.c \
677 vnet/devices/ssvm/node.c
679 nobase_include_HEADERS += \
680 vnet/devices/ssvm/ssvm_eth.h
682 ########################################
683 # Linux packet interface
684 ########################################
686 libvnet_la_SOURCES += \
687 vnet/devices/af_packet/af_packet.c \
688 vnet/devices/af_packet/device.c \
689 vnet/devices/af_packet/node.c \
690 vnet/devices/af_packet/cli.c
692 nobase_include_HEADERS += \
693 vnet/devices/af_packet/af_packet.h
695 ########################################
697 ########################################
699 libvnet_la_SOURCES += \
700 vnet/devices/netmap/netmap.c \
701 vnet/devices/netmap/device.c \
702 vnet/devices/netmap/node.c \
703 vnet/devices/netmap/cli.c
705 nobase_include_HEADERS += \
706 vnet/devices/netmap/netmap.h
709 ########################################
710 # Unix kernel related
711 ########################################
713 # FIXME: vnet/unix/hgshm.c
715 libvnet_la_SOURCES += \
716 vnet/unix/gdb_funcs.c \
721 nobase_include_HEADERS += \
726 ########################################
727 # Plugin client library
728 ########################################
730 libvnetplugin_la_SOURCES += \
733 nobase_include_HEADERS += \
736 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
741 dpdk_libs += -l:libdpdk.a
745 vnet/unix/pcap2pg.c \
748 pcap2pg_LDFLAGS = -static
749 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
751 noinst_PROGRAMS += pcap2pg