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
45 list(APPEND VNET_MULTIARCH_SOURCES
51 list(APPEND VNET_HEADERS
60 interface/rx_queue_funcs.h
61 interface/tx_queue_funcs.h
77 ethernet/ethernet_format_fns.h
78 ethernet/ethernet_types_api.h
81 list(APPEND VNET_API_FILES
89 ##############################################################################
91 ##############################################################################
92 list(APPEND VNET_SOURCES
99 list(APPEND VNET_MULTIARCH_SOURCES
103 list(APPEND VNET_HEADERS
109 list(APPEND VNET_API_FILES
111 policer/policer_types.api
114 ##############################################################################
115 # Layer 2 protocols go here
116 ##############################################################################
118 ##############################################################################
119 # Layer 2 protocol: Ethernet
120 ##############################################################################
121 list(APPEND VNET_SOURCES
122 ethernet/arp_packet.c
123 ethernet/ethernet_types_api.c
127 ethernet/mac_address.c
131 ethernet/p2p_ethernet.c
132 ethernet/p2p_ethernet_input.c
133 ethernet/p2p_ethernet_api.c
136 list(APPEND VNET_MULTIARCH_SOURCES
138 ethernet/p2p_ethernet_input.c
141 list(APPEND VNET_HEADERS
144 ethernet/mac_address.h
148 ethernet/p2p_ethernet.h
149 ethernet/arp_packet.h
152 list(APPEND VNET_API_FILES
153 ethernet/p2p_ethernet.api
154 ethernet/ethernet_types.api)
156 ##############################################################################
157 # Layer 2 protocol: Ethernet bridging
158 ##############################################################################
159 list(APPEND VNET_SOURCES
166 l2/l2_input_classify.c
167 l2/l2_output_classify.c
178 l2/l2_in_out_feat_arc.c
186 list(APPEND VNET_MULTIARCH_SOURCES
192 l2/l2_in_out_feat_arc.c
193 l2/l2_input_classify.c
195 l2/l2_output_classify.c
205 list(APPEND VNET_HEADERS
222 list(APPEND VNET_API_FILES l2/l2.api)
224 ##############################################################################
225 # Layer 2 protocol: SRP
226 ##############################################################################
227 list(APPEND VNET_SOURCES
234 list(APPEND VNET_HEADERS
239 ##############################################################################
240 # Layer 2 protocol: PPP
241 ##############################################################################
242 list(APPEND VNET_SOURCES
248 list(APPEND VNET_HEADERS
254 ##############################################################################
255 # Layer 2 protocol: HDLC
256 ##############################################################################
257 list(APPEND VNET_SOURCES
263 list(APPEND VNET_HEADERS
269 ##############################################################################
270 # Layer 2 protocol: LLC
271 ##############################################################################
272 list(APPEND VNET_SOURCES
278 list(APPEND VNET_HEADERS
282 ##############################################################################
283 # Layer 2 protocol: SNAP
284 ##############################################################################
285 list(APPEND VNET_SOURCES
291 list(APPEND VNET_HEADERS
295 ##############################################################################
297 ##############################################################################
298 list(APPEND VNET_SOURCES
305 list(APPEND VNET_MULTIARCH_SOURCES
309 list(APPEND VNET_HEADERS
312 vxlan/vxlan_error.def
315 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
317 list(APPEND VNET_API_FILES vxlan/vxlan.api)
319 ##############################################################################
321 ##############################################################################
322 list(APPEND VNET_SOURCES
329 list(APPEND VNET_HEADERS
333 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
334 list(APPEND VNET_API_FILES bonding/bond.api)
336 ##############################################################################
337 # Layer 2/3 "classify"
338 ##############################################################################
339 list(APPEND VNET_SOURCES
340 classify/vnet_classify.c
341 classify/trace_classify.h
342 classify/ip_classify.c
343 classify/in_out_acl.c
344 classify/policer_classify.c
345 classify/flow_classify.c
346 classify/flow_classify_node.c
347 classify/vnet_classify.h
348 classify/classify_api.c
351 list(APPEND VNET_MULTIARCH_SOURCES
352 classify/ip_classify.c
353 classify/flow_classify_node.c
356 list(APPEND VNET_HEADERS
357 classify/vnet_classify.h
358 classify/trace_classify.h
359 classify/in_out_acl.h
360 classify/policer_classify.h
361 classify/flow_classify.h
364 list(APPEND VNET_API_FILES classify/classify.api)
366 ##############################################################################
367 # Layer 3 protocols go here
368 ##############################################################################
370 ##############################################################################
371 # Layer 3 protocol: IP v4/v6
372 ##############################################################################
373 list(APPEND VNET_SOURCES
387 ip/ip4_source_and_port_range_check.c
388 ip/reass/ip4_full_reass.c
389 ip/reass/ip4_sv_reass.c
399 ip/reass/ip6_full_reass.c
400 ip/reass/ip6_sv_reass.c
403 ip/ip_container_proxy.c
410 ip/ip_path_mtu_node.c
421 list(APPEND VNET_MULTIARCH_SOURCES
423 ip/reass/ip4_full_reass.c
425 ip/reass/ip6_full_reass.c
426 ip/reass/ip4_sv_reass.c
428 ip/reass/ip6_full_reass.c
429 ip/reass/ip6_sv_reass.c
434 ip/ip_path_mtu_node.c
437 list(APPEND VNET_HEADERS
452 ip/ip6_hop_by_hop_packet.h
456 ip/ip_container_proxy.h
461 ip/ip_source_and_port_range_check.h
470 list(APPEND VNET_API_FILES
475 list(APPEND VNET_MULTIARCH_SOURCES
481 ##############################################################################
483 ##############################################################################
484 list(APPEND VNET_SOURCES
485 ip-neighbor/ip_neighbor.c
486 ip-neighbor/ip_neighbor_api.c
487 ip-neighbor/ip_neighbor_dp.c
488 ip-neighbor/ip_neighbor_types.c
489 ip-neighbor/ip_neighbor_watch.c
490 ip-neighbor/ip4_neighbor.c
491 ip-neighbor/ip6_neighbor.c
494 list(APPEND VNET_HEADERS
495 ip-neighbor/ip_neighbor.h
496 ip-neighbor/ip_neighbor_types.h
499 list(APPEND VNET_API_FILES
500 ip-neighbor/ip_neighbor.api
503 ##############################################################################
504 # Bidirectional Forwarding Detection
505 ##############################################################################
507 list(APPEND VNET_HEADERS
514 list(APPEND VNET_SOURCES
523 list(APPEND VNET_API_FILES bfd/bfd.api)
525 ##############################################################################
527 ##############################################################################
529 list(APPEND VNET_SOURCES
537 list(APPEND VNET_HEADERS
541 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
543 list(APPEND VNET_API_FILES crypto/crypto.api)
545 ##############################################################################
546 # Layer 3 protocol: IPSec
547 ##############################################################################
548 list(APPEND VNET_SOURCES
552 ipsec/ipsec_handoff.c
558 ipsec/ipsec_spd_policy.c
567 ipsec/ipsec_types_api.c
570 list(APPEND VNET_MULTIARCH_SOURCES
575 ipsec/ipsec_handoff.c
581 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
582 list(APPEND VNET_API_FILES ipsec/ipsec.api)
584 list(APPEND VNET_SOURCES
588 list(APPEND VNET_HEADERS
591 ipsec/ipsec_spd_policy.h
594 ipsec/ipsec_types_api.h
600 ##############################################################################
601 # Layer 3 protocol: osi
602 ##############################################################################
603 list(APPEND VNET_SOURCES
609 list(APPEND VNET_HEADERS
613 ##############################################################################
614 # Layer 4 protocol: tcp
615 ##############################################################################
616 list(APPEND VNET_SOURCES
620 tcp/tcp_syn_filter4.c
633 list(APPEND VNET_MULTIARCH_SOURCES
636 tcp/tcp_syn_filter4.c
639 list(APPEND VNET_HEADERS
652 list(APPEND VNET_API_FILES tcp/tcp.api)
654 ##############################################################################
655 # Layer 4 protocol: udp
656 ##############################################################################
657 list(APPEND VNET_SOURCES
670 list(APPEND VNET_MULTIARCH_SOURCES
675 list(APPEND VNET_HEADERS
683 list(APPEND VNET_API_FILES udp/udp.api)
685 ##############################################################################
686 # Tunnel protocol: gre
687 ##############################################################################
688 list(APPEND VNET_SOURCES
696 list(APPEND VNET_MULTIARCH_SOURCES
701 list(APPEND VNET_HEADERS
707 list(APPEND VNET_API_FILES gre/gre.api)
709 ##############################################################################
710 # Tunnel protocol: ipip
711 ##############################################################################
712 list(APPEND VNET_SOURCES
720 list(APPEND VNET_MULTIARCH_SOURCES
724 list(APPEND VNET_HEADERS
728 list(APPEND VNET_API_FILES
732 ##############################################################################
734 ##############################################################################
735 list(APPEND VNET_SOURCES
737 tunnel/tunnel_types_api.c
740 list(APPEND VNET_API_FILES
741 tunnel/tunnel_types.api
744 list(APPEND VNET_HEADERS
749 ##############################################################################
750 # Tunnel protocol: gre+mpls
751 ##############################################################################
752 list(APPEND VNET_SOURCES
764 list(APPEND VNET_MULTIARCH_SOURCES
771 list(APPEND VNET_HEADERS
779 list(APPEND VNET_API_FILES mpls/mpls.api)
781 ##############################################################################
782 # Tunnel protocol: vxlan-gbp
783 ##############################################################################
784 list(APPEND VNET_SOURCES
787 vxlan-gbp/vxlan_gbp_api.c
788 vxlan-gbp/vxlan_gbp.c
789 vxlan-gbp/vxlan_gbp_packet.c
792 list (APPEND VNET_MULTIARCH_SOURCES
797 list(APPEND VNET_HEADERS
798 vxlan-gbp/vxlan_gbp.h
799 vxlan-gbp/vxlan_gbp_packet.h
800 vxlan-gbp/vxlan_gbp_error.def
803 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
805 ##############################################################################
806 # Tunnel protocol: vxlan-gpe
807 ##############################################################################
809 list(APPEND VNET_SOURCES
810 vxlan-gpe/vxlan_gpe.c
813 vxlan-gpe/vxlan_gpe_api.c
816 list (APPEND VNET_MULTIARCH_SOURCES
820 list(APPEND VNET_HEADERS
821 vxlan-gpe/vxlan_gpe.h
822 vxlan-gpe/vxlan_gpe_packet.h
823 vxlan-gpe/vxlan_gpe_error.def
826 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
828 ##############################################################################
829 # ipv6 segment routing
830 ##############################################################################
832 list(APPEND VNET_SOURCES
835 srv6/sr_policy_rewrite.c
840 list(APPEND VNET_HEADERS
845 list(APPEND VNET_API_FILES
850 ##############################################################################
851 # mpls segment routing
852 ##############################################################################
854 list(APPEND VNET_SOURCES
855 srmpls/sr_mpls_policy.c
856 srmpls/sr_mpls_steering.c
860 list(APPEND VNET_HEADERS
864 list(APPEND VNET_API_FILES
868 ##############################################################################
869 # IPFIX / netflow v10
870 ##############################################################################
871 list(APPEND VNET_SOURCES
872 ipfix-export/flow_report.c
873 ipfix-export/flow_api.c
876 list(APPEND VNET_HEADERS
877 ipfix-export/flow_report.h
878 ipfix-export/ipfix_info_elements.h
879 ipfix-export/ipfix_packet.h
882 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
884 ##############################################################################
886 ##############################################################################
887 list(APPEND VNET_SOURCES
893 list(APPEND VNET_HEADERS
897 ##############################################################################
899 ##############################################################################
900 list(APPEND VNET_SOURCES
907 list(APPEND VNET_HEADERS
910 gso/hdr_offset_parser.h
914 list(APPEND VNET_API_FILES
918 ##############################################################################
919 # IPFIX classify code
920 ##############################################################################
922 list(APPEND VNET_SOURCES
923 ipfix-export/flow_report_classify.c
926 list(APPEND VNET_HEADERS
927 ipfix-export/flow_report_classify.h
930 ##############################################################################
932 ##############################################################################
934 list(APPEND VNET_SOURCES
935 lawful-intercept/lawful_intercept.c
936 lawful-intercept/node.c
939 list(APPEND VNET_MULTIARCH_SOURCES
940 lawful-intercept/node.c
943 list(APPEND VNET_HEADERS
944 lawful-intercept/lawful_intercept.h
947 ##############################################################################
948 # SPAN (port mirroring)
949 ##############################################################################
951 list(APPEND VNET_SOURCES
957 list(APPEND VNET_MULTIARCH_SOURCES
961 list(APPEND VNET_HEADERS
965 list(APPEND VNET_API_FILES span/span.api)
967 ##############################################################################
969 ##############################################################################
971 list(APPEND VNET_SOURCES
981 list(APPEND VNET_HEADERS
986 list(APPEND VNET_API_FILES pg/pg.api)
988 ##############################################################################
990 ##############################################################################
992 list(APPEND VNET_SOURCES
994 devices/virtio/device.c
995 devices/virtio/format.c
996 devices/virtio/node.c
998 devices/virtio/vhost_user.c
999 devices/virtio/vhost_user_input.c
1000 devices/virtio/vhost_user_output.c
1001 devices/virtio/vhost_user_api.c
1002 devices/virtio/virtio.c
1003 devices/virtio/virtio_api.c
1004 devices/virtio/virtio_pci_legacy.c
1005 devices/virtio/virtio_pci_modern.c
1006 devices/virtio/virtio_process.c
1007 devices/virtio/virtio_types_api.c
1010 list(APPEND VNET_HEADERS
1011 devices/virtio/pci.h
1012 devices/virtio/virtio.h
1013 devices/virtio/virtio_buffering.h
1014 devices/virtio/virtio_std.h
1015 devices/virtio/virtio_pci_legacy.h
1016 devices/virtio/virtio_pci_modern.h
1017 devices/virtio/vhost_std.h
1018 devices/virtio/vhost_user.h
1019 devices/virtio/virtio_types_api.h
1022 list(APPEND VNET_MULTIARCH_SOURCES
1023 devices/virtio/vhost_user_input.c
1024 devices/virtio/vhost_user_output.c
1025 devices/virtio/node.c
1026 devices/af_packet/node.c
1027 devices/virtio/device.c
1030 list(APPEND VNET_API_FILES
1031 devices/virtio/vhost_user.api
1032 devices/virtio/virtio.api
1033 devices/virtio/virtio_types.api
1036 ##############################################################################
1037 # tap interface (with virtio backend)
1038 ##############################################################################
1040 list(APPEND VNET_SOURCES
1043 devices/tap/tapv2_api.c
1046 list(APPEND VNET_HEADERS
1050 list(APPEND VNET_API_FILES
1051 devices/tap/tapv2.api
1054 ##############################################################################
1055 # tap interface (with virtio backend)
1056 ##############################################################################
1058 list(APPEND VNET_SOURCES
1059 devices/pipe/pipe_api.c
1063 list(APPEND VNET_HEADERS
1067 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1069 ##############################################################################
1070 # session managmeent
1071 ##############################################################################
1073 list(APPEND VNET_SOURCES
1075 session/session_debug.c
1076 session/session_table.c
1077 session/session_rules_table.c
1078 session/session_lookup.c
1079 session/session_node.c
1081 session/application.c
1082 session/application_worker.c
1083 session/session_cli.c
1084 session/application_interface.c
1085 session/application_local.c
1086 session/application_namespace.c
1087 session/segment_manager.c
1088 session/session_api.c
1091 list(APPEND VNET_HEADERS
1093 session/session_table.h
1094 session/session_rules_table.h
1095 session/session_types.h
1096 session/session_lookup.h
1097 session/application.h
1099 session/transport_types.h
1100 session/application_interface.h
1101 session/application_local.h
1102 session/application_namespace.h
1103 session/session_debug.h
1104 session/segment_manager.h
1105 session/mma_template.h
1106 session/mma_template.c
1111 list(APPEND VNET_API_FILES session/session.api)
1113 ##############################################################################
1115 ##############################################################################
1117 list(APPEND VNET_SOURCES
1121 list(APPEND VNET_HEADERS
1126 ##############################################################################
1127 # Linux packet interface
1128 ##############################################################################
1130 list(APPEND VNET_SOURCES
1131 devices/af_packet/af_packet.c
1132 devices/af_packet/device.c
1133 devices/af_packet/node.c
1134 devices/af_packet/cli.c
1135 devices/af_packet/af_packet_api.c
1138 list(APPEND VNET_MULTIARCH_SOURCES
1139 devices/af_packet/device.c
1142 list(APPEND VNET_HEADERS
1143 devices/af_packet/af_packet.h
1146 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1148 ##############################################################################
1149 # Driver feature graph arc support
1150 ##############################################################################
1152 list(APPEND VNET_SOURCES
1154 feature/feature_api.c
1155 feature/registration.c
1158 list(APPEND VNET_HEADERS
1162 list(APPEND VNET_API_FILES feature/feature.api)
1164 ##############################################################################
1165 # Unix kernel related
1166 ##############################################################################
1168 # FIXME: unix/hgshm.c
1170 list(APPEND VNET_SOURCES
1175 list(APPEND VNET_HEADERS
1179 ##############################################################################
1181 ##############################################################################
1183 list(APPEND VNET_SOURCES
1198 fib/fib_entry_src_adj.c
1199 fib/fib_entry_src_api.c
1200 fib/fib_entry_src_drop.c
1201 fib/fib_entry_src_interface.c
1202 fib/fib_entry_src_interpose.c
1203 fib/fib_entry_src_lisp.c
1204 fib/fib_entry_src_mpls.c
1205 fib/fib_entry_src_simple.c
1206 fib/fib_entry_src_rr.c
1207 fib/fib_entry_cover.c
1208 fib/fib_entry_delegate.c
1209 fib/fib_entry_track.c
1216 fib/fib_attached_export.c
1221 list(APPEND VNET_HEADERS
1231 fib/fib_entry_delegate.h
1236 list(APPEND VNET_API_FILES
1241 ##############################################################################
1243 ##############################################################################
1245 list(APPEND VNET_SOURCES
1249 adj/adj_midchain_node.c
1250 adj/adj_midchain_delegate.c
1260 list(APPEND VNET_MULTIARCH_SOURCES
1263 adj/adj_midchain_node.c
1266 list(APPEND VNET_HEADERS
1276 ##############################################################################
1277 # Data-Plane Objects
1278 ##############################################################################
1280 list(APPEND VNET_SOURCES
1288 dpo/load_balance_map.c
1292 dpo/interface_rx_dpo.c
1293 dpo/interface_tx_dpo.c
1294 dpo/mpls_disposition.c
1295 dpo/mpls_label_dpo.c
1301 list(APPEND VNET_MULTIARCH_SOURCES
1303 dpo/mpls_disposition.c
1305 dpo/mpls_label_dpo.c
1306 dpo/interface_rx_dpo.c
1309 list(APPEND VNET_HEADERS
1321 ##############################################################################
1323 ##############################################################################
1325 list(APPEND VNET_SOURCES
1335 mfib/mfib_entry_cover.c
1336 mfib/mfib_entry_delegate.c
1337 mfib/mfib_entry_src.c
1338 mfib/mfib_entry_src_rr.c
1342 list(APPEND VNET_MULTIARCH_SOURCES
1346 list(APPEND VNET_HEADERS
1352 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1354 ##############################################################################
1356 ##############################################################################
1358 list(APPEND VNET_SOURCES
1364 list(APPEND VNET_HEADERS
1368 ##############################################################################
1370 ##############################################################################
1372 list(APPEND VNET_SOURCES
1375 qos/qos_egress_map.c
1377 qos/qos_record_node.c
1379 qos/qos_store_node.c
1384 list(APPEND VNET_MULTIARCH_SOURCES
1385 qos/qos_record_node.c
1389 list(APPEND VNET_API_FILES qos/qos.api)
1391 ##############################################################################
1393 ##############################################################################
1395 list(APPEND VNET_SOURCES
1396 bier/bier_bit_string.c
1399 bier/bier_fmask_db.c
1408 bier/bier_imp_node.c
1410 bier/bier_disp_entry.c
1411 bier/bier_disp_lookup_node.c
1412 bier/bier_disp_dispatch_node.c
1413 bier/bier_disp_table.c
1414 bier/bier_bift_table.c
1417 list(APPEND VNET_MULTIARCH_SOURCES
1418 bier/bier_disp_dispatch_node.c
1419 bier/bier_disp_lookup_node.c
1420 bier/bier_imp_node.c
1423 list(APPEND VNET_HEADERS
1430 list(APPEND VNET_API_FILES bier/bier.api)
1432 ##############################################################################
1434 ##############################################################################
1436 list (APPEND VNET_SOURCES
1442 list(APPEND VNET_HEADERS
1447 list(APPEND VNET_API_FILES syslog/syslog.api)
1449 ##############################################################################
1450 # Tunnel Endpoint Information Base
1451 ##############################################################################
1453 list (APPEND VNET_SOURCES
1459 list(APPEND VNET_HEADERS
1463 list(APPEND VNET_API_FILES teib/teib.api)
1465 ##############################################################################
1467 ##############################################################################
1469 list (APPEND VNET_SOURCES
1475 list(APPEND VNET_HEADERS
1479 list(APPEND VNET_API_FILES arp/arp.api)
1481 list (APPEND VNET_SOURCES
1485 ip6-nd/ip6_nd_proxy.c
1486 ip6-nd/ip6_nd_mirror_proxy.c
1492 list(APPEND VNET_HEADERS
1496 list(APPEND VNET_API_FILES
1501 ##############################################################################
1503 ##############################################################################
1505 add_vpp_library(vnet
1506 SOURCES ${VNET_SOURCES}
1507 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1508 INSTALL_HEADERS ${VNET_HEADERS}
1509 API_FILES ${VNET_API_FILES}
1510 LINK_LIBRARIES vppinfra svm vlib
1511 DEPENDS vpp_version_h api_headers
1514 ##############################################################################
1515 # vpp api test client library
1516 ##############################################################################
1518 add_vpp_library (vatclient
1519 SOURCES ip/ip_types_api.c
1523 ##############################################################################
1525 ##############################################################################
1526 add_vpp_test_library(vnet
1530 ##############################################################################