1 # Copyright (c) 2018-2020 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
17 unset(VNET_MULTIARCH_SOURCES)
19 option(VPP_IP_FIB_MTRIE_16 "IP FIB's MTRIE Stride is 16-8-8 (if not set it's 8-8-8-8)" ON)
21 ##############################################################################
23 ##############################################################################
24 list(APPEND VNET_SOURCES
49 list(APPEND VNET_MULTIARCH_SOURCES
55 list(APPEND VNET_HEADERS
64 interface/rx_queue_funcs.h
65 interface/tx_queue_funcs.h
81 ethernet/ethernet_format_fns.h
82 ethernet/ethernet_types_api.h
85 list(APPEND VNET_API_FILES
93 ##############################################################################
95 ##############################################################################
96 list(APPEND VNET_SOURCES
100 policer/policer_api.c
103 list(APPEND VNET_MULTIARCH_SOURCES
107 list(APPEND VNET_HEADERS
113 list(APPEND VNET_API_FILES
115 policer/policer_types.api
118 ##############################################################################
119 # Layer 2 protocols go here
120 ##############################################################################
122 ##############################################################################
123 # Layer 2 protocol: Ethernet
124 ##############################################################################
125 list(APPEND VNET_SOURCES
126 ethernet/arp_packet.c
127 ethernet/ethernet_types_api.c
131 ethernet/mac_address.c
135 ethernet/p2p_ethernet.c
136 ethernet/p2p_ethernet_input.c
137 ethernet/p2p_ethernet_api.c
140 list(APPEND VNET_MULTIARCH_SOURCES
142 ethernet/p2p_ethernet_input.c
145 list(APPEND VNET_HEADERS
148 ethernet/mac_address.h
152 ethernet/p2p_ethernet.h
153 ethernet/arp_packet.h
156 list(APPEND VNET_API_FILES
157 ethernet/p2p_ethernet.api
158 ethernet/ethernet_types.api)
160 ##############################################################################
161 # Layer 2 protocol: Ethernet bridging
162 ##############################################################################
163 list(APPEND VNET_SOURCES
170 l2/l2_input_classify.c
171 l2/l2_output_classify.c
182 l2/l2_in_out_feat_arc.c
190 list(APPEND VNET_MULTIARCH_SOURCES
196 l2/l2_in_out_feat_arc.c
197 l2/l2_input_classify.c
199 l2/l2_output_classify.c
209 list(APPEND VNET_HEADERS
226 list(APPEND VNET_API_FILES l2/l2.api)
228 ##############################################################################
229 # Layer 2 protocol: SRP
230 ##############################################################################
231 list(APPEND VNET_SOURCES
238 list(APPEND VNET_HEADERS
243 ##############################################################################
244 # Layer 2 protocol: PPP
245 ##############################################################################
246 list(APPEND VNET_SOURCES
252 list(APPEND VNET_HEADERS
258 ##############################################################################
259 # Layer 2 protocol: HDLC
260 ##############################################################################
261 list(APPEND VNET_SOURCES
267 list(APPEND VNET_HEADERS
273 ##############################################################################
274 # Layer 2 protocol: LLC
275 ##############################################################################
276 list(APPEND VNET_SOURCES
282 list(APPEND VNET_HEADERS
286 ##############################################################################
287 # Layer 2 protocol: SNAP
288 ##############################################################################
289 list(APPEND VNET_SOURCES
295 list(APPEND VNET_HEADERS
299 ##############################################################################
301 ##############################################################################
302 list(APPEND VNET_SOURCES
309 list(APPEND VNET_HEADERS
313 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
314 list(APPEND VNET_API_FILES bonding/bond.api)
316 ##############################################################################
317 # Layer 2/3 "classify"
318 ##############################################################################
319 list(APPEND VNET_SOURCES
320 classify/vnet_classify.c
321 classify/trace_classify.h
322 classify/ip_classify.c
323 classify/in_out_acl.c
324 classify/policer_classify.c
325 classify/flow_classify.c
326 classify/flow_classify_node.c
327 classify/vnet_classify.h
328 classify/classify_api.c
331 list(APPEND VNET_MULTIARCH_SOURCES
332 classify/ip_classify.c
333 classify/flow_classify_node.c
336 list(APPEND VNET_HEADERS
337 classify/vnet_classify.h
338 classify/trace_classify.h
339 classify/in_out_acl.h
340 classify/policer_classify.h
341 classify/flow_classify.h
344 list(APPEND VNET_API_FILES classify/classify.api)
346 ##############################################################################
347 # Layer 3 protocols go here
348 ##############################################################################
350 ##############################################################################
351 # Layer 3 protocol: IP v4/v6
352 ##############################################################################
353 list(APPEND VNET_SOURCES
367 ip/ip4_source_and_port_range_check.c
368 ip/reass/ip4_full_reass.c
369 ip/reass/ip4_sv_reass.c
379 ip/reass/ip6_full_reass.c
380 ip/reass/ip6_sv_reass.c
383 ip/ip_container_proxy.c
390 ip/ip_path_mtu_node.c
401 list(APPEND VNET_MULTIARCH_SOURCES
403 ip/reass/ip4_full_reass.c
405 ip/reass/ip6_full_reass.c
406 ip/reass/ip4_sv_reass.c
408 ip/reass/ip6_full_reass.c
409 ip/reass/ip6_sv_reass.c
414 ip/ip_path_mtu_node.c
417 list(APPEND VNET_HEADERS
430 ip/ip6_hop_by_hop_packet.h
434 ip/ip_container_proxy.h
440 ip/ip_source_and_port_range_check.h
447 ip/reass/ip4_sv_reass.h
448 ip/reass/ip6_sv_reass.h
451 list(APPEND VNET_API_FILES
456 list(APPEND VNET_MULTIARCH_SOURCES
462 ##############################################################################
464 ##############################################################################
465 list(APPEND VNET_SOURCES
466 ip-neighbor/ip_neighbor.c
467 ip-neighbor/ip_neighbor_api.c
468 ip-neighbor/ip_neighbor_dp.c
469 ip-neighbor/ip_neighbor_types.c
470 ip-neighbor/ip_neighbor_watch.c
471 ip-neighbor/ip4_neighbor.c
472 ip-neighbor/ip6_neighbor.c
475 list(APPEND VNET_HEADERS
476 ip-neighbor/ip_neighbor.h
477 ip-neighbor/ip_neighbor_types.h
480 list(APPEND VNET_API_FILES
481 ip-neighbor/ip_neighbor.api
484 ##############################################################################
485 # Bidirectional Forwarding Detection
486 ##############################################################################
488 list(APPEND VNET_HEADERS
495 list(APPEND VNET_SOURCES
504 list(APPEND VNET_API_FILES bfd/bfd.api)
506 ##############################################################################
508 ##############################################################################
510 list(APPEND VNET_SOURCES
518 list(APPEND VNET_HEADERS
522 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
524 list(APPEND VNET_API_FILES crypto/crypto.api)
526 ##############################################################################
527 # Layer 3 protocol: IPSec
528 ##############################################################################
529 list(APPEND VNET_SOURCES
533 ipsec/ipsec_handoff.c
539 ipsec/ipsec_spd_policy.c
548 ipsec/ipsec_types_api.c
551 list(APPEND VNET_MULTIARCH_SOURCES
556 ipsec/ipsec_handoff.c
562 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
563 list(APPEND VNET_API_FILES ipsec/ipsec.api)
565 list(APPEND VNET_SOURCES
569 list(APPEND VNET_HEADERS
572 ipsec/ipsec_spd_policy.h
575 ipsec/ipsec_types_api.h
581 ##############################################################################
582 # Layer 3 protocol: osi
583 ##############################################################################
584 list(APPEND VNET_SOURCES
590 list(APPEND VNET_HEADERS
594 ##############################################################################
595 # Layer 4 protocol: tcp
596 ##############################################################################
597 list(APPEND VNET_SOURCES
601 tcp/tcp_syn_filter4.c
614 list(APPEND VNET_MULTIARCH_SOURCES
617 tcp/tcp_syn_filter4.c
620 list(APPEND VNET_HEADERS
633 list(APPEND VNET_API_FILES tcp/tcp.api)
635 ##############################################################################
636 # Layer 4 protocol: udp
637 ##############################################################################
638 list(APPEND VNET_SOURCES
652 list(APPEND VNET_MULTIARCH_SOURCES
657 list(APPEND VNET_HEADERS
666 list(APPEND VNET_API_FILES udp/udp.api)
668 ##############################################################################
669 # Tunnel protocol: gre
670 ##############################################################################
671 list(APPEND VNET_SOURCES
679 list(APPEND VNET_MULTIARCH_SOURCES
684 list(APPEND VNET_HEADERS
690 list(APPEND VNET_API_FILES gre/gre.api)
692 ##############################################################################
693 # Tunnel protocol: ipip
694 ##############################################################################
695 list(APPEND VNET_SOURCES
703 list(APPEND VNET_MULTIARCH_SOURCES
707 list(APPEND VNET_HEADERS
711 list(APPEND VNET_API_FILES
715 ##############################################################################
717 ##############################################################################
718 list(APPEND VNET_SOURCES
720 tunnel/tunnel_types_api.c
723 list(APPEND VNET_API_FILES
724 tunnel/tunnel_types.api
727 list(APPEND VNET_HEADERS
730 tunnel/tunnel_types_api.h
733 ##############################################################################
734 # Tunnel protocol: gre+mpls
735 ##############################################################################
736 list(APPEND VNET_SOURCES
748 list(APPEND VNET_MULTIARCH_SOURCES
755 list(APPEND VNET_HEADERS
763 list(APPEND VNET_API_FILES mpls/mpls.api)
765 ##############################################################################
766 # Tunnel protocol: vxlan-gpe
767 ##############################################################################
769 list(APPEND VNET_SOURCES
770 vxlan-gpe/vxlan_gpe.c
773 vxlan-gpe/vxlan_gpe_api.c
776 list (APPEND VNET_MULTIARCH_SOURCES
780 list(APPEND VNET_HEADERS
781 vxlan-gpe/vxlan_gpe.h
782 vxlan-gpe/vxlan_gpe_packet.h
783 vxlan-gpe/vxlan_gpe_error.def
786 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
788 ##############################################################################
789 # ipv6 segment routing
790 ##############################################################################
792 list(APPEND VNET_SOURCES
795 srv6/sr_policy_rewrite.c
803 list(APPEND VNET_HEADERS
809 list(APPEND VNET_API_FILES
815 ##############################################################################
816 # mpls segment routing
817 ##############################################################################
819 list(APPEND VNET_SOURCES
820 srmpls/sr_mpls_policy.c
821 srmpls/sr_mpls_steering.c
825 list(APPEND VNET_HEADERS
829 list(APPEND VNET_API_FILES
833 ##############################################################################
834 # IPFIX / netflow v10
835 ##############################################################################
836 list(APPEND VNET_SOURCES
837 ipfix-export/flow_report.c
838 ipfix-export/flow_api.c
841 list(APPEND VNET_HEADERS
842 ipfix-export/flow_report.h
843 ipfix-export/ipfix_info_elements.h
844 ipfix-export/ipfix_packet.h
847 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
849 ##############################################################################
851 ##############################################################################
852 list(APPEND VNET_SOURCES
860 list(APPEND VNET_HEADERS
864 ##############################################################################
866 ##############################################################################
867 list(APPEND VNET_SOURCES
874 list(APPEND VNET_HEADERS
877 gso/hdr_offset_parser.h
881 list(APPEND VNET_API_FILES
885 ##############################################################################
886 # IPFIX classify code
887 ##############################################################################
889 list(APPEND VNET_SOURCES
890 ipfix-export/flow_report_classify.c
893 list(APPEND VNET_HEADERS
894 ipfix-export/flow_report_classify.h
897 ##############################################################################
899 ##############################################################################
901 list(APPEND VNET_SOURCES
902 lawful-intercept/lawful_intercept.c
903 lawful-intercept/node.c
906 list(APPEND VNET_MULTIARCH_SOURCES
907 lawful-intercept/node.c
910 list(APPEND VNET_HEADERS
911 lawful-intercept/lawful_intercept.h
914 ##############################################################################
915 # SPAN (port mirroring)
916 ##############################################################################
918 list(APPEND VNET_SOURCES
924 list(APPEND VNET_MULTIARCH_SOURCES
928 list(APPEND VNET_HEADERS
932 list(APPEND VNET_API_FILES span/span.api)
934 ##############################################################################
936 ##############################################################################
938 list(APPEND VNET_SOURCES
948 list(APPEND VNET_HEADERS
953 list(APPEND VNET_API_FILES pg/pg.api)
955 ##############################################################################
957 ##############################################################################
959 list(APPEND VNET_SOURCES
961 devices/virtio/device.c
962 devices/virtio/format.c
963 devices/virtio/node.c
965 devices/virtio/virtio.c
966 devices/virtio/virtio_api.c
967 devices/virtio/virtio_pci_legacy.c
968 devices/virtio/virtio_pci_modern.c
969 devices/virtio/virtio_pre_input.c
970 devices/virtio/virtio_types_api.c
973 list(APPEND VNET_HEADERS
975 devices/virtio/virtio.h
976 devices/virtio/virtio_buffering.h
977 devices/virtio/virtio_std.h
978 devices/virtio/virtio_pci_legacy.h
979 devices/virtio/virtio_pci_modern.h
980 devices/virtio/vhost_std.h
981 devices/virtio/virtio_types_api.h
984 list(APPEND VNET_MULTIARCH_SOURCES
985 devices/virtio/node.c
986 devices/virtio/device.c
989 list(APPEND VNET_API_FILES
990 devices/virtio/virtio.api
991 devices/virtio/virtio_types.api
994 ##############################################################################
995 # tap interface (with virtio backend)
996 ##############################################################################
998 list(APPEND VNET_SOURCES
1001 devices/tap/tapv2_api.c
1004 list(APPEND VNET_HEADERS
1008 list(APPEND VNET_API_FILES
1009 devices/tap/tapv2.api
1012 ##############################################################################
1013 # tap interface (with virtio backend)
1014 ##############################################################################
1016 list(APPEND VNET_SOURCES
1017 devices/pipe/pipe_api.c
1021 list(APPEND VNET_HEADERS
1025 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1027 ##############################################################################
1028 # session managmeent
1029 ##############################################################################
1031 list(APPEND VNET_SOURCES
1033 session/session_debug.c
1034 session/session_table.c
1035 session/session_rules_table.c
1036 session/session_lookup.c
1037 session/session_node.c
1039 session/application.c
1040 session/application_worker.c
1041 session/session_cli.c
1042 session/application_interface.c
1043 session/application_local.c
1044 session/application_namespace.c
1045 session/segment_manager.c
1046 session/session_api.c
1049 list(APPEND VNET_HEADERS
1051 session/session_table.h
1052 session/session_rules_table.h
1053 session/session_types.h
1054 session/session_lookup.h
1055 session/application.h
1057 session/transport_types.h
1058 session/application_interface.h
1059 session/application_local.h
1060 session/application_namespace.h
1061 session/session_debug.h
1062 session/segment_manager.h
1063 session/mma_template.h
1064 session/mma_template.c
1069 list(APPEND VNET_API_FILES session/session.api)
1071 ##############################################################################
1073 ##############################################################################
1075 list(APPEND VNET_SOURCES
1079 list(APPEND VNET_HEADERS
1085 ##############################################################################
1086 # Driver feature graph arc support
1087 ##############################################################################
1089 list(APPEND VNET_SOURCES
1091 feature/feature_api.c
1092 feature/registration.c
1095 list(APPEND VNET_HEADERS
1099 list(APPEND VNET_API_FILES feature/feature.api)
1101 ##############################################################################
1102 # Unix kernel related
1103 ##############################################################################
1105 # FIXME: unix/hgshm.c
1107 list(APPEND VNET_SOURCES
1112 list(APPEND VNET_HEADERS
1116 ##############################################################################
1118 ##############################################################################
1120 list(APPEND VNET_SOURCES
1135 fib/fib_entry_src_adj.c
1136 fib/fib_entry_src_api.c
1137 fib/fib_entry_src_drop.c
1138 fib/fib_entry_src_interface.c
1139 fib/fib_entry_src_interpose.c
1140 fib/fib_entry_src_lisp.c
1141 fib/fib_entry_src_mpls.c
1142 fib/fib_entry_src_simple.c
1143 fib/fib_entry_src_rr.c
1144 fib/fib_entry_cover.c
1145 fib/fib_entry_delegate.c
1146 fib/fib_entry_track.c
1153 fib/fib_attached_export.c
1158 list(APPEND VNET_HEADERS
1161 fib/fib_entry_track.h
1172 fib/fib_entry_delegate.h
1179 list(APPEND VNET_API_FILES
1184 ##############################################################################
1186 ##############################################################################
1188 list(APPEND VNET_SOURCES
1192 adj/adj_midchain_node.c
1193 adj/adj_midchain_delegate.c
1203 list(APPEND VNET_MULTIARCH_SOURCES
1206 adj/adj_midchain_node.c
1209 list(APPEND VNET_HEADERS
1219 ##############################################################################
1220 # Data-Plane Objects
1221 ##############################################################################
1223 list(APPEND VNET_SOURCES
1231 dpo/load_balance_map.c
1235 dpo/interface_rx_dpo.c
1236 dpo/interface_tx_dpo.c
1237 dpo/mpls_disposition.c
1238 dpo/mpls_label_dpo.c
1244 list(APPEND VNET_MULTIARCH_SOURCES
1246 dpo/mpls_disposition.c
1248 dpo/mpls_label_dpo.c
1249 dpo/interface_rx_dpo.c
1252 list(APPEND VNET_HEADERS
1254 dpo/load_balance_map.h
1265 ##############################################################################
1267 ##############################################################################
1269 list(APPEND VNET_SOURCES
1279 mfib/mfib_entry_cover.c
1280 mfib/mfib_entry_delegate.c
1281 mfib/mfib_entry_src.c
1282 mfib/mfib_entry_src_rr.c
1286 list(APPEND VNET_MULTIARCH_SOURCES
1290 list(APPEND VNET_HEADERS
1296 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1298 ##############################################################################
1300 ##############################################################################
1302 list(APPEND VNET_SOURCES
1308 list(APPEND VNET_HEADERS
1312 ##############################################################################
1314 ##############################################################################
1316 list(APPEND VNET_SOURCES
1319 qos/qos_egress_map.c
1321 qos/qos_record_node.c
1323 qos/qos_store_node.c
1328 list(APPEND VNET_MULTIARCH_SOURCES
1329 qos/qos_record_node.c
1333 list(APPEND VNET_API_FILES qos/qos.api)
1335 ##############################################################################
1337 ##############################################################################
1339 list(APPEND VNET_SOURCES
1340 bier/bier_bit_string.c
1343 bier/bier_fmask_db.c
1352 bier/bier_imp_node.c
1354 bier/bier_disp_entry.c
1355 bier/bier_disp_lookup_node.c
1356 bier/bier_disp_dispatch_node.c
1357 bier/bier_disp_table.c
1358 bier/bier_bift_table.c
1361 list(APPEND VNET_MULTIARCH_SOURCES
1362 bier/bier_disp_dispatch_node.c
1363 bier/bier_disp_lookup_node.c
1364 bier/bier_imp_node.c
1367 list(APPEND VNET_HEADERS
1368 bier/bier_bit_string.h
1371 bier/bier_hdr_inlines.h
1377 list(APPEND VNET_API_FILES bier/bier.api)
1379 ##############################################################################
1381 ##############################################################################
1383 list (APPEND VNET_SOURCES
1389 list(APPEND VNET_HEADERS
1394 list(APPEND VNET_API_FILES syslog/syslog.api)
1396 ##############################################################################
1397 # Tunnel Endpoint Information Base
1398 ##############################################################################
1400 list (APPEND VNET_SOURCES
1406 list(APPEND VNET_HEADERS
1410 list(APPEND VNET_API_FILES teib/teib.api)
1412 ##############################################################################
1414 ##############################################################################
1416 list (APPEND VNET_SOURCES
1422 list(APPEND VNET_HEADERS
1426 list(APPEND VNET_API_FILES arp/arp.api)
1428 list (APPEND VNET_SOURCES
1432 ip6-nd/ip6_nd_proxy.c
1433 ip6-nd/ip6_nd_mirror_proxy.c
1439 list(APPEND VNET_HEADERS
1443 list(APPEND VNET_API_FILES
1448 ##############################################################################
1450 ##############################################################################
1452 add_vpp_library(vnet
1453 SOURCES ${VNET_SOURCES}
1454 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1455 INSTALL_HEADERS ${VNET_HEADERS}
1456 API_FILES ${VNET_API_FILES}
1457 LINK_LIBRARIES vppinfra svm vlib
1458 DEPENDS vpp_version_h api_headers
1461 ##############################################################################
1462 # vpp api test client library
1463 ##############################################################################
1465 add_vpp_library (vatclient
1466 SOURCES ip/ip_types_api.c
1470 add_vat_test_library(vnet
1474 ip6-nd/ip6_nd_test.c
1475 srmpls/sr_mpls_test.c
1476 session/session_test.c
1481 ##############################################################################
1483 ##############################################################################
1484 add_vpp_test_library(vnet
1488 ##############################################################################