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
427 list(APPEND VNET_MULTIARCH_SOURCES
429 ip/reass/ip4_full_reass.c
431 ip/reass/ip6_full_reass.c
432 ip/reass/ip4_sv_reass.c
434 ip/reass/ip6_full_reass.c
435 ip/reass/ip6_sv_reass.c
442 list(APPEND VNET_HEADERS
457 ip/ip6_hop_by_hop_packet.h
461 ip/ip_container_proxy.h
466 ip/ip_source_and_port_range_check.h
475 list(APPEND VNET_API_FILES
480 list(APPEND VNET_MULTIARCH_SOURCES
486 ##############################################################################
488 ##############################################################################
489 list(APPEND VNET_SOURCES
490 ip-neighbor/ip_neighbor.c
491 ip-neighbor/ip_neighbor_api.c
492 ip-neighbor/ip_neighbor_dp.c
493 ip-neighbor/ip_neighbor_types.c
494 ip-neighbor/ip_neighbor_watch.c
495 ip-neighbor/ip4_neighbor.c
496 ip-neighbor/ip6_neighbor.c
499 list(APPEND VNET_HEADERS
500 ip-neighbor/ip_neighbor.h
501 ip-neighbor/ip_neighbor_types.h
504 list(APPEND VNET_API_FILES
505 ip-neighbor/ip_neighbor.api
508 ##############################################################################
509 # Bidirectional Forwarding Detection
510 ##############################################################################
512 list(APPEND VNET_HEADERS
519 list(APPEND VNET_SOURCES
528 list(APPEND VNET_API_FILES bfd/bfd.api)
530 ##############################################################################
532 ##############################################################################
534 list(APPEND VNET_SOURCES
542 list(APPEND VNET_HEADERS
546 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
548 list(APPEND VNET_API_FILES crypto/crypto.api)
550 ##############################################################################
551 # Layer 3 protocol: IPSec
552 ##############################################################################
553 list(APPEND VNET_SOURCES
557 ipsec/ipsec_handoff.c
563 ipsec/ipsec_spd_policy.c
572 ipsec/ipsec_types_api.c
575 list(APPEND VNET_MULTIARCH_SOURCES
580 ipsec/ipsec_handoff.c
586 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
587 list(APPEND VNET_API_FILES ipsec/ipsec.api)
589 list(APPEND VNET_SOURCES
593 list(APPEND VNET_HEADERS
596 ipsec/ipsec_spd_policy.h
599 ipsec/ipsec_types_api.h
605 ##############################################################################
606 # Layer 3 protocol: osi
607 ##############################################################################
608 list(APPEND VNET_SOURCES
614 list(APPEND VNET_HEADERS
618 ##############################################################################
619 # Layer 4 protocol: tcp
620 ##############################################################################
621 list(APPEND VNET_SOURCES
625 tcp/tcp_syn_filter4.c
638 list(APPEND VNET_MULTIARCH_SOURCES
641 tcp/tcp_syn_filter4.c
644 list(APPEND VNET_HEADERS
657 list(APPEND VNET_API_FILES tcp/tcp.api)
659 ##############################################################################
660 # Layer 4 protocol: udp
661 ##############################################################################
662 list(APPEND VNET_SOURCES
674 list(APPEND VNET_MULTIARCH_SOURCES
679 list(APPEND VNET_HEADERS
687 list(APPEND VNET_API_FILES udp/udp.api)
689 ##############################################################################
690 # Tunnel protocol: gre
691 ##############################################################################
692 list(APPEND VNET_SOURCES
700 list(APPEND VNET_MULTIARCH_SOURCES
705 list(APPEND VNET_HEADERS
711 list(APPEND VNET_API_FILES gre/gre.api)
713 ##############################################################################
714 # Tunnel protocol: ipip
715 ##############################################################################
716 list(APPEND VNET_SOURCES
724 list(APPEND VNET_MULTIARCH_SOURCES
728 list(APPEND VNET_HEADERS
732 list(APPEND VNET_API_FILES
736 ##############################################################################
738 ##############################################################################
739 list(APPEND VNET_SOURCES
741 tunnel/tunnel_types_api.c
744 list(APPEND VNET_API_FILES
745 tunnel/tunnel_types.api
748 list(APPEND VNET_HEADERS
753 ##############################################################################
754 # Tunnel protocol: gre+mpls
755 ##############################################################################
756 list(APPEND VNET_SOURCES
768 list(APPEND VNET_MULTIARCH_SOURCES
775 list(APPEND VNET_HEADERS
783 list(APPEND VNET_API_FILES mpls/mpls.api)
785 ##############################################################################
786 # Tunnel protocol: vxlan-gbp
787 ##############################################################################
788 list(APPEND VNET_SOURCES
791 vxlan-gbp/vxlan_gbp_api.c
792 vxlan-gbp/vxlan_gbp.c
793 vxlan-gbp/vxlan_gbp_packet.c
796 list (APPEND VNET_MULTIARCH_SOURCES
801 list(APPEND VNET_HEADERS
802 vxlan-gbp/vxlan_gbp.h
803 vxlan-gbp/vxlan_gbp_packet.h
804 vxlan-gbp/vxlan_gbp_error.def
807 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
809 ##############################################################################
810 # Tunnel protocol: vxlan-gpe
811 ##############################################################################
813 list(APPEND VNET_SOURCES
814 vxlan-gpe/vxlan_gpe.c
817 vxlan-gpe/vxlan_gpe_api.c
820 list (APPEND VNET_MULTIARCH_SOURCES
824 list(APPEND VNET_HEADERS
825 vxlan-gpe/vxlan_gpe.h
826 vxlan-gpe/vxlan_gpe_packet.h
827 vxlan-gpe/vxlan_gpe_error.def
830 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
832 ##############################################################################
833 # ipv6 segment routing
834 ##############################################################################
836 list(APPEND VNET_SOURCES
839 srv6/sr_policy_rewrite.c
844 list(APPEND VNET_HEADERS
849 list(APPEND VNET_API_FILES
854 ##############################################################################
855 # mpls segment routing
856 ##############################################################################
858 list(APPEND VNET_SOURCES
859 srmpls/sr_mpls_policy.c
860 srmpls/sr_mpls_steering.c
864 list(APPEND VNET_HEADERS
868 list(APPEND VNET_API_FILES
872 ##############################################################################
873 # IPFIX / netflow v10
874 ##############################################################################
875 list(APPEND VNET_SOURCES
876 ipfix-export/flow_report.c
877 ipfix-export/flow_api.c
880 list(APPEND VNET_HEADERS
881 ipfix-export/flow_report.h
882 ipfix-export/ipfix_info_elements.h
883 ipfix-export/ipfix_packet.h
886 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
888 ##############################################################################
890 ##############################################################################
891 list(APPEND VNET_SOURCES
898 list(APPEND VNET_HEADERS
901 gso/hdr_offset_parser.h
905 list(APPEND VNET_API_FILES
909 ##############################################################################
910 # IPFIX classify code
911 ##############################################################################
913 list(APPEND VNET_SOURCES
914 ipfix-export/flow_report_classify.c
917 list(APPEND VNET_HEADERS
918 ipfix-export/flow_report_classify.h
921 ##############################################################################
923 ##############################################################################
925 list(APPEND VNET_SOURCES
926 lawful-intercept/lawful_intercept.c
927 lawful-intercept/node.c
930 list(APPEND VNET_MULTIARCH_SOURCES
931 lawful-intercept/node.c
934 list(APPEND VNET_HEADERS
935 lawful-intercept/lawful_intercept.h
938 ##############################################################################
939 # SPAN (port mirroring)
940 ##############################################################################
942 list(APPEND VNET_SOURCES
948 list(APPEND VNET_MULTIARCH_SOURCES
952 list(APPEND VNET_HEADERS
956 list(APPEND VNET_API_FILES span/span.api)
958 ##############################################################################
960 ##############################################################################
962 list(APPEND VNET_SOURCES
972 list(APPEND VNET_HEADERS
977 list(APPEND VNET_API_FILES pg/pg.api)
979 ##############################################################################
981 ##############################################################################
983 list(APPEND VNET_SOURCES
985 devices/virtio/device.c
986 devices/virtio/format.c
987 devices/virtio/node.c
989 devices/virtio/vhost_user.c
990 devices/virtio/vhost_user_input.c
991 devices/virtio/vhost_user_output.c
992 devices/virtio/vhost_user_api.c
993 devices/virtio/virtio.c
994 devices/virtio/virtio_api.c
995 devices/virtio/virtio_pci_legacy.c
996 devices/virtio/virtio_pci_modern.c
997 devices/virtio/virtio_process.c
998 devices/virtio/virtio_types_api.c
1001 list(APPEND VNET_HEADERS
1002 devices/virtio/pci.h
1003 devices/virtio/virtio.h
1004 devices/virtio/virtio_buffering.h
1005 devices/virtio/virtio_std.h
1006 devices/virtio/virtio_pci_legacy.h
1007 devices/virtio/virtio_pci_modern.h
1008 devices/virtio/vhost_std.h
1009 devices/virtio/vhost_user.h
1010 devices/virtio/virtio_types_api.h
1013 list(APPEND VNET_MULTIARCH_SOURCES
1014 devices/virtio/vhost_user_input.c
1015 devices/virtio/vhost_user_output.c
1016 devices/virtio/node.c
1017 devices/af_packet/node.c
1018 devices/virtio/device.c
1021 list(APPEND VNET_API_FILES
1022 devices/virtio/vhost_user.api
1023 devices/virtio/virtio.api
1024 devices/virtio/virtio_types.api
1027 ##############################################################################
1028 # tap interface (with virtio backend)
1029 ##############################################################################
1031 list(APPEND VNET_SOURCES
1034 devices/tap/tapv2_api.c
1037 list(APPEND VNET_HEADERS
1041 list(APPEND VNET_API_FILES
1042 devices/tap/tapv2.api
1045 ##############################################################################
1046 # tap interface (with virtio backend)
1047 ##############################################################################
1049 list(APPEND VNET_SOURCES
1050 devices/pipe/pipe_api.c
1054 list(APPEND VNET_HEADERS
1058 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1060 ##############################################################################
1061 # session managmeent
1062 ##############################################################################
1064 list(APPEND VNET_SOURCES
1066 session/session_debug.c
1067 session/session_table.c
1068 session/session_rules_table.c
1069 session/session_lookup.c
1070 session/session_node.c
1072 session/application.c
1073 session/application_worker.c
1074 session/session_cli.c
1075 session/application_interface.c
1076 session/application_local.c
1077 session/application_namespace.c
1078 session/segment_manager.c
1079 session/session_api.c
1082 list(APPEND VNET_HEADERS
1084 session/session_table.h
1085 session/session_rules_table.h
1086 session/session_types.h
1087 session/session_lookup.h
1088 session/application.h
1090 session/transport_types.h
1091 session/application_interface.h
1092 session/application_local.h
1093 session/application_namespace.h
1094 session/session_debug.h
1095 session/segment_manager.h
1096 session/mma_template.h
1097 session/mma_template.c
1102 list(APPEND VNET_API_FILES session/session.api)
1104 ##############################################################################
1106 ##############################################################################
1108 list(APPEND VNET_SOURCES
1112 list(APPEND VNET_HEADERS
1117 ##############################################################################
1118 # Linux packet interface
1119 ##############################################################################
1121 list(APPEND VNET_SOURCES
1122 devices/af_packet/af_packet.c
1123 devices/af_packet/device.c
1124 devices/af_packet/node.c
1125 devices/af_packet/cli.c
1126 devices/af_packet/af_packet_api.c
1129 list(APPEND VNET_MULTIARCH_SOURCES
1130 devices/af_packet/device.c
1133 list(APPEND VNET_HEADERS
1134 devices/af_packet/af_packet.h
1137 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1139 ##############################################################################
1140 # Driver feature graph arc support
1141 ##############################################################################
1143 list(APPEND VNET_SOURCES
1145 feature/feature_api.c
1146 feature/registration.c
1149 list(APPEND VNET_HEADERS
1153 list(APPEND VNET_API_FILES feature/feature.api)
1155 ##############################################################################
1156 # Unix kernel related
1157 ##############################################################################
1159 # FIXME: unix/hgshm.c
1161 list(APPEND VNET_SOURCES
1166 list(APPEND VNET_HEADERS
1170 ##############################################################################
1172 ##############################################################################
1174 list(APPEND VNET_SOURCES
1186 fib/fib_entry_src_adj.c
1187 fib/fib_entry_src_api.c
1188 fib/fib_entry_src_drop.c
1189 fib/fib_entry_src_interface.c
1190 fib/fib_entry_src_interpose.c
1191 fib/fib_entry_src_lisp.c
1192 fib/fib_entry_src_mpls.c
1193 fib/fib_entry_src_simple.c
1194 fib/fib_entry_src_rr.c
1195 fib/fib_entry_cover.c
1196 fib/fib_entry_delegate.c
1197 fib/fib_entry_track.c
1204 fib/fib_attached_export.c
1209 list(APPEND VNET_HEADERS
1219 fib/fib_entry_delegate.h
1224 list(APPEND VNET_API_FILES fib/fib_types.api)
1226 ##############################################################################
1228 ##############################################################################
1230 list(APPEND VNET_SOURCES
1234 adj/adj_midchain_delegate.c
1244 list(APPEND VNET_MULTIARCH_SOURCES
1250 list(APPEND VNET_HEADERS
1260 ##############################################################################
1261 # Data-Plane Objects
1262 ##############################################################################
1264 list(APPEND VNET_SOURCES
1272 dpo/load_balance_map.c
1276 dpo/interface_rx_dpo.c
1277 dpo/interface_tx_dpo.c
1278 dpo/mpls_disposition.c
1279 dpo/mpls_label_dpo.c
1285 list(APPEND VNET_MULTIARCH_SOURCES
1287 dpo/mpls_disposition.c
1289 dpo/mpls_label_dpo.c
1290 dpo/interface_rx_dpo.c
1293 list(APPEND VNET_HEADERS
1305 ##############################################################################
1307 ##############################################################################
1309 list(APPEND VNET_SOURCES
1319 mfib/mfib_entry_cover.c
1320 mfib/mfib_entry_delegate.c
1321 mfib/mfib_entry_src.c
1322 mfib/mfib_entry_src_rr.c
1326 list(APPEND VNET_MULTIARCH_SOURCES
1330 list(APPEND VNET_HEADERS
1336 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1338 ##############################################################################
1340 ##############################################################################
1342 list(APPEND VNET_SOURCES
1349 list(APPEND VNET_HEADERS
1353 ##############################################################################
1355 ##############################################################################
1357 list(APPEND VNET_SOURCES
1360 qos/qos_egress_map.c
1362 qos/qos_record_node.c
1364 qos/qos_store_node.c
1369 list(APPEND VNET_MULTIARCH_SOURCES
1370 qos/qos_record_node.c
1374 list(APPEND VNET_API_FILES qos/qos.api)
1376 ##############################################################################
1378 ##############################################################################
1380 list(APPEND VNET_SOURCES
1381 bier/bier_bit_string.c
1384 bier/bier_fmask_db.c
1393 bier/bier_imp_node.c
1395 bier/bier_disp_entry.c
1396 bier/bier_disp_lookup_node.c
1397 bier/bier_disp_dispatch_node.c
1398 bier/bier_disp_table.c
1399 bier/bier_bift_table.c
1402 list(APPEND VNET_MULTIARCH_SOURCES
1403 bier/bier_disp_dispatch_node.c
1404 bier/bier_disp_lookup_node.c
1405 bier/bier_imp_node.c
1408 list(APPEND VNET_HEADERS
1415 list(APPEND VNET_API_FILES bier/bier.api)
1417 ##############################################################################
1419 ##############################################################################
1421 list (APPEND VNET_SOURCES
1427 list(APPEND VNET_HEADERS
1432 list(APPEND VNET_API_FILES syslog/syslog.api)
1434 ##############################################################################
1435 # Tunnel Endpoint Information Base
1436 ##############################################################################
1438 list (APPEND VNET_SOURCES
1444 list(APPEND VNET_HEADERS
1448 list(APPEND VNET_API_FILES teib/teib.api)
1450 ##############################################################################
1452 ##############################################################################
1454 list (APPEND VNET_SOURCES
1460 list(APPEND VNET_HEADERS
1464 list(APPEND VNET_API_FILES arp/arp.api)
1466 list (APPEND VNET_SOURCES
1470 ip6-nd/ip6_nd_proxy.c
1476 list(APPEND VNET_HEADERS
1480 list(APPEND VNET_API_FILES
1485 ##############################################################################
1487 ##############################################################################
1489 add_vpp_library(vnet
1490 SOURCES ${VNET_SOURCES}
1491 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1492 INSTALL_HEADERS ${VNET_HEADERS}
1493 API_FILES ${VNET_API_FILES}
1494 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1495 DEPENDS vpp_version_h api_headers
1498 ##############################################################################
1499 # vpp api test client library
1500 ##############################################################################
1502 add_vpp_library (vatclient
1503 SOURCES ip/ip_types_api.c
1507 ##############################################################################
1509 ##############################################################################
1510 add_vpp_test_library(vnet
1514 ##############################################################################