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 # mpls segment routing
817 ##############################################################################
819 list(APPEND VNET_SOURCES
820 srmpls/sr_mpls_policy.c
821 srmpls/sr_mpls_steering.c
825 list(APPEND VNET_HEADERS
829 list(APPEND VNET_API_FILES
833 ##############################################################################
834 # IPFIX / netflow v10
835 ##############################################################################
836 list(APPEND VNET_SOURCES
837 ipfix-export/flow_report.c
838 ipfix-export/flow_api.c
841 list(APPEND VNET_HEADERS
842 ipfix-export/flow_report.h
843 ipfix-export/ipfix_info_elements.h
844 ipfix-export/ipfix_packet.h
847 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
849 ##############################################################################
851 ##############################################################################
852 list(APPEND VNET_SOURCES
860 list(APPEND VNET_HEADERS
864 ##############################################################################
866 ##############################################################################
867 list(APPEND VNET_SOURCES
874 list(APPEND VNET_HEADERS
877 gso/hdr_offset_parser.h
881 list(APPEND VNET_API_FILES
885 ##############################################################################
886 # IPFIX classify code
887 ##############################################################################
889 list(APPEND VNET_SOURCES
890 ipfix-export/flow_report_classify.c
893 list(APPEND VNET_HEADERS
894 ipfix-export/flow_report_classify.h
897 ##############################################################################
899 ##############################################################################
901 list(APPEND VNET_SOURCES
902 lawful-intercept/lawful_intercept.c
903 lawful-intercept/node.c
906 list(APPEND VNET_MULTIARCH_SOURCES
907 lawful-intercept/node.c
910 list(APPEND VNET_HEADERS
911 lawful-intercept/lawful_intercept.h
914 ##############################################################################
915 # SPAN (port mirroring)
916 ##############################################################################
918 list(APPEND VNET_SOURCES
924 list(APPEND VNET_MULTIARCH_SOURCES
928 list(APPEND VNET_HEADERS
932 list(APPEND VNET_API_FILES span/span.api)
934 ##############################################################################
936 ##############################################################################
938 list(APPEND VNET_SOURCES
948 list(APPEND VNET_HEADERS
953 list(APPEND VNET_API_FILES pg/pg.api)
955 ##############################################################################
957 ##############################################################################
959 list(APPEND VNET_SOURCES
961 devices/virtio/device.c
962 devices/virtio/format.c
963 devices/virtio/node.c
965 devices/virtio/virtio.c
966 devices/virtio/virtio_api.c
967 devices/virtio/virtio_pci_legacy.c
968 devices/virtio/virtio_pci_modern.c
969 devices/virtio/virtio_pre_input.c
970 devices/virtio/virtio_types_api.c
973 list(APPEND VNET_HEADERS
975 devices/virtio/virtio.h
976 devices/virtio/virtio_buffering.h
977 devices/virtio/virtio_std.h
978 devices/virtio/virtio_pci_legacy.h
979 devices/virtio/virtio_pci_modern.h
980 devices/virtio/vhost_std.h
981 devices/virtio/virtio_types_api.h
984 list(APPEND VNET_MULTIARCH_SOURCES
985 devices/virtio/node.c
986 devices/virtio/device.c
989 list(APPEND VNET_API_FILES
990 devices/virtio/virtio.api
991 devices/virtio/virtio_types.api
994 ##############################################################################
995 # tap interface (with virtio backend)
996 ##############################################################################
998 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
999 list(APPEND VNET_SOURCES
1002 devices/tap/tapv2_api.c
1005 list(APPEND VNET_HEADERS
1009 list(APPEND VNET_API_FILES
1010 devices/tap/tapv2.api
1014 ##############################################################################
1015 # tap interface (with virtio backend)
1016 ##############################################################################
1018 list(APPEND VNET_SOURCES
1019 devices/pipe/pipe_api.c
1023 list(APPEND VNET_HEADERS
1027 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1029 ##############################################################################
1030 # session managmeent
1031 ##############################################################################
1033 list(APPEND VNET_SOURCES
1035 session/session_debug.c
1036 session/session_table.c
1037 session/session_rules_table.c
1038 session/session_lookup.c
1039 session/session_node.c
1040 session/session_input.c
1042 session/application.c
1043 session/application_worker.c
1044 session/session_cli.c
1045 session/application_interface.c
1046 session/application_local.c
1047 session/application_namespace.c
1048 session/segment_manager.c
1049 session/session_api.c
1052 list(APPEND VNET_HEADERS
1054 session/session_table.h
1055 session/session_rules_table.h
1056 session/session_types.h
1057 session/session_lookup.h
1058 session/application.h
1060 session/transport_types.h
1061 session/application_interface.h
1062 session/application_local.h
1063 session/application_namespace.h
1064 session/session_debug.h
1065 session/segment_manager.h
1066 session/mma_template.h
1067 session/mma_template.c
1072 list(APPEND VNET_API_FILES session/session.api)
1074 ##############################################################################
1076 ##############################################################################
1078 list(APPEND VNET_SOURCES
1082 list(APPEND VNET_HEADERS
1088 ##############################################################################
1089 # Driver feature graph arc support
1090 ##############################################################################
1092 list(APPEND VNET_SOURCES
1094 feature/feature_api.c
1095 feature/registration.c
1098 list(APPEND VNET_HEADERS
1102 list(APPEND VNET_API_FILES feature/feature.api)
1104 ##############################################################################
1105 # Unix kernel related
1106 ##############################################################################
1108 # FIXME: unix/hgshm.c
1110 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
1111 list(APPEND VNET_SOURCES
1116 list(APPEND VNET_HEADERS
1121 ##############################################################################
1123 ##############################################################################
1125 list(APPEND VNET_SOURCES
1140 fib/fib_entry_src_adj.c
1141 fib/fib_entry_src_api.c
1142 fib/fib_entry_src_drop.c
1143 fib/fib_entry_src_interface.c
1144 fib/fib_entry_src_interpose.c
1145 fib/fib_entry_src_lisp.c
1146 fib/fib_entry_src_mpls.c
1147 fib/fib_entry_src_simple.c
1148 fib/fib_entry_src_rr.c
1149 fib/fib_entry_cover.c
1150 fib/fib_entry_delegate.c
1151 fib/fib_entry_track.c
1158 fib/fib_attached_export.c
1163 list(APPEND VNET_HEADERS
1166 fib/fib_entry_track.h
1177 fib/fib_entry_delegate.h
1184 list(APPEND VNET_API_FILES
1189 ##############################################################################
1191 ##############################################################################
1193 list(APPEND VNET_SOURCES
1197 adj/adj_midchain_node.c
1198 adj/adj_midchain_delegate.c
1208 list(APPEND VNET_MULTIARCH_SOURCES
1211 adj/adj_midchain_node.c
1214 list(APPEND VNET_HEADERS
1224 ##############################################################################
1225 # Data-Plane Objects
1226 ##############################################################################
1228 list(APPEND VNET_SOURCES
1236 dpo/load_balance_map.c
1240 dpo/interface_rx_dpo.c
1241 dpo/interface_tx_dpo.c
1242 dpo/mpls_disposition.c
1243 dpo/mpls_label_dpo.c
1249 list(APPEND VNET_MULTIARCH_SOURCES
1251 dpo/mpls_disposition.c
1253 dpo/mpls_label_dpo.c
1254 dpo/interface_rx_dpo.c
1257 list(APPEND VNET_HEADERS
1259 dpo/load_balance_map.h
1270 ##############################################################################
1272 ##############################################################################
1274 list(APPEND VNET_SOURCES
1284 mfib/mfib_entry_cover.c
1285 mfib/mfib_entry_delegate.c
1286 mfib/mfib_entry_src.c
1287 mfib/mfib_entry_src_rr.c
1291 list(APPEND VNET_MULTIARCH_SOURCES
1295 list(APPEND VNET_HEADERS
1301 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1303 ##############################################################################
1305 ##############################################################################
1307 list(APPEND VNET_SOURCES
1313 list(APPEND VNET_HEADERS
1317 ##############################################################################
1319 ##############################################################################
1321 list(APPEND VNET_SOURCES
1324 qos/qos_egress_map.c
1326 qos/qos_record_node.c
1328 qos/qos_store_node.c
1333 list(APPEND VNET_MULTIARCH_SOURCES
1334 qos/qos_record_node.c
1338 list(APPEND VNET_API_FILES qos/qos.api)
1340 ##############################################################################
1342 ##############################################################################
1344 list(APPEND VNET_SOURCES
1345 bier/bier_bit_string.c
1348 bier/bier_fmask_db.c
1357 bier/bier_imp_node.c
1359 bier/bier_disp_entry.c
1360 bier/bier_disp_lookup_node.c
1361 bier/bier_disp_dispatch_node.c
1362 bier/bier_disp_table.c
1363 bier/bier_bift_table.c
1366 list(APPEND VNET_MULTIARCH_SOURCES
1367 bier/bier_disp_dispatch_node.c
1368 bier/bier_disp_lookup_node.c
1369 bier/bier_imp_node.c
1372 list(APPEND VNET_HEADERS
1373 bier/bier_bit_string.h
1376 bier/bier_hdr_inlines.h
1382 list(APPEND VNET_API_FILES bier/bier.api)
1384 ##############################################################################
1386 ##############################################################################
1388 list (APPEND VNET_SOURCES
1394 list(APPEND VNET_HEADERS
1399 list(APPEND VNET_API_FILES syslog/syslog.api)
1401 ##############################################################################
1402 # Tunnel Endpoint Information Base
1403 ##############################################################################
1405 list (APPEND VNET_SOURCES
1411 list(APPEND VNET_HEADERS
1415 list(APPEND VNET_API_FILES teib/teib.api)
1417 ##############################################################################
1419 ##############################################################################
1421 list (APPEND VNET_SOURCES
1427 list(APPEND VNET_HEADERS
1431 list(APPEND VNET_API_FILES arp/arp.api)
1433 list (APPEND VNET_SOURCES
1437 ip6-nd/ip6_nd_proxy.c
1438 ip6-nd/ip6_nd_mirror_proxy.c
1444 list(APPEND VNET_HEADERS
1448 list(APPEND VNET_API_FILES
1453 ##############################################################################
1455 ##############################################################################
1457 add_vpp_library(vnet
1458 SOURCES ${VNET_SOURCES}
1459 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1460 INSTALL_HEADERS ${VNET_HEADERS}
1461 API_FILES ${VNET_API_FILES}
1462 LINK_LIBRARIES vppinfra svm vlib
1463 DEPENDS vpp_version_h api_headers
1466 ##############################################################################
1467 # vpp api test client library
1468 ##############################################################################
1470 add_vpp_library (vatclient
1471 SOURCES ip/ip_types_api.c
1475 add_vat_test_library(vnet
1479 ip6-nd/ip6_nd_test.c
1480 srmpls/sr_mpls_test.c
1481 session/session_test.c
1486 ##############################################################################
1488 ##############################################################################
1489 add_vpp_test_library(vnet
1493 ##############################################################################