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
90 interface/rx_queue_funcs.h
91 interface/tx_queue_funcs.h
108 ethernet/ethernet_format_fns.h
109 ethernet/ethernet_types_api.h
112 list(APPEND VNET_API_FILES
121 ##############################################################################
123 ##############################################################################
124 list(APPEND VNET_SOURCES
128 policer/policer_api.c
131 list(APPEND VNET_MULTIARCH_SOURCES
135 list(APPEND VNET_HEADERS
141 list(APPEND VNET_API_FILES
143 policer/policer_types.api
146 ##############################################################################
147 # Layer 2 protocols go here
148 ##############################################################################
150 ##############################################################################
151 # Layer 2 protocol: Ethernet
152 ##############################################################################
153 list(APPEND VNET_SOURCES
154 ethernet/arp_packet.c
155 ethernet/ethernet_types_api.c
159 ethernet/mac_address.c
163 ethernet/p2p_ethernet.c
164 ethernet/p2p_ethernet_input.c
165 ethernet/p2p_ethernet_api.c
168 list(APPEND VNET_MULTIARCH_SOURCES
170 ethernet/p2p_ethernet_input.c
173 list(APPEND VNET_HEADERS
176 ethernet/mac_address.h
180 ethernet/p2p_ethernet.h
181 ethernet/arp_packet.h
184 list(APPEND VNET_API_FILES
185 ethernet/p2p_ethernet.api
186 ethernet/ethernet_types.api)
188 ##############################################################################
189 # Layer 2 protocol: Ethernet bridging
190 ##############################################################################
191 list(APPEND VNET_SOURCES
198 l2/l2_input_classify.c
199 l2/l2_output_classify.c
210 l2/l2_in_out_feat_arc.c
218 list(APPEND VNET_MULTIARCH_SOURCES
224 l2/l2_in_out_feat_arc.c
225 l2/l2_input_classify.c
227 l2/l2_output_classify.c
237 list(APPEND VNET_HEADERS
254 list(APPEND VNET_API_FILES l2/l2.api)
256 ##############################################################################
257 # Layer 2 protocol: SRP
258 ##############################################################################
259 list(APPEND VNET_SOURCES
266 list(APPEND VNET_HEADERS
271 ##############################################################################
272 # Layer 2 protocol: PPP
273 ##############################################################################
274 list(APPEND VNET_SOURCES
280 list(APPEND VNET_HEADERS
286 ##############################################################################
287 # Layer 2 protocol: HDLC
288 ##############################################################################
289 list(APPEND VNET_SOURCES
295 list(APPEND VNET_HEADERS
301 ##############################################################################
302 # Layer 2 protocol: LLC
303 ##############################################################################
304 list(APPEND VNET_SOURCES
310 list(APPEND VNET_HEADERS
314 ##############################################################################
315 # Layer 2 protocol: SNAP
316 ##############################################################################
317 list(APPEND VNET_SOURCES
323 list(APPEND VNET_HEADERS
327 ##############################################################################
329 ##############################################################################
330 list(APPEND VNET_SOURCES
337 list(APPEND VNET_HEADERS
341 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
342 list(APPEND VNET_API_FILES bonding/bond.api)
344 ##############################################################################
345 # Layer 2/3 "classify"
346 ##############################################################################
347 list(APPEND VNET_SOURCES
348 classify/vnet_classify.c
349 classify/trace_classify.h
350 classify/ip_classify.c
351 classify/in_out_acl.c
352 classify/policer_classify.c
353 classify/flow_classify.c
354 classify/flow_classify_node.c
355 classify/vnet_classify.h
356 classify/classify_api.c
359 list(APPEND VNET_MULTIARCH_SOURCES
360 classify/ip_classify.c
361 classify/flow_classify_node.c
364 list(APPEND VNET_HEADERS
365 classify/vnet_classify.h
366 classify/trace_classify.h
367 classify/in_out_acl.h
368 classify/policer_classify.h
369 classify/flow_classify.h
372 list(APPEND VNET_API_FILES classify/classify.api)
374 ##############################################################################
375 # Layer 3 protocols go here
376 ##############################################################################
378 ##############################################################################
379 # Layer 3 protocol: IP v4/v6
380 ##############################################################################
381 list(APPEND VNET_SOURCES
395 ip/ip4_source_and_port_range_check.c
396 ip/reass/ip4_full_reass.c
397 ip/reass/ip4_sv_reass.c
407 ip/reass/ip6_full_reass.c
408 ip/reass/ip6_sv_reass.c
411 ip/ip_container_proxy.c
418 ip/ip_path_mtu_node.c
429 list(APPEND VNET_MULTIARCH_SOURCES
431 ip/reass/ip4_full_reass.c
433 ip/reass/ip6_full_reass.c
434 ip/reass/ip4_sv_reass.c
436 ip/reass/ip6_full_reass.c
437 ip/reass/ip6_sv_reass.c
442 ip/ip_path_mtu_node.c
445 list(APPEND VNET_HEADERS
458 ip/ip6_hop_by_hop_packet.h
462 ip/ip_container_proxy.h
468 ip/ip_source_and_port_range_check.h
475 ip/reass/ip4_sv_reass.h
476 ip/reass/ip6_sv_reass.h
479 list(APPEND VNET_API_FILES
484 list(APPEND VNET_MULTIARCH_SOURCES
490 ##############################################################################
492 ##############################################################################
493 list(APPEND VNET_SOURCES
494 ip-neighbor/ip_neighbor.c
495 ip-neighbor/ip_neighbor_api.c
496 ip-neighbor/ip_neighbor_dp.c
497 ip-neighbor/ip_neighbor_types.c
498 ip-neighbor/ip_neighbor_watch.c
499 ip-neighbor/ip4_neighbor.c
500 ip-neighbor/ip6_neighbor.c
503 list(APPEND VNET_HEADERS
504 ip-neighbor/ip_neighbor.h
505 ip-neighbor/ip_neighbor_types.h
508 list(APPEND VNET_API_FILES
509 ip-neighbor/ip_neighbor.api
512 ##############################################################################
513 # Bidirectional Forwarding Detection
514 ##############################################################################
516 list(APPEND VNET_HEADERS
523 list(APPEND VNET_SOURCES
532 list(APPEND VNET_API_FILES bfd/bfd.api)
534 ##############################################################################
536 ##############################################################################
538 list(APPEND VNET_SOURCES
546 list(APPEND VNET_HEADERS
550 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
552 list(APPEND VNET_API_FILES crypto/crypto.api)
554 ##############################################################################
555 # Layer 3 protocol: IPSec
556 ##############################################################################
557 list(APPEND VNET_SOURCES
561 ipsec/ipsec_handoff.c
567 ipsec/ipsec_spd_policy.c
576 ipsec/ipsec_types_api.c
579 list(APPEND VNET_MULTIARCH_SOURCES
584 ipsec/ipsec_handoff.c
590 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
591 list(APPEND VNET_API_FILES ipsec/ipsec.api)
593 list(APPEND VNET_SOURCES
597 list(APPEND VNET_HEADERS
600 ipsec/ipsec_spd_policy.h
603 ipsec/ipsec_types_api.h
609 ##############################################################################
610 # Layer 3 protocol: osi
611 ##############################################################################
612 list(APPEND VNET_SOURCES
618 list(APPEND VNET_HEADERS
622 ##############################################################################
623 # Layer 4 protocol: tcp
624 ##############################################################################
625 list(APPEND VNET_SOURCES
629 tcp/tcp_syn_filter4.c
642 list(APPEND VNET_MULTIARCH_SOURCES
645 tcp/tcp_syn_filter4.c
648 list(APPEND VNET_HEADERS
661 list(APPEND VNET_API_FILES tcp/tcp.api)
663 ##############################################################################
664 # Layer 4 protocol: udp
665 ##############################################################################
666 list(APPEND VNET_SOURCES
680 list(APPEND VNET_MULTIARCH_SOURCES
685 list(APPEND VNET_HEADERS
694 list(APPEND VNET_API_FILES udp/udp.api)
696 ##############################################################################
697 # Tunnel protocol: gre
698 ##############################################################################
699 list(APPEND VNET_HEADERS
703 ##############################################################################
704 # Tunnel protocol: ipip
705 ##############################################################################
706 list(APPEND VNET_SOURCES
714 list(APPEND VNET_MULTIARCH_SOURCES
718 list(APPEND VNET_HEADERS
722 list(APPEND VNET_API_FILES
726 ##############################################################################
728 ##############################################################################
729 list(APPEND VNET_SOURCES
731 tunnel/tunnel_types_api.c
734 list(APPEND VNET_API_FILES
735 tunnel/tunnel_types.api
738 list(APPEND VNET_HEADERS
741 tunnel/tunnel_types_api.h
744 ##############################################################################
745 # Tunnel protocol: gre+mpls
746 ##############################################################################
747 list(APPEND VNET_SOURCES
759 list(APPEND VNET_MULTIARCH_SOURCES
766 list(APPEND VNET_HEADERS
774 list(APPEND VNET_API_FILES mpls/mpls.api)
776 ##############################################################################
777 # Tunnel protocol: vxlan-gpe
778 ##############################################################################
780 list(APPEND VNET_SOURCES
781 vxlan-gpe/vxlan_gpe.c
784 vxlan-gpe/vxlan_gpe_api.c
787 list (APPEND VNET_MULTIARCH_SOURCES
791 list(APPEND VNET_HEADERS
792 vxlan-gpe/vxlan_gpe.h
793 vxlan-gpe/vxlan_gpe_packet.h
794 vxlan-gpe/vxlan_gpe_error.def
797 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
799 ##############################################################################
800 # ipv6 segment routing
801 ##############################################################################
803 list(APPEND VNET_SOURCES
806 srv6/sr_policy_rewrite.c
814 list(APPEND VNET_HEADERS
820 list(APPEND VNET_API_FILES
826 ##############################################################################
827 # IPFIX / netflow v10
828 ##############################################################################
829 list(APPEND VNET_SOURCES
830 ipfix-export/flow_report.c
831 ipfix-export/flow_api.c
834 list(APPEND VNET_HEADERS
835 ipfix-export/flow_report.h
836 ipfix-export/ipfix_info_elements.h
837 ipfix-export/ipfix_packet.h
840 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
842 ##############################################################################
844 ##############################################################################
845 list(APPEND VNET_SOURCES
853 list(APPEND VNET_HEADERS
857 ##############################################################################
859 ##############################################################################
860 list(APPEND VNET_SOURCES
867 list(APPEND VNET_HEADERS
870 gso/hdr_offset_parser.h
874 list(APPEND VNET_API_FILES
878 ##############################################################################
879 # IPFIX classify code
880 ##############################################################################
882 list(APPEND VNET_SOURCES
883 ipfix-export/flow_report_classify.c
886 list(APPEND VNET_HEADERS
887 ipfix-export/flow_report_classify.h
890 ##############################################################################
891 # SPAN (port mirroring)
892 ##############################################################################
894 list(APPEND VNET_SOURCES
900 list(APPEND VNET_MULTIARCH_SOURCES
904 list(APPEND VNET_HEADERS
908 list(APPEND VNET_API_FILES span/span.api)
910 ##############################################################################
912 ##############################################################################
914 list(APPEND VNET_SOURCES
924 list(APPEND VNET_HEADERS
929 list(APPEND VNET_API_FILES pg/pg.api)
931 ##############################################################################
933 ##############################################################################
935 list(APPEND VNET_SOURCES
937 devices/virtio/device.c
938 devices/virtio/format.c
939 devices/virtio/node.c
941 devices/virtio/virtio.c
942 devices/virtio/virtio_api.c
943 devices/virtio/virtio_pci_legacy.c
944 devices/virtio/virtio_pci_modern.c
945 devices/virtio/virtio_pre_input.c
946 devices/virtio/virtio_types_api.c
949 list(APPEND VNET_HEADERS
951 devices/virtio/virtio.h
952 devices/virtio/virtio_buffering.h
953 devices/virtio/virtio_std.h
954 devices/virtio/virtio_pci_legacy.h
955 devices/virtio/virtio_pci_modern.h
956 devices/virtio/vhost_std.h
957 devices/virtio/virtio_types_api.h
960 list(APPEND VNET_MULTIARCH_SOURCES
961 devices/virtio/node.c
962 devices/virtio/device.c
965 list(APPEND VNET_API_FILES
966 devices/virtio/virtio.api
967 devices/virtio/virtio_types.api
970 ##############################################################################
971 # tap interface (with virtio backend)
972 ##############################################################################
974 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
975 list(APPEND VNET_SOURCES
978 devices/tap/tapv2_api.c
981 list(APPEND VNET_HEADERS
985 list(APPEND VNET_API_FILES
986 devices/tap/tapv2.api
990 ##############################################################################
991 # tap interface (with virtio backend)
992 ##############################################################################
994 list(APPEND VNET_SOURCES
995 devices/pipe/pipe_api.c
999 list(APPEND VNET_HEADERS
1003 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1005 ##############################################################################
1006 # session managmeent
1007 ##############################################################################
1009 list(APPEND VNET_SOURCES
1011 session/session_debug.c
1012 session/session_table.c
1013 session/session_rules_table.c
1014 session/session_lookup.c
1015 session/session_node.c
1016 session/session_input.c
1018 session/application.c
1019 session/application_worker.c
1020 session/session_cli.c
1021 session/application_interface.c
1022 session/application_local.c
1023 session/application_namespace.c
1024 session/segment_manager.c
1025 session/session_api.c
1028 list(APPEND VNET_HEADERS
1030 session/session_table.h
1031 session/session_rules_table.h
1032 session/session_types.h
1033 session/session_lookup.h
1034 session/application.h
1036 session/transport_types.h
1037 session/application_interface.h
1038 session/application_local.h
1039 session/application_namespace.h
1040 session/session_debug.h
1041 session/segment_manager.h
1042 session/mma_template.h
1043 session/mma_template.c
1048 list(APPEND VNET_API_FILES session/session.api)
1050 ##############################################################################
1052 ##############################################################################
1054 list(APPEND VNET_SOURCES
1058 list(APPEND VNET_HEADERS
1064 ##############################################################################
1065 # Driver feature graph arc support
1066 ##############################################################################
1068 list(APPEND VNET_SOURCES
1070 feature/feature_api.c
1071 feature/registration.c
1074 list(APPEND VNET_HEADERS
1078 list(APPEND VNET_API_FILES feature/feature.api)
1080 ##############################################################################
1081 # Unix kernel related
1082 ##############################################################################
1084 # FIXME: unix/hgshm.c
1086 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
1087 list(APPEND VNET_SOURCES
1092 list(APPEND VNET_HEADERS
1097 ##############################################################################
1099 ##############################################################################
1101 list(APPEND VNET_SOURCES
1116 fib/fib_entry_src_adj.c
1117 fib/fib_entry_src_api.c
1118 fib/fib_entry_src_drop.c
1119 fib/fib_entry_src_interface.c
1120 fib/fib_entry_src_interpose.c
1121 fib/fib_entry_src_lisp.c
1122 fib/fib_entry_src_mpls.c
1123 fib/fib_entry_src_simple.c
1124 fib/fib_entry_src_rr.c
1125 fib/fib_entry_cover.c
1126 fib/fib_entry_delegate.c
1127 fib/fib_entry_track.c
1134 fib/fib_attached_export.c
1139 list(APPEND VNET_HEADERS
1142 fib/fib_entry_track.h
1153 fib/fib_entry_delegate.h
1161 list(APPEND VNET_API_FILES
1166 ##############################################################################
1168 ##############################################################################
1170 list(APPEND VNET_SOURCES
1174 adj/adj_midchain_node.c
1175 adj/adj_midchain_delegate.c
1185 list(APPEND VNET_MULTIARCH_SOURCES
1188 adj/adj_midchain_node.c
1191 list(APPEND VNET_HEADERS
1201 ##############################################################################
1202 # Data-Plane Objects
1203 ##############################################################################
1205 list(APPEND VNET_SOURCES
1213 dpo/load_balance_map.c
1217 dpo/interface_rx_dpo.c
1218 dpo/interface_tx_dpo.c
1219 dpo/mpls_disposition.c
1220 dpo/mpls_label_dpo.c
1226 list(APPEND VNET_MULTIARCH_SOURCES
1228 dpo/mpls_disposition.c
1230 dpo/mpls_label_dpo.c
1231 dpo/interface_rx_dpo.c
1234 list(APPEND VNET_HEADERS
1236 dpo/load_balance_map.h
1247 ##############################################################################
1249 ##############################################################################
1251 list(APPEND VNET_SOURCES
1261 mfib/mfib_entry_cover.c
1262 mfib/mfib_entry_delegate.c
1263 mfib/mfib_entry_src.c
1264 mfib/mfib_entry_src_rr.c
1268 list(APPEND VNET_MULTIARCH_SOURCES
1272 list(APPEND VNET_HEADERS
1278 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1280 ##############################################################################
1282 ##############################################################################
1284 list(APPEND VNET_SOURCES
1290 list(APPEND VNET_HEADERS
1294 ##############################################################################
1296 ##############################################################################
1298 list(APPEND VNET_SOURCES
1301 qos/qos_egress_map.c
1303 qos/qos_record_node.c
1305 qos/qos_store_node.c
1310 list(APPEND VNET_MULTIARCH_SOURCES
1311 qos/qos_record_node.c
1315 list(APPEND VNET_API_FILES qos/qos.api)
1317 ##############################################################################
1319 ##############################################################################
1321 list(APPEND VNET_SOURCES
1322 bier/bier_bit_string.c
1325 bier/bier_fmask_db.c
1334 bier/bier_imp_node.c
1336 bier/bier_disp_entry.c
1337 bier/bier_disp_lookup_node.c
1338 bier/bier_disp_dispatch_node.c
1339 bier/bier_disp_table.c
1340 bier/bier_bift_table.c
1343 list(APPEND VNET_MULTIARCH_SOURCES
1344 bier/bier_disp_dispatch_node.c
1345 bier/bier_disp_lookup_node.c
1346 bier/bier_imp_node.c
1349 list(APPEND VNET_HEADERS
1350 bier/bier_bit_string.h
1353 bier/bier_hdr_inlines.h
1359 list(APPEND VNET_API_FILES bier/bier.api)
1361 ##############################################################################
1363 ##############################################################################
1365 list (APPEND VNET_SOURCES
1371 list(APPEND VNET_HEADERS
1376 list(APPEND VNET_API_FILES syslog/syslog.api)
1378 ##############################################################################
1379 # Tunnel Endpoint Information Base
1380 ##############################################################################
1382 list (APPEND VNET_SOURCES
1388 list(APPEND VNET_HEADERS
1392 list(APPEND VNET_API_FILES teib/teib.api)
1394 ##############################################################################
1396 ##############################################################################
1398 list (APPEND VNET_SOURCES
1404 list(APPEND VNET_HEADERS
1409 list(APPEND VNET_API_FILES arp/arp.api)
1411 list (APPEND VNET_SOURCES
1415 ip6-nd/ip6_nd_proxy.c
1416 ip6-nd/ip6_nd_mirror_proxy.c
1422 list(APPEND VNET_HEADERS
1426 list(APPEND VNET_API_FILES
1431 ##############################################################################
1433 ##############################################################################
1435 add_vpp_library(vnet
1436 SOURCES ${VNET_SOURCES}
1437 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1438 INSTALL_HEADERS ${VNET_HEADERS}
1439 API_FILES ${VNET_API_FILES}
1440 LINK_LIBRARIES vppinfra svm vlib
1441 DEPENDS vpp_version_h api_headers
1444 ##############################################################################
1445 # vpp api test client library
1446 ##############################################################################
1448 add_vpp_library (vatclient
1449 SOURCES ip/ip_types_api.c
1453 add_vat_test_library(vnet
1457 ip6-nd/ip6_nd_test.c
1458 session/session_test.c
1463 ##############################################################################
1465 ##############################################################################
1466 add_vpp_test_library(vnet
1470 ##############################################################################