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.
14 add_definitions (-DWITH_LIBSSL=1)
15 include_directories(${OPENSSL_INCLUDE_DIR})
20 unset(VNET_MULTIARCH_SOURCES)
22 ##############################################################################
24 ##############################################################################
25 list(APPEND VNET_SOURCES
45 list(APPEND VNET_MULTIARCH_SOURCES
51 list(APPEND VNET_HEADERS
60 interface/rx_queue_funcs.h
77 ethernet/ethernet_format_fns.h
80 list(APPEND VNET_API_FILES
88 ##############################################################################
90 ##############################################################################
91 list(APPEND VNET_SOURCES
98 list(APPEND VNET_MULTIARCH_SOURCES
102 list(APPEND VNET_HEADERS
108 list(APPEND VNET_API_FILES
110 policer/policer_types.api
113 ##############################################################################
114 # Binary API compatibility until vpp 20.12, see the ADL plugin...
115 ##############################################################################
117 list(APPEND VNET_SOURCES
121 list(APPEND VNET_API_FILES cop/cop.api)
123 ##############################################################################
124 # Layer 2 protocols go here
125 ##############################################################################
127 ##############################################################################
128 # Layer 2 protocol: Ethernet
129 ##############################################################################
130 list(APPEND VNET_SOURCES
131 ethernet/arp_packet.c
132 ethernet/ethernet_types_api.c
136 ethernet/mac_address.c
140 ethernet/p2p_ethernet.c
141 ethernet/p2p_ethernet_input.c
142 ethernet/p2p_ethernet_api.c
145 list(APPEND VNET_MULTIARCH_SOURCES
147 ethernet/p2p_ethernet_input.c
150 list(APPEND VNET_HEADERS
153 ethernet/mac_address.h
157 ethernet/p2p_ethernet.h
158 ethernet/arp_packet.h
161 list(APPEND VNET_API_FILES
162 ethernet/p2p_ethernet.api
163 ethernet/ethernet_types.api)
165 ##############################################################################
166 # Layer 2 protocol: Ethernet bridging
167 ##############################################################################
168 list(APPEND VNET_SOURCES
175 l2/l2_input_classify.c
176 l2/l2_output_classify.c
187 l2/l2_in_out_feat_arc.c
195 list(APPEND VNET_MULTIARCH_SOURCES
201 l2/l2_in_out_feat_arc.c
202 l2/l2_input_classify.c
204 l2/l2_output_classify.c
214 list(APPEND VNET_HEADERS
231 list(APPEND VNET_API_FILES l2/l2.api)
233 ##############################################################################
234 # Layer 2 protocol: SRP
235 ##############################################################################
236 list(APPEND VNET_SOURCES
243 list(APPEND VNET_HEADERS
248 ##############################################################################
249 # Layer 2 protocol: PPP
250 ##############################################################################
251 list(APPEND VNET_SOURCES
257 list(APPEND VNET_HEADERS
263 ##############################################################################
264 # Layer 2 protocol: HDLC
265 ##############################################################################
266 list(APPEND VNET_SOURCES
272 list(APPEND VNET_HEADERS
278 ##############################################################################
279 # Layer 2 protocol: LLC
280 ##############################################################################
281 list(APPEND VNET_SOURCES
287 list(APPEND VNET_HEADERS
291 ##############################################################################
292 # Layer 2 protocol: SNAP
293 ##############################################################################
294 list(APPEND VNET_SOURCES
300 list(APPEND VNET_HEADERS
304 ##############################################################################
306 ##############################################################################
307 list(APPEND VNET_SOURCES
314 list(APPEND VNET_MULTIARCH_SOURCES
318 list(APPEND VNET_HEADERS
321 vxlan/vxlan_error.def
324 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
326 list(APPEND VNET_API_FILES vxlan/vxlan.api)
328 ##############################################################################
330 ##############################################################################
331 list(APPEND VNET_SOURCES
338 list(APPEND VNET_HEADERS
342 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
343 list(APPEND VNET_API_FILES bonding/bond.api)
345 ##############################################################################
346 # Layer 2/3 "classify"
347 ##############################################################################
348 list(APPEND VNET_SOURCES
349 classify/vnet_classify.c
350 classify/trace_classify.h
351 classify/ip_classify.c
352 classify/in_out_acl.c
353 classify/policer_classify.c
354 classify/flow_classify.c
355 classify/flow_classify_node.c
356 classify/vnet_classify.h
357 classify/classify_api.c
360 list(APPEND VNET_MULTIARCH_SOURCES
361 classify/ip_classify.c
362 classify/flow_classify_node.c
365 list(APPEND VNET_HEADERS
366 classify/vnet_classify.h
367 classify/trace_classify.h
368 classify/in_out_acl.h
369 classify/policer_classify.h
370 classify/flow_classify.h
373 list(APPEND VNET_API_FILES classify/classify.api)
375 ##############################################################################
376 # Layer 3 protocols go here
377 ##############################################################################
379 ##############################################################################
380 # Layer 3 protocol: IP v4/v6
381 ##############################################################################
382 list(APPEND VNET_SOURCES
396 ip/ip4_source_and_port_range_check.c
397 ip/reass/ip4_full_reass.c
398 ip/reass/ip4_sv_reass.c
408 ip/reass/ip6_full_reass.c
409 ip/reass/ip6_sv_reass.c
412 ip/ip_container_proxy.c
419 ip/ip_path_mtu_node.c
429 list(APPEND VNET_MULTIARCH_SOURCES
431 ip/reass/ip4_full_reass.c
433 ip/reass/ip6_full_reass.c
434 ip/reass/ip4_sv_reass.c
436 ip/reass/ip6_full_reass.c
437 ip/reass/ip6_sv_reass.c
442 ip/ip_path_mtu_node.c
445 list(APPEND VNET_HEADERS
460 ip/ip6_hop_by_hop_packet.h
464 ip/ip_container_proxy.h
469 ip/ip_source_and_port_range_check.h
478 list(APPEND VNET_API_FILES
483 list(APPEND VNET_MULTIARCH_SOURCES
489 ##############################################################################
491 ##############################################################################
492 list(APPEND VNET_SOURCES
493 ip-neighbor/ip_neighbor.c
494 ip-neighbor/ip_neighbor_api.c
495 ip-neighbor/ip_neighbor_dp.c
496 ip-neighbor/ip_neighbor_types.c
497 ip-neighbor/ip_neighbor_watch.c
498 ip-neighbor/ip4_neighbor.c
499 ip-neighbor/ip6_neighbor.c
502 list(APPEND VNET_HEADERS
503 ip-neighbor/ip_neighbor.h
504 ip-neighbor/ip_neighbor_types.h
507 list(APPEND VNET_API_FILES
508 ip-neighbor/ip_neighbor.api
511 ##############################################################################
512 # Bidirectional Forwarding Detection
513 ##############################################################################
515 list(APPEND VNET_HEADERS
522 list(APPEND VNET_SOURCES
531 list(APPEND VNET_API_FILES bfd/bfd.api)
533 ##############################################################################
535 ##############################################################################
537 list(APPEND VNET_SOURCES
545 list(APPEND VNET_HEADERS
549 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
551 list(APPEND VNET_API_FILES crypto/crypto.api)
553 ##############################################################################
554 # Layer 3 protocol: IPSec
555 ##############################################################################
556 list(APPEND VNET_SOURCES
560 ipsec/ipsec_handoff.c
566 ipsec/ipsec_spd_policy.c
575 ipsec/ipsec_types_api.c
578 list(APPEND VNET_MULTIARCH_SOURCES
583 ipsec/ipsec_handoff.c
589 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
590 list(APPEND VNET_API_FILES ipsec/ipsec.api)
592 list(APPEND VNET_SOURCES
596 list(APPEND VNET_HEADERS
599 ipsec/ipsec_spd_policy.h
602 ipsec/ipsec_types_api.h
608 ##############################################################################
609 # Layer 3 protocol: osi
610 ##############################################################################
611 list(APPEND VNET_SOURCES
617 list(APPEND VNET_HEADERS
621 ##############################################################################
622 # Layer 4 protocol: tcp
623 ##############################################################################
624 list(APPEND VNET_SOURCES
628 tcp/tcp_syn_filter4.c
641 list(APPEND VNET_MULTIARCH_SOURCES
644 tcp/tcp_syn_filter4.c
647 list(APPEND VNET_HEADERS
660 list(APPEND VNET_API_FILES tcp/tcp.api)
662 ##############################################################################
663 # Layer 4 protocol: udp
664 ##############################################################################
665 list(APPEND VNET_SOURCES
677 list(APPEND VNET_MULTIARCH_SOURCES
682 list(APPEND VNET_HEADERS
690 list(APPEND VNET_API_FILES udp/udp.api)
692 ##############################################################################
693 # Tunnel protocol: gre
694 ##############################################################################
695 list(APPEND VNET_SOURCES
703 list(APPEND VNET_MULTIARCH_SOURCES
708 list(APPEND VNET_HEADERS
714 list(APPEND VNET_API_FILES gre/gre.api)
716 ##############################################################################
717 # Tunnel protocol: ipip
718 ##############################################################################
719 list(APPEND VNET_SOURCES
727 list(APPEND VNET_MULTIARCH_SOURCES
731 list(APPEND VNET_HEADERS
735 list(APPEND VNET_API_FILES
739 ##############################################################################
741 ##############################################################################
742 list(APPEND VNET_SOURCES
744 tunnel/tunnel_types_api.c
747 list(APPEND VNET_API_FILES
748 tunnel/tunnel_types.api
751 list(APPEND VNET_HEADERS
756 ##############################################################################
757 # Tunnel protocol: gre+mpls
758 ##############################################################################
759 list(APPEND VNET_SOURCES
771 list(APPEND VNET_MULTIARCH_SOURCES
778 list(APPEND VNET_HEADERS
786 list(APPEND VNET_API_FILES mpls/mpls.api)
788 ##############################################################################
789 # Tunnel protocol: vxlan-gbp
790 ##############################################################################
791 list(APPEND VNET_SOURCES
794 vxlan-gbp/vxlan_gbp_api.c
795 vxlan-gbp/vxlan_gbp.c
796 vxlan-gbp/vxlan_gbp_packet.c
799 list (APPEND VNET_MULTIARCH_SOURCES
804 list(APPEND VNET_HEADERS
805 vxlan-gbp/vxlan_gbp.h
806 vxlan-gbp/vxlan_gbp_packet.h
807 vxlan-gbp/vxlan_gbp_error.def
810 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
812 ##############################################################################
813 # Tunnel protocol: vxlan-gpe
814 ##############################################################################
816 list(APPEND VNET_SOURCES
817 vxlan-gpe/vxlan_gpe.c
820 vxlan-gpe/vxlan_gpe_api.c
823 list (APPEND VNET_MULTIARCH_SOURCES
827 list(APPEND VNET_HEADERS
828 vxlan-gpe/vxlan_gpe.h
829 vxlan-gpe/vxlan_gpe_packet.h
830 vxlan-gpe/vxlan_gpe_error.def
833 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
835 ##############################################################################
836 # ipv6 segment routing
837 ##############################################################################
839 list(APPEND VNET_SOURCES
842 srv6/sr_policy_rewrite.c
847 list(APPEND VNET_HEADERS
852 list(APPEND VNET_API_FILES
857 ##############################################################################
858 # mpls segment routing
859 ##############################################################################
861 list(APPEND VNET_SOURCES
862 srmpls/sr_mpls_policy.c
863 srmpls/sr_mpls_steering.c
867 list(APPEND VNET_HEADERS
871 list(APPEND VNET_API_FILES
875 ##############################################################################
876 # IPFIX / netflow v10
877 ##############################################################################
878 list(APPEND VNET_SOURCES
879 ipfix-export/flow_report.c
880 ipfix-export/flow_api.c
883 list(APPEND VNET_HEADERS
884 ipfix-export/flow_report.h
885 ipfix-export/ipfix_info_elements.h
886 ipfix-export/ipfix_packet.h
889 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
891 ##############################################################################
893 ##############################################################################
894 list(APPEND VNET_SOURCES
901 list(APPEND VNET_HEADERS
904 gso/hdr_offset_parser.h
908 list(APPEND VNET_API_FILES
912 ##############################################################################
913 # IPFIX classify code
914 ##############################################################################
916 list(APPEND VNET_SOURCES
917 ipfix-export/flow_report_classify.c
920 list(APPEND VNET_HEADERS
921 ipfix-export/flow_report_classify.h
924 ##############################################################################
926 ##############################################################################
928 list(APPEND VNET_SOURCES
929 lawful-intercept/lawful_intercept.c
930 lawful-intercept/node.c
933 list(APPEND VNET_MULTIARCH_SOURCES
934 lawful-intercept/node.c
937 list(APPEND VNET_HEADERS
938 lawful-intercept/lawful_intercept.h
941 ##############################################################################
942 # SPAN (port mirroring)
943 ##############################################################################
945 list(APPEND VNET_SOURCES
951 list(APPEND VNET_MULTIARCH_SOURCES
955 list(APPEND VNET_HEADERS
959 list(APPEND VNET_API_FILES span/span.api)
961 ##############################################################################
963 ##############################################################################
965 list(APPEND VNET_SOURCES
975 list(APPEND VNET_HEADERS
980 list(APPEND VNET_API_FILES pg/pg.api)
982 ##############################################################################
984 ##############################################################################
986 list(APPEND VNET_SOURCES
988 devices/virtio/device.c
989 devices/virtio/format.c
990 devices/virtio/node.c
992 devices/virtio/vhost_user.c
993 devices/virtio/vhost_user_input.c
994 devices/virtio/vhost_user_output.c
995 devices/virtio/vhost_user_api.c
996 devices/virtio/virtio.c
997 devices/virtio/virtio_api.c
998 devices/virtio/virtio_pci_legacy.c
999 devices/virtio/virtio_pci_modern.c
1000 devices/virtio/virtio_process.c
1001 devices/virtio/virtio_types_api.c
1004 list(APPEND VNET_HEADERS
1005 devices/virtio/pci.h
1006 devices/virtio/virtio.h
1007 devices/virtio/virtio_buffering.h
1008 devices/virtio/virtio_std.h
1009 devices/virtio/virtio_pci_legacy.h
1010 devices/virtio/virtio_pci_modern.h
1011 devices/virtio/vhost_std.h
1012 devices/virtio/vhost_user.h
1013 devices/virtio/virtio_types_api.h
1016 list(APPEND VNET_MULTIARCH_SOURCES
1017 devices/virtio/vhost_user_input.c
1018 devices/virtio/vhost_user_output.c
1019 devices/virtio/node.c
1020 devices/af_packet/node.c
1021 devices/virtio/device.c
1024 list(APPEND VNET_API_FILES
1025 devices/virtio/vhost_user.api
1026 devices/virtio/virtio.api
1027 devices/virtio/virtio_types.api
1030 ##############################################################################
1031 # tap interface (with virtio backend)
1032 ##############################################################################
1034 list(APPEND VNET_SOURCES
1037 devices/tap/tapv2_api.c
1040 list(APPEND VNET_HEADERS
1044 list(APPEND VNET_API_FILES
1045 devices/tap/tapv2.api
1048 ##############################################################################
1049 # tap interface (with virtio backend)
1050 ##############################################################################
1052 list(APPEND VNET_SOURCES
1053 devices/pipe/pipe_api.c
1057 list(APPEND VNET_HEADERS
1061 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1063 ##############################################################################
1064 # session managmeent
1065 ##############################################################################
1067 list(APPEND VNET_SOURCES
1069 session/session_debug.c
1070 session/session_table.c
1071 session/session_rules_table.c
1072 session/session_lookup.c
1073 session/session_node.c
1075 session/application.c
1076 session/application_worker.c
1077 session/session_cli.c
1078 session/application_interface.c
1079 session/application_local.c
1080 session/application_namespace.c
1081 session/segment_manager.c
1082 session/session_api.c
1085 list(APPEND VNET_HEADERS
1087 session/session_table.h
1088 session/session_rules_table.h
1089 session/session_types.h
1090 session/session_lookup.h
1091 session/application.h
1093 session/transport_types.h
1094 session/application_interface.h
1095 session/application_local.h
1096 session/application_namespace.h
1097 session/session_debug.h
1098 session/segment_manager.h
1099 session/mma_template.h
1100 session/mma_template.c
1105 list(APPEND VNET_API_FILES session/session.api)
1107 ##############################################################################
1109 ##############################################################################
1111 list(APPEND VNET_SOURCES
1115 list(APPEND VNET_HEADERS
1120 ##############################################################################
1121 # Linux packet interface
1122 ##############################################################################
1124 list(APPEND VNET_SOURCES
1125 devices/af_packet/af_packet.c
1126 devices/af_packet/device.c
1127 devices/af_packet/node.c
1128 devices/af_packet/cli.c
1129 devices/af_packet/af_packet_api.c
1132 list(APPEND VNET_MULTIARCH_SOURCES
1133 devices/af_packet/device.c
1136 list(APPEND VNET_HEADERS
1137 devices/af_packet/af_packet.h
1140 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1142 ##############################################################################
1143 # Driver feature graph arc support
1144 ##############################################################################
1146 list(APPEND VNET_SOURCES
1148 feature/feature_api.c
1149 feature/registration.c
1152 list(APPEND VNET_HEADERS
1156 list(APPEND VNET_API_FILES feature/feature.api)
1158 ##############################################################################
1159 # Unix kernel related
1160 ##############################################################################
1162 # FIXME: unix/hgshm.c
1164 list(APPEND VNET_SOURCES
1169 list(APPEND VNET_HEADERS
1173 ##############################################################################
1175 ##############################################################################
1177 list(APPEND VNET_SOURCES
1189 fib/fib_entry_src_adj.c
1190 fib/fib_entry_src_api.c
1191 fib/fib_entry_src_drop.c
1192 fib/fib_entry_src_interface.c
1193 fib/fib_entry_src_interpose.c
1194 fib/fib_entry_src_lisp.c
1195 fib/fib_entry_src_mpls.c
1196 fib/fib_entry_src_simple.c
1197 fib/fib_entry_src_rr.c
1198 fib/fib_entry_cover.c
1199 fib/fib_entry_delegate.c
1200 fib/fib_entry_track.c
1207 fib/fib_attached_export.c
1212 list(APPEND VNET_HEADERS
1222 fib/fib_entry_delegate.h
1227 list(APPEND VNET_API_FILES fib/fib_types.api)
1229 ##############################################################################
1231 ##############################################################################
1233 list(APPEND VNET_SOURCES
1237 adj/adj_midchain_delegate.c
1247 list(APPEND VNET_MULTIARCH_SOURCES
1253 list(APPEND VNET_HEADERS
1263 ##############################################################################
1264 # Data-Plane Objects
1265 ##############################################################################
1267 list(APPEND VNET_SOURCES
1275 dpo/load_balance_map.c
1279 dpo/interface_rx_dpo.c
1280 dpo/interface_tx_dpo.c
1281 dpo/mpls_disposition.c
1282 dpo/mpls_label_dpo.c
1288 list(APPEND VNET_MULTIARCH_SOURCES
1290 dpo/mpls_disposition.c
1292 dpo/mpls_label_dpo.c
1293 dpo/interface_rx_dpo.c
1296 list(APPEND VNET_HEADERS
1308 ##############################################################################
1310 ##############################################################################
1312 list(APPEND VNET_SOURCES
1322 mfib/mfib_entry_cover.c
1323 mfib/mfib_entry_delegate.c
1324 mfib/mfib_entry_src.c
1325 mfib/mfib_entry_src_rr.c
1329 list(APPEND VNET_MULTIARCH_SOURCES
1333 list(APPEND VNET_HEADERS
1339 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1341 ##############################################################################
1343 ##############################################################################
1345 list(APPEND VNET_SOURCES
1352 list(APPEND VNET_HEADERS
1356 ##############################################################################
1358 ##############################################################################
1360 list(APPEND VNET_SOURCES
1363 qos/qos_egress_map.c
1365 qos/qos_record_node.c
1367 qos/qos_store_node.c
1372 list(APPEND VNET_MULTIARCH_SOURCES
1373 qos/qos_record_node.c
1377 list(APPEND VNET_API_FILES qos/qos.api)
1379 ##############################################################################
1381 ##############################################################################
1383 list(APPEND VNET_SOURCES
1384 bier/bier_bit_string.c
1387 bier/bier_fmask_db.c
1396 bier/bier_imp_node.c
1398 bier/bier_disp_entry.c
1399 bier/bier_disp_lookup_node.c
1400 bier/bier_disp_dispatch_node.c
1401 bier/bier_disp_table.c
1402 bier/bier_bift_table.c
1405 list(APPEND VNET_MULTIARCH_SOURCES
1406 bier/bier_disp_dispatch_node.c
1407 bier/bier_disp_lookup_node.c
1408 bier/bier_imp_node.c
1411 list(APPEND VNET_HEADERS
1418 list(APPEND VNET_API_FILES bier/bier.api)
1420 ##############################################################################
1422 ##############################################################################
1424 list (APPEND VNET_SOURCES
1430 list(APPEND VNET_HEADERS
1435 list(APPEND VNET_API_FILES syslog/syslog.api)
1437 ##############################################################################
1438 # Tunnel Endpoint Information Base
1439 ##############################################################################
1441 list (APPEND VNET_SOURCES
1447 list(APPEND VNET_HEADERS
1451 list(APPEND VNET_API_FILES teib/teib.api)
1453 ##############################################################################
1455 ##############################################################################
1457 list (APPEND VNET_SOURCES
1463 list(APPEND VNET_HEADERS
1467 list(APPEND VNET_API_FILES arp/arp.api)
1469 list (APPEND VNET_SOURCES
1473 ip6-nd/ip6_nd_proxy.c
1479 list(APPEND VNET_HEADERS
1483 list(APPEND VNET_API_FILES
1488 ##############################################################################
1490 ##############################################################################
1492 add_vpp_library(vnet
1493 SOURCES ${VNET_SOURCES}
1494 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1495 INSTALL_HEADERS ${VNET_HEADERS}
1496 API_FILES ${VNET_API_FILES}
1497 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1498 DEPENDS vpp_version_h api_headers
1501 ##############################################################################
1502 # vpp api test client library
1503 ##############################################################################
1505 add_vpp_library (vatclient
1506 SOURCES ip/ip_types_api.c
1510 ##############################################################################
1512 ##############################################################################
1513 add_vpp_test_library(vnet
1517 ##############################################################################