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 \
61 vnet/policer/policer.h \
62 vnet/policer/fix_types.h \
65 ########################################
67 ########################################
69 libvnet_la_SOURCES += \
72 vnet/cop/ip4_whitelist.c \
73 vnet/cop/ip6_whitelist.c
75 nobase_include_HEADERS += \
78 ########################################
79 # Layer 2 protocols go here
80 ########################################
82 ########################################
83 # Layer 2 protocol: Ethernet
84 ########################################
85 libvnet_la_SOURCES += \
87 vnet/ethernet/format.c \
88 vnet/ethernet/init.c \
89 vnet/ethernet/interface.c \
90 vnet/ethernet/node.c \
93 nobase_include_HEADERS += \
94 vnet/ethernet/arp_packet.h \
95 vnet/ethernet/error.def \
96 vnet/ethernet/ethernet.h \
97 vnet/ethernet/packet.h \
98 vnet/ethernet/types.def
100 ########################################
101 # Layer 2 protocol: Ethernet bridging
102 ########################################
103 libvnet_la_SOURCES += \
104 vnet/l2/feat_bitmap.c \
107 vnet/l2/l2_classify.c \
108 vnet/l2/l2_efp_filter.c \
112 vnet/l2/l2_input_acl.c \
114 vnet/l2/l2_input_vtr.c \
116 vnet/l2/l2_output_acl.c \
117 vnet/l2/l2_output.c \
123 nobase_include_HEADERS += \
124 vnet/l2/feat_bitmap.h \
126 vnet/l2/l2_output.h \
128 vnet/l2/l2_input_vtr.h \
129 vnet/l2/l2_efp_filter.h \
137 vnet/l2/l2_classify.h
139 ########################################
140 # Layer 2 protocol: SRP
141 ########################################
142 libvnet_la_SOURCES += \
144 vnet/srp/interface.c \
148 nobase_include_HEADERS += \
152 ########################################
153 # Layer 2 protocol: PPP
154 ########################################
155 libvnet_la_SOURCES += \
160 nobase_include_HEADERS += \
165 ########################################
166 # Layer 2 protocol: HDLC
167 ########################################
168 libvnet_la_SOURCES += \
173 nobase_include_HEADERS += \
174 vnet/hdlc/error.def \
178 ########################################
179 # Layer 2 protocol: LLC
180 ########################################
181 libvnet_la_SOURCES += \
186 nobase_include_HEADERS += \
189 ########################################
190 # Layer 2 protocol: SNAP
191 ########################################
192 libvnet_la_SOURCES += \
197 nobase_include_HEADERS += \
200 ########################################
202 ########################################
203 libvnet_la_SOURCES += \
208 nobase_include_HEADERS += \
210 vnet/vxlan/vxlan_packet.h \
211 vnet/vxlan/vxlan_error.def
213 ########################################
215 ########################################
216 libvnet_la_SOURCES += \
217 vnet/cdp/cdp_input.c \
218 vnet/cdp/cdp_node.c \
219 vnet/cdp/cdp_periodic.c
221 nobase_include_HEADERS += \
222 vnet/cdp/cdp_protocol.h
224 ########################################
225 # Layer 2/3 "classify"
226 ########################################
227 libvnet_la_SOURCES += \
228 vnet/classify/vnet_classify.c \
229 vnet/classify/ip_classify.c \
230 vnet/classify/input_acl.c \
231 vnet/classify/vnet_classify.h
233 nobase_include_HEADERS += \
234 vnet/classify/vnet_classify.h \
235 vnet/classify/input_acl.h
237 ########################################
238 # Layer 3 protocols go here
239 ########################################
241 ########################################
242 # Layer 3 protocol: IP v4/v6
243 ########################################
244 libvnet_la_SOURCES += \
245 vnet/ip/adj_alloc.c \
250 vnet/ip/ip4_format.c \
251 vnet/ip/ip4_forward.c \
252 vnet/ip/ip4_hop_by_hop.c \
253 vnet/ip/ip4_input.c \
254 vnet/ip/ip4_mtrie.c \
256 vnet/ip/ip4_source_check.c \
257 vnet/ip/ip6_format.c \
258 vnet/ip/ip6_forward.c \
259 vnet/ip/ip6_hop_by_hop.c \
260 vnet/ip/ip6_input.c \
261 vnet/ip/ip6_neighbor.c \
263 vnet/ip/ip_checksum.c \
267 vnet/ip/udp_format.c \
269 vnet/ip/udp_local.c \
271 vnet/ip/ip_input_acl.c \
274 nobase_include_HEADERS += \
275 vnet/ip/adj_alloc.h \
277 vnet/ip/icmp46_packet.h \
280 vnet/ip/igmp_packet.h \
283 vnet/ip/ip4_mtrie.h \
284 vnet/ip/ip4_error.h \
285 vnet/ip/ip4_packet.h \
287 vnet/ip/ip6_error.h \
288 vnet/ip/ip6_hop_by_hop.h \
289 vnet/ip/ip6_hop_by_hop_packet.h \
290 vnet/ip/ip6_packet.h \
292 vnet/ip/ip_packet.h \
294 vnet/ip/protocols.def \
295 vnet/ip/tcp_packet.h \
297 vnet/ip/udp_error.def \
300 ########################################
301 # Layer 3 protocol: IPSec
302 ########################################
304 libvnet_la_SOURCES += \
306 vnet/ipsec/ipsec_cli.c \
307 vnet/ipsec/ipsec_format.c \
308 vnet/ipsec/ipsec_input.c \
309 vnet/ipsec/ipsec_if.c \
310 vnet/ipsec/ipsec_if_in.c \
311 vnet/ipsec/ipsec_if_out.c \
312 vnet/ipsec/esp_encrypt.c \
313 vnet/ipsec/esp_decrypt.c \
315 vnet/ipsec/ikev2_crypto.c \
316 vnet/ipsec/ikev2_cli.c \
317 vnet/ipsec/ikev2_payload.c \
318 vnet/ipsec/ikev2_format.c
321 libvnet_la_SOURCES += \
322 vnet/ipsec/ipsec_output.c
324 nobase_include_HEADERS += \
328 vnet/ipsec/ikev2_priv.h
330 ########################################
331 # Layer 3 protocol: osi
332 ########################################
333 libvnet_la_SOURCES += \
338 nobase_include_HEADERS += \
341 ########################################
342 # Layer 3 protocol: MAP
343 ########################################
344 libvnet_la_SOURCES += \
349 vnet/map/ip4_sixrd.c \
350 vnet/map/ip6_sixrd.c \
351 vnet/map/ip4_map_t.c \
354 nobase_include_HEADERS += \
358 ########################################
359 # Tunnel protocol: gre
360 ########################################
361 libvnet_la_SOURCES += \
364 vnet/gre/interface.c \
367 nobase_include_HEADERS += \
372 ########################################
373 # Tunnel protocol: l2tpv3
374 ########################################
375 libvnet_la_SOURCES += \
381 nobase_include_HEADERS += \
385 ########################################
386 # Tunnel protocol: gre+mpls
387 ########################################
388 libvnet_la_SOURCES += \
389 vnet/mpls-gre/mpls.c \
390 vnet/mpls-gre/node.c \
391 vnet/mpls-gre/interface.c \
392 vnet/mpls-gre/policy_encap.c \
395 nobase_include_HEADERS += \
396 vnet/mpls-gre/mpls.h \
397 vnet/mpls-gre/packet.h \
398 vnet/mpls-gre/error.def
401 ########################################
403 ########################################
404 libvnet_la_SOURCES += \
407 nobase_include_HEADERS += \
408 vnet/nsh/nsh_packet.h \
410 vnet/nsh/nsh_error.def
413 ########################################
414 # Tunnel protocol: nsh-gre
415 ########################################
417 # libvnet_la_SOURCES += \
418 # vnet/nsh-gre/nsh_gre.c \
419 # vnet/nsh-gre/encap.c \
420 # vnet/nsh-gre/decap.c
422 # nobase_include_HEADERS += \
423 # vnet/nsh-gre/nsh_gre.h
425 ########################################
426 # Tunnel protocol: vxlan-gpe
427 ########################################
429 libvnet_la_SOURCES += \
430 vnet/vxlan-gpe/vxlan_gpe.c \
431 vnet/vxlan-gpe/encap.c \
432 vnet/vxlan-gpe/decap.c
434 nobase_include_HEADERS += \
435 vnet/vxlan-gpe/vxlan_gpe.h \
436 vnet/vxlan-gpe/vxlan_gpe_packet.h \
437 vnet/vxlan-gpe/vxlan_gpe_error.def
439 ########################################
440 # LISP control plane: lisp-cp
441 ########################################
443 libvnet_la_SOURCES += \
444 vnet/lisp-cp/lisp_types.c \
445 vnet/lisp-cp/control.c \
446 vnet/lisp-cp/gid_dictionary.c \
447 vnet/lisp-cp/lisp_msg_serdes.c \
448 vnet/lisp-cp/packets.c
450 nobase_include_HEADERS += \
451 vnet/lisp-cp/lisp_types.h \
452 vnet/lisp-cp/packets.h \
453 vnet/lisp-cp/gid_dictionary.h \
454 vnet/lisp-cp/lisp_cp_messages.h \
455 vnet/lisp-cp/lisp_msg_serdes.h \
456 vnet/lisp-cp/control.h
460 LDS = -lvppinfra -l:libvlib.a -l:libdpdk.a -l:libvlibmemory.a \
461 -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
463 TESTS += test_cp_serdes test_lisp_types
465 test_cp_serdes_SOURCES = \
466 test/lisp-cp/test_cp_serdes.c \
467 vnet/lisp-cp/lisp_msg_serdes.c \
468 vnet/lisp-cp/lisp_types.c \
469 vnet/lisp-cp/packets.c \
470 vnet/ip/ip_checksum.c
472 test_lisp_types_SOURCES = \
473 test/lisp-cp/test_lisp_types.c \
474 vnet/lisp-cp/lisp_types.c
476 test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
477 test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
479 test_cp_serdes_LDADD = libvnet.la $(LDS)
480 test_lisp_types_LDADD = libvnet.la $(LDS)
482 test_cp_serdes_LDFLAGS = -static
483 test_lisp_types_LDFLAGS = -static
486 ########################################
487 # Tunnel protocol: lisp-gpe
488 ########################################
490 libvnet_la_SOURCES += \
491 vnet/lisp-gpe/lisp_gpe.c \
492 vnet/lisp-gpe/interface.c \
493 vnet/lisp-gpe/ip_forward.c \
494 vnet/lisp-gpe/decap.c
496 nobase_include_HEADERS += \
497 vnet/lisp-gpe/lisp_gpe.h \
498 vnet/lisp-gpe/lisp_gpe_packet.h \
499 vnet/lisp-gpe/lisp_gpe_error.def
504 test_test_SOURCES = test/lisp-gpe/test.c
506 test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
508 test_test_LDADD = $(LIBOBJS)
510 noinst_PROGRAMS += $(TESTS)
511 check_PROGRAMS = $(TESTS)
514 ########################################
516 ########################################
517 libvnet_la_SOURCES += \
521 nobase_include_HEADERS += \
524 ########################################
526 ########################################
527 libvnet_la_SOURCES += \
528 vnet/dhcp/proxy_node.c \
531 nobase_include_HEADERS += \
534 vnet/dhcp/proxy_error.def
536 ########################################
537 # ipv6 segment routing
538 ########################################
541 libvnet_la_SOURCES += \
543 vnet/sr/sr_replicate.c
546 nobase_include_HEADERS += \
547 vnet/sr/sr_packet.h \
548 vnet/sr/sr_error.def \
551 ########################################
553 #########################################
556 libvnet_la_SOURCES += \
557 vnet/vcgn/cnat_bulk_port.c \
558 vnet/vcgn/cnat_config.c \
559 vnet/vcgn/cnat_db_scanner.c \
560 vnet/vcgn/cnat_db_v2.c \
561 vnet/vcgn/cnat_debug_msg_handler.c \
562 vnet/vcgn/cnat_cli_handler.c \
563 vnet/vcgn/cnat_global.c \
564 vnet/vcgn/cnat_ipv4_udp_inside_input.c \
565 vnet/vcgn/cnat_ipv4_udp_inside_input_exceptions.c \
566 vnet/vcgn/cnat_ipv4_udp_outside_input.c \
567 vnet/vcgn/cnat_ipv4_tcp_inside_input.c \
568 vnet/vcgn/cnat_ipv4_tcp_inside_input_exceptions.c \
569 vnet/vcgn/cnat_ipv4_tcp_outside_input.c \
570 vnet/vcgn/cnat_ipv4_icmp_query_inside_input.c \
571 vnet/vcgn/cnat_ipv4_icmp_query_inside_input_exception.c \
572 vnet/vcgn/cnat_ipv4_icmp_query_outside_input.c \
573 vnet/vcgn/cnat_ipv4_icmp_error_inside_input.c \
574 vnet/vcgn/cnat_ipv4_icmp_error_outside_input.c \
575 vnet/vcgn/cnat_logging.c \
576 vnet/vcgn/cnat_ports.c \
577 vnet/vcgn/cnat_util.c \
578 vnet/vcgn/cnat_show.c \
579 vnet/vcgn/cnat_syslog.c \
580 vnet/vcgn/cnat_v4_functions.c \
581 vnet/vcgn/index_list.c \
582 vnet/vcgn/spp_platform_trace_log.c \
583 vnet/vcgn/vcgn_classify.c
586 ########################################
588 ########################################
589 libvnet_la_SOURCES += \
590 vnet/dhcpv6/proxy_node.c
592 nobase_include_HEADERS += \
593 vnet/dhcpv6/packet.h \
594 vnet/dhcpv6/proxy.h \
595 vnet/dhcpv6/proxy_error.def
597 ########################################
598 # IPFIX / netflow v10
599 ########################################
600 libvnet_la_SOURCES += \
601 vnet/flow/flow_report.c
603 nobase_include_HEADERS += \
604 vnet/flow/flow_report.h \
605 vnet/flow/ipfix_info_elements.h \
606 vnet/flow/ipfix_packet.h
608 ########################################
610 ########################################
612 libvnet_la_SOURCES += \
613 vnet/flow/flow_report_sample.c
615 nobase_include_HEADERS += \
616 vnet/flow/flow_report_sample.h
618 ########################################
620 ########################################
622 libvnet_la_SOURCES += \
623 vnet/lawful-intercept/lawful_intercept.c \
624 vnet/lawful-intercept/node.c
626 nobase_include_HEADERS += \
627 vnet/dpdk_replication.h \
628 vnet/lawful-intercept/lawful_intercept.h
630 ########################################
632 ########################################
634 libvnet_la_SOURCES += \
642 nobase_include_HEADERS += \
646 ########################################
648 ########################################
650 libvnet_la_SOURCES += \
651 vnet/devices/dpdk/dpdk_priv.h \
652 vnet/devices/dpdk/device.c \
653 vnet/devices/dpdk/format.c \
654 vnet/devices/dpdk/init.c \
655 vnet/devices/dpdk/node.c \
656 vnet/devices/dpdk/threads.c \
657 vnet/devices/dpdk/vhost_user.c \
658 vnet/devices/dpdk/cli.c
660 nobase_include_HEADERS += \
661 vnet/devices/dpdk/dpdk.h \
662 vnet/devices/dpdk/threads.h
665 ########################################
667 ########################################
670 libvnet_la_SOURCES += \
671 vnet/devices/virtio/vhost-user.c
673 nobase_include_HEADERS += \
674 vnet/devices/virtio/vhost-user.h
677 ########################################
679 ########################################
680 libvnet_la_SOURCES += \
681 vnet/devices/ssvm/ssvm_eth.c \
682 vnet/devices/ssvm/node.c
684 nobase_include_HEADERS += \
685 vnet/devices/ssvm/ssvm_eth.h
687 ########################################
688 # Linux packet interface
689 ########################################
691 libvnet_la_SOURCES += \
692 vnet/devices/af_packet/af_packet.c \
693 vnet/devices/af_packet/device.c \
694 vnet/devices/af_packet/node.c \
695 vnet/devices/af_packet/cli.c
697 nobase_include_HEADERS += \
698 vnet/devices/af_packet/af_packet.h
700 ########################################
702 ########################################
704 libvnet_la_SOURCES += \
705 vnet/devices/netmap/netmap.c \
706 vnet/devices/netmap/device.c \
707 vnet/devices/netmap/node.c \
708 vnet/devices/netmap/cli.c
710 nobase_include_HEADERS += \
711 vnet/devices/netmap/netmap.h
714 ########################################
715 # Unix kernel related
716 ########################################
718 # FIXME: vnet/unix/hgshm.c
720 libvnet_la_SOURCES += \
721 vnet/unix/gdb_funcs.c \
726 nobase_include_HEADERS += \
731 ########################################
732 # Plugin client library
733 ########################################
735 libvnetplugin_la_SOURCES += \
738 nobase_include_HEADERS += \
741 ########################################
742 # Service Chain verification util
743 ########################################
744 libvnet_la_SOURCES += \
745 vnet/lib-scv/scv_util.c
747 nobase_include_HEADERS += \
748 vnet/lib-scv/scv_util.h \
749 vnet/lib-scv/math64.h
751 lib_LTLIBRARIES = libvnet.la libvnetplugin.la
756 dpdk_libs += -l:libdpdk.a
760 vnet/unix/pcap2pg.c \
763 pcap2pg_LDFLAGS = -static
764 pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
766 noinst_PROGRAMS += pcap2pg