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-gpe
783 ##############################################################################
785 list(APPEND VNET_SOURCES
786 vxlan-gpe/vxlan_gpe.c
789 vxlan-gpe/vxlan_gpe_api.c
792 list (APPEND VNET_MULTIARCH_SOURCES
796 list(APPEND VNET_HEADERS
797 vxlan-gpe/vxlan_gpe.h
798 vxlan-gpe/vxlan_gpe_packet.h
799 vxlan-gpe/vxlan_gpe_error.def
802 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
804 ##############################################################################
805 # ipv6 segment routing
806 ##############################################################################
808 list(APPEND VNET_SOURCES
811 srv6/sr_policy_rewrite.c
816 list(APPEND VNET_HEADERS
821 list(APPEND VNET_API_FILES
826 ##############################################################################
827 # mpls segment routing
828 ##############################################################################
830 list(APPEND VNET_SOURCES
831 srmpls/sr_mpls_policy.c
832 srmpls/sr_mpls_steering.c
836 list(APPEND VNET_HEADERS
840 list(APPEND VNET_API_FILES
844 ##############################################################################
845 # IPFIX / netflow v10
846 ##############################################################################
847 list(APPEND VNET_SOURCES
848 ipfix-export/flow_report.c
849 ipfix-export/flow_api.c
852 list(APPEND VNET_HEADERS
853 ipfix-export/flow_report.h
854 ipfix-export/ipfix_info_elements.h
855 ipfix-export/ipfix_packet.h
858 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
860 ##############################################################################
862 ##############################################################################
863 list(APPEND VNET_SOURCES
870 list(APPEND VNET_HEADERS
874 ##############################################################################
876 ##############################################################################
877 list(APPEND VNET_SOURCES
884 list(APPEND VNET_HEADERS
887 gso/hdr_offset_parser.h
891 list(APPEND VNET_API_FILES
895 ##############################################################################
896 # IPFIX classify code
897 ##############################################################################
899 list(APPEND VNET_SOURCES
900 ipfix-export/flow_report_classify.c
903 list(APPEND VNET_HEADERS
904 ipfix-export/flow_report_classify.h
907 ##############################################################################
909 ##############################################################################
911 list(APPEND VNET_SOURCES
912 lawful-intercept/lawful_intercept.c
913 lawful-intercept/node.c
916 list(APPEND VNET_MULTIARCH_SOURCES
917 lawful-intercept/node.c
920 list(APPEND VNET_HEADERS
921 lawful-intercept/lawful_intercept.h
924 ##############################################################################
925 # SPAN (port mirroring)
926 ##############################################################################
928 list(APPEND VNET_SOURCES
934 list(APPEND VNET_MULTIARCH_SOURCES
938 list(APPEND VNET_HEADERS
942 list(APPEND VNET_API_FILES span/span.api)
944 ##############################################################################
946 ##############################################################################
948 list(APPEND VNET_SOURCES
958 list(APPEND VNET_HEADERS
963 list(APPEND VNET_API_FILES pg/pg.api)
965 ##############################################################################
967 ##############################################################################
969 list(APPEND VNET_SOURCES
971 devices/virtio/device.c
972 devices/virtio/format.c
973 devices/virtio/node.c
975 devices/virtio/vhost_user.c
976 devices/virtio/vhost_user_input.c
977 devices/virtio/vhost_user_output.c
978 devices/virtio/vhost_user_api.c
979 devices/virtio/virtio.c
980 devices/virtio/virtio_api.c
981 devices/virtio/virtio_pci_legacy.c
982 devices/virtio/virtio_pci_modern.c
983 devices/virtio/virtio_process.c
984 devices/virtio/virtio_types_api.c
987 list(APPEND VNET_HEADERS
989 devices/virtio/virtio.h
990 devices/virtio/virtio_buffering.h
991 devices/virtio/virtio_std.h
992 devices/virtio/virtio_pci_legacy.h
993 devices/virtio/virtio_pci_modern.h
994 devices/virtio/vhost_std.h
995 devices/virtio/vhost_user.h
996 devices/virtio/virtio_types_api.h
999 list(APPEND VNET_MULTIARCH_SOURCES
1000 devices/virtio/vhost_user_input.c
1001 devices/virtio/vhost_user_output.c
1002 devices/virtio/node.c
1003 devices/af_packet/node.c
1004 devices/virtio/device.c
1007 list(APPEND VNET_API_FILES
1008 devices/virtio/vhost_user.api
1009 devices/virtio/virtio.api
1010 devices/virtio/virtio_types.api
1013 ##############################################################################
1014 # tap interface (with virtio backend)
1015 ##############################################################################
1017 list(APPEND VNET_SOURCES
1020 devices/tap/tapv2_api.c
1023 list(APPEND VNET_HEADERS
1027 list(APPEND VNET_API_FILES
1028 devices/tap/tapv2.api
1031 ##############################################################################
1032 # tap interface (with virtio backend)
1033 ##############################################################################
1035 list(APPEND VNET_SOURCES
1036 devices/pipe/pipe_api.c
1040 list(APPEND VNET_HEADERS
1044 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1046 ##############################################################################
1047 # session managmeent
1048 ##############################################################################
1050 list(APPEND VNET_SOURCES
1052 session/session_debug.c
1053 session/session_table.c
1054 session/session_rules_table.c
1055 session/session_lookup.c
1056 session/session_node.c
1058 session/application.c
1059 session/application_worker.c
1060 session/session_cli.c
1061 session/application_interface.c
1062 session/application_local.c
1063 session/application_namespace.c
1064 session/segment_manager.c
1065 session/session_api.c
1068 list(APPEND VNET_HEADERS
1070 session/session_table.h
1071 session/session_rules_table.h
1072 session/session_types.h
1073 session/session_lookup.h
1074 session/application.h
1076 session/transport_types.h
1077 session/application_interface.h
1078 session/application_local.h
1079 session/application_namespace.h
1080 session/session_debug.h
1081 session/segment_manager.h
1082 session/mma_template.h
1083 session/mma_template.c
1088 list(APPEND VNET_API_FILES session/session.api)
1090 ##############################################################################
1092 ##############################################################################
1094 list(APPEND VNET_SOURCES
1098 list(APPEND VNET_HEADERS
1103 ##############################################################################
1104 # Linux packet interface
1105 ##############################################################################
1107 list(APPEND VNET_SOURCES
1108 devices/af_packet/af_packet.c
1109 devices/af_packet/device.c
1110 devices/af_packet/node.c
1111 devices/af_packet/cli.c
1112 devices/af_packet/af_packet_api.c
1115 list(APPEND VNET_MULTIARCH_SOURCES
1116 devices/af_packet/device.c
1119 list(APPEND VNET_HEADERS
1120 devices/af_packet/af_packet.h
1123 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1125 ##############################################################################
1126 # Driver feature graph arc support
1127 ##############################################################################
1129 list(APPEND VNET_SOURCES
1131 feature/feature_api.c
1132 feature/registration.c
1135 list(APPEND VNET_HEADERS
1139 list(APPEND VNET_API_FILES feature/feature.api)
1141 ##############################################################################
1142 # Unix kernel related
1143 ##############################################################################
1145 # FIXME: unix/hgshm.c
1147 list(APPEND VNET_SOURCES
1152 list(APPEND VNET_HEADERS
1156 ##############################################################################
1158 ##############################################################################
1160 list(APPEND VNET_SOURCES
1175 fib/fib_entry_src_adj.c
1176 fib/fib_entry_src_api.c
1177 fib/fib_entry_src_drop.c
1178 fib/fib_entry_src_interface.c
1179 fib/fib_entry_src_interpose.c
1180 fib/fib_entry_src_lisp.c
1181 fib/fib_entry_src_mpls.c
1182 fib/fib_entry_src_simple.c
1183 fib/fib_entry_src_rr.c
1184 fib/fib_entry_cover.c
1185 fib/fib_entry_delegate.c
1186 fib/fib_entry_track.c
1193 fib/fib_attached_export.c
1198 list(APPEND VNET_HEADERS
1211 fib/fib_entry_delegate.h
1216 list(APPEND VNET_API_FILES
1221 ##############################################################################
1223 ##############################################################################
1225 list(APPEND VNET_SOURCES
1229 adj/adj_midchain_node.c
1230 adj/adj_midchain_delegate.c
1240 list(APPEND VNET_MULTIARCH_SOURCES
1243 adj/adj_midchain_node.c
1246 list(APPEND VNET_HEADERS
1256 ##############################################################################
1257 # Data-Plane Objects
1258 ##############################################################################
1260 list(APPEND VNET_SOURCES
1268 dpo/load_balance_map.c
1272 dpo/interface_rx_dpo.c
1273 dpo/interface_tx_dpo.c
1274 dpo/mpls_disposition.c
1275 dpo/mpls_label_dpo.c
1281 list(APPEND VNET_MULTIARCH_SOURCES
1283 dpo/mpls_disposition.c
1285 dpo/mpls_label_dpo.c
1286 dpo/interface_rx_dpo.c
1289 list(APPEND VNET_HEADERS
1301 ##############################################################################
1303 ##############################################################################
1305 list(APPEND VNET_SOURCES
1315 mfib/mfib_entry_cover.c
1316 mfib/mfib_entry_delegate.c
1317 mfib/mfib_entry_src.c
1318 mfib/mfib_entry_src_rr.c
1322 list(APPEND VNET_MULTIARCH_SOURCES
1326 list(APPEND VNET_HEADERS
1332 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1334 ##############################################################################
1336 ##############################################################################
1338 list(APPEND VNET_SOURCES
1344 list(APPEND VNET_HEADERS
1348 ##############################################################################
1350 ##############################################################################
1352 list(APPEND VNET_SOURCES
1355 qos/qos_egress_map.c
1357 qos/qos_record_node.c
1359 qos/qos_store_node.c
1364 list(APPEND VNET_MULTIARCH_SOURCES
1365 qos/qos_record_node.c
1369 list(APPEND VNET_API_FILES qos/qos.api)
1371 ##############################################################################
1373 ##############################################################################
1375 list(APPEND VNET_SOURCES
1376 bier/bier_bit_string.c
1379 bier/bier_fmask_db.c
1388 bier/bier_imp_node.c
1390 bier/bier_disp_entry.c
1391 bier/bier_disp_lookup_node.c
1392 bier/bier_disp_dispatch_node.c
1393 bier/bier_disp_table.c
1394 bier/bier_bift_table.c
1397 list(APPEND VNET_MULTIARCH_SOURCES
1398 bier/bier_disp_dispatch_node.c
1399 bier/bier_disp_lookup_node.c
1400 bier/bier_imp_node.c
1403 list(APPEND VNET_HEADERS
1410 list(APPEND VNET_API_FILES bier/bier.api)
1412 ##############################################################################
1414 ##############################################################################
1416 list (APPEND VNET_SOURCES
1422 list(APPEND VNET_HEADERS
1427 list(APPEND VNET_API_FILES syslog/syslog.api)
1429 ##############################################################################
1430 # Tunnel Endpoint Information Base
1431 ##############################################################################
1433 list (APPEND VNET_SOURCES
1439 list(APPEND VNET_HEADERS
1443 list(APPEND VNET_API_FILES teib/teib.api)
1445 ##############################################################################
1447 ##############################################################################
1449 list (APPEND VNET_SOURCES
1455 list(APPEND VNET_HEADERS
1459 list(APPEND VNET_API_FILES arp/arp.api)
1461 list (APPEND VNET_SOURCES
1465 ip6-nd/ip6_nd_proxy.c
1466 ip6-nd/ip6_nd_mirror_proxy.c
1472 list(APPEND VNET_HEADERS
1476 list(APPEND VNET_API_FILES
1481 ##############################################################################
1483 ##############################################################################
1485 add_vpp_library(vnet
1486 SOURCES ${VNET_SOURCES}
1487 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1488 INSTALL_HEADERS ${VNET_HEADERS}
1489 API_FILES ${VNET_API_FILES}
1490 LINK_LIBRARIES vppinfra svm vlib
1491 DEPENDS vpp_version_h api_headers
1494 ##############################################################################
1495 # vpp api test client library
1496 ##############################################################################
1498 add_vpp_library (vatclient
1499 SOURCES ip/ip_types_api.c
1503 add_vat_test_library(vnet
1507 ip6-nd/ip6_nd_test.c
1508 srmpls/sr_mpls_test.c
1509 session/session_test.c
1514 ##############################################################################
1516 ##############################################################################
1517 add_vpp_test_library(vnet
1521 ##############################################################################