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
59 interface/rx_queue_funcs.h
60 interface/tx_queue_funcs.h
76 ethernet/ethernet_format_fns.h
77 ethernet/ethernet_types_api.h
80 list(APPEND VNET_API_FILES
88 ##############################################################################
90 ##############################################################################
91 list(APPEND VNET_SOURCES
98 list(APPEND VNET_MULTIARCH_SOURCES
102 list(APPEND VNET_HEADERS
108 list(APPEND VNET_API_FILES
110 policer/policer_types.api
113 ##############################################################################
114 # Layer 2 protocols go here
115 ##############################################################################
117 ##############################################################################
118 # Layer 2 protocol: Ethernet
119 ##############################################################################
120 list(APPEND VNET_SOURCES
121 ethernet/arp_packet.c
122 ethernet/ethernet_types_api.c
126 ethernet/mac_address.c
130 ethernet/p2p_ethernet.c
131 ethernet/p2p_ethernet_input.c
132 ethernet/p2p_ethernet_api.c
135 list(APPEND VNET_MULTIARCH_SOURCES
137 ethernet/p2p_ethernet_input.c
140 list(APPEND VNET_HEADERS
143 ethernet/mac_address.h
147 ethernet/p2p_ethernet.h
148 ethernet/arp_packet.h
151 list(APPEND VNET_API_FILES
152 ethernet/p2p_ethernet.api
153 ethernet/ethernet_types.api)
155 ##############################################################################
156 # Layer 2 protocol: Ethernet bridging
157 ##############################################################################
158 list(APPEND VNET_SOURCES
165 l2/l2_input_classify.c
166 l2/l2_output_classify.c
177 l2/l2_in_out_feat_arc.c
185 list(APPEND VNET_MULTIARCH_SOURCES
191 l2/l2_in_out_feat_arc.c
192 l2/l2_input_classify.c
194 l2/l2_output_classify.c
204 list(APPEND VNET_HEADERS
221 list(APPEND VNET_API_FILES l2/l2.api)
223 ##############################################################################
224 # Layer 2 protocol: SRP
225 ##############################################################################
226 list(APPEND VNET_SOURCES
233 list(APPEND VNET_HEADERS
238 ##############################################################################
239 # Layer 2 protocol: PPP
240 ##############################################################################
241 list(APPEND VNET_SOURCES
247 list(APPEND VNET_HEADERS
253 ##############################################################################
254 # Layer 2 protocol: HDLC
255 ##############################################################################
256 list(APPEND VNET_SOURCES
262 list(APPEND VNET_HEADERS
268 ##############################################################################
269 # Layer 2 protocol: LLC
270 ##############################################################################
271 list(APPEND VNET_SOURCES
277 list(APPEND VNET_HEADERS
281 ##############################################################################
282 # Layer 2 protocol: SNAP
283 ##############################################################################
284 list(APPEND VNET_SOURCES
290 list(APPEND VNET_HEADERS
294 ##############################################################################
296 ##############################################################################
297 list(APPEND VNET_SOURCES
304 list(APPEND VNET_MULTIARCH_SOURCES
308 list(APPEND VNET_HEADERS
311 vxlan/vxlan_error.def
314 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
316 list(APPEND VNET_API_FILES vxlan/vxlan.api)
318 ##############################################################################
320 ##############################################################################
321 list(APPEND VNET_SOURCES
328 list(APPEND VNET_HEADERS
332 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
333 list(APPEND VNET_API_FILES bonding/bond.api)
335 ##############################################################################
336 # Layer 2/3 "classify"
337 ##############################################################################
338 list(APPEND VNET_SOURCES
339 classify/vnet_classify.c
340 classify/trace_classify.h
341 classify/ip_classify.c
342 classify/in_out_acl.c
343 classify/policer_classify.c
344 classify/flow_classify.c
345 classify/flow_classify_node.c
346 classify/vnet_classify.h
347 classify/classify_api.c
350 list(APPEND VNET_MULTIARCH_SOURCES
351 classify/ip_classify.c
352 classify/flow_classify_node.c
355 list(APPEND VNET_HEADERS
356 classify/vnet_classify.h
357 classify/trace_classify.h
358 classify/in_out_acl.h
359 classify/policer_classify.h
360 classify/flow_classify.h
363 list(APPEND VNET_API_FILES classify/classify.api)
365 ##############################################################################
366 # Layer 3 protocols go here
367 ##############################################################################
369 ##############################################################################
370 # Layer 3 protocol: IP v4/v6
371 ##############################################################################
372 list(APPEND VNET_SOURCES
386 ip/ip4_source_and_port_range_check.c
387 ip/reass/ip4_full_reass.c
388 ip/reass/ip4_sv_reass.c
398 ip/reass/ip6_full_reass.c
399 ip/reass/ip6_sv_reass.c
402 ip/ip_container_proxy.c
409 ip/ip_path_mtu_node.c
420 list(APPEND VNET_MULTIARCH_SOURCES
422 ip/reass/ip4_full_reass.c
424 ip/reass/ip6_full_reass.c
425 ip/reass/ip4_sv_reass.c
427 ip/reass/ip6_full_reass.c
428 ip/reass/ip6_sv_reass.c
433 ip/ip_path_mtu_node.c
436 list(APPEND VNET_HEADERS
451 ip/ip6_hop_by_hop_packet.h
455 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
894 list(APPEND VNET_HEADERS
898 ##############################################################################
900 ##############################################################################
901 list(APPEND VNET_SOURCES
908 list(APPEND VNET_HEADERS
911 gso/hdr_offset_parser.h
915 list(APPEND VNET_API_FILES
919 ##############################################################################
920 # IPFIX classify code
921 ##############################################################################
923 list(APPEND VNET_SOURCES
924 ipfix-export/flow_report_classify.c
927 list(APPEND VNET_HEADERS
928 ipfix-export/flow_report_classify.h
931 ##############################################################################
933 ##############################################################################
935 list(APPEND VNET_SOURCES
936 lawful-intercept/lawful_intercept.c
937 lawful-intercept/node.c
940 list(APPEND VNET_MULTIARCH_SOURCES
941 lawful-intercept/node.c
944 list(APPEND VNET_HEADERS
945 lawful-intercept/lawful_intercept.h
948 ##############################################################################
949 # SPAN (port mirroring)
950 ##############################################################################
952 list(APPEND VNET_SOURCES
958 list(APPEND VNET_MULTIARCH_SOURCES
962 list(APPEND VNET_HEADERS
966 list(APPEND VNET_API_FILES span/span.api)
968 ##############################################################################
970 ##############################################################################
972 list(APPEND VNET_SOURCES
982 list(APPEND VNET_HEADERS
987 list(APPEND VNET_API_FILES pg/pg.api)
989 ##############################################################################
991 ##############################################################################
993 list(APPEND VNET_SOURCES
995 devices/virtio/device.c
996 devices/virtio/format.c
997 devices/virtio/node.c
999 devices/virtio/vhost_user.c
1000 devices/virtio/vhost_user_input.c
1001 devices/virtio/vhost_user_output.c
1002 devices/virtio/vhost_user_api.c
1003 devices/virtio/virtio.c
1004 devices/virtio/virtio_api.c
1005 devices/virtio/virtio_pci_legacy.c
1006 devices/virtio/virtio_pci_modern.c
1007 devices/virtio/virtio_process.c
1008 devices/virtio/virtio_types_api.c
1011 list(APPEND VNET_HEADERS
1012 devices/virtio/pci.h
1013 devices/virtio/virtio.h
1014 devices/virtio/virtio_buffering.h
1015 devices/virtio/virtio_std.h
1016 devices/virtio/virtio_pci_legacy.h
1017 devices/virtio/virtio_pci_modern.h
1018 devices/virtio/vhost_std.h
1019 devices/virtio/vhost_user.h
1020 devices/virtio/virtio_types_api.h
1023 list(APPEND VNET_MULTIARCH_SOURCES
1024 devices/virtio/vhost_user_input.c
1025 devices/virtio/vhost_user_output.c
1026 devices/virtio/node.c
1027 devices/af_packet/node.c
1028 devices/virtio/device.c
1031 list(APPEND VNET_API_FILES
1032 devices/virtio/vhost_user.api
1033 devices/virtio/virtio.api
1034 devices/virtio/virtio_types.api
1037 ##############################################################################
1038 # tap interface (with virtio backend)
1039 ##############################################################################
1041 list(APPEND VNET_SOURCES
1044 devices/tap/tapv2_api.c
1047 list(APPEND VNET_HEADERS
1051 list(APPEND VNET_API_FILES
1052 devices/tap/tapv2.api
1055 ##############################################################################
1056 # tap interface (with virtio backend)
1057 ##############################################################################
1059 list(APPEND VNET_SOURCES
1060 devices/pipe/pipe_api.c
1064 list(APPEND VNET_HEADERS
1068 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1070 ##############################################################################
1071 # session managmeent
1072 ##############################################################################
1074 list(APPEND VNET_SOURCES
1076 session/session_debug.c
1077 session/session_table.c
1078 session/session_rules_table.c
1079 session/session_lookup.c
1080 session/session_node.c
1082 session/application.c
1083 session/application_worker.c
1084 session/session_cli.c
1085 session/application_interface.c
1086 session/application_local.c
1087 session/application_namespace.c
1088 session/segment_manager.c
1089 session/session_api.c
1092 list(APPEND VNET_HEADERS
1094 session/session_table.h
1095 session/session_rules_table.h
1096 session/session_types.h
1097 session/session_lookup.h
1098 session/application.h
1100 session/transport_types.h
1101 session/application_interface.h
1102 session/application_local.h
1103 session/application_namespace.h
1104 session/session_debug.h
1105 session/segment_manager.h
1106 session/mma_template.h
1107 session/mma_template.c
1112 list(APPEND VNET_API_FILES session/session.api)
1114 ##############################################################################
1116 ##############################################################################
1118 list(APPEND VNET_SOURCES
1122 list(APPEND VNET_HEADERS
1127 ##############################################################################
1128 # Linux packet interface
1129 ##############################################################################
1131 list(APPEND VNET_SOURCES
1132 devices/af_packet/af_packet.c
1133 devices/af_packet/device.c
1134 devices/af_packet/node.c
1135 devices/af_packet/cli.c
1136 devices/af_packet/af_packet_api.c
1139 list(APPEND VNET_MULTIARCH_SOURCES
1140 devices/af_packet/device.c
1143 list(APPEND VNET_HEADERS
1144 devices/af_packet/af_packet.h
1147 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1149 ##############################################################################
1150 # Driver feature graph arc support
1151 ##############################################################################
1153 list(APPEND VNET_SOURCES
1155 feature/feature_api.c
1156 feature/registration.c
1159 list(APPEND VNET_HEADERS
1163 list(APPEND VNET_API_FILES feature/feature.api)
1165 ##############################################################################
1166 # Unix kernel related
1167 ##############################################################################
1169 # FIXME: unix/hgshm.c
1171 list(APPEND VNET_SOURCES
1176 list(APPEND VNET_HEADERS
1180 ##############################################################################
1182 ##############################################################################
1184 list(APPEND VNET_SOURCES
1199 fib/fib_entry_src_adj.c
1200 fib/fib_entry_src_api.c
1201 fib/fib_entry_src_drop.c
1202 fib/fib_entry_src_interface.c
1203 fib/fib_entry_src_interpose.c
1204 fib/fib_entry_src_lisp.c
1205 fib/fib_entry_src_mpls.c
1206 fib/fib_entry_src_simple.c
1207 fib/fib_entry_src_rr.c
1208 fib/fib_entry_cover.c
1209 fib/fib_entry_delegate.c
1210 fib/fib_entry_track.c
1217 fib/fib_attached_export.c
1222 list(APPEND VNET_HEADERS
1235 fib/fib_entry_delegate.h
1240 list(APPEND VNET_API_FILES
1245 ##############################################################################
1247 ##############################################################################
1249 list(APPEND VNET_SOURCES
1253 adj/adj_midchain_node.c
1254 adj/adj_midchain_delegate.c
1264 list(APPEND VNET_MULTIARCH_SOURCES
1267 adj/adj_midchain_node.c
1270 list(APPEND VNET_HEADERS
1280 ##############################################################################
1281 # Data-Plane Objects
1282 ##############################################################################
1284 list(APPEND VNET_SOURCES
1292 dpo/load_balance_map.c
1296 dpo/interface_rx_dpo.c
1297 dpo/interface_tx_dpo.c
1298 dpo/mpls_disposition.c
1299 dpo/mpls_label_dpo.c
1305 list(APPEND VNET_MULTIARCH_SOURCES
1307 dpo/mpls_disposition.c
1309 dpo/mpls_label_dpo.c
1310 dpo/interface_rx_dpo.c
1313 list(APPEND VNET_HEADERS
1325 ##############################################################################
1327 ##############################################################################
1329 list(APPEND VNET_SOURCES
1339 mfib/mfib_entry_cover.c
1340 mfib/mfib_entry_delegate.c
1341 mfib/mfib_entry_src.c
1342 mfib/mfib_entry_src_rr.c
1346 list(APPEND VNET_MULTIARCH_SOURCES
1350 list(APPEND VNET_HEADERS
1356 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1358 ##############################################################################
1360 ##############################################################################
1362 list(APPEND VNET_SOURCES
1368 list(APPEND VNET_HEADERS
1372 ##############################################################################
1374 ##############################################################################
1376 list(APPEND VNET_SOURCES
1379 qos/qos_egress_map.c
1381 qos/qos_record_node.c
1383 qos/qos_store_node.c
1388 list(APPEND VNET_MULTIARCH_SOURCES
1389 qos/qos_record_node.c
1393 list(APPEND VNET_API_FILES qos/qos.api)
1395 ##############################################################################
1397 ##############################################################################
1399 list(APPEND VNET_SOURCES
1400 bier/bier_bit_string.c
1403 bier/bier_fmask_db.c
1412 bier/bier_imp_node.c
1414 bier/bier_disp_entry.c
1415 bier/bier_disp_lookup_node.c
1416 bier/bier_disp_dispatch_node.c
1417 bier/bier_disp_table.c
1418 bier/bier_bift_table.c
1421 list(APPEND VNET_MULTIARCH_SOURCES
1422 bier/bier_disp_dispatch_node.c
1423 bier/bier_disp_lookup_node.c
1424 bier/bier_imp_node.c
1427 list(APPEND VNET_HEADERS
1434 list(APPEND VNET_API_FILES bier/bier.api)
1436 ##############################################################################
1438 ##############################################################################
1440 list (APPEND VNET_SOURCES
1446 list(APPEND VNET_HEADERS
1451 list(APPEND VNET_API_FILES syslog/syslog.api)
1453 ##############################################################################
1454 # Tunnel Endpoint Information Base
1455 ##############################################################################
1457 list (APPEND VNET_SOURCES
1463 list(APPEND VNET_HEADERS
1467 list(APPEND VNET_API_FILES teib/teib.api)
1469 ##############################################################################
1471 ##############################################################################
1473 list (APPEND VNET_SOURCES
1479 list(APPEND VNET_HEADERS
1483 list(APPEND VNET_API_FILES arp/arp.api)
1485 list (APPEND VNET_SOURCES
1489 ip6-nd/ip6_nd_proxy.c
1490 ip6-nd/ip6_nd_mirror_proxy.c
1496 list(APPEND VNET_HEADERS
1500 list(APPEND VNET_API_FILES
1505 ##############################################################################
1507 ##############################################################################
1509 add_vpp_library(vnet
1510 SOURCES ${VNET_SOURCES}
1511 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1512 INSTALL_HEADERS ${VNET_HEADERS}
1513 API_FILES ${VNET_API_FILES}
1514 LINK_LIBRARIES vppinfra svm vlib
1515 DEPENDS vpp_version_h api_headers
1518 ##############################################################################
1519 # vpp api test client library
1520 ##############################################################################
1522 add_vpp_library (vatclient
1523 SOURCES ip/ip_types_api.c
1527 add_vat_test_library(vnet
1531 ip6-nd/ip6_nd_test.c
1532 srmpls/sr_mpls_test.c
1533 session/session_test.c
1538 ##############################################################################
1540 ##############################################################################
1541 add_vpp_test_library(vnet
1545 ##############################################################################