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
43 list(APPEND VNET_MULTIARCH_SOURCES
49 list(APPEND VNET_HEADERS
74 ethernet/ethernet_format_fns.h
77 list(APPEND VNET_API_FILES
85 ##############################################################################
87 ##############################################################################
88 list(APPEND VNET_SOURCES
95 list(APPEND VNET_MULTIARCH_SOURCES
99 list(APPEND VNET_HEADERS
105 list(APPEND VNET_API_FILES
107 policer/policer_types.api
110 ##############################################################################
111 # Binary API compatibility until vpp 20.12, see the ADL plugin...
112 ##############################################################################
114 list(APPEND VNET_SOURCES
118 list(APPEND VNET_API_FILES cop/cop.api)
120 ##############################################################################
121 # Layer 2 protocols go here
122 ##############################################################################
124 ##############################################################################
125 # Layer 2 protocol: Ethernet
126 ##############################################################################
127 list(APPEND VNET_SOURCES
128 ethernet/arp_packet.c
129 ethernet/ethernet_types_api.c
133 ethernet/mac_address.c
137 ethernet/p2p_ethernet.c
138 ethernet/p2p_ethernet_input.c
139 ethernet/p2p_ethernet_api.c
142 list(APPEND VNET_MULTIARCH_SOURCES
144 ethernet/p2p_ethernet_input.c
147 list(APPEND VNET_HEADERS
150 ethernet/mac_address.h
154 ethernet/p2p_ethernet.h
155 ethernet/arp_packet.h
158 list(APPEND VNET_API_FILES
159 ethernet/p2p_ethernet.api
160 ethernet/ethernet_types.api)
162 ##############################################################################
163 # Layer 2 protocol: Ethernet bridging
164 ##############################################################################
165 list(APPEND VNET_SOURCES
172 l2/l2_input_classify.c
173 l2/l2_output_classify.c
184 l2/l2_in_out_feat_arc.c
192 list(APPEND VNET_MULTIARCH_SOURCES
198 l2/l2_in_out_feat_arc.c
199 l2/l2_input_classify.c
201 l2/l2_output_classify.c
211 list(APPEND VNET_HEADERS
228 list(APPEND VNET_API_FILES l2/l2.api)
230 ##############################################################################
231 # Layer 2 protocol: SRP
232 ##############################################################################
233 list(APPEND VNET_SOURCES
240 list(APPEND VNET_HEADERS
245 ##############################################################################
246 # Layer 2 protocol: PPP
247 ##############################################################################
248 list(APPEND VNET_SOURCES
254 list(APPEND VNET_HEADERS
260 ##############################################################################
261 # Layer 2 protocol: HDLC
262 ##############################################################################
263 list(APPEND VNET_SOURCES
269 list(APPEND VNET_HEADERS
275 ##############################################################################
276 # Layer 2 protocol: LLC
277 ##############################################################################
278 list(APPEND VNET_SOURCES
284 list(APPEND VNET_HEADERS
288 ##############################################################################
289 # Layer 2 protocol: SNAP
290 ##############################################################################
291 list(APPEND VNET_SOURCES
297 list(APPEND VNET_HEADERS
301 ##############################################################################
303 ##############################################################################
304 list(APPEND VNET_SOURCES
311 list(APPEND VNET_MULTIARCH_SOURCES
315 list(APPEND VNET_HEADERS
318 vxlan/vxlan_error.def
321 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
323 list(APPEND VNET_API_FILES vxlan/vxlan.api)
325 ##############################################################################
327 ##############################################################################
328 list(APPEND VNET_SOURCES
335 list(APPEND VNET_HEADERS
339 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
340 list(APPEND VNET_API_FILES bonding/bond.api)
342 ##############################################################################
343 # Layer 2/3 "classify"
344 ##############################################################################
345 list(APPEND VNET_SOURCES
346 classify/vnet_classify.c
347 classify/trace_classify.h
348 classify/ip_classify.c
349 classify/in_out_acl.c
350 classify/policer_classify.c
351 classify/flow_classify.c
352 classify/flow_classify_node.c
353 classify/vnet_classify.h
354 classify/classify_api.c
357 list(APPEND VNET_MULTIARCH_SOURCES
358 classify/ip_classify.c
359 classify/flow_classify_node.c
362 list(APPEND VNET_HEADERS
363 classify/vnet_classify.h
364 classify/trace_classify.h
365 classify/in_out_acl.h
366 classify/policer_classify.h
367 classify/flow_classify.h
370 list(APPEND VNET_API_FILES classify/classify.api)
372 ##############################################################################
373 # Layer 3 protocols go here
374 ##############################################################################
376 ##############################################################################
377 # Layer 3 protocol: IP v4/v6
378 ##############################################################################
379 list(APPEND VNET_SOURCES
393 ip/ip4_source_and_port_range_check.c
394 ip/reass/ip4_full_reass.c
395 ip/reass/ip4_sv_reass.c
405 ip/reass/ip6_full_reass.c
406 ip/reass/ip6_sv_reass.c
409 ip/ip_container_proxy.c
424 list(APPEND VNET_MULTIARCH_SOURCES
426 ip/reass/ip4_full_reass.c
428 ip/reass/ip6_full_reass.c
429 ip/reass/ip4_sv_reass.c
431 ip/reass/ip6_full_reass.c
432 ip/reass/ip6_sv_reass.c
439 list(APPEND VNET_HEADERS
454 ip/ip6_hop_by_hop_packet.h
458 ip/ip_container_proxy.h
463 ip/ip_source_and_port_range_check.h
472 list(APPEND VNET_API_FILES
477 list(APPEND VNET_MULTIARCH_SOURCES
483 ##############################################################################
485 ##############################################################################
486 list(APPEND VNET_SOURCES
487 ip-neighbor/ip_neighbor.c
488 ip-neighbor/ip_neighbor_api.c
489 ip-neighbor/ip_neighbor_dp.c
490 ip-neighbor/ip_neighbor_types.c
491 ip-neighbor/ip_neighbor_watch.c
492 ip-neighbor/ip4_neighbor.c
493 ip-neighbor/ip6_neighbor.c
496 list(APPEND VNET_HEADERS
497 ip-neighbor/ip_neighbor.h
498 ip-neighbor/ip_neighbor_types.h
501 list(APPEND VNET_API_FILES
502 ip-neighbor/ip_neighbor.api
505 ##############################################################################
506 # Bidirectional Forwarding Detection
507 ##############################################################################
509 list(APPEND VNET_HEADERS
516 list(APPEND VNET_SOURCES
525 list(APPEND VNET_API_FILES bfd/bfd.api)
527 ##############################################################################
529 ##############################################################################
531 list(APPEND VNET_SOURCES
539 list(APPEND VNET_HEADERS
543 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
545 list(APPEND VNET_API_FILES crypto/crypto.api)
547 ##############################################################################
548 # Layer 3 protocol: IPSec
549 ##############################################################################
550 list(APPEND VNET_SOURCES
554 ipsec/ipsec_handoff.c
560 ipsec/ipsec_spd_policy.c
569 ipsec/ipsec_types_api.c
572 list(APPEND VNET_MULTIARCH_SOURCES
577 ipsec/ipsec_handoff.c
583 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
584 list(APPEND VNET_API_FILES ipsec/ipsec.api)
586 list(APPEND VNET_SOURCES
590 list(APPEND VNET_HEADERS
593 ipsec/ipsec_spd_policy.h
596 ipsec/ipsec_types_api.h
602 ##############################################################################
603 # Layer 3 protocol: osi
604 ##############################################################################
605 list(APPEND VNET_SOURCES
611 list(APPEND VNET_HEADERS
615 ##############################################################################
616 # Layer 4 protocol: tcp
617 ##############################################################################
618 list(APPEND VNET_SOURCES
622 tcp/tcp_syn_filter4.c
635 list(APPEND VNET_MULTIARCH_SOURCES
638 tcp/tcp_syn_filter4.c
641 list(APPEND VNET_HEADERS
654 list(APPEND VNET_API_FILES tcp/tcp.api)
656 ##############################################################################
657 # Layer 4 protocol: udp
658 ##############################################################################
659 list(APPEND VNET_SOURCES
671 list(APPEND VNET_MULTIARCH_SOURCES
676 list(APPEND VNET_HEADERS
684 list(APPEND VNET_API_FILES udp/udp.api)
686 ##############################################################################
687 # Tunnel protocol: gre
688 ##############################################################################
689 list(APPEND VNET_SOURCES
697 list(APPEND VNET_MULTIARCH_SOURCES
702 list(APPEND VNET_HEADERS
708 list(APPEND VNET_API_FILES gre/gre.api)
710 ##############################################################################
711 # Tunnel protocol: ipip
712 ##############################################################################
713 list(APPEND VNET_SOURCES
721 list(APPEND VNET_MULTIARCH_SOURCES
725 list(APPEND VNET_HEADERS
729 list(APPEND VNET_API_FILES
733 ##############################################################################
735 ##############################################################################
736 list(APPEND VNET_SOURCES
738 tunnel/tunnel_types_api.c
741 list(APPEND VNET_API_FILES
742 tunnel/tunnel_types.api
745 list(APPEND VNET_HEADERS
750 ##############################################################################
751 # Tunnel protocol: gre+mpls
752 ##############################################################################
753 list(APPEND VNET_SOURCES
765 list(APPEND VNET_MULTIARCH_SOURCES
772 list(APPEND VNET_HEADERS
780 list(APPEND VNET_API_FILES mpls/mpls.api)
782 ##############################################################################
783 # Tunnel protocol: vxlan-gbp
784 ##############################################################################
785 list(APPEND VNET_SOURCES
788 vxlan-gbp/vxlan_gbp_api.c
789 vxlan-gbp/vxlan_gbp.c
790 vxlan-gbp/vxlan_gbp_packet.c
793 list (APPEND VNET_MULTIARCH_SOURCES
798 list(APPEND VNET_HEADERS
799 vxlan-gbp/vxlan_gbp.h
800 vxlan-gbp/vxlan_gbp_packet.h
801 vxlan-gbp/vxlan_gbp_error.def
804 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
806 ##############################################################################
807 # Tunnel protocol: vxlan-gpe
808 ##############################################################################
810 list(APPEND VNET_SOURCES
811 vxlan-gpe/vxlan_gpe.c
814 vxlan-gpe/vxlan_gpe_api.c
817 list (APPEND VNET_MULTIARCH_SOURCES
821 list(APPEND VNET_HEADERS
822 vxlan-gpe/vxlan_gpe.h
823 vxlan-gpe/vxlan_gpe_packet.h
824 vxlan-gpe/vxlan_gpe_error.def
827 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
829 ##############################################################################
830 # ipv6 segment routing
831 ##############################################################################
833 list(APPEND VNET_SOURCES
836 srv6/sr_policy_rewrite.c
841 list(APPEND VNET_HEADERS
846 list(APPEND VNET_API_FILES
851 ##############################################################################
852 # mpls segment routing
853 ##############################################################################
855 list(APPEND VNET_SOURCES
856 srmpls/sr_mpls_policy.c
857 srmpls/sr_mpls_steering.c
861 list(APPEND VNET_HEADERS
865 list(APPEND VNET_API_FILES
870 ##############################################################################
871 # IPFIX / netflow v10
872 ##############################################################################
873 list(APPEND VNET_SOURCES
874 ipfix-export/flow_report.c
875 ipfix-export/flow_api.c
878 list(APPEND VNET_HEADERS
879 ipfix-export/flow_report.h
880 ipfix-export/ipfix_info_elements.h
881 ipfix-export/ipfix_packet.h
884 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
886 ##############################################################################
888 ##############################################################################
889 list(APPEND VNET_SOURCES
896 list(APPEND VNET_HEADERS
899 gso/hdr_offset_parser.h
903 list(APPEND VNET_API_FILES
907 ##############################################################################
908 # IPFIX classify code
909 ##############################################################################
911 list(APPEND VNET_SOURCES
912 ipfix-export/flow_report_classify.c
915 list(APPEND VNET_HEADERS
916 ipfix-export/flow_report_classify.h
919 ##############################################################################
921 ##############################################################################
923 list(APPEND VNET_SOURCES
924 lawful-intercept/lawful_intercept.c
925 lawful-intercept/node.c
928 list(APPEND VNET_MULTIARCH_SOURCES
929 lawful-intercept/node.c
932 list(APPEND VNET_HEADERS
933 lawful-intercept/lawful_intercept.h
936 ##############################################################################
937 # SPAN (port mirroring)
938 ##############################################################################
940 list(APPEND VNET_SOURCES
946 list(APPEND VNET_MULTIARCH_SOURCES
950 list(APPEND VNET_HEADERS
954 list(APPEND VNET_API_FILES span/span.api)
956 ##############################################################################
958 ##############################################################################
960 list(APPEND VNET_SOURCES
970 list(APPEND VNET_HEADERS
975 list(APPEND VNET_API_FILES pg/pg.api)
977 ##############################################################################
979 ##############################################################################
981 list(APPEND VNET_SOURCES
983 devices/virtio/device.c
984 devices/virtio/format.c
985 devices/virtio/node.c
987 devices/virtio/vhost_user.c
988 devices/virtio/vhost_user_input.c
989 devices/virtio/vhost_user_output.c
990 devices/virtio/vhost_user_api.c
991 devices/virtio/virtio.c
992 devices/virtio/virtio_api.c
993 devices/virtio/virtio_pci_legacy.c
994 devices/virtio/virtio_pci_modern.c
995 devices/virtio/virtio_process.c
996 devices/virtio/virtio_types_api.c
999 list(APPEND VNET_HEADERS
1000 devices/virtio/pci.h
1001 devices/virtio/virtio.h
1002 devices/virtio/virtio_buffering.h
1003 devices/virtio/virtio_std.h
1004 devices/virtio/virtio_pci_legacy.h
1005 devices/virtio/virtio_pci_modern.h
1006 devices/virtio/vhost_std.h
1007 devices/virtio/vhost_user.h
1008 devices/virtio/virtio_types_api.h
1011 list(APPEND VNET_MULTIARCH_SOURCES
1012 devices/virtio/vhost_user_input.c
1013 devices/virtio/vhost_user_output.c
1014 devices/virtio/node.c
1015 devices/af_packet/node.c
1016 devices/virtio/device.c
1019 list(APPEND VNET_API_FILES
1020 devices/virtio/vhost_user.api
1021 devices/virtio/virtio.api
1022 devices/virtio/virtio_types.api
1025 ##############################################################################
1026 # tap interface (with virtio backend)
1027 ##############################################################################
1029 list(APPEND VNET_SOURCES
1032 devices/tap/tapv2_api.c
1035 list(APPEND VNET_HEADERS
1039 list(APPEND VNET_API_FILES
1040 devices/tap/tapv2.api
1043 ##############################################################################
1044 # tap interface (with virtio backend)
1045 ##############################################################################
1047 list(APPEND VNET_SOURCES
1048 devices/pipe/pipe_api.c
1052 list(APPEND VNET_HEADERS
1056 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1058 ##############################################################################
1059 # session managmeent
1060 ##############################################################################
1062 list(APPEND VNET_SOURCES
1064 session/session_debug.c
1065 session/session_table.c
1066 session/session_rules_table.c
1067 session/session_lookup.c
1068 session/session_node.c
1070 session/application.c
1071 session/application_worker.c
1072 session/session_cli.c
1073 session/application_interface.c
1074 session/application_local.c
1075 session/application_namespace.c
1076 session/segment_manager.c
1077 session/session_api.c
1080 list(APPEND VNET_HEADERS
1082 session/session_table.h
1083 session/session_rules_table.h
1084 session/session_types.h
1085 session/session_lookup.h
1086 session/application.h
1088 session/transport_types.h
1089 session/application_interface.h
1090 session/application_local.h
1091 session/application_namespace.h
1092 session/session_debug.h
1093 session/segment_manager.h
1094 session/mma_template.h
1095 session/mma_template.c
1100 list(APPEND VNET_API_FILES session/session.api)
1102 ##############################################################################
1104 ##############################################################################
1106 list(APPEND VNET_SOURCES
1110 list(APPEND VNET_HEADERS
1115 ##############################################################################
1116 # Linux packet interface
1117 ##############################################################################
1119 list(APPEND VNET_SOURCES
1120 devices/af_packet/af_packet.c
1121 devices/af_packet/device.c
1122 devices/af_packet/node.c
1123 devices/af_packet/cli.c
1124 devices/af_packet/af_packet_api.c
1127 list(APPEND VNET_MULTIARCH_SOURCES
1128 devices/af_packet/device.c
1131 list(APPEND VNET_HEADERS
1132 devices/af_packet/af_packet.h
1135 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1137 ##############################################################################
1138 # Driver feature graph arc support
1139 ##############################################################################
1141 list(APPEND VNET_SOURCES
1143 feature/feature_api.c
1144 feature/registration.c
1147 list(APPEND VNET_HEADERS
1151 list(APPEND VNET_API_FILES feature/feature.api)
1153 ##############################################################################
1154 # Unix kernel related
1155 ##############################################################################
1157 # FIXME: unix/hgshm.c
1159 list(APPEND VNET_SOURCES
1164 list(APPEND VNET_HEADERS
1168 ##############################################################################
1170 ##############################################################################
1172 list(APPEND VNET_SOURCES
1184 fib/fib_entry_src_adj.c
1185 fib/fib_entry_src_api.c
1186 fib/fib_entry_src_drop.c
1187 fib/fib_entry_src_interface.c
1188 fib/fib_entry_src_interpose.c
1189 fib/fib_entry_src_lisp.c
1190 fib/fib_entry_src_mpls.c
1191 fib/fib_entry_src_simple.c
1192 fib/fib_entry_src_rr.c
1193 fib/fib_entry_cover.c
1194 fib/fib_entry_delegate.c
1195 fib/fib_entry_track.c
1201 fib/fib_attached_export.c
1206 list(APPEND VNET_HEADERS
1216 fib/fib_entry_delegate.h
1220 list(APPEND VNET_API_FILES fib/fib_types.api)
1222 ##############################################################################
1224 ##############################################################################
1226 list(APPEND VNET_SOURCES
1230 adj/adj_midchain_delegate.c
1240 list(APPEND VNET_MULTIARCH_SOURCES
1246 list(APPEND VNET_HEADERS
1256 ##############################################################################
1257 # Data-Plane Objects
1258 ##############################################################################
1260 list(APPEND VNET_SOURCES
1268 dpo/load_balance_map.c
1272 dpo/interface_rx_dpo.c
1273 dpo/interface_tx_dpo.c
1274 dpo/mpls_disposition.c
1275 dpo/mpls_label_dpo.c
1281 list(APPEND VNET_MULTIARCH_SOURCES
1283 dpo/mpls_disposition.c
1285 dpo/mpls_label_dpo.c
1286 dpo/interface_rx_dpo.c
1289 list(APPEND VNET_HEADERS
1301 ##############################################################################
1303 ##############################################################################
1305 list(APPEND VNET_SOURCES
1315 mfib/mfib_entry_cover.c
1316 mfib/mfib_entry_delegate.c
1317 mfib/mfib_entry_src.c
1318 mfib/mfib_entry_src_rr.c
1322 list(APPEND VNET_MULTIARCH_SOURCES
1326 list(APPEND VNET_HEADERS
1332 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1334 ##############################################################################
1336 ##############################################################################
1338 list(APPEND VNET_SOURCES
1345 list(APPEND VNET_HEADERS
1349 ##############################################################################
1351 ##############################################################################
1353 list(APPEND VNET_SOURCES
1356 qos/qos_egress_map.c
1358 qos/qos_record_node.c
1360 qos/qos_store_node.c
1365 list(APPEND VNET_MULTIARCH_SOURCES
1366 qos/qos_record_node.c
1370 list(APPEND VNET_API_FILES qos/qos.api)
1372 ##############################################################################
1374 ##############################################################################
1376 list(APPEND VNET_SOURCES
1377 bier/bier_bit_string.c
1380 bier/bier_fmask_db.c
1389 bier/bier_imp_node.c
1391 bier/bier_disp_entry.c
1392 bier/bier_disp_lookup_node.c
1393 bier/bier_disp_dispatch_node.c
1394 bier/bier_disp_table.c
1395 bier/bier_bift_table.c
1398 list(APPEND VNET_MULTIARCH_SOURCES
1399 bier/bier_disp_dispatch_node.c
1400 bier/bier_disp_lookup_node.c
1401 bier/bier_imp_node.c
1404 list(APPEND VNET_HEADERS
1411 list(APPEND VNET_API_FILES bier/bier.api)
1413 ##############################################################################
1415 ##############################################################################
1417 list (APPEND VNET_SOURCES
1423 list(APPEND VNET_HEADERS
1428 list(APPEND VNET_API_FILES syslog/syslog.api)
1430 ##############################################################################
1431 # Tunnel Endpoint Information Base
1432 ##############################################################################
1434 list (APPEND VNET_SOURCES
1440 list(APPEND VNET_HEADERS
1444 list(APPEND VNET_API_FILES teib/teib.api)
1446 ##############################################################################
1448 ##############################################################################
1450 list (APPEND VNET_SOURCES
1456 list(APPEND VNET_HEADERS
1460 list(APPEND VNET_API_FILES arp/arp.api)
1462 list (APPEND VNET_SOURCES
1466 ip6-nd/ip6_nd_proxy.c
1472 list(APPEND VNET_HEADERS
1476 list(APPEND VNET_API_FILES
1481 ##############################################################################
1483 ##############################################################################
1485 add_vpp_library(vnet
1486 SOURCES ${VNET_SOURCES}
1487 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1488 INSTALL_HEADERS ${VNET_HEADERS}
1489 API_FILES ${VNET_API_FILES}
1490 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1491 DEPENDS vpp_version_h api_headers
1494 ##############################################################################
1495 # vpp api test client library
1496 ##############################################################################
1498 add_vpp_library (vatclient
1499 SOURCES ip/ip_types_api.c
1503 ##############################################################################