1 # Copyright (c) 2018-2020 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.
17 unset(VNET_MULTIARCH_SOURCES)
19 option(VPP_IP_FIB_MTRIE_16 "IP FIB's MTRIE Stride is 16-8-8 (if not set it's 8-8-8-8)" ON)
21 ##############################################################################
23 ##############################################################################
24 list(APPEND VNET_SOURCES
64 list(APPEND VNET_MULTIARCH_SOURCES
70 list(APPEND VNET_HEADERS
80 interface/rx_queue_funcs.h
81 interface/tx_queue_funcs.h
97 ethernet/ethernet_format_fns.h
98 ethernet/ethernet_types_api.h
101 list(APPEND VNET_API_FILES
110 ##############################################################################
112 ##############################################################################
113 list(APPEND VNET_SOURCES
117 policer/policer_api.c
120 list(APPEND VNET_MULTIARCH_SOURCES
124 list(APPEND VNET_HEADERS
130 list(APPEND VNET_API_FILES
132 policer/policer_types.api
135 ##############################################################################
136 # Layer 2 protocols go here
137 ##############################################################################
139 ##############################################################################
140 # Layer 2 protocol: Ethernet
141 ##############################################################################
142 list(APPEND VNET_SOURCES
143 ethernet/arp_packet.c
144 ethernet/ethernet_types_api.c
148 ethernet/mac_address.c
152 ethernet/p2p_ethernet.c
153 ethernet/p2p_ethernet_input.c
154 ethernet/p2p_ethernet_api.c
157 list(APPEND VNET_MULTIARCH_SOURCES
159 ethernet/p2p_ethernet_input.c
162 list(APPEND VNET_HEADERS
165 ethernet/mac_address.h
169 ethernet/p2p_ethernet.h
170 ethernet/arp_packet.h
173 list(APPEND VNET_API_FILES
174 ethernet/p2p_ethernet.api
175 ethernet/ethernet_types.api)
177 ##############################################################################
178 # Layer 2 protocol: Ethernet bridging
179 ##############################################################################
180 list(APPEND VNET_SOURCES
187 l2/l2_input_classify.c
188 l2/l2_output_classify.c
199 l2/l2_in_out_feat_arc.c
207 list(APPEND VNET_MULTIARCH_SOURCES
213 l2/l2_in_out_feat_arc.c
214 l2/l2_input_classify.c
216 l2/l2_output_classify.c
226 list(APPEND VNET_HEADERS
243 list(APPEND VNET_API_FILES l2/l2.api)
245 ##############################################################################
246 # Layer 2 protocol: SRP
247 ##############################################################################
248 list(APPEND VNET_SOURCES
255 list(APPEND VNET_HEADERS
260 ##############################################################################
261 # Layer 2 protocol: PPP
262 ##############################################################################
263 list(APPEND VNET_SOURCES
269 list(APPEND VNET_HEADERS
275 ##############################################################################
276 # Layer 2 protocol: HDLC
277 ##############################################################################
278 list(APPEND VNET_SOURCES
284 list(APPEND VNET_HEADERS
290 ##############################################################################
291 # Layer 2 protocol: LLC
292 ##############################################################################
293 list(APPEND VNET_SOURCES
299 list(APPEND VNET_HEADERS
303 ##############################################################################
304 # Layer 2 protocol: SNAP
305 ##############################################################################
306 list(APPEND VNET_SOURCES
312 list(APPEND VNET_HEADERS
316 ##############################################################################
318 ##############################################################################
319 list(APPEND VNET_SOURCES
326 list(APPEND VNET_HEADERS
330 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
331 list(APPEND VNET_API_FILES bonding/bond.api)
333 ##############################################################################
334 # Layer 2/3 "classify"
335 ##############################################################################
336 list(APPEND VNET_SOURCES
337 classify/vnet_classify.c
338 classify/trace_classify.h
339 classify/ip_classify.c
340 classify/in_out_acl.c
341 classify/policer_classify.c
342 classify/flow_classify.c
343 classify/flow_classify_node.c
344 classify/vnet_classify.h
345 classify/classify_api.c
348 list(APPEND VNET_MULTIARCH_SOURCES
349 classify/ip_classify.c
350 classify/flow_classify_node.c
353 list(APPEND VNET_HEADERS
354 classify/vnet_classify.h
355 classify/trace_classify.h
356 classify/in_out_acl.h
357 classify/policer_classify.h
358 classify/flow_classify.h
361 list(APPEND VNET_API_FILES classify/classify.api)
363 ##############################################################################
364 # Layer 3 protocols go here
365 ##############################################################################
367 ##############################################################################
368 # Layer 3 protocol: IP v4/v6
369 ##############################################################################
370 list(APPEND VNET_SOURCES
384 ip/ip4_source_and_port_range_check.c
385 ip/reass/ip4_full_reass.c
386 ip/reass/ip4_sv_reass.c
396 ip/reass/ip6_full_reass.c
397 ip/reass/ip6_sv_reass.c
400 ip/ip_container_proxy.c
407 ip/ip_path_mtu_node.c
418 list(APPEND VNET_MULTIARCH_SOURCES
420 ip/reass/ip4_full_reass.c
422 ip/reass/ip6_full_reass.c
423 ip/reass/ip4_sv_reass.c
425 ip/reass/ip6_full_reass.c
426 ip/reass/ip6_sv_reass.c
431 ip/ip_path_mtu_node.c
434 list(APPEND VNET_HEADERS
447 ip/ip6_hop_by_hop_packet.h
451 ip/ip_container_proxy.h
457 ip/ip_source_and_port_range_check.h
464 ip/reass/ip4_sv_reass.h
465 ip/reass/ip6_sv_reass.h
468 list(APPEND VNET_API_FILES
473 list(APPEND VNET_MULTIARCH_SOURCES
479 ##############################################################################
481 ##############################################################################
482 list(APPEND VNET_SOURCES
483 ip-neighbor/ip_neighbor.c
484 ip-neighbor/ip_neighbor_api.c
485 ip-neighbor/ip_neighbor_dp.c
486 ip-neighbor/ip_neighbor_types.c
487 ip-neighbor/ip_neighbor_watch.c
488 ip-neighbor/ip4_neighbor.c
489 ip-neighbor/ip6_neighbor.c
492 list(APPEND VNET_HEADERS
493 ip-neighbor/ip_neighbor.h
494 ip-neighbor/ip_neighbor_types.h
497 list(APPEND VNET_API_FILES
498 ip-neighbor/ip_neighbor.api
501 ##############################################################################
502 # Bidirectional Forwarding Detection
503 ##############################################################################
505 list(APPEND VNET_HEADERS
512 list(APPEND VNET_SOURCES
521 list(APPEND VNET_API_FILES bfd/bfd.api)
523 ##############################################################################
525 ##############################################################################
527 list(APPEND VNET_SOURCES
535 list(APPEND VNET_HEADERS
539 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
541 list(APPEND VNET_API_FILES crypto/crypto.api)
543 ##############################################################################
544 # Layer 3 protocol: IPSec
545 ##############################################################################
546 list(APPEND VNET_SOURCES
550 ipsec/ipsec_handoff.c
556 ipsec/ipsec_spd_policy.c
565 ipsec/ipsec_types_api.c
568 list(APPEND VNET_MULTIARCH_SOURCES
573 ipsec/ipsec_handoff.c
579 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
580 list(APPEND VNET_API_FILES ipsec/ipsec.api)
582 list(APPEND VNET_SOURCES
586 list(APPEND VNET_HEADERS
589 ipsec/ipsec_spd_policy.h
592 ipsec/ipsec_types_api.h
598 ##############################################################################
599 # Layer 3 protocol: osi
600 ##############################################################################
601 list(APPEND VNET_SOURCES
607 list(APPEND VNET_HEADERS
611 ##############################################################################
612 # Layer 4 protocol: tcp
613 ##############################################################################
614 list(APPEND VNET_SOURCES
618 tcp/tcp_syn_filter4.c
631 list(APPEND VNET_MULTIARCH_SOURCES
634 tcp/tcp_syn_filter4.c
637 list(APPEND VNET_HEADERS
650 list(APPEND VNET_API_FILES tcp/tcp.api)
652 ##############################################################################
653 # Layer 4 protocol: udp
654 ##############################################################################
655 list(APPEND VNET_SOURCES
669 list(APPEND VNET_MULTIARCH_SOURCES
674 list(APPEND VNET_HEADERS
683 list(APPEND VNET_API_FILES udp/udp.api)
685 ##############################################################################
686 # Tunnel protocol: gre
687 ##############################################################################
688 list(APPEND VNET_HEADERS
692 ##############################################################################
693 # Tunnel protocol: ipip
694 ##############################################################################
695 list(APPEND VNET_SOURCES
703 list(APPEND VNET_MULTIARCH_SOURCES
707 list(APPEND VNET_HEADERS
711 list(APPEND VNET_API_FILES
715 ##############################################################################
717 ##############################################################################
718 list(APPEND VNET_SOURCES
720 tunnel/tunnel_types_api.c
723 list(APPEND VNET_API_FILES
724 tunnel/tunnel_types.api
727 list(APPEND VNET_HEADERS
730 tunnel/tunnel_types_api.h
733 ##############################################################################
734 # Tunnel protocol: gre+mpls
735 ##############################################################################
736 list(APPEND VNET_SOURCES
748 list(APPEND VNET_MULTIARCH_SOURCES
755 list(APPEND VNET_HEADERS
763 list(APPEND VNET_API_FILES mpls/mpls.api)
765 ##############################################################################
766 # Tunnel protocol: vxlan-gpe
767 ##############################################################################
769 list(APPEND VNET_SOURCES
770 vxlan-gpe/vxlan_gpe.c
773 vxlan-gpe/vxlan_gpe_api.c
776 list (APPEND VNET_MULTIARCH_SOURCES
780 list(APPEND VNET_HEADERS
781 vxlan-gpe/vxlan_gpe.h
782 vxlan-gpe/vxlan_gpe_packet.h
783 vxlan-gpe/vxlan_gpe_error.def
786 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
788 ##############################################################################
789 # ipv6 segment routing
790 ##############################################################################
792 list(APPEND VNET_SOURCES
795 srv6/sr_policy_rewrite.c
803 list(APPEND VNET_HEADERS
809 list(APPEND VNET_API_FILES
815 ##############################################################################
816 # IPFIX / netflow v10
817 ##############################################################################
818 list(APPEND VNET_SOURCES
819 ipfix-export/flow_report.c
820 ipfix-export/flow_api.c
823 list(APPEND VNET_HEADERS
824 ipfix-export/flow_report.h
825 ipfix-export/ipfix_info_elements.h
826 ipfix-export/ipfix_packet.h
829 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
831 ##############################################################################
833 ##############################################################################
834 list(APPEND VNET_SOURCES
842 list(APPEND VNET_HEADERS
846 ##############################################################################
848 ##############################################################################
849 list(APPEND VNET_SOURCES
856 list(APPEND VNET_HEADERS
859 gso/hdr_offset_parser.h
863 list(APPEND VNET_API_FILES
867 ##############################################################################
868 # IPFIX classify code
869 ##############################################################################
871 list(APPEND VNET_SOURCES
872 ipfix-export/flow_report_classify.c
875 list(APPEND VNET_HEADERS
876 ipfix-export/flow_report_classify.h
879 ##############################################################################
880 # SPAN (port mirroring)
881 ##############################################################################
883 list(APPEND VNET_SOURCES
889 list(APPEND VNET_MULTIARCH_SOURCES
893 list(APPEND VNET_HEADERS
897 list(APPEND VNET_API_FILES span/span.api)
899 ##############################################################################
901 ##############################################################################
903 list(APPEND VNET_SOURCES
913 list(APPEND VNET_HEADERS
918 list(APPEND VNET_API_FILES pg/pg.api)
920 ##############################################################################
922 ##############################################################################
924 list(APPEND VNET_SOURCES
926 devices/virtio/device.c
927 devices/virtio/format.c
928 devices/virtio/node.c
930 devices/virtio/virtio.c
931 devices/virtio/virtio_api.c
932 devices/virtio/virtio_pci_legacy.c
933 devices/virtio/virtio_pci_modern.c
934 devices/virtio/virtio_pre_input.c
935 devices/virtio/virtio_types_api.c
938 list(APPEND VNET_HEADERS
940 devices/virtio/virtio.h
941 devices/virtio/virtio_buffering.h
942 devices/virtio/virtio_std.h
943 devices/virtio/virtio_pci_legacy.h
944 devices/virtio/virtio_pci_modern.h
945 devices/virtio/vhost_std.h
946 devices/virtio/virtio_types_api.h
949 list(APPEND VNET_MULTIARCH_SOURCES
950 devices/virtio/node.c
951 devices/virtio/device.c
954 list(APPEND VNET_API_FILES
955 devices/virtio/virtio.api
956 devices/virtio/virtio_types.api
959 ##############################################################################
960 # tap interface (with virtio backend)
961 ##############################################################################
963 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
964 list(APPEND VNET_SOURCES
967 devices/tap/tapv2_api.c
970 list(APPEND VNET_HEADERS
974 list(APPEND VNET_API_FILES
975 devices/tap/tapv2.api
979 ##############################################################################
980 # tap interface (with virtio backend)
981 ##############################################################################
983 list(APPEND VNET_SOURCES
984 devices/pipe/pipe_api.c
988 list(APPEND VNET_HEADERS
992 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
994 ##############################################################################
996 ##############################################################################
998 list(APPEND VNET_SOURCES
1000 session/session_debug.c
1001 session/session_table.c
1002 session/session_rules_table.c
1003 session/session_lookup.c
1004 session/session_node.c
1005 session/session_input.c
1007 session/application.c
1008 session/application_worker.c
1009 session/session_cli.c
1010 session/application_interface.c
1011 session/application_local.c
1012 session/application_namespace.c
1013 session/segment_manager.c
1014 session/session_api.c
1017 list(APPEND VNET_HEADERS
1019 session/session_table.h
1020 session/session_rules_table.h
1021 session/session_types.h
1022 session/session_lookup.h
1023 session/application.h
1025 session/transport_types.h
1026 session/application_interface.h
1027 session/application_local.h
1028 session/application_namespace.h
1029 session/session_debug.h
1030 session/segment_manager.h
1031 session/mma_template.h
1032 session/mma_template.c
1037 list(APPEND VNET_API_FILES session/session.api)
1039 ##############################################################################
1041 ##############################################################################
1043 list(APPEND VNET_SOURCES
1047 list(APPEND VNET_HEADERS
1053 ##############################################################################
1054 # Driver feature graph arc support
1055 ##############################################################################
1057 list(APPEND VNET_SOURCES
1059 feature/feature_api.c
1060 feature/registration.c
1063 list(APPEND VNET_HEADERS
1067 list(APPEND VNET_API_FILES feature/feature.api)
1069 ##############################################################################
1070 # Unix kernel related
1071 ##############################################################################
1073 # FIXME: unix/hgshm.c
1075 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
1076 list(APPEND VNET_SOURCES
1081 list(APPEND VNET_HEADERS
1086 ##############################################################################
1088 ##############################################################################
1090 list(APPEND VNET_SOURCES
1105 fib/fib_entry_src_adj.c
1106 fib/fib_entry_src_api.c
1107 fib/fib_entry_src_drop.c
1108 fib/fib_entry_src_interface.c
1109 fib/fib_entry_src_interpose.c
1110 fib/fib_entry_src_lisp.c
1111 fib/fib_entry_src_mpls.c
1112 fib/fib_entry_src_simple.c
1113 fib/fib_entry_src_rr.c
1114 fib/fib_entry_cover.c
1115 fib/fib_entry_delegate.c
1116 fib/fib_entry_track.c
1123 fib/fib_attached_export.c
1128 list(APPEND VNET_HEADERS
1131 fib/fib_entry_track.h
1142 fib/fib_entry_delegate.h
1149 list(APPEND VNET_API_FILES
1154 ##############################################################################
1156 ##############################################################################
1158 list(APPEND VNET_SOURCES
1162 adj/adj_midchain_node.c
1163 adj/adj_midchain_delegate.c
1173 list(APPEND VNET_MULTIARCH_SOURCES
1176 adj/adj_midchain_node.c
1179 list(APPEND VNET_HEADERS
1189 ##############################################################################
1190 # Data-Plane Objects
1191 ##############################################################################
1193 list(APPEND VNET_SOURCES
1201 dpo/load_balance_map.c
1205 dpo/interface_rx_dpo.c
1206 dpo/interface_tx_dpo.c
1207 dpo/mpls_disposition.c
1208 dpo/mpls_label_dpo.c
1214 list(APPEND VNET_MULTIARCH_SOURCES
1216 dpo/mpls_disposition.c
1218 dpo/mpls_label_dpo.c
1219 dpo/interface_rx_dpo.c
1222 list(APPEND VNET_HEADERS
1224 dpo/load_balance_map.h
1235 ##############################################################################
1237 ##############################################################################
1239 list(APPEND VNET_SOURCES
1249 mfib/mfib_entry_cover.c
1250 mfib/mfib_entry_delegate.c
1251 mfib/mfib_entry_src.c
1252 mfib/mfib_entry_src_rr.c
1256 list(APPEND VNET_MULTIARCH_SOURCES
1260 list(APPEND VNET_HEADERS
1266 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1268 ##############################################################################
1270 ##############################################################################
1272 list(APPEND VNET_SOURCES
1278 list(APPEND VNET_HEADERS
1282 ##############################################################################
1284 ##############################################################################
1286 list(APPEND VNET_SOURCES
1289 qos/qos_egress_map.c
1291 qos/qos_record_node.c
1293 qos/qos_store_node.c
1298 list(APPEND VNET_MULTIARCH_SOURCES
1299 qos/qos_record_node.c
1303 list(APPEND VNET_API_FILES qos/qos.api)
1305 ##############################################################################
1307 ##############################################################################
1309 list(APPEND VNET_SOURCES
1310 bier/bier_bit_string.c
1313 bier/bier_fmask_db.c
1322 bier/bier_imp_node.c
1324 bier/bier_disp_entry.c
1325 bier/bier_disp_lookup_node.c
1326 bier/bier_disp_dispatch_node.c
1327 bier/bier_disp_table.c
1328 bier/bier_bift_table.c
1331 list(APPEND VNET_MULTIARCH_SOURCES
1332 bier/bier_disp_dispatch_node.c
1333 bier/bier_disp_lookup_node.c
1334 bier/bier_imp_node.c
1337 list(APPEND VNET_HEADERS
1338 bier/bier_bit_string.h
1341 bier/bier_hdr_inlines.h
1347 list(APPEND VNET_API_FILES bier/bier.api)
1349 ##############################################################################
1351 ##############################################################################
1353 list (APPEND VNET_SOURCES
1359 list(APPEND VNET_HEADERS
1364 list(APPEND VNET_API_FILES syslog/syslog.api)
1366 ##############################################################################
1367 # Tunnel Endpoint Information Base
1368 ##############################################################################
1370 list (APPEND VNET_SOURCES
1376 list(APPEND VNET_HEADERS
1380 list(APPEND VNET_API_FILES teib/teib.api)
1382 ##############################################################################
1384 ##############################################################################
1386 list (APPEND VNET_SOURCES
1392 list(APPEND VNET_HEADERS
1396 list(APPEND VNET_API_FILES arp/arp.api)
1398 list (APPEND VNET_SOURCES
1402 ip6-nd/ip6_nd_proxy.c
1403 ip6-nd/ip6_nd_mirror_proxy.c
1409 list(APPEND VNET_HEADERS
1413 list(APPEND VNET_API_FILES
1418 ##############################################################################
1420 ##############################################################################
1422 add_vpp_library(vnet
1423 SOURCES ${VNET_SOURCES}
1424 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1425 INSTALL_HEADERS ${VNET_HEADERS}
1426 API_FILES ${VNET_API_FILES}
1427 LINK_LIBRARIES vppinfra svm vlib
1428 DEPENDS vpp_version_h api_headers
1431 ##############################################################################
1432 # vpp api test client library
1433 ##############################################################################
1435 add_vpp_library (vatclient
1436 SOURCES ip/ip_types_api.c
1440 add_vat_test_library(vnet
1444 ip6-nd/ip6_nd_test.c
1445 session/session_test.c
1450 ##############################################################################
1452 ##############################################################################
1453 add_vpp_test_library(vnet
1457 ##############################################################################