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
60 interface/rx_queue_funcs.h
61 interface/tx_queue_funcs.h
77 ethernet/ethernet_format_fns.h
78 ethernet/ethernet_types_api.h
81 list(APPEND VNET_API_FILES
89 ##############################################################################
91 ##############################################################################
92 list(APPEND VNET_SOURCES
99 list(APPEND VNET_MULTIARCH_SOURCES
103 list(APPEND VNET_HEADERS
109 list(APPEND VNET_API_FILES
111 policer/policer_types.api
114 ##############################################################################
115 # Layer 2 protocols go here
116 ##############################################################################
118 ##############################################################################
119 # Layer 2 protocol: Ethernet
120 ##############################################################################
121 list(APPEND VNET_SOURCES
122 ethernet/arp_packet.c
123 ethernet/ethernet_types_api.c
127 ethernet/mac_address.c
131 ethernet/p2p_ethernet.c
132 ethernet/p2p_ethernet_input.c
133 ethernet/p2p_ethernet_api.c
136 list(APPEND VNET_MULTIARCH_SOURCES
138 ethernet/p2p_ethernet_input.c
141 list(APPEND VNET_HEADERS
144 ethernet/mac_address.h
148 ethernet/p2p_ethernet.h
149 ethernet/arp_packet.h
152 list(APPEND VNET_API_FILES
153 ethernet/p2p_ethernet.api
154 ethernet/ethernet_types.api)
156 ##############################################################################
157 # Layer 2 protocol: Ethernet bridging
158 ##############################################################################
159 list(APPEND VNET_SOURCES
166 l2/l2_input_classify.c
167 l2/l2_output_classify.c
178 l2/l2_in_out_feat_arc.c
186 list(APPEND VNET_MULTIARCH_SOURCES
192 l2/l2_in_out_feat_arc.c
193 l2/l2_input_classify.c
195 l2/l2_output_classify.c
205 list(APPEND VNET_HEADERS
222 list(APPEND VNET_API_FILES l2/l2.api)
224 ##############################################################################
225 # Layer 2 protocol: SRP
226 ##############################################################################
227 list(APPEND VNET_SOURCES
234 list(APPEND VNET_HEADERS
239 ##############################################################################
240 # Layer 2 protocol: PPP
241 ##############################################################################
242 list(APPEND VNET_SOURCES
248 list(APPEND VNET_HEADERS
254 ##############################################################################
255 # Layer 2 protocol: HDLC
256 ##############################################################################
257 list(APPEND VNET_SOURCES
263 list(APPEND VNET_HEADERS
269 ##############################################################################
270 # Layer 2 protocol: LLC
271 ##############################################################################
272 list(APPEND VNET_SOURCES
278 list(APPEND VNET_HEADERS
282 ##############################################################################
283 # Layer 2 protocol: SNAP
284 ##############################################################################
285 list(APPEND VNET_SOURCES
291 list(APPEND VNET_HEADERS
295 ##############################################################################
297 ##############################################################################
298 list(APPEND VNET_SOURCES
305 list(APPEND VNET_MULTIARCH_SOURCES
309 list(APPEND VNET_HEADERS
312 vxlan/vxlan_error.def
315 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
317 list(APPEND VNET_API_FILES vxlan/vxlan.api)
319 ##############################################################################
321 ##############################################################################
322 list(APPEND VNET_SOURCES
329 list(APPEND VNET_HEADERS
333 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
334 list(APPEND VNET_API_FILES bonding/bond.api)
336 ##############################################################################
337 # Layer 2/3 "classify"
338 ##############################################################################
339 list(APPEND VNET_SOURCES
340 classify/vnet_classify.c
341 classify/trace_classify.h
342 classify/ip_classify.c
343 classify/in_out_acl.c
344 classify/policer_classify.c
345 classify/flow_classify.c
346 classify/flow_classify_node.c
347 classify/vnet_classify.h
348 classify/classify_api.c
351 list(APPEND VNET_MULTIARCH_SOURCES
352 classify/ip_classify.c
353 classify/flow_classify_node.c
356 list(APPEND VNET_HEADERS
357 classify/vnet_classify.h
358 classify/trace_classify.h
359 classify/in_out_acl.h
360 classify/policer_classify.h
361 classify/flow_classify.h
364 list(APPEND VNET_API_FILES classify/classify.api)
366 ##############################################################################
367 # Layer 3 protocols go here
368 ##############################################################################
370 ##############################################################################
371 # Layer 3 protocol: IP v4/v6
372 ##############################################################################
373 list(APPEND VNET_SOURCES
387 ip/ip4_source_and_port_range_check.c
388 ip/reass/ip4_full_reass.c
389 ip/reass/ip4_sv_reass.c
399 ip/reass/ip6_full_reass.c
400 ip/reass/ip6_sv_reass.c
403 ip/ip_container_proxy.c
410 ip/ip_path_mtu_node.c
421 list(APPEND VNET_MULTIARCH_SOURCES
423 ip/reass/ip4_full_reass.c
425 ip/reass/ip6_full_reass.c
426 ip/reass/ip4_sv_reass.c
428 ip/reass/ip6_full_reass.c
429 ip/reass/ip6_sv_reass.c
434 ip/ip_path_mtu_node.c
437 list(APPEND VNET_HEADERS
452 ip/ip6_hop_by_hop_packet.h
456 ip/ip_container_proxy.h
462 ip/ip_source_and_port_range_check.h
471 list(APPEND VNET_API_FILES
476 list(APPEND VNET_MULTIARCH_SOURCES
482 ##############################################################################
484 ##############################################################################
485 list(APPEND VNET_SOURCES
486 ip-neighbor/ip_neighbor.c
487 ip-neighbor/ip_neighbor_api.c
488 ip-neighbor/ip_neighbor_dp.c
489 ip-neighbor/ip_neighbor_types.c
490 ip-neighbor/ip_neighbor_watch.c
491 ip-neighbor/ip4_neighbor.c
492 ip-neighbor/ip6_neighbor.c
495 list(APPEND VNET_HEADERS
496 ip-neighbor/ip_neighbor.h
497 ip-neighbor/ip_neighbor_types.h
500 list(APPEND VNET_API_FILES
501 ip-neighbor/ip_neighbor.api
504 ##############################################################################
505 # Bidirectional Forwarding Detection
506 ##############################################################################
508 list(APPEND VNET_HEADERS
515 list(APPEND VNET_SOURCES
524 list(APPEND VNET_API_FILES bfd/bfd.api)
526 ##############################################################################
528 ##############################################################################
530 list(APPEND VNET_SOURCES
538 list(APPEND VNET_HEADERS
542 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
544 list(APPEND VNET_API_FILES crypto/crypto.api)
546 ##############################################################################
547 # Layer 3 protocol: IPSec
548 ##############################################################################
549 list(APPEND VNET_SOURCES
553 ipsec/ipsec_handoff.c
559 ipsec/ipsec_spd_policy.c
568 ipsec/ipsec_types_api.c
571 list(APPEND VNET_MULTIARCH_SOURCES
576 ipsec/ipsec_handoff.c
582 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
583 list(APPEND VNET_API_FILES ipsec/ipsec.api)
585 list(APPEND VNET_SOURCES
589 list(APPEND VNET_HEADERS
592 ipsec/ipsec_spd_policy.h
595 ipsec/ipsec_types_api.h
601 ##############################################################################
602 # Layer 3 protocol: osi
603 ##############################################################################
604 list(APPEND VNET_SOURCES
610 list(APPEND VNET_HEADERS
614 ##############################################################################
615 # Layer 4 protocol: tcp
616 ##############################################################################
617 list(APPEND VNET_SOURCES
621 tcp/tcp_syn_filter4.c
634 list(APPEND VNET_MULTIARCH_SOURCES
637 tcp/tcp_syn_filter4.c
640 list(APPEND VNET_HEADERS
653 list(APPEND VNET_API_FILES tcp/tcp.api)
655 ##############################################################################
656 # Layer 4 protocol: udp
657 ##############################################################################
658 list(APPEND VNET_SOURCES
671 list(APPEND VNET_MULTIARCH_SOURCES
676 list(APPEND VNET_HEADERS
684 list(APPEND VNET_API_FILES udp/udp.api)
686 ##############################################################################
687 # Tunnel protocol: gre
688 ##############################################################################
689 list(APPEND VNET_SOURCES
697 list(APPEND VNET_MULTIARCH_SOURCES
702 list(APPEND VNET_HEADERS
708 list(APPEND VNET_API_FILES gre/gre.api)
710 ##############################################################################
711 # Tunnel protocol: ipip
712 ##############################################################################
713 list(APPEND VNET_SOURCES
721 list(APPEND VNET_MULTIARCH_SOURCES
725 list(APPEND VNET_HEADERS
729 list(APPEND VNET_API_FILES
733 ##############################################################################
735 ##############################################################################
736 list(APPEND VNET_SOURCES
738 tunnel/tunnel_types_api.c
741 list(APPEND VNET_API_FILES
742 tunnel/tunnel_types.api
745 list(APPEND VNET_HEADERS
750 ##############################################################################
751 # Tunnel protocol: gre+mpls
752 ##############################################################################
753 list(APPEND VNET_SOURCES
765 list(APPEND VNET_MULTIARCH_SOURCES
772 list(APPEND VNET_HEADERS
780 list(APPEND VNET_API_FILES mpls/mpls.api)
782 ##############################################################################
783 # Tunnel protocol: vxlan-gbp
784 ##############################################################################
785 list(APPEND VNET_SOURCES
788 vxlan-gbp/vxlan_gbp_api.c
789 vxlan-gbp/vxlan_gbp.c
790 vxlan-gbp/vxlan_gbp_packet.c
793 list (APPEND VNET_MULTIARCH_SOURCES
798 list(APPEND VNET_HEADERS
799 vxlan-gbp/vxlan_gbp.h
800 vxlan-gbp/vxlan_gbp_packet.h
801 vxlan-gbp/vxlan_gbp_error.def
804 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
806 ##############################################################################
807 # Tunnel protocol: vxlan-gpe
808 ##############################################################################
810 list(APPEND VNET_SOURCES
811 vxlan-gpe/vxlan_gpe.c
814 vxlan-gpe/vxlan_gpe_api.c
817 list (APPEND VNET_MULTIARCH_SOURCES
821 list(APPEND VNET_HEADERS
822 vxlan-gpe/vxlan_gpe.h
823 vxlan-gpe/vxlan_gpe_packet.h
824 vxlan-gpe/vxlan_gpe_error.def
827 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
829 ##############################################################################
830 # ipv6 segment routing
831 ##############################################################################
833 list(APPEND VNET_SOURCES
836 srv6/sr_policy_rewrite.c
841 list(APPEND VNET_HEADERS
846 list(APPEND VNET_API_FILES
851 ##############################################################################
852 # mpls segment routing
853 ##############################################################################
855 list(APPEND VNET_SOURCES
856 srmpls/sr_mpls_policy.c
857 srmpls/sr_mpls_steering.c
861 list(APPEND VNET_HEADERS
865 list(APPEND VNET_API_FILES
869 ##############################################################################
870 # IPFIX / netflow v10
871 ##############################################################################
872 list(APPEND VNET_SOURCES
873 ipfix-export/flow_report.c
874 ipfix-export/flow_api.c
877 list(APPEND VNET_HEADERS
878 ipfix-export/flow_report.h
879 ipfix-export/ipfix_info_elements.h
880 ipfix-export/ipfix_packet.h
883 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
885 ##############################################################################
887 ##############################################################################
888 list(APPEND VNET_SOURCES
894 list(APPEND VNET_HEADERS
898 ##############################################################################
900 ##############################################################################
901 list(APPEND VNET_SOURCES
908 list(APPEND VNET_HEADERS
911 gso/hdr_offset_parser.h
915 list(APPEND VNET_API_FILES
919 ##############################################################################
920 # IPFIX classify code
921 ##############################################################################
923 list(APPEND VNET_SOURCES
924 ipfix-export/flow_report_classify.c
927 list(APPEND VNET_HEADERS
928 ipfix-export/flow_report_classify.h
931 ##############################################################################
933 ##############################################################################
935 list(APPEND VNET_SOURCES
936 lawful-intercept/lawful_intercept.c
937 lawful-intercept/node.c
940 list(APPEND VNET_MULTIARCH_SOURCES
941 lawful-intercept/node.c
944 list(APPEND VNET_HEADERS
945 lawful-intercept/lawful_intercept.h
948 ##############################################################################
949 # SPAN (port mirroring)
950 ##############################################################################
952 list(APPEND VNET_SOURCES
958 list(APPEND VNET_MULTIARCH_SOURCES
962 list(APPEND VNET_HEADERS
966 list(APPEND VNET_API_FILES span/span.api)
968 ##############################################################################
970 ##############################################################################
972 list(APPEND VNET_SOURCES
982 list(APPEND VNET_HEADERS
987 list(APPEND VNET_API_FILES pg/pg.api)
989 ##############################################################################
991 ##############################################################################
993 list(APPEND VNET_SOURCES
995 devices/virtio/device.c
996 devices/virtio/format.c
997 devices/virtio/node.c
999 devices/virtio/vhost_user.c
1000 devices/virtio/vhost_user_input.c
1001 devices/virtio/vhost_user_output.c
1002 devices/virtio/vhost_user_api.c
1003 devices/virtio/virtio.c
1004 devices/virtio/virtio_api.c
1005 devices/virtio/virtio_pci_legacy.c
1006 devices/virtio/virtio_pci_modern.c
1007 devices/virtio/virtio_process.c
1008 devices/virtio/virtio_types_api.c
1011 list(APPEND VNET_HEADERS
1012 devices/virtio/pci.h
1013 devices/virtio/virtio.h
1014 devices/virtio/virtio_buffering.h
1015 devices/virtio/virtio_std.h
1016 devices/virtio/virtio_pci_legacy.h
1017 devices/virtio/virtio_pci_modern.h
1018 devices/virtio/vhost_std.h
1019 devices/virtio/vhost_user.h
1020 devices/virtio/virtio_types_api.h
1023 list(APPEND VNET_MULTIARCH_SOURCES
1024 devices/virtio/vhost_user_input.c
1025 devices/virtio/vhost_user_output.c
1026 devices/virtio/node.c
1027 devices/af_packet/node.c
1028 devices/virtio/device.c
1031 list(APPEND VNET_API_FILES
1032 devices/virtio/vhost_user.api
1033 devices/virtio/virtio.api
1034 devices/virtio/virtio_types.api
1037 ##############################################################################
1038 # tap interface (with virtio backend)
1039 ##############################################################################
1041 list(APPEND VNET_SOURCES
1044 devices/tap/tapv2_api.c
1047 list(APPEND VNET_HEADERS
1051 list(APPEND VNET_API_FILES
1052 devices/tap/tapv2.api
1055 ##############################################################################
1056 # tap interface (with virtio backend)
1057 ##############################################################################
1059 list(APPEND VNET_SOURCES
1060 devices/pipe/pipe_api.c
1064 list(APPEND VNET_HEADERS
1068 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1070 ##############################################################################
1071 # session managmeent
1072 ##############################################################################
1074 list(APPEND VNET_SOURCES
1076 session/session_debug.c
1077 session/session_table.c
1078 session/session_rules_table.c
1079 session/session_lookup.c
1080 session/session_node.c
1082 session/application.c
1083 session/application_worker.c
1084 session/session_cli.c
1085 session/application_interface.c
1086 session/application_local.c
1087 session/application_namespace.c
1088 session/segment_manager.c
1089 session/session_api.c
1092 list(APPEND VNET_HEADERS
1094 session/session_table.h
1095 session/session_rules_table.h
1096 session/session_types.h
1097 session/session_lookup.h
1098 session/application.h
1100 session/transport_types.h
1101 session/application_interface.h
1102 session/application_local.h
1103 session/application_namespace.h
1104 session/session_debug.h
1105 session/segment_manager.h
1106 session/mma_template.h
1107 session/mma_template.c
1112 list(APPEND VNET_API_FILES session/session.api)
1114 ##############################################################################
1116 ##############################################################################
1118 list(APPEND VNET_SOURCES
1122 list(APPEND VNET_HEADERS
1127 ##############################################################################
1128 # Linux packet interface
1129 ##############################################################################
1131 list(APPEND VNET_SOURCES
1132 devices/af_packet/af_packet.c
1133 devices/af_packet/device.c
1134 devices/af_packet/node.c
1135 devices/af_packet/cli.c
1136 devices/af_packet/af_packet_api.c
1139 list(APPEND VNET_MULTIARCH_SOURCES
1140 devices/af_packet/device.c
1143 list(APPEND VNET_HEADERS
1144 devices/af_packet/af_packet.h
1147 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1149 ##############################################################################
1150 # Driver feature graph arc support
1151 ##############################################################################
1153 list(APPEND VNET_SOURCES
1155 feature/feature_api.c
1156 feature/registration.c
1159 list(APPEND VNET_HEADERS
1163 list(APPEND VNET_API_FILES feature/feature.api)
1165 ##############################################################################
1166 # Unix kernel related
1167 ##############################################################################
1169 # FIXME: unix/hgshm.c
1171 list(APPEND VNET_SOURCES
1176 list(APPEND VNET_HEADERS
1180 ##############################################################################
1182 ##############################################################################
1184 list(APPEND VNET_SOURCES
1199 fib/fib_entry_src_adj.c
1200 fib/fib_entry_src_api.c
1201 fib/fib_entry_src_drop.c
1202 fib/fib_entry_src_interface.c
1203 fib/fib_entry_src_interpose.c
1204 fib/fib_entry_src_lisp.c
1205 fib/fib_entry_src_mpls.c
1206 fib/fib_entry_src_simple.c
1207 fib/fib_entry_src_rr.c
1208 fib/fib_entry_cover.c
1209 fib/fib_entry_delegate.c
1210 fib/fib_entry_track.c
1217 fib/fib_attached_export.c
1222 list(APPEND VNET_HEADERS
1232 fib/fib_entry_delegate.h
1237 list(APPEND VNET_API_FILES
1242 ##############################################################################
1244 ##############################################################################
1246 list(APPEND VNET_SOURCES
1250 adj/adj_midchain_node.c
1251 adj/adj_midchain_delegate.c
1261 list(APPEND VNET_MULTIARCH_SOURCES
1264 adj/adj_midchain_node.c
1267 list(APPEND VNET_HEADERS
1277 ##############################################################################
1278 # Data-Plane Objects
1279 ##############################################################################
1281 list(APPEND VNET_SOURCES
1289 dpo/load_balance_map.c
1293 dpo/interface_rx_dpo.c
1294 dpo/interface_tx_dpo.c
1295 dpo/mpls_disposition.c
1296 dpo/mpls_label_dpo.c
1302 list(APPEND VNET_MULTIARCH_SOURCES
1304 dpo/mpls_disposition.c
1306 dpo/mpls_label_dpo.c
1307 dpo/interface_rx_dpo.c
1310 list(APPEND VNET_HEADERS
1322 ##############################################################################
1324 ##############################################################################
1326 list(APPEND VNET_SOURCES
1336 mfib/mfib_entry_cover.c
1337 mfib/mfib_entry_delegate.c
1338 mfib/mfib_entry_src.c
1339 mfib/mfib_entry_src_rr.c
1343 list(APPEND VNET_MULTIARCH_SOURCES
1347 list(APPEND VNET_HEADERS
1353 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1355 ##############################################################################
1357 ##############################################################################
1359 list(APPEND VNET_SOURCES
1365 list(APPEND VNET_HEADERS
1369 ##############################################################################
1371 ##############################################################################
1373 list(APPEND VNET_SOURCES
1376 qos/qos_egress_map.c
1378 qos/qos_record_node.c
1380 qos/qos_store_node.c
1385 list(APPEND VNET_MULTIARCH_SOURCES
1386 qos/qos_record_node.c
1390 list(APPEND VNET_API_FILES qos/qos.api)
1392 ##############################################################################
1394 ##############################################################################
1396 list(APPEND VNET_SOURCES
1397 bier/bier_bit_string.c
1400 bier/bier_fmask_db.c
1409 bier/bier_imp_node.c
1411 bier/bier_disp_entry.c
1412 bier/bier_disp_lookup_node.c
1413 bier/bier_disp_dispatch_node.c
1414 bier/bier_disp_table.c
1415 bier/bier_bift_table.c
1418 list(APPEND VNET_MULTIARCH_SOURCES
1419 bier/bier_disp_dispatch_node.c
1420 bier/bier_disp_lookup_node.c
1421 bier/bier_imp_node.c
1424 list(APPEND VNET_HEADERS
1431 list(APPEND VNET_API_FILES bier/bier.api)
1433 ##############################################################################
1435 ##############################################################################
1437 list (APPEND VNET_SOURCES
1443 list(APPEND VNET_HEADERS
1448 list(APPEND VNET_API_FILES syslog/syslog.api)
1450 ##############################################################################
1451 # Tunnel Endpoint Information Base
1452 ##############################################################################
1454 list (APPEND VNET_SOURCES
1460 list(APPEND VNET_HEADERS
1464 list(APPEND VNET_API_FILES teib/teib.api)
1466 ##############################################################################
1468 ##############################################################################
1470 list (APPEND VNET_SOURCES
1476 list(APPEND VNET_HEADERS
1480 list(APPEND VNET_API_FILES arp/arp.api)
1482 list (APPEND VNET_SOURCES
1486 ip6-nd/ip6_nd_proxy.c
1487 ip6-nd/ip6_nd_mirror_proxy.c
1493 list(APPEND VNET_HEADERS
1497 list(APPEND VNET_API_FILES
1502 ##############################################################################
1504 ##############################################################################
1506 add_vpp_library(vnet
1507 SOURCES ${VNET_SOURCES}
1508 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1509 INSTALL_HEADERS ${VNET_HEADERS}
1510 API_FILES ${VNET_API_FILES}
1511 LINK_LIBRARIES vppinfra svm vlib
1512 DEPENDS vpp_version_h api_headers
1515 ##############################################################################
1516 # vpp api test client library
1517 ##############################################################################
1519 add_vpp_library (vatclient
1520 SOURCES ip/ip_types_api.c
1524 add_vat_test_library(vnet
1528 ip6-nd/ip6_nd_test.c
1529 srmpls/sr_mpls_test.c
1530 session/session_test.c
1535 ##############################################################################
1537 ##############################################################################
1538 add_vpp_test_library(vnet
1542 ##############################################################################