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
46 list(APPEND VNET_MULTIARCH_SOURCES
52 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-gpe
784 ##############################################################################
786 list(APPEND VNET_SOURCES
787 vxlan-gpe/vxlan_gpe.c
790 vxlan-gpe/vxlan_gpe_api.c
793 list (APPEND VNET_MULTIARCH_SOURCES
797 list(APPEND VNET_HEADERS
798 vxlan-gpe/vxlan_gpe.h
799 vxlan-gpe/vxlan_gpe_packet.h
800 vxlan-gpe/vxlan_gpe_error.def
803 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
805 ##############################################################################
806 # ipv6 segment routing
807 ##############################################################################
809 list(APPEND VNET_SOURCES
812 srv6/sr_policy_rewrite.c
817 list(APPEND VNET_HEADERS
822 list(APPEND VNET_API_FILES
827 ##############################################################################
828 # mpls segment routing
829 ##############################################################################
831 list(APPEND VNET_SOURCES
832 srmpls/sr_mpls_policy.c
833 srmpls/sr_mpls_steering.c
837 list(APPEND VNET_HEADERS
841 list(APPEND VNET_API_FILES
845 ##############################################################################
846 # IPFIX / netflow v10
847 ##############################################################################
848 list(APPEND VNET_SOURCES
849 ipfix-export/flow_report.c
850 ipfix-export/flow_api.c
853 list(APPEND VNET_HEADERS
854 ipfix-export/flow_report.h
855 ipfix-export/ipfix_info_elements.h
856 ipfix-export/ipfix_packet.h
859 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
861 ##############################################################################
863 ##############################################################################
864 list(APPEND VNET_SOURCES
871 list(APPEND VNET_HEADERS
875 ##############################################################################
877 ##############################################################################
878 list(APPEND VNET_SOURCES
885 list(APPEND VNET_HEADERS
888 gso/hdr_offset_parser.h
892 list(APPEND VNET_API_FILES
896 ##############################################################################
897 # IPFIX classify code
898 ##############################################################################
900 list(APPEND VNET_SOURCES
901 ipfix-export/flow_report_classify.c
904 list(APPEND VNET_HEADERS
905 ipfix-export/flow_report_classify.h
908 ##############################################################################
910 ##############################################################################
912 list(APPEND VNET_SOURCES
913 lawful-intercept/lawful_intercept.c
914 lawful-intercept/node.c
917 list(APPEND VNET_MULTIARCH_SOURCES
918 lawful-intercept/node.c
921 list(APPEND VNET_HEADERS
922 lawful-intercept/lawful_intercept.h
925 ##############################################################################
926 # SPAN (port mirroring)
927 ##############################################################################
929 list(APPEND VNET_SOURCES
935 list(APPEND VNET_MULTIARCH_SOURCES
939 list(APPEND VNET_HEADERS
943 list(APPEND VNET_API_FILES span/span.api)
945 ##############################################################################
947 ##############################################################################
949 list(APPEND VNET_SOURCES
959 list(APPEND VNET_HEADERS
964 list(APPEND VNET_API_FILES pg/pg.api)
966 ##############################################################################
968 ##############################################################################
970 list(APPEND VNET_SOURCES
972 devices/virtio/device.c
973 devices/virtio/format.c
974 devices/virtio/node.c
976 devices/virtio/vhost_user.c
977 devices/virtio/vhost_user_input.c
978 devices/virtio/vhost_user_output.c
979 devices/virtio/vhost_user_api.c
980 devices/virtio/virtio.c
981 devices/virtio/virtio_api.c
982 devices/virtio/virtio_pci_legacy.c
983 devices/virtio/virtio_pci_modern.c
984 devices/virtio/virtio_pre_input.c
985 devices/virtio/virtio_types_api.c
988 list(APPEND VNET_HEADERS
990 devices/virtio/virtio.h
991 devices/virtio/virtio_buffering.h
992 devices/virtio/virtio_std.h
993 devices/virtio/virtio_pci_legacy.h
994 devices/virtio/virtio_pci_modern.h
995 devices/virtio/vhost_std.h
996 devices/virtio/vhost_user.h
997 devices/virtio/virtio_types_api.h
1000 list(APPEND VNET_MULTIARCH_SOURCES
1001 devices/virtio/vhost_user_input.c
1002 devices/virtio/vhost_user_output.c
1003 devices/virtio/node.c
1004 devices/af_packet/node.c
1005 devices/virtio/device.c
1008 list(APPEND VNET_API_FILES
1009 devices/virtio/vhost_user.api
1010 devices/virtio/virtio.api
1011 devices/virtio/virtio_types.api
1014 ##############################################################################
1015 # tap interface (with virtio backend)
1016 ##############################################################################
1018 list(APPEND VNET_SOURCES
1021 devices/tap/tapv2_api.c
1024 list(APPEND VNET_HEADERS
1028 list(APPEND VNET_API_FILES
1029 devices/tap/tapv2.api
1032 ##############################################################################
1033 # tap interface (with virtio backend)
1034 ##############################################################################
1036 list(APPEND VNET_SOURCES
1037 devices/pipe/pipe_api.c
1041 list(APPEND VNET_HEADERS
1045 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1047 ##############################################################################
1048 # session managmeent
1049 ##############################################################################
1051 list(APPEND VNET_SOURCES
1053 session/session_debug.c
1054 session/session_table.c
1055 session/session_rules_table.c
1056 session/session_lookup.c
1057 session/session_node.c
1059 session/application.c
1060 session/application_worker.c
1061 session/session_cli.c
1062 session/application_interface.c
1063 session/application_local.c
1064 session/application_namespace.c
1065 session/segment_manager.c
1066 session/session_api.c
1069 list(APPEND VNET_HEADERS
1071 session/session_table.h
1072 session/session_rules_table.h
1073 session/session_types.h
1074 session/session_lookup.h
1075 session/application.h
1077 session/transport_types.h
1078 session/application_interface.h
1079 session/application_local.h
1080 session/application_namespace.h
1081 session/session_debug.h
1082 session/segment_manager.h
1083 session/mma_template.h
1084 session/mma_template.c
1089 list(APPEND VNET_API_FILES session/session.api)
1091 ##############################################################################
1093 ##############################################################################
1095 list(APPEND VNET_SOURCES
1099 list(APPEND VNET_HEADERS
1104 ##############################################################################
1105 # Linux packet interface
1106 ##############################################################################
1108 list(APPEND VNET_SOURCES
1109 devices/af_packet/af_packet.c
1110 devices/af_packet/device.c
1111 devices/af_packet/node.c
1112 devices/af_packet/cli.c
1113 devices/af_packet/af_packet_api.c
1116 list(APPEND VNET_MULTIARCH_SOURCES
1117 devices/af_packet/device.c
1120 list(APPEND VNET_HEADERS
1121 devices/af_packet/af_packet.h
1124 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1126 ##############################################################################
1127 # Driver feature graph arc support
1128 ##############################################################################
1130 list(APPEND VNET_SOURCES
1132 feature/feature_api.c
1133 feature/registration.c
1136 list(APPEND VNET_HEADERS
1140 list(APPEND VNET_API_FILES feature/feature.api)
1142 ##############################################################################
1143 # Unix kernel related
1144 ##############################################################################
1146 # FIXME: unix/hgshm.c
1148 list(APPEND VNET_SOURCES
1153 list(APPEND VNET_HEADERS
1157 ##############################################################################
1159 ##############################################################################
1161 list(APPEND VNET_SOURCES
1176 fib/fib_entry_src_adj.c
1177 fib/fib_entry_src_api.c
1178 fib/fib_entry_src_drop.c
1179 fib/fib_entry_src_interface.c
1180 fib/fib_entry_src_interpose.c
1181 fib/fib_entry_src_lisp.c
1182 fib/fib_entry_src_mpls.c
1183 fib/fib_entry_src_simple.c
1184 fib/fib_entry_src_rr.c
1185 fib/fib_entry_cover.c
1186 fib/fib_entry_delegate.c
1187 fib/fib_entry_track.c
1194 fib/fib_attached_export.c
1199 list(APPEND VNET_HEADERS
1212 fib/fib_entry_delegate.h
1217 list(APPEND VNET_API_FILES
1222 ##############################################################################
1224 ##############################################################################
1226 list(APPEND VNET_SOURCES
1230 adj/adj_midchain_node.c
1231 adj/adj_midchain_delegate.c
1241 list(APPEND VNET_MULTIARCH_SOURCES
1244 adj/adj_midchain_node.c
1247 list(APPEND VNET_HEADERS
1257 ##############################################################################
1258 # Data-Plane Objects
1259 ##############################################################################
1261 list(APPEND VNET_SOURCES
1269 dpo/load_balance_map.c
1273 dpo/interface_rx_dpo.c
1274 dpo/interface_tx_dpo.c
1275 dpo/mpls_disposition.c
1276 dpo/mpls_label_dpo.c
1282 list(APPEND VNET_MULTIARCH_SOURCES
1284 dpo/mpls_disposition.c
1286 dpo/mpls_label_dpo.c
1287 dpo/interface_rx_dpo.c
1290 list(APPEND VNET_HEADERS
1302 ##############################################################################
1304 ##############################################################################
1306 list(APPEND VNET_SOURCES
1316 mfib/mfib_entry_cover.c
1317 mfib/mfib_entry_delegate.c
1318 mfib/mfib_entry_src.c
1319 mfib/mfib_entry_src_rr.c
1323 list(APPEND VNET_MULTIARCH_SOURCES
1327 list(APPEND VNET_HEADERS
1333 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1335 ##############################################################################
1337 ##############################################################################
1339 list(APPEND VNET_SOURCES
1345 list(APPEND VNET_HEADERS
1349 ##############################################################################
1351 ##############################################################################
1353 list(APPEND VNET_SOURCES
1356 qos/qos_egress_map.c
1358 qos/qos_record_node.c
1360 qos/qos_store_node.c
1365 list(APPEND VNET_MULTIARCH_SOURCES
1366 qos/qos_record_node.c
1370 list(APPEND VNET_API_FILES qos/qos.api)
1372 ##############################################################################
1374 ##############################################################################
1376 list(APPEND VNET_SOURCES
1377 bier/bier_bit_string.c
1380 bier/bier_fmask_db.c
1389 bier/bier_imp_node.c
1391 bier/bier_disp_entry.c
1392 bier/bier_disp_lookup_node.c
1393 bier/bier_disp_dispatch_node.c
1394 bier/bier_disp_table.c
1395 bier/bier_bift_table.c
1398 list(APPEND VNET_MULTIARCH_SOURCES
1399 bier/bier_disp_dispatch_node.c
1400 bier/bier_disp_lookup_node.c
1401 bier/bier_imp_node.c
1404 list(APPEND VNET_HEADERS
1411 list(APPEND VNET_API_FILES bier/bier.api)
1413 ##############################################################################
1415 ##############################################################################
1417 list (APPEND VNET_SOURCES
1423 list(APPEND VNET_HEADERS
1428 list(APPEND VNET_API_FILES syslog/syslog.api)
1430 ##############################################################################
1431 # Tunnel Endpoint Information Base
1432 ##############################################################################
1434 list (APPEND VNET_SOURCES
1440 list(APPEND VNET_HEADERS
1444 list(APPEND VNET_API_FILES teib/teib.api)
1446 ##############################################################################
1448 ##############################################################################
1450 list (APPEND VNET_SOURCES
1456 list(APPEND VNET_HEADERS
1460 list(APPEND VNET_API_FILES arp/arp.api)
1462 list (APPEND VNET_SOURCES
1466 ip6-nd/ip6_nd_proxy.c
1467 ip6-nd/ip6_nd_mirror_proxy.c
1473 list(APPEND VNET_HEADERS
1477 list(APPEND VNET_API_FILES
1482 ##############################################################################
1484 ##############################################################################
1486 add_vpp_library(vnet
1487 SOURCES ${VNET_SOURCES}
1488 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1489 INSTALL_HEADERS ${VNET_HEADERS}
1490 API_FILES ${VNET_API_FILES}
1491 LINK_LIBRARIES vppinfra svm vlib
1492 DEPENDS vpp_version_h api_headers
1495 ##############################################################################
1496 # vpp api test client library
1497 ##############################################################################
1499 add_vpp_library (vatclient
1500 SOURCES ip/ip_types_api.c
1504 add_vat_test_library(vnet
1508 ip6-nd/ip6_nd_test.c
1509 srmpls/sr_mpls_test.c
1510 session/session_test.c
1515 ##############################################################################
1517 ##############################################################################
1518 add_vpp_test_library(vnet
1522 ##############################################################################