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
1022 session/application.c
1023 session/application_worker.c
1024 session/session_cli.c
1025 session/application_interface.c
1026 session/application_local.c
1027 session/application_namespace.c
1028 session/segment_manager.c
1029 session/session_api.c
1032 list(APPEND VNET_HEADERS
1034 session/session_table.h
1035 session/session_rules_table.h
1036 session/session_types.h
1037 session/session_lookup.h
1038 session/application.h
1040 session/transport_types.h
1041 session/application_interface.h
1042 session/application_local.h
1043 session/application_namespace.h
1044 session/session_debug.h
1045 session/segment_manager.h
1046 session/mma_template.h
1047 session/mma_template.c
1052 list(APPEND VNET_API_FILES session/session.api)
1054 ##############################################################################
1056 ##############################################################################
1058 list(APPEND VNET_SOURCES
1062 list(APPEND VNET_HEADERS
1068 ##############################################################################
1069 # Driver feature graph arc support
1070 ##############################################################################
1072 list(APPEND VNET_SOURCES
1074 feature/feature_api.c
1075 feature/registration.c
1078 list(APPEND VNET_HEADERS
1082 list(APPEND VNET_API_FILES feature/feature.api)
1084 ##############################################################################
1085 # Unix kernel related
1086 ##############################################################################
1088 # FIXME: unix/hgshm.c
1090 list(APPEND VNET_SOURCES
1095 list(APPEND VNET_HEADERS
1099 ##############################################################################
1101 ##############################################################################
1103 list(APPEND VNET_SOURCES
1118 fib/fib_entry_src_adj.c
1119 fib/fib_entry_src_api.c
1120 fib/fib_entry_src_drop.c
1121 fib/fib_entry_src_interface.c
1122 fib/fib_entry_src_interpose.c
1123 fib/fib_entry_src_lisp.c
1124 fib/fib_entry_src_mpls.c
1125 fib/fib_entry_src_simple.c
1126 fib/fib_entry_src_rr.c
1127 fib/fib_entry_cover.c
1128 fib/fib_entry_delegate.c
1129 fib/fib_entry_track.c
1136 fib/fib_attached_export.c
1141 list(APPEND VNET_HEADERS
1144 fib/fib_entry_track.h
1155 fib/fib_entry_delegate.h
1162 list(APPEND VNET_API_FILES
1167 ##############################################################################
1169 ##############################################################################
1171 list(APPEND VNET_SOURCES
1175 adj/adj_midchain_node.c
1176 adj/adj_midchain_delegate.c
1186 list(APPEND VNET_MULTIARCH_SOURCES
1189 adj/adj_midchain_node.c
1192 list(APPEND VNET_HEADERS
1202 ##############################################################################
1203 # Data-Plane Objects
1204 ##############################################################################
1206 list(APPEND VNET_SOURCES
1214 dpo/load_balance_map.c
1218 dpo/interface_rx_dpo.c
1219 dpo/interface_tx_dpo.c
1220 dpo/mpls_disposition.c
1221 dpo/mpls_label_dpo.c
1227 list(APPEND VNET_MULTIARCH_SOURCES
1229 dpo/mpls_disposition.c
1231 dpo/mpls_label_dpo.c
1232 dpo/interface_rx_dpo.c
1235 list(APPEND VNET_HEADERS
1237 dpo/load_balance_map.h
1248 ##############################################################################
1250 ##############################################################################
1252 list(APPEND VNET_SOURCES
1262 mfib/mfib_entry_cover.c
1263 mfib/mfib_entry_delegate.c
1264 mfib/mfib_entry_src.c
1265 mfib/mfib_entry_src_rr.c
1269 list(APPEND VNET_MULTIARCH_SOURCES
1273 list(APPEND VNET_HEADERS
1279 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1281 ##############################################################################
1283 ##############################################################################
1285 list(APPEND VNET_SOURCES
1291 list(APPEND VNET_HEADERS
1295 ##############################################################################
1297 ##############################################################################
1299 list(APPEND VNET_SOURCES
1302 qos/qos_egress_map.c
1304 qos/qos_record_node.c
1306 qos/qos_store_node.c
1311 list(APPEND VNET_MULTIARCH_SOURCES
1312 qos/qos_record_node.c
1316 list(APPEND VNET_API_FILES qos/qos.api)
1318 ##############################################################################
1320 ##############################################################################
1322 list(APPEND VNET_SOURCES
1323 bier/bier_bit_string.c
1326 bier/bier_fmask_db.c
1335 bier/bier_imp_node.c
1337 bier/bier_disp_entry.c
1338 bier/bier_disp_lookup_node.c
1339 bier/bier_disp_dispatch_node.c
1340 bier/bier_disp_table.c
1341 bier/bier_bift_table.c
1344 list(APPEND VNET_MULTIARCH_SOURCES
1345 bier/bier_disp_dispatch_node.c
1346 bier/bier_disp_lookup_node.c
1347 bier/bier_imp_node.c
1350 list(APPEND VNET_HEADERS
1351 bier/bier_bit_string.h
1354 bier/bier_hdr_inlines.h
1360 list(APPEND VNET_API_FILES bier/bier.api)
1362 ##############################################################################
1364 ##############################################################################
1366 list (APPEND VNET_SOURCES
1372 list(APPEND VNET_HEADERS
1377 list(APPEND VNET_API_FILES syslog/syslog.api)
1379 ##############################################################################
1380 # Tunnel Endpoint Information Base
1381 ##############################################################################
1383 list (APPEND VNET_SOURCES
1389 list(APPEND VNET_HEADERS
1393 list(APPEND VNET_API_FILES teib/teib.api)
1395 ##############################################################################
1397 ##############################################################################
1399 list (APPEND VNET_SOURCES
1405 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 srmpls/sr_mpls_test.c
1459 session/session_test.c
1464 ##############################################################################
1466 ##############################################################################
1467 add_vpp_test_library(vnet
1471 ##############################################################################