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
62 list(APPEND VNET_MULTIARCH_SOURCES
68 list(APPEND VNET_HEADERS
78 interface/rx_queue_funcs.h
79 interface/tx_queue_funcs.h
95 ethernet/ethernet_format_fns.h
96 ethernet/ethernet_types_api.h
99 list(APPEND VNET_API_FILES
107 ##############################################################################
109 ##############################################################################
110 list(APPEND VNET_SOURCES
114 policer/policer_api.c
117 list(APPEND VNET_MULTIARCH_SOURCES
121 list(APPEND VNET_HEADERS
127 list(APPEND VNET_API_FILES
129 policer/policer_types.api
132 ##############################################################################
133 # Layer 2 protocols go here
134 ##############################################################################
136 ##############################################################################
137 # Layer 2 protocol: Ethernet
138 ##############################################################################
139 list(APPEND VNET_SOURCES
140 ethernet/arp_packet.c
141 ethernet/ethernet_types_api.c
145 ethernet/mac_address.c
149 ethernet/p2p_ethernet.c
150 ethernet/p2p_ethernet_input.c
151 ethernet/p2p_ethernet_api.c
154 list(APPEND VNET_MULTIARCH_SOURCES
156 ethernet/p2p_ethernet_input.c
159 list(APPEND VNET_HEADERS
162 ethernet/mac_address.h
166 ethernet/p2p_ethernet.h
167 ethernet/arp_packet.h
170 list(APPEND VNET_API_FILES
171 ethernet/p2p_ethernet.api
172 ethernet/ethernet_types.api)
174 ##############################################################################
175 # Layer 2 protocol: Ethernet bridging
176 ##############################################################################
177 list(APPEND VNET_SOURCES
184 l2/l2_input_classify.c
185 l2/l2_output_classify.c
196 l2/l2_in_out_feat_arc.c
204 list(APPEND VNET_MULTIARCH_SOURCES
210 l2/l2_in_out_feat_arc.c
211 l2/l2_input_classify.c
213 l2/l2_output_classify.c
223 list(APPEND VNET_HEADERS
240 list(APPEND VNET_API_FILES l2/l2.api)
242 ##############################################################################
243 # Layer 2 protocol: SRP
244 ##############################################################################
245 list(APPEND VNET_SOURCES
252 list(APPEND VNET_HEADERS
257 ##############################################################################
258 # Layer 2 protocol: PPP
259 ##############################################################################
260 list(APPEND VNET_SOURCES
266 list(APPEND VNET_HEADERS
272 ##############################################################################
273 # Layer 2 protocol: HDLC
274 ##############################################################################
275 list(APPEND VNET_SOURCES
281 list(APPEND VNET_HEADERS
287 ##############################################################################
288 # Layer 2 protocol: LLC
289 ##############################################################################
290 list(APPEND VNET_SOURCES
296 list(APPEND VNET_HEADERS
300 ##############################################################################
301 # Layer 2 protocol: SNAP
302 ##############################################################################
303 list(APPEND VNET_SOURCES
309 list(APPEND VNET_HEADERS
313 ##############################################################################
315 ##############################################################################
316 list(APPEND VNET_SOURCES
323 list(APPEND VNET_HEADERS
327 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
328 list(APPEND VNET_API_FILES bonding/bond.api)
330 ##############################################################################
331 # Layer 2/3 "classify"
332 ##############################################################################
333 list(APPEND VNET_SOURCES
334 classify/vnet_classify.c
335 classify/trace_classify.h
336 classify/ip_classify.c
337 classify/in_out_acl.c
338 classify/policer_classify.c
339 classify/flow_classify.c
340 classify/flow_classify_node.c
341 classify/vnet_classify.h
342 classify/classify_api.c
345 list(APPEND VNET_MULTIARCH_SOURCES
346 classify/ip_classify.c
347 classify/flow_classify_node.c
350 list(APPEND VNET_HEADERS
351 classify/vnet_classify.h
352 classify/trace_classify.h
353 classify/in_out_acl.h
354 classify/policer_classify.h
355 classify/flow_classify.h
358 list(APPEND VNET_API_FILES classify/classify.api)
360 ##############################################################################
361 # Layer 3 protocols go here
362 ##############################################################################
364 ##############################################################################
365 # Layer 3 protocol: IP v4/v6
366 ##############################################################################
367 list(APPEND VNET_SOURCES
381 ip/ip4_source_and_port_range_check.c
382 ip/reass/ip4_full_reass.c
383 ip/reass/ip4_sv_reass.c
393 ip/reass/ip6_full_reass.c
394 ip/reass/ip6_sv_reass.c
397 ip/ip_container_proxy.c
404 ip/ip_path_mtu_node.c
415 list(APPEND VNET_MULTIARCH_SOURCES
417 ip/reass/ip4_full_reass.c
419 ip/reass/ip6_full_reass.c
420 ip/reass/ip4_sv_reass.c
422 ip/reass/ip6_full_reass.c
423 ip/reass/ip6_sv_reass.c
428 ip/ip_path_mtu_node.c
431 list(APPEND VNET_HEADERS
444 ip/ip6_hop_by_hop_packet.h
448 ip/ip_container_proxy.h
454 ip/ip_source_and_port_range_check.h
461 ip/reass/ip4_sv_reass.h
462 ip/reass/ip6_sv_reass.h
465 list(APPEND VNET_API_FILES
470 list(APPEND VNET_MULTIARCH_SOURCES
476 ##############################################################################
478 ##############################################################################
479 list(APPEND VNET_SOURCES
480 ip-neighbor/ip_neighbor.c
481 ip-neighbor/ip_neighbor_api.c
482 ip-neighbor/ip_neighbor_dp.c
483 ip-neighbor/ip_neighbor_types.c
484 ip-neighbor/ip_neighbor_watch.c
485 ip-neighbor/ip4_neighbor.c
486 ip-neighbor/ip6_neighbor.c
489 list(APPEND VNET_HEADERS
490 ip-neighbor/ip_neighbor.h
491 ip-neighbor/ip_neighbor_types.h
494 list(APPEND VNET_API_FILES
495 ip-neighbor/ip_neighbor.api
498 ##############################################################################
499 # Bidirectional Forwarding Detection
500 ##############################################################################
502 list(APPEND VNET_HEADERS
509 list(APPEND VNET_SOURCES
518 list(APPEND VNET_API_FILES bfd/bfd.api)
520 ##############################################################################
522 ##############################################################################
524 list(APPEND VNET_SOURCES
532 list(APPEND VNET_HEADERS
536 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
538 list(APPEND VNET_API_FILES crypto/crypto.api)
540 ##############################################################################
541 # Layer 3 protocol: IPSec
542 ##############################################################################
543 list(APPEND VNET_SOURCES
547 ipsec/ipsec_handoff.c
553 ipsec/ipsec_spd_policy.c
562 ipsec/ipsec_types_api.c
565 list(APPEND VNET_MULTIARCH_SOURCES
570 ipsec/ipsec_handoff.c
576 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
577 list(APPEND VNET_API_FILES ipsec/ipsec.api)
579 list(APPEND VNET_SOURCES
583 list(APPEND VNET_HEADERS
586 ipsec/ipsec_spd_policy.h
589 ipsec/ipsec_types_api.h
595 ##############################################################################
596 # Layer 3 protocol: osi
597 ##############################################################################
598 list(APPEND VNET_SOURCES
604 list(APPEND VNET_HEADERS
608 ##############################################################################
609 # Layer 4 protocol: tcp
610 ##############################################################################
611 list(APPEND VNET_SOURCES
615 tcp/tcp_syn_filter4.c
628 list(APPEND VNET_MULTIARCH_SOURCES
631 tcp/tcp_syn_filter4.c
634 list(APPEND VNET_HEADERS
647 list(APPEND VNET_API_FILES tcp/tcp.api)
649 ##############################################################################
650 # Layer 4 protocol: udp
651 ##############################################################################
652 list(APPEND VNET_SOURCES
666 list(APPEND VNET_MULTIARCH_SOURCES
671 list(APPEND VNET_HEADERS
680 list(APPEND VNET_API_FILES udp/udp.api)
682 ##############################################################################
683 # Tunnel protocol: gre
684 ##############################################################################
685 list(APPEND VNET_HEADERS
689 ##############################################################################
690 # Tunnel protocol: ipip
691 ##############################################################################
692 list(APPEND VNET_SOURCES
700 list(APPEND VNET_MULTIARCH_SOURCES
704 list(APPEND VNET_HEADERS
708 list(APPEND VNET_API_FILES
712 ##############################################################################
714 ##############################################################################
715 list(APPEND VNET_SOURCES
717 tunnel/tunnel_types_api.c
720 list(APPEND VNET_API_FILES
721 tunnel/tunnel_types.api
724 list(APPEND VNET_HEADERS
727 tunnel/tunnel_types_api.h
730 ##############################################################################
731 # Tunnel protocol: gre+mpls
732 ##############################################################################
733 list(APPEND VNET_SOURCES
745 list(APPEND VNET_MULTIARCH_SOURCES
752 list(APPEND VNET_HEADERS
760 list(APPEND VNET_API_FILES mpls/mpls.api)
762 ##############################################################################
763 # Tunnel protocol: vxlan-gpe
764 ##############################################################################
766 list(APPEND VNET_SOURCES
767 vxlan-gpe/vxlan_gpe.c
770 vxlan-gpe/vxlan_gpe_api.c
773 list (APPEND VNET_MULTIARCH_SOURCES
777 list(APPEND VNET_HEADERS
778 vxlan-gpe/vxlan_gpe.h
779 vxlan-gpe/vxlan_gpe_packet.h
780 vxlan-gpe/vxlan_gpe_error.def
783 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
785 ##############################################################################
786 # ipv6 segment routing
787 ##############################################################################
789 list(APPEND VNET_SOURCES
792 srv6/sr_policy_rewrite.c
800 list(APPEND VNET_HEADERS
806 list(APPEND VNET_API_FILES
812 ##############################################################################
813 # mpls segment routing
814 ##############################################################################
816 list(APPEND VNET_SOURCES
817 srmpls/sr_mpls_policy.c
818 srmpls/sr_mpls_steering.c
822 list(APPEND VNET_HEADERS
826 list(APPEND VNET_API_FILES
830 ##############################################################################
831 # IPFIX / netflow v10
832 ##############################################################################
833 list(APPEND VNET_SOURCES
834 ipfix-export/flow_report.c
835 ipfix-export/flow_api.c
838 list(APPEND VNET_HEADERS
839 ipfix-export/flow_report.h
840 ipfix-export/ipfix_info_elements.h
841 ipfix-export/ipfix_packet.h
844 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
846 ##############################################################################
848 ##############################################################################
849 list(APPEND VNET_SOURCES
857 list(APPEND VNET_HEADERS
861 ##############################################################################
863 ##############################################################################
864 list(APPEND VNET_SOURCES
871 list(APPEND VNET_HEADERS
874 gso/hdr_offset_parser.h
878 list(APPEND VNET_API_FILES
882 ##############################################################################
883 # IPFIX classify code
884 ##############################################################################
886 list(APPEND VNET_SOURCES
887 ipfix-export/flow_report_classify.c
890 list(APPEND VNET_HEADERS
891 ipfix-export/flow_report_classify.h
894 ##############################################################################
896 ##############################################################################
898 list(APPEND VNET_SOURCES
899 lawful-intercept/lawful_intercept.c
900 lawful-intercept/node.c
903 list(APPEND VNET_MULTIARCH_SOURCES
904 lawful-intercept/node.c
907 list(APPEND VNET_HEADERS
908 lawful-intercept/lawful_intercept.h
911 ##############################################################################
912 # SPAN (port mirroring)
913 ##############################################################################
915 list(APPEND VNET_SOURCES
921 list(APPEND VNET_MULTIARCH_SOURCES
925 list(APPEND VNET_HEADERS
929 list(APPEND VNET_API_FILES span/span.api)
931 ##############################################################################
933 ##############################################################################
935 list(APPEND VNET_SOURCES
945 list(APPEND VNET_HEADERS
950 list(APPEND VNET_API_FILES pg/pg.api)
952 ##############################################################################
954 ##############################################################################
956 list(APPEND VNET_SOURCES
958 devices/virtio/device.c
959 devices/virtio/format.c
960 devices/virtio/node.c
962 devices/virtio/virtio.c
963 devices/virtio/virtio_api.c
964 devices/virtio/virtio_pci_legacy.c
965 devices/virtio/virtio_pci_modern.c
966 devices/virtio/virtio_pre_input.c
967 devices/virtio/virtio_types_api.c
970 list(APPEND VNET_HEADERS
972 devices/virtio/virtio.h
973 devices/virtio/virtio_buffering.h
974 devices/virtio/virtio_std.h
975 devices/virtio/virtio_pci_legacy.h
976 devices/virtio/virtio_pci_modern.h
977 devices/virtio/vhost_std.h
978 devices/virtio/virtio_types_api.h
981 list(APPEND VNET_MULTIARCH_SOURCES
982 devices/virtio/node.c
983 devices/virtio/device.c
986 list(APPEND VNET_API_FILES
987 devices/virtio/virtio.api
988 devices/virtio/virtio_types.api
991 ##############################################################################
992 # tap interface (with virtio backend)
993 ##############################################################################
995 list(APPEND VNET_SOURCES
998 devices/tap/tapv2_api.c
1001 list(APPEND VNET_HEADERS
1005 list(APPEND VNET_API_FILES
1006 devices/tap/tapv2.api
1009 ##############################################################################
1010 # tap interface (with virtio backend)
1011 ##############################################################################
1013 list(APPEND VNET_SOURCES
1014 devices/pipe/pipe_api.c
1018 list(APPEND VNET_HEADERS
1022 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1024 ##############################################################################
1025 # session managmeent
1026 ##############################################################################
1028 list(APPEND VNET_SOURCES
1030 session/session_debug.c
1031 session/session_table.c
1032 session/session_rules_table.c
1033 session/session_lookup.c
1034 session/session_node.c
1035 session/session_input.c
1037 session/application.c
1038 session/application_worker.c
1039 session/session_cli.c
1040 session/application_interface.c
1041 session/application_local.c
1042 session/application_namespace.c
1043 session/segment_manager.c
1044 session/session_api.c
1047 list(APPEND VNET_HEADERS
1049 session/session_table.h
1050 session/session_rules_table.h
1051 session/session_types.h
1052 session/session_lookup.h
1053 session/application.h
1055 session/transport_types.h
1056 session/application_interface.h
1057 session/application_local.h
1058 session/application_namespace.h
1059 session/session_debug.h
1060 session/segment_manager.h
1061 session/mma_template.h
1062 session/mma_template.c
1067 list(APPEND VNET_API_FILES session/session.api)
1069 ##############################################################################
1071 ##############################################################################
1073 list(APPEND VNET_SOURCES
1077 list(APPEND VNET_HEADERS
1083 ##############################################################################
1084 # Driver feature graph arc support
1085 ##############################################################################
1087 list(APPEND VNET_SOURCES
1089 feature/feature_api.c
1090 feature/registration.c
1093 list(APPEND VNET_HEADERS
1097 list(APPEND VNET_API_FILES feature/feature.api)
1099 ##############################################################################
1100 # Unix kernel related
1101 ##############################################################################
1103 # FIXME: unix/hgshm.c
1105 list(APPEND VNET_SOURCES
1110 list(APPEND VNET_HEADERS
1114 ##############################################################################
1116 ##############################################################################
1118 list(APPEND VNET_SOURCES
1133 fib/fib_entry_src_adj.c
1134 fib/fib_entry_src_api.c
1135 fib/fib_entry_src_drop.c
1136 fib/fib_entry_src_interface.c
1137 fib/fib_entry_src_interpose.c
1138 fib/fib_entry_src_lisp.c
1139 fib/fib_entry_src_mpls.c
1140 fib/fib_entry_src_simple.c
1141 fib/fib_entry_src_rr.c
1142 fib/fib_entry_cover.c
1143 fib/fib_entry_delegate.c
1144 fib/fib_entry_track.c
1151 fib/fib_attached_export.c
1156 list(APPEND VNET_HEADERS
1159 fib/fib_entry_track.h
1170 fib/fib_entry_delegate.h
1177 list(APPEND VNET_API_FILES
1182 ##############################################################################
1184 ##############################################################################
1186 list(APPEND VNET_SOURCES
1190 adj/adj_midchain_node.c
1191 adj/adj_midchain_delegate.c
1201 list(APPEND VNET_MULTIARCH_SOURCES
1204 adj/adj_midchain_node.c
1207 list(APPEND VNET_HEADERS
1217 ##############################################################################
1218 # Data-Plane Objects
1219 ##############################################################################
1221 list(APPEND VNET_SOURCES
1229 dpo/load_balance_map.c
1233 dpo/interface_rx_dpo.c
1234 dpo/interface_tx_dpo.c
1235 dpo/mpls_disposition.c
1236 dpo/mpls_label_dpo.c
1242 list(APPEND VNET_MULTIARCH_SOURCES
1244 dpo/mpls_disposition.c
1246 dpo/mpls_label_dpo.c
1247 dpo/interface_rx_dpo.c
1250 list(APPEND VNET_HEADERS
1252 dpo/load_balance_map.h
1263 ##############################################################################
1265 ##############################################################################
1267 list(APPEND VNET_SOURCES
1277 mfib/mfib_entry_cover.c
1278 mfib/mfib_entry_delegate.c
1279 mfib/mfib_entry_src.c
1280 mfib/mfib_entry_src_rr.c
1284 list(APPEND VNET_MULTIARCH_SOURCES
1288 list(APPEND VNET_HEADERS
1294 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1296 ##############################################################################
1298 ##############################################################################
1300 list(APPEND VNET_SOURCES
1306 list(APPEND VNET_HEADERS
1310 ##############################################################################
1312 ##############################################################################
1314 list(APPEND VNET_SOURCES
1317 qos/qos_egress_map.c
1319 qos/qos_record_node.c
1321 qos/qos_store_node.c
1326 list(APPEND VNET_MULTIARCH_SOURCES
1327 qos/qos_record_node.c
1331 list(APPEND VNET_API_FILES qos/qos.api)
1333 ##############################################################################
1335 ##############################################################################
1337 list(APPEND VNET_SOURCES
1338 bier/bier_bit_string.c
1341 bier/bier_fmask_db.c
1350 bier/bier_imp_node.c
1352 bier/bier_disp_entry.c
1353 bier/bier_disp_lookup_node.c
1354 bier/bier_disp_dispatch_node.c
1355 bier/bier_disp_table.c
1356 bier/bier_bift_table.c
1359 list(APPEND VNET_MULTIARCH_SOURCES
1360 bier/bier_disp_dispatch_node.c
1361 bier/bier_disp_lookup_node.c
1362 bier/bier_imp_node.c
1365 list(APPEND VNET_HEADERS
1366 bier/bier_bit_string.h
1369 bier/bier_hdr_inlines.h
1375 list(APPEND VNET_API_FILES bier/bier.api)
1377 ##############################################################################
1379 ##############################################################################
1381 list (APPEND VNET_SOURCES
1387 list(APPEND VNET_HEADERS
1392 list(APPEND VNET_API_FILES syslog/syslog.api)
1394 ##############################################################################
1395 # Tunnel Endpoint Information Base
1396 ##############################################################################
1398 list (APPEND VNET_SOURCES
1404 list(APPEND VNET_HEADERS
1408 list(APPEND VNET_API_FILES teib/teib.api)
1410 ##############################################################################
1412 ##############################################################################
1414 list (APPEND VNET_SOURCES
1420 list(APPEND VNET_HEADERS
1424 list(APPEND VNET_API_FILES arp/arp.api)
1426 list (APPEND VNET_SOURCES
1430 ip6-nd/ip6_nd_proxy.c
1431 ip6-nd/ip6_nd_mirror_proxy.c
1437 list(APPEND VNET_HEADERS
1441 list(APPEND VNET_API_FILES
1446 ##############################################################################
1448 ##############################################################################
1450 add_vpp_library(vnet
1451 SOURCES ${VNET_SOURCES}
1452 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1453 INSTALL_HEADERS ${VNET_HEADERS}
1454 API_FILES ${VNET_API_FILES}
1455 LINK_LIBRARIES vppinfra svm vlib
1456 DEPENDS vpp_version_h api_headers
1459 ##############################################################################
1460 # vpp api test client library
1461 ##############################################################################
1463 add_vpp_library (vatclient
1464 SOURCES ip/ip_types_api.c
1468 add_vat_test_library(vnet
1472 ip6-nd/ip6_nd_test.c
1473 srmpls/sr_mpls_test.c
1474 session/session_test.c
1479 ##############################################################################
1481 ##############################################################################
1482 add_vpp_test_library(vnet
1486 ##############################################################################