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
49 list(APPEND VNET_MULTIARCH_SOURCES
55 list(APPEND VNET_HEADERS
64 interface/rx_queue_funcs.h
65 interface/tx_queue_funcs.h
81 ethernet/ethernet_format_fns.h
82 ethernet/ethernet_types_api.h
85 list(APPEND VNET_API_FILES
93 ##############################################################################
95 ##############################################################################
96 list(APPEND VNET_SOURCES
100 policer/policer_api.c
103 list(APPEND VNET_MULTIARCH_SOURCES
107 list(APPEND VNET_HEADERS
113 list(APPEND VNET_API_FILES
115 policer/policer_types.api
118 ##############################################################################
119 # Layer 2 protocols go here
120 ##############################################################################
122 ##############################################################################
123 # Layer 2 protocol: Ethernet
124 ##############################################################################
125 list(APPEND VNET_SOURCES
126 ethernet/arp_packet.c
127 ethernet/ethernet_types_api.c
131 ethernet/mac_address.c
135 ethernet/p2p_ethernet.c
136 ethernet/p2p_ethernet_input.c
137 ethernet/p2p_ethernet_api.c
140 list(APPEND VNET_MULTIARCH_SOURCES
142 ethernet/p2p_ethernet_input.c
145 list(APPEND VNET_HEADERS
148 ethernet/mac_address.h
152 ethernet/p2p_ethernet.h
153 ethernet/arp_packet.h
156 list(APPEND VNET_API_FILES
157 ethernet/p2p_ethernet.api
158 ethernet/ethernet_types.api)
160 ##############################################################################
161 # Layer 2 protocol: Ethernet bridging
162 ##############################################################################
163 list(APPEND VNET_SOURCES
170 l2/l2_input_classify.c
171 l2/l2_output_classify.c
182 l2/l2_in_out_feat_arc.c
190 list(APPEND VNET_MULTIARCH_SOURCES
196 l2/l2_in_out_feat_arc.c
197 l2/l2_input_classify.c
199 l2/l2_output_classify.c
209 list(APPEND VNET_HEADERS
226 list(APPEND VNET_API_FILES l2/l2.api)
228 ##############################################################################
229 # Layer 2 protocol: SRP
230 ##############################################################################
231 list(APPEND VNET_SOURCES
238 list(APPEND VNET_HEADERS
243 ##############################################################################
244 # Layer 2 protocol: PPP
245 ##############################################################################
246 list(APPEND VNET_SOURCES
252 list(APPEND VNET_HEADERS
258 ##############################################################################
259 # Layer 2 protocol: HDLC
260 ##############################################################################
261 list(APPEND VNET_SOURCES
267 list(APPEND VNET_HEADERS
273 ##############################################################################
274 # Layer 2 protocol: LLC
275 ##############################################################################
276 list(APPEND VNET_SOURCES
282 list(APPEND VNET_HEADERS
286 ##############################################################################
287 # Layer 2 protocol: SNAP
288 ##############################################################################
289 list(APPEND VNET_SOURCES
295 list(APPEND VNET_HEADERS
299 ##############################################################################
301 ##############################################################################
302 list(APPEND VNET_SOURCES
309 list(APPEND VNET_HEADERS
313 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
314 list(APPEND VNET_API_FILES bonding/bond.api)
316 ##############################################################################
317 # Layer 2/3 "classify"
318 ##############################################################################
319 list(APPEND VNET_SOURCES
320 classify/vnet_classify.c
321 classify/trace_classify.h
322 classify/ip_classify.c
323 classify/in_out_acl.c
324 classify/policer_classify.c
325 classify/flow_classify.c
326 classify/flow_classify_node.c
327 classify/vnet_classify.h
328 classify/classify_api.c
331 list(APPEND VNET_MULTIARCH_SOURCES
332 classify/ip_classify.c
333 classify/flow_classify_node.c
336 list(APPEND VNET_HEADERS
337 classify/vnet_classify.h
338 classify/trace_classify.h
339 classify/in_out_acl.h
340 classify/policer_classify.h
341 classify/flow_classify.h
344 list(APPEND VNET_API_FILES classify/classify.api)
346 ##############################################################################
347 # Layer 3 protocols go here
348 ##############################################################################
350 ##############################################################################
351 # Layer 3 protocol: IP v4/v6
352 ##############################################################################
353 list(APPEND VNET_SOURCES
367 ip/ip4_source_and_port_range_check.c
368 ip/reass/ip4_full_reass.c
369 ip/reass/ip4_sv_reass.c
379 ip/reass/ip6_full_reass.c
380 ip/reass/ip6_sv_reass.c
383 ip/ip_container_proxy.c
390 ip/ip_path_mtu_node.c
401 list(APPEND VNET_MULTIARCH_SOURCES
403 ip/reass/ip4_full_reass.c
405 ip/reass/ip6_full_reass.c
406 ip/reass/ip4_sv_reass.c
408 ip/reass/ip6_full_reass.c
409 ip/reass/ip6_sv_reass.c
414 ip/ip_path_mtu_node.c
417 list(APPEND VNET_HEADERS
430 ip/ip6_hop_by_hop_packet.h
434 ip/ip_container_proxy.h
440 ip/ip_source_and_port_range_check.h
447 ip/reass/ip4_sv_reass.h
448 ip/reass/ip6_sv_reass.h
451 list(APPEND VNET_API_FILES
456 list(APPEND VNET_MULTIARCH_SOURCES
462 ##############################################################################
464 ##############################################################################
465 list(APPEND VNET_SOURCES
466 ip-neighbor/ip_neighbor.c
467 ip-neighbor/ip_neighbor_api.c
468 ip-neighbor/ip_neighbor_dp.c
469 ip-neighbor/ip_neighbor_types.c
470 ip-neighbor/ip_neighbor_watch.c
471 ip-neighbor/ip4_neighbor.c
472 ip-neighbor/ip6_neighbor.c
475 list(APPEND VNET_HEADERS
476 ip-neighbor/ip_neighbor.h
477 ip-neighbor/ip_neighbor_types.h
480 list(APPEND VNET_API_FILES
481 ip-neighbor/ip_neighbor.api
484 ##############################################################################
485 # Bidirectional Forwarding Detection
486 ##############################################################################
488 list(APPEND VNET_HEADERS
495 list(APPEND VNET_SOURCES
504 list(APPEND VNET_API_FILES bfd/bfd.api)
506 ##############################################################################
508 ##############################################################################
510 list(APPEND VNET_SOURCES
518 list(APPEND VNET_HEADERS
522 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
524 list(APPEND VNET_API_FILES crypto/crypto.api)
526 ##############################################################################
527 # Layer 3 protocol: IPSec
528 ##############################################################################
529 list(APPEND VNET_SOURCES
533 ipsec/ipsec_handoff.c
539 ipsec/ipsec_spd_policy.c
548 ipsec/ipsec_types_api.c
551 list(APPEND VNET_MULTIARCH_SOURCES
556 ipsec/ipsec_handoff.c
562 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
563 list(APPEND VNET_API_FILES ipsec/ipsec.api)
565 list(APPEND VNET_SOURCES
569 list(APPEND VNET_HEADERS
572 ipsec/ipsec_spd_policy.h
575 ipsec/ipsec_types_api.h
581 ##############################################################################
582 # Layer 3 protocol: osi
583 ##############################################################################
584 list(APPEND VNET_SOURCES
590 list(APPEND VNET_HEADERS
594 ##############################################################################
595 # Layer 4 protocol: tcp
596 ##############################################################################
597 list(APPEND VNET_SOURCES
601 tcp/tcp_syn_filter4.c
614 list(APPEND VNET_MULTIARCH_SOURCES
617 tcp/tcp_syn_filter4.c
620 list(APPEND VNET_HEADERS
633 list(APPEND VNET_API_FILES tcp/tcp.api)
635 ##############################################################################
636 # Layer 4 protocol: udp
637 ##############################################################################
638 list(APPEND VNET_SOURCES
652 list(APPEND VNET_MULTIARCH_SOURCES
657 list(APPEND VNET_HEADERS
666 list(APPEND VNET_API_FILES udp/udp.api)
668 ##############################################################################
669 # Tunnel protocol: gre
670 ##############################################################################
671 list(APPEND VNET_HEADERS
675 ##############################################################################
676 # Tunnel protocol: ipip
677 ##############################################################################
678 list(APPEND VNET_SOURCES
686 list(APPEND VNET_MULTIARCH_SOURCES
690 list(APPEND VNET_HEADERS
694 list(APPEND VNET_API_FILES
698 ##############################################################################
700 ##############################################################################
701 list(APPEND VNET_SOURCES
703 tunnel/tunnel_types_api.c
706 list(APPEND VNET_API_FILES
707 tunnel/tunnel_types.api
710 list(APPEND VNET_HEADERS
713 tunnel/tunnel_types_api.h
716 ##############################################################################
717 # Tunnel protocol: gre+mpls
718 ##############################################################################
719 list(APPEND VNET_SOURCES
731 list(APPEND VNET_MULTIARCH_SOURCES
738 list(APPEND VNET_HEADERS
746 list(APPEND VNET_API_FILES mpls/mpls.api)
748 ##############################################################################
749 # Tunnel protocol: vxlan-gpe
750 ##############################################################################
752 list(APPEND VNET_SOURCES
753 vxlan-gpe/vxlan_gpe.c
756 vxlan-gpe/vxlan_gpe_api.c
759 list (APPEND VNET_MULTIARCH_SOURCES
763 list(APPEND VNET_HEADERS
764 vxlan-gpe/vxlan_gpe.h
765 vxlan-gpe/vxlan_gpe_packet.h
766 vxlan-gpe/vxlan_gpe_error.def
769 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
771 ##############################################################################
772 # ipv6 segment routing
773 ##############################################################################
775 list(APPEND VNET_SOURCES
778 srv6/sr_policy_rewrite.c
786 list(APPEND VNET_HEADERS
792 list(APPEND VNET_API_FILES
798 ##############################################################################
799 # mpls segment routing
800 ##############################################################################
802 list(APPEND VNET_SOURCES
803 srmpls/sr_mpls_policy.c
804 srmpls/sr_mpls_steering.c
808 list(APPEND VNET_HEADERS
812 list(APPEND VNET_API_FILES
816 ##############################################################################
817 # IPFIX / netflow v10
818 ##############################################################################
819 list(APPEND VNET_SOURCES
820 ipfix-export/flow_report.c
821 ipfix-export/flow_api.c
824 list(APPEND VNET_HEADERS
825 ipfix-export/flow_report.h
826 ipfix-export/ipfix_info_elements.h
827 ipfix-export/ipfix_packet.h
830 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
832 ##############################################################################
834 ##############################################################################
835 list(APPEND VNET_SOURCES
843 list(APPEND VNET_HEADERS
847 ##############################################################################
849 ##############################################################################
850 list(APPEND VNET_SOURCES
857 list(APPEND VNET_HEADERS
860 gso/hdr_offset_parser.h
864 list(APPEND VNET_API_FILES
868 ##############################################################################
869 # IPFIX classify code
870 ##############################################################################
872 list(APPEND VNET_SOURCES
873 ipfix-export/flow_report_classify.c
876 list(APPEND VNET_HEADERS
877 ipfix-export/flow_report_classify.h
880 ##############################################################################
882 ##############################################################################
884 list(APPEND VNET_SOURCES
885 lawful-intercept/lawful_intercept.c
886 lawful-intercept/node.c
889 list(APPEND VNET_MULTIARCH_SOURCES
890 lawful-intercept/node.c
893 list(APPEND VNET_HEADERS
894 lawful-intercept/lawful_intercept.h
897 ##############################################################################
898 # SPAN (port mirroring)
899 ##############################################################################
901 list(APPEND VNET_SOURCES
907 list(APPEND VNET_MULTIARCH_SOURCES
911 list(APPEND VNET_HEADERS
915 list(APPEND VNET_API_FILES span/span.api)
917 ##############################################################################
919 ##############################################################################
921 list(APPEND VNET_SOURCES
931 list(APPEND VNET_HEADERS
936 list(APPEND VNET_API_FILES pg/pg.api)
938 ##############################################################################
940 ##############################################################################
942 list(APPEND VNET_SOURCES
944 devices/virtio/device.c
945 devices/virtio/format.c
946 devices/virtio/node.c
948 devices/virtio/virtio.c
949 devices/virtio/virtio_api.c
950 devices/virtio/virtio_pci_legacy.c
951 devices/virtio/virtio_pci_modern.c
952 devices/virtio/virtio_pre_input.c
953 devices/virtio/virtio_types_api.c
956 list(APPEND VNET_HEADERS
958 devices/virtio/virtio.h
959 devices/virtio/virtio_buffering.h
960 devices/virtio/virtio_std.h
961 devices/virtio/virtio_pci_legacy.h
962 devices/virtio/virtio_pci_modern.h
963 devices/virtio/vhost_std.h
964 devices/virtio/virtio_types_api.h
967 list(APPEND VNET_MULTIARCH_SOURCES
968 devices/virtio/node.c
969 devices/virtio/device.c
972 list(APPEND VNET_API_FILES
973 devices/virtio/virtio.api
974 devices/virtio/virtio_types.api
977 ##############################################################################
978 # tap interface (with virtio backend)
979 ##############################################################################
981 list(APPEND VNET_SOURCES
984 devices/tap/tapv2_api.c
987 list(APPEND VNET_HEADERS
991 list(APPEND VNET_API_FILES
992 devices/tap/tapv2.api
995 ##############################################################################
996 # tap interface (with virtio backend)
997 ##############################################################################
999 list(APPEND VNET_SOURCES
1000 devices/pipe/pipe_api.c
1004 list(APPEND VNET_HEADERS
1008 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1010 ##############################################################################
1011 # session managmeent
1012 ##############################################################################
1014 list(APPEND VNET_SOURCES
1016 session/session_debug.c
1017 session/session_table.c
1018 session/session_rules_table.c
1019 session/session_lookup.c
1020 session/session_node.c
1021 session/session_input.c
1023 session/application.c
1024 session/application_worker.c
1025 session/session_cli.c
1026 session/application_interface.c
1027 session/application_local.c
1028 session/application_namespace.c
1029 session/segment_manager.c
1030 session/session_api.c
1033 list(APPEND VNET_HEADERS
1035 session/session_table.h
1036 session/session_rules_table.h
1037 session/session_types.h
1038 session/session_lookup.h
1039 session/application.h
1041 session/transport_types.h
1042 session/application_interface.h
1043 session/application_local.h
1044 session/application_namespace.h
1045 session/session_debug.h
1046 session/segment_manager.h
1047 session/mma_template.h
1048 session/mma_template.c
1053 list(APPEND VNET_API_FILES session/session.api)
1055 ##############################################################################
1057 ##############################################################################
1059 list(APPEND VNET_SOURCES
1063 list(APPEND VNET_HEADERS
1069 ##############################################################################
1070 # Driver feature graph arc support
1071 ##############################################################################
1073 list(APPEND VNET_SOURCES
1075 feature/feature_api.c
1076 feature/registration.c
1079 list(APPEND VNET_HEADERS
1083 list(APPEND VNET_API_FILES feature/feature.api)
1085 ##############################################################################
1086 # Unix kernel related
1087 ##############################################################################
1089 # FIXME: unix/hgshm.c
1091 list(APPEND VNET_SOURCES
1096 list(APPEND VNET_HEADERS
1100 ##############################################################################
1102 ##############################################################################
1104 list(APPEND VNET_SOURCES
1119 fib/fib_entry_src_adj.c
1120 fib/fib_entry_src_api.c
1121 fib/fib_entry_src_drop.c
1122 fib/fib_entry_src_interface.c
1123 fib/fib_entry_src_interpose.c
1124 fib/fib_entry_src_lisp.c
1125 fib/fib_entry_src_mpls.c
1126 fib/fib_entry_src_simple.c
1127 fib/fib_entry_src_rr.c
1128 fib/fib_entry_cover.c
1129 fib/fib_entry_delegate.c
1130 fib/fib_entry_track.c
1137 fib/fib_attached_export.c
1142 list(APPEND VNET_HEADERS
1145 fib/fib_entry_track.h
1156 fib/fib_entry_delegate.h
1163 list(APPEND VNET_API_FILES
1168 ##############################################################################
1170 ##############################################################################
1172 list(APPEND VNET_SOURCES
1176 adj/adj_midchain_node.c
1177 adj/adj_midchain_delegate.c
1187 list(APPEND VNET_MULTIARCH_SOURCES
1190 adj/adj_midchain_node.c
1193 list(APPEND VNET_HEADERS
1203 ##############################################################################
1204 # Data-Plane Objects
1205 ##############################################################################
1207 list(APPEND VNET_SOURCES
1215 dpo/load_balance_map.c
1219 dpo/interface_rx_dpo.c
1220 dpo/interface_tx_dpo.c
1221 dpo/mpls_disposition.c
1222 dpo/mpls_label_dpo.c
1228 list(APPEND VNET_MULTIARCH_SOURCES
1230 dpo/mpls_disposition.c
1232 dpo/mpls_label_dpo.c
1233 dpo/interface_rx_dpo.c
1236 list(APPEND VNET_HEADERS
1238 dpo/load_balance_map.h
1249 ##############################################################################
1251 ##############################################################################
1253 list(APPEND VNET_SOURCES
1263 mfib/mfib_entry_cover.c
1264 mfib/mfib_entry_delegate.c
1265 mfib/mfib_entry_src.c
1266 mfib/mfib_entry_src_rr.c
1270 list(APPEND VNET_MULTIARCH_SOURCES
1274 list(APPEND VNET_HEADERS
1280 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1282 ##############################################################################
1284 ##############################################################################
1286 list(APPEND VNET_SOURCES
1292 list(APPEND VNET_HEADERS
1296 ##############################################################################
1298 ##############################################################################
1300 list(APPEND VNET_SOURCES
1303 qos/qos_egress_map.c
1305 qos/qos_record_node.c
1307 qos/qos_store_node.c
1312 list(APPEND VNET_MULTIARCH_SOURCES
1313 qos/qos_record_node.c
1317 list(APPEND VNET_API_FILES qos/qos.api)
1319 ##############################################################################
1321 ##############################################################################
1323 list(APPEND VNET_SOURCES
1324 bier/bier_bit_string.c
1327 bier/bier_fmask_db.c
1336 bier/bier_imp_node.c
1338 bier/bier_disp_entry.c
1339 bier/bier_disp_lookup_node.c
1340 bier/bier_disp_dispatch_node.c
1341 bier/bier_disp_table.c
1342 bier/bier_bift_table.c
1345 list(APPEND VNET_MULTIARCH_SOURCES
1346 bier/bier_disp_dispatch_node.c
1347 bier/bier_disp_lookup_node.c
1348 bier/bier_imp_node.c
1351 list(APPEND VNET_HEADERS
1352 bier/bier_bit_string.h
1355 bier/bier_hdr_inlines.h
1361 list(APPEND VNET_API_FILES bier/bier.api)
1363 ##############################################################################
1365 ##############################################################################
1367 list (APPEND VNET_SOURCES
1373 list(APPEND VNET_HEADERS
1378 list(APPEND VNET_API_FILES syslog/syslog.api)
1380 ##############################################################################
1381 # Tunnel Endpoint Information Base
1382 ##############################################################################
1384 list (APPEND VNET_SOURCES
1390 list(APPEND VNET_HEADERS
1394 list(APPEND VNET_API_FILES teib/teib.api)
1396 ##############################################################################
1398 ##############################################################################
1400 list (APPEND VNET_SOURCES
1406 list(APPEND VNET_HEADERS
1410 list(APPEND VNET_API_FILES arp/arp.api)
1412 list (APPEND VNET_SOURCES
1416 ip6-nd/ip6_nd_proxy.c
1417 ip6-nd/ip6_nd_mirror_proxy.c
1423 list(APPEND VNET_HEADERS
1427 list(APPEND VNET_API_FILES
1432 ##############################################################################
1434 ##############################################################################
1436 add_vpp_library(vnet
1437 SOURCES ${VNET_SOURCES}
1438 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1439 INSTALL_HEADERS ${VNET_HEADERS}
1440 API_FILES ${VNET_API_FILES}
1441 LINK_LIBRARIES vppinfra svm vlib
1442 DEPENDS vpp_version_h api_headers
1445 ##############################################################################
1446 # vpp api test client library
1447 ##############################################################################
1449 add_vpp_library (vatclient
1450 SOURCES ip/ip_types_api.c
1454 add_vat_test_library(vnet
1458 ip6-nd/ip6_nd_test.c
1459 srmpls/sr_mpls_test.c
1460 session/session_test.c
1465 ##############################################################################
1467 ##############################################################################
1468 add_vpp_test_library(vnet
1472 ##############################################################################