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
63 list(APPEND VNET_MULTIARCH_SOURCES
69 list(APPEND VNET_HEADERS
79 interface/rx_queue_funcs.h
80 interface/tx_queue_funcs.h
96 ethernet/ethernet_format_fns.h
97 ethernet/ethernet_types_api.h
100 list(APPEND VNET_API_FILES
108 ##############################################################################
110 ##############################################################################
111 list(APPEND VNET_SOURCES
115 policer/policer_api.c
118 list(APPEND VNET_MULTIARCH_SOURCES
122 list(APPEND VNET_HEADERS
128 list(APPEND VNET_API_FILES
130 policer/policer_types.api
133 ##############################################################################
134 # Layer 2 protocols go here
135 ##############################################################################
137 ##############################################################################
138 # Layer 2 protocol: Ethernet
139 ##############################################################################
140 list(APPEND VNET_SOURCES
141 ethernet/arp_packet.c
142 ethernet/ethernet_types_api.c
146 ethernet/mac_address.c
150 ethernet/p2p_ethernet.c
151 ethernet/p2p_ethernet_input.c
152 ethernet/p2p_ethernet_api.c
155 list(APPEND VNET_MULTIARCH_SOURCES
157 ethernet/p2p_ethernet_input.c
160 list(APPEND VNET_HEADERS
163 ethernet/mac_address.h
167 ethernet/p2p_ethernet.h
168 ethernet/arp_packet.h
171 list(APPEND VNET_API_FILES
172 ethernet/p2p_ethernet.api
173 ethernet/ethernet_types.api)
175 ##############################################################################
176 # Layer 2 protocol: Ethernet bridging
177 ##############################################################################
178 list(APPEND VNET_SOURCES
185 l2/l2_input_classify.c
186 l2/l2_output_classify.c
197 l2/l2_in_out_feat_arc.c
205 list(APPEND VNET_MULTIARCH_SOURCES
211 l2/l2_in_out_feat_arc.c
212 l2/l2_input_classify.c
214 l2/l2_output_classify.c
224 list(APPEND VNET_HEADERS
241 list(APPEND VNET_API_FILES l2/l2.api)
243 ##############################################################################
244 # Layer 2 protocol: SRP
245 ##############################################################################
246 list(APPEND VNET_SOURCES
253 list(APPEND VNET_HEADERS
258 ##############################################################################
259 # Layer 2 protocol: PPP
260 ##############################################################################
261 list(APPEND VNET_SOURCES
267 list(APPEND VNET_HEADERS
273 ##############################################################################
274 # Layer 2 protocol: HDLC
275 ##############################################################################
276 list(APPEND VNET_SOURCES
282 list(APPEND VNET_HEADERS
288 ##############################################################################
289 # Layer 2 protocol: LLC
290 ##############################################################################
291 list(APPEND VNET_SOURCES
297 list(APPEND VNET_HEADERS
301 ##############################################################################
302 # Layer 2 protocol: SNAP
303 ##############################################################################
304 list(APPEND VNET_SOURCES
310 list(APPEND VNET_HEADERS
314 ##############################################################################
316 ##############################################################################
317 list(APPEND VNET_SOURCES
324 list(APPEND VNET_HEADERS
328 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
329 list(APPEND VNET_API_FILES bonding/bond.api)
331 ##############################################################################
332 # Layer 2/3 "classify"
333 ##############################################################################
334 list(APPEND VNET_SOURCES
335 classify/vnet_classify.c
336 classify/trace_classify.h
337 classify/ip_classify.c
338 classify/in_out_acl.c
339 classify/policer_classify.c
340 classify/flow_classify.c
341 classify/flow_classify_node.c
342 classify/vnet_classify.h
343 classify/classify_api.c
346 list(APPEND VNET_MULTIARCH_SOURCES
347 classify/ip_classify.c
348 classify/flow_classify_node.c
351 list(APPEND VNET_HEADERS
352 classify/vnet_classify.h
353 classify/trace_classify.h
354 classify/in_out_acl.h
355 classify/policer_classify.h
356 classify/flow_classify.h
359 list(APPEND VNET_API_FILES classify/classify.api)
361 ##############################################################################
362 # Layer 3 protocols go here
363 ##############################################################################
365 ##############################################################################
366 # Layer 3 protocol: IP v4/v6
367 ##############################################################################
368 list(APPEND VNET_SOURCES
382 ip/ip4_source_and_port_range_check.c
383 ip/reass/ip4_full_reass.c
384 ip/reass/ip4_sv_reass.c
394 ip/reass/ip6_full_reass.c
395 ip/reass/ip6_sv_reass.c
398 ip/ip_container_proxy.c
405 ip/ip_path_mtu_node.c
416 list(APPEND VNET_MULTIARCH_SOURCES
418 ip/reass/ip4_full_reass.c
420 ip/reass/ip6_full_reass.c
421 ip/reass/ip4_sv_reass.c
423 ip/reass/ip6_full_reass.c
424 ip/reass/ip6_sv_reass.c
429 ip/ip_path_mtu_node.c
432 list(APPEND VNET_HEADERS
445 ip/ip6_hop_by_hop_packet.h
449 ip/ip_container_proxy.h
455 ip/ip_source_and_port_range_check.h
462 ip/reass/ip4_sv_reass.h
463 ip/reass/ip6_sv_reass.h
466 list(APPEND VNET_API_FILES
471 list(APPEND VNET_MULTIARCH_SOURCES
477 ##############################################################################
479 ##############################################################################
480 list(APPEND VNET_SOURCES
481 ip-neighbor/ip_neighbor.c
482 ip-neighbor/ip_neighbor_api.c
483 ip-neighbor/ip_neighbor_dp.c
484 ip-neighbor/ip_neighbor_types.c
485 ip-neighbor/ip_neighbor_watch.c
486 ip-neighbor/ip4_neighbor.c
487 ip-neighbor/ip6_neighbor.c
490 list(APPEND VNET_HEADERS
491 ip-neighbor/ip_neighbor.h
492 ip-neighbor/ip_neighbor_types.h
495 list(APPEND VNET_API_FILES
496 ip-neighbor/ip_neighbor.api
499 ##############################################################################
500 # Bidirectional Forwarding Detection
501 ##############################################################################
503 list(APPEND VNET_HEADERS
510 list(APPEND VNET_SOURCES
519 list(APPEND VNET_API_FILES bfd/bfd.api)
521 ##############################################################################
523 ##############################################################################
525 list(APPEND VNET_SOURCES
533 list(APPEND VNET_HEADERS
537 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
539 list(APPEND VNET_API_FILES crypto/crypto.api)
541 ##############################################################################
542 # Layer 3 protocol: IPSec
543 ##############################################################################
544 list(APPEND VNET_SOURCES
548 ipsec/ipsec_handoff.c
554 ipsec/ipsec_spd_policy.c
563 ipsec/ipsec_types_api.c
566 list(APPEND VNET_MULTIARCH_SOURCES
571 ipsec/ipsec_handoff.c
577 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
578 list(APPEND VNET_API_FILES ipsec/ipsec.api)
580 list(APPEND VNET_SOURCES
584 list(APPEND VNET_HEADERS
587 ipsec/ipsec_spd_policy.h
590 ipsec/ipsec_types_api.h
596 ##############################################################################
597 # Layer 3 protocol: osi
598 ##############################################################################
599 list(APPEND VNET_SOURCES
605 list(APPEND VNET_HEADERS
609 ##############################################################################
610 # Layer 4 protocol: tcp
611 ##############################################################################
612 list(APPEND VNET_SOURCES
616 tcp/tcp_syn_filter4.c
629 list(APPEND VNET_MULTIARCH_SOURCES
632 tcp/tcp_syn_filter4.c
635 list(APPEND VNET_HEADERS
648 list(APPEND VNET_API_FILES tcp/tcp.api)
650 ##############################################################################
651 # Layer 4 protocol: udp
652 ##############################################################################
653 list(APPEND VNET_SOURCES
667 list(APPEND VNET_MULTIARCH_SOURCES
672 list(APPEND VNET_HEADERS
681 list(APPEND VNET_API_FILES udp/udp.api)
683 ##############################################################################
684 # Tunnel protocol: gre
685 ##############################################################################
686 list(APPEND VNET_HEADERS
690 ##############################################################################
691 # Tunnel protocol: ipip
692 ##############################################################################
693 list(APPEND VNET_SOURCES
701 list(APPEND VNET_MULTIARCH_SOURCES
705 list(APPEND VNET_HEADERS
709 list(APPEND VNET_API_FILES
713 ##############################################################################
715 ##############################################################################
716 list(APPEND VNET_SOURCES
718 tunnel/tunnel_types_api.c
721 list(APPEND VNET_API_FILES
722 tunnel/tunnel_types.api
725 list(APPEND VNET_HEADERS
728 tunnel/tunnel_types_api.h
731 ##############################################################################
732 # Tunnel protocol: gre+mpls
733 ##############################################################################
734 list(APPEND VNET_SOURCES
746 list(APPEND VNET_MULTIARCH_SOURCES
753 list(APPEND VNET_HEADERS
761 list(APPEND VNET_API_FILES mpls/mpls.api)
763 ##############################################################################
764 # Tunnel protocol: vxlan-gpe
765 ##############################################################################
767 list(APPEND VNET_SOURCES
768 vxlan-gpe/vxlan_gpe.c
771 vxlan-gpe/vxlan_gpe_api.c
774 list (APPEND VNET_MULTIARCH_SOURCES
778 list(APPEND VNET_HEADERS
779 vxlan-gpe/vxlan_gpe.h
780 vxlan-gpe/vxlan_gpe_packet.h
781 vxlan-gpe/vxlan_gpe_error.def
784 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
786 ##############################################################################
787 # ipv6 segment routing
788 ##############################################################################
790 list(APPEND VNET_SOURCES
793 srv6/sr_policy_rewrite.c
801 list(APPEND VNET_HEADERS
807 list(APPEND VNET_API_FILES
813 ##############################################################################
814 # mpls segment routing
815 ##############################################################################
817 list(APPEND VNET_SOURCES
818 srmpls/sr_mpls_policy.c
819 srmpls/sr_mpls_steering.c
823 list(APPEND VNET_HEADERS
827 list(APPEND VNET_API_FILES
831 ##############################################################################
832 # IPFIX / netflow v10
833 ##############################################################################
834 list(APPEND VNET_SOURCES
835 ipfix-export/flow_report.c
836 ipfix-export/flow_api.c
839 list(APPEND VNET_HEADERS
840 ipfix-export/flow_report.h
841 ipfix-export/ipfix_info_elements.h
842 ipfix-export/ipfix_packet.h
845 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
847 ##############################################################################
849 ##############################################################################
850 list(APPEND VNET_SOURCES
858 list(APPEND VNET_HEADERS
862 ##############################################################################
864 ##############################################################################
865 list(APPEND VNET_SOURCES
872 list(APPEND VNET_HEADERS
875 gso/hdr_offset_parser.h
879 list(APPEND VNET_API_FILES
883 ##############################################################################
884 # IPFIX classify code
885 ##############################################################################
887 list(APPEND VNET_SOURCES
888 ipfix-export/flow_report_classify.c
891 list(APPEND VNET_HEADERS
892 ipfix-export/flow_report_classify.h
895 ##############################################################################
897 ##############################################################################
899 list(APPEND VNET_SOURCES
900 lawful-intercept/lawful_intercept.c
901 lawful-intercept/node.c
904 list(APPEND VNET_MULTIARCH_SOURCES
905 lawful-intercept/node.c
908 list(APPEND VNET_HEADERS
909 lawful-intercept/lawful_intercept.h
912 ##############################################################################
913 # SPAN (port mirroring)
914 ##############################################################################
916 list(APPEND VNET_SOURCES
922 list(APPEND VNET_MULTIARCH_SOURCES
926 list(APPEND VNET_HEADERS
930 list(APPEND VNET_API_FILES span/span.api)
932 ##############################################################################
934 ##############################################################################
936 list(APPEND VNET_SOURCES
946 list(APPEND VNET_HEADERS
951 list(APPEND VNET_API_FILES pg/pg.api)
953 ##############################################################################
955 ##############################################################################
957 list(APPEND VNET_SOURCES
959 devices/virtio/device.c
960 devices/virtio/format.c
961 devices/virtio/node.c
963 devices/virtio/virtio.c
964 devices/virtio/virtio_api.c
965 devices/virtio/virtio_pci_legacy.c
966 devices/virtio/virtio_pci_modern.c
967 devices/virtio/virtio_pre_input.c
968 devices/virtio/virtio_types_api.c
971 list(APPEND VNET_HEADERS
973 devices/virtio/virtio.h
974 devices/virtio/virtio_buffering.h
975 devices/virtio/virtio_std.h
976 devices/virtio/virtio_pci_legacy.h
977 devices/virtio/virtio_pci_modern.h
978 devices/virtio/vhost_std.h
979 devices/virtio/virtio_types_api.h
982 list(APPEND VNET_MULTIARCH_SOURCES
983 devices/virtio/node.c
984 devices/virtio/device.c
987 list(APPEND VNET_API_FILES
988 devices/virtio/virtio.api
989 devices/virtio/virtio_types.api
992 ##############################################################################
993 # tap interface (with virtio backend)
994 ##############################################################################
996 list(APPEND VNET_SOURCES
999 devices/tap/tapv2_api.c
1002 list(APPEND VNET_HEADERS
1006 list(APPEND VNET_API_FILES
1007 devices/tap/tapv2.api
1010 ##############################################################################
1011 # tap interface (with virtio backend)
1012 ##############################################################################
1014 list(APPEND VNET_SOURCES
1015 devices/pipe/pipe_api.c
1019 list(APPEND VNET_HEADERS
1023 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1025 ##############################################################################
1026 # session managmeent
1027 ##############################################################################
1029 list(APPEND VNET_SOURCES
1031 session/session_debug.c
1032 session/session_table.c
1033 session/session_rules_table.c
1034 session/session_lookup.c
1035 session/session_node.c
1036 session/session_input.c
1038 session/application.c
1039 session/application_worker.c
1040 session/session_cli.c
1041 session/application_interface.c
1042 session/application_local.c
1043 session/application_namespace.c
1044 session/segment_manager.c
1045 session/session_api.c
1048 list(APPEND VNET_HEADERS
1050 session/session_table.h
1051 session/session_rules_table.h
1052 session/session_types.h
1053 session/session_lookup.h
1054 session/application.h
1056 session/transport_types.h
1057 session/application_interface.h
1058 session/application_local.h
1059 session/application_namespace.h
1060 session/session_debug.h
1061 session/segment_manager.h
1062 session/mma_template.h
1063 session/mma_template.c
1068 list(APPEND VNET_API_FILES session/session.api)
1070 ##############################################################################
1072 ##############################################################################
1074 list(APPEND VNET_SOURCES
1078 list(APPEND VNET_HEADERS
1084 ##############################################################################
1085 # Driver feature graph arc support
1086 ##############################################################################
1088 list(APPEND VNET_SOURCES
1090 feature/feature_api.c
1091 feature/registration.c
1094 list(APPEND VNET_HEADERS
1098 list(APPEND VNET_API_FILES feature/feature.api)
1100 ##############################################################################
1101 # Unix kernel related
1102 ##############################################################################
1104 # FIXME: unix/hgshm.c
1106 list(APPEND VNET_SOURCES
1111 list(APPEND VNET_HEADERS
1115 ##############################################################################
1117 ##############################################################################
1119 list(APPEND VNET_SOURCES
1134 fib/fib_entry_src_adj.c
1135 fib/fib_entry_src_api.c
1136 fib/fib_entry_src_drop.c
1137 fib/fib_entry_src_interface.c
1138 fib/fib_entry_src_interpose.c
1139 fib/fib_entry_src_lisp.c
1140 fib/fib_entry_src_mpls.c
1141 fib/fib_entry_src_simple.c
1142 fib/fib_entry_src_rr.c
1143 fib/fib_entry_cover.c
1144 fib/fib_entry_delegate.c
1145 fib/fib_entry_track.c
1152 fib/fib_attached_export.c
1157 list(APPEND VNET_HEADERS
1160 fib/fib_entry_track.h
1171 fib/fib_entry_delegate.h
1178 list(APPEND VNET_API_FILES
1183 ##############################################################################
1185 ##############################################################################
1187 list(APPEND VNET_SOURCES
1191 adj/adj_midchain_node.c
1192 adj/adj_midchain_delegate.c
1202 list(APPEND VNET_MULTIARCH_SOURCES
1205 adj/adj_midchain_node.c
1208 list(APPEND VNET_HEADERS
1218 ##############################################################################
1219 # Data-Plane Objects
1220 ##############################################################################
1222 list(APPEND VNET_SOURCES
1230 dpo/load_balance_map.c
1234 dpo/interface_rx_dpo.c
1235 dpo/interface_tx_dpo.c
1236 dpo/mpls_disposition.c
1237 dpo/mpls_label_dpo.c
1243 list(APPEND VNET_MULTIARCH_SOURCES
1245 dpo/mpls_disposition.c
1247 dpo/mpls_label_dpo.c
1248 dpo/interface_rx_dpo.c
1251 list(APPEND VNET_HEADERS
1253 dpo/load_balance_map.h
1264 ##############################################################################
1266 ##############################################################################
1268 list(APPEND VNET_SOURCES
1278 mfib/mfib_entry_cover.c
1279 mfib/mfib_entry_delegate.c
1280 mfib/mfib_entry_src.c
1281 mfib/mfib_entry_src_rr.c
1285 list(APPEND VNET_MULTIARCH_SOURCES
1289 list(APPEND VNET_HEADERS
1295 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1297 ##############################################################################
1299 ##############################################################################
1301 list(APPEND VNET_SOURCES
1307 list(APPEND VNET_HEADERS
1311 ##############################################################################
1313 ##############################################################################
1315 list(APPEND VNET_SOURCES
1318 qos/qos_egress_map.c
1320 qos/qos_record_node.c
1322 qos/qos_store_node.c
1327 list(APPEND VNET_MULTIARCH_SOURCES
1328 qos/qos_record_node.c
1332 list(APPEND VNET_API_FILES qos/qos.api)
1334 ##############################################################################
1336 ##############################################################################
1338 list(APPEND VNET_SOURCES
1339 bier/bier_bit_string.c
1342 bier/bier_fmask_db.c
1351 bier/bier_imp_node.c
1353 bier/bier_disp_entry.c
1354 bier/bier_disp_lookup_node.c
1355 bier/bier_disp_dispatch_node.c
1356 bier/bier_disp_table.c
1357 bier/bier_bift_table.c
1360 list(APPEND VNET_MULTIARCH_SOURCES
1361 bier/bier_disp_dispatch_node.c
1362 bier/bier_disp_lookup_node.c
1363 bier/bier_imp_node.c
1366 list(APPEND VNET_HEADERS
1367 bier/bier_bit_string.h
1370 bier/bier_hdr_inlines.h
1376 list(APPEND VNET_API_FILES bier/bier.api)
1378 ##############################################################################
1380 ##############################################################################
1382 list (APPEND VNET_SOURCES
1388 list(APPEND VNET_HEADERS
1393 list(APPEND VNET_API_FILES syslog/syslog.api)
1395 ##############################################################################
1396 # Tunnel Endpoint Information Base
1397 ##############################################################################
1399 list (APPEND VNET_SOURCES
1405 list(APPEND VNET_HEADERS
1409 list(APPEND VNET_API_FILES teib/teib.api)
1411 ##############################################################################
1413 ##############################################################################
1415 list (APPEND VNET_SOURCES
1421 list(APPEND VNET_HEADERS
1425 list(APPEND VNET_API_FILES arp/arp.api)
1427 list (APPEND VNET_SOURCES
1431 ip6-nd/ip6_nd_proxy.c
1432 ip6-nd/ip6_nd_mirror_proxy.c
1438 list(APPEND VNET_HEADERS
1442 list(APPEND VNET_API_FILES
1447 ##############################################################################
1449 ##############################################################################
1451 add_vpp_library(vnet
1452 SOURCES ${VNET_SOURCES}
1453 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1454 INSTALL_HEADERS ${VNET_HEADERS}
1455 API_FILES ${VNET_API_FILES}
1456 LINK_LIBRARIES vppinfra svm vlib
1457 DEPENDS vpp_version_h api_headers
1460 ##############################################################################
1461 # vpp api test client library
1462 ##############################################################################
1464 add_vpp_library (vatclient
1465 SOURCES ip/ip_types_api.c
1469 add_vat_test_library(vnet
1473 ip6-nd/ip6_nd_test.c
1474 srmpls/sr_mpls_test.c
1475 session/session_test.c
1480 ##############################################################################
1482 ##############################################################################
1483 add_vpp_test_library(vnet
1487 ##############################################################################