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
423 list(APPEND VNET_MULTIARCH_SOURCES
425 ip/reass/ip4_full_reass.c
427 ip/reass/ip6_full_reass.c
428 ip/reass/ip4_sv_reass.c
430 ip/reass/ip6_full_reass.c
431 ip/reass/ip6_sv_reass.c
438 list(APPEND VNET_HEADERS
452 ip/ip6_hop_by_hop_packet.h
458 ip/ip_source_and_port_range_check.h
467 list(APPEND VNET_API_FILES
472 list(APPEND VNET_MULTIARCH_SOURCES
478 ##############################################################################
480 ##############################################################################
481 list(APPEND VNET_SOURCES
482 ip-neighbor/ip_neighbor.c
483 ip-neighbor/ip_neighbor_api.c
484 ip-neighbor/ip_neighbor_dp.c
485 ip-neighbor/ip_neighbor_types.c
486 ip-neighbor/ip_neighbor_watch.c
487 ip-neighbor/ip4_neighbor.c
488 ip-neighbor/ip6_neighbor.c
491 list(APPEND VNET_HEADERS
492 ip-neighbor/ip_neighbor.h
493 ip-neighbor/ip_neighbor_types.h
496 list(APPEND VNET_API_FILES
497 ip-neighbor/ip_neighbor.api
500 ##############################################################################
501 # Bidirectional Forwarding Detection
502 ##############################################################################
504 list(APPEND VNET_HEADERS
511 list(APPEND VNET_SOURCES
520 list(APPEND VNET_API_FILES bfd/bfd.api)
522 ##############################################################################
524 ##############################################################################
526 list(APPEND VNET_SOURCES
534 list(APPEND VNET_HEADERS
538 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
540 list(APPEND VNET_API_FILES crypto/crypto.api)
542 ##############################################################################
543 # Layer 3 protocol: IPSec
544 ##############################################################################
545 list(APPEND VNET_SOURCES
549 ipsec/ipsec_handoff.c
555 ipsec/ipsec_spd_policy.c
564 ipsec/ipsec_types_api.c
567 list(APPEND VNET_MULTIARCH_SOURCES
572 ipsec/ipsec_handoff.c
578 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
579 list(APPEND VNET_API_FILES ipsec/ipsec.api)
581 list(APPEND VNET_SOURCES
585 list(APPEND VNET_HEADERS
588 ipsec/ipsec_spd_policy.h
591 ipsec/ipsec_types_api.h
597 ##############################################################################
598 # Layer 3 protocol: osi
599 ##############################################################################
600 list(APPEND VNET_SOURCES
606 list(APPEND VNET_HEADERS
610 ##############################################################################
611 # Layer 4 protocol: tcp
612 ##############################################################################
613 list(APPEND VNET_SOURCES
617 tcp/tcp_syn_filter4.c
630 list(APPEND VNET_MULTIARCH_SOURCES
633 tcp/tcp_syn_filter4.c
636 list(APPEND VNET_HEADERS
649 list(APPEND VNET_API_FILES tcp/tcp.api)
651 ##############################################################################
652 # Layer 4 protocol: udp
653 ##############################################################################
654 list(APPEND VNET_SOURCES
666 list(APPEND VNET_MULTIARCH_SOURCES
671 list(APPEND VNET_HEADERS
677 list(APPEND VNET_API_FILES udp/udp.api)
679 ##############################################################################
680 # Tunnel protocol: gre
681 ##############################################################################
682 list(APPEND VNET_SOURCES
690 list(APPEND VNET_MULTIARCH_SOURCES
695 list(APPEND VNET_HEADERS
701 list(APPEND VNET_API_FILES gre/gre.api)
703 ##############################################################################
704 # Tunnel protocol: ipip
705 ##############################################################################
706 list(APPEND VNET_SOURCES
714 list(APPEND VNET_MULTIARCH_SOURCES
718 list(APPEND VNET_HEADERS
722 list(APPEND VNET_API_FILES
726 ##############################################################################
728 ##############################################################################
729 list(APPEND VNET_SOURCES
731 tunnel/tunnel_types_api.c
734 list(APPEND VNET_API_FILES
735 tunnel/tunnel_types.api
738 list(APPEND VNET_HEADERS
743 ##############################################################################
744 # Tunnel protocol: gre+mpls
745 ##############################################################################
746 list(APPEND VNET_SOURCES
758 list(APPEND VNET_MULTIARCH_SOURCES
765 list(APPEND VNET_HEADERS
773 list(APPEND VNET_API_FILES mpls/mpls.api)
775 ##############################################################################
776 # Tunnel protocol: vxlan-gbp
777 ##############################################################################
778 list(APPEND VNET_SOURCES
781 vxlan-gbp/vxlan_gbp_api.c
782 vxlan-gbp/vxlan_gbp.c
783 vxlan-gbp/vxlan_gbp_packet.c
786 list (APPEND VNET_MULTIARCH_SOURCES
791 list(APPEND VNET_HEADERS
792 vxlan-gbp/vxlan_gbp.h
793 vxlan-gbp/vxlan_gbp_packet.h
794 vxlan-gbp/vxlan_gbp_error.def
797 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
799 ##############################################################################
800 # Tunnel protocol: vxlan-gpe
801 ##############################################################################
803 list(APPEND VNET_SOURCES
804 vxlan-gpe/vxlan_gpe.c
807 vxlan-gpe/vxlan_gpe_api.c
810 list (APPEND VNET_MULTIARCH_SOURCES
814 list(APPEND VNET_HEADERS
815 vxlan-gpe/vxlan_gpe.h
816 vxlan-gpe/vxlan_gpe_packet.h
817 vxlan-gpe/vxlan_gpe_error.def
820 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
822 ##############################################################################
823 # ipv6 segment routing
824 ##############################################################################
826 list(APPEND VNET_SOURCES
829 srv6/sr_policy_rewrite.c
834 list(APPEND VNET_HEADERS
839 list(APPEND VNET_API_FILES
844 ##############################################################################
845 # mpls segment routing
846 ##############################################################################
848 list(APPEND VNET_SOURCES
849 srmpls/sr_mpls_policy.c
850 srmpls/sr_mpls_steering.c
854 list(APPEND VNET_HEADERS
858 list(APPEND VNET_API_FILES
863 ##############################################################################
864 # IPFIX / netflow v10
865 ##############################################################################
866 list(APPEND VNET_SOURCES
867 ipfix-export/flow_report.c
868 ipfix-export/flow_api.c
871 list(APPEND VNET_HEADERS
872 ipfix-export/flow_report.h
873 ipfix-export/ipfix_info_elements.h
874 ipfix-export/ipfix_packet.h
877 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
879 ##############################################################################
881 ##############################################################################
882 list(APPEND VNET_SOURCES
889 list(APPEND VNET_HEADERS
892 gso/hdr_offset_parser.h
896 list(APPEND VNET_API_FILES
900 ##############################################################################
901 # IPFIX classify code
902 ##############################################################################
904 list(APPEND VNET_SOURCES
905 ipfix-export/flow_report_classify.c
908 list(APPEND VNET_HEADERS
909 ipfix-export/flow_report_classify.h
912 ##############################################################################
914 ##############################################################################
916 list(APPEND VNET_SOURCES
917 lawful-intercept/lawful_intercept.c
918 lawful-intercept/node.c
921 list(APPEND VNET_MULTIARCH_SOURCES
922 lawful-intercept/node.c
925 list(APPEND VNET_HEADERS
926 lawful-intercept/lawful_intercept.h
929 ##############################################################################
930 # SPAN (port mirroring)
931 ##############################################################################
933 list(APPEND VNET_SOURCES
939 list(APPEND VNET_MULTIARCH_SOURCES
943 list(APPEND VNET_HEADERS
947 list(APPEND VNET_API_FILES span/span.api)
949 ##############################################################################
951 ##############################################################################
953 list(APPEND VNET_SOURCES
963 list(APPEND VNET_HEADERS
968 list(APPEND VNET_API_FILES pg/pg.api)
970 ##############################################################################
972 ##############################################################################
974 list(APPEND VNET_SOURCES
976 devices/virtio/device.c
977 devices/virtio/format.c
978 devices/virtio/node.c
980 devices/virtio/vhost_user.c
981 devices/virtio/vhost_user_input.c
982 devices/virtio/vhost_user_output.c
983 devices/virtio/vhost_user_api.c
984 devices/virtio/virtio.c
985 devices/virtio/virtio_api.c
986 devices/virtio/virtio_pci_legacy.c
987 devices/virtio/virtio_pci_modern.c
988 devices/virtio/virtio_types_api.c
991 list(APPEND VNET_HEADERS
993 devices/virtio/virtio.h
994 devices/virtio/virtio_buffering.h
995 devices/virtio/virtio_std.h
996 devices/virtio/virtio_pci_legacy.h
997 devices/virtio/virtio_pci_modern.h
998 devices/virtio/vhost_std.h
999 devices/virtio/vhost_user.h
1000 devices/virtio/virtio_types_api.h
1003 list(APPEND VNET_MULTIARCH_SOURCES
1004 devices/virtio/vhost_user_input.c
1005 devices/virtio/vhost_user_output.c
1006 devices/virtio/node.c
1007 devices/af_packet/node.c
1008 devices/virtio/device.c
1011 list(APPEND VNET_API_FILES
1012 devices/virtio/vhost_user.api
1013 devices/virtio/virtio.api
1014 devices/virtio/virtio_types.api
1017 ##############################################################################
1018 # tap interface (with virtio backend)
1019 ##############################################################################
1021 list(APPEND VNET_SOURCES
1024 devices/tap/tapv2_api.c
1027 list(APPEND VNET_HEADERS
1031 list(APPEND VNET_API_FILES
1032 devices/tap/tapv2.api
1035 ##############################################################################
1036 # tap interface (with virtio backend)
1037 ##############################################################################
1039 list(APPEND VNET_SOURCES
1040 devices/pipe/pipe_api.c
1044 list(APPEND VNET_HEADERS
1048 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1050 ##############################################################################
1051 # session managmeent
1052 ##############################################################################
1054 list(APPEND VNET_SOURCES
1056 session/session_debug.c
1057 session/session_table.c
1058 session/session_rules_table.c
1059 session/session_lookup.c
1060 session/session_node.c
1062 session/application.c
1063 session/application_worker.c
1064 session/session_cli.c
1065 session/application_interface.c
1066 session/application_local.c
1067 session/application_namespace.c
1068 session/segment_manager.c
1069 session/session_api.c
1072 list(APPEND VNET_HEADERS
1074 session/session_table.h
1075 session/session_rules_table.h
1076 session/session_types.h
1077 session/session_lookup.h
1078 session/application.h
1080 session/transport_types.h
1081 session/application_interface.h
1082 session/application_local.h
1083 session/application_namespace.h
1084 session/session_debug.h
1085 session/segment_manager.h
1086 session/mma_template.h
1087 session/mma_template.c
1092 list(APPEND VNET_API_FILES session/session.api)
1094 ##############################################################################
1096 ##############################################################################
1098 list(APPEND VNET_SOURCES
1102 list(APPEND VNET_HEADERS
1107 ##############################################################################
1108 # Linux packet interface
1109 ##############################################################################
1111 list(APPEND VNET_SOURCES
1112 devices/af_packet/af_packet.c
1113 devices/af_packet/device.c
1114 devices/af_packet/node.c
1115 devices/af_packet/cli.c
1116 devices/af_packet/af_packet_api.c
1119 list(APPEND VNET_MULTIARCH_SOURCES
1120 devices/af_packet/device.c
1123 list(APPEND VNET_HEADERS
1124 devices/af_packet/af_packet.h
1127 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1129 ##############################################################################
1130 # Driver feature graph arc support
1131 ##############################################################################
1133 list(APPEND VNET_SOURCES
1135 feature/feature_api.c
1136 feature/registration.c
1139 list(APPEND VNET_HEADERS
1143 list(APPEND VNET_API_FILES feature/feature.api)
1145 ##############################################################################
1146 # Unix kernel related
1147 ##############################################################################
1149 # FIXME: unix/hgshm.c
1151 list(APPEND VNET_SOURCES
1156 list(APPEND VNET_HEADERS
1160 ##############################################################################
1162 ##############################################################################
1164 list(APPEND VNET_SOURCES
1176 fib/fib_entry_src_adj.c
1177 fib/fib_entry_src_api.c
1178 fib/fib_entry_src_drop.c
1179 fib/fib_entry_src_interface.c
1180 fib/fib_entry_src_interpose.c
1181 fib/fib_entry_src_lisp.c
1182 fib/fib_entry_src_mpls.c
1183 fib/fib_entry_src_simple.c
1184 fib/fib_entry_src_rr.c
1185 fib/fib_entry_cover.c
1186 fib/fib_entry_delegate.c
1187 fib/fib_entry_track.c
1193 fib/fib_attached_export.c
1198 list(APPEND VNET_HEADERS
1208 fib/fib_entry_delegate.h
1212 list(APPEND VNET_API_FILES fib/fib_types.api)
1214 ##############################################################################
1216 ##############################################################################
1218 list(APPEND VNET_SOURCES
1222 adj/adj_midchain_delegate.c
1232 list(APPEND VNET_MULTIARCH_SOURCES
1238 list(APPEND VNET_HEADERS
1248 ##############################################################################
1249 # Data-Plane Objects
1250 ##############################################################################
1252 list(APPEND VNET_SOURCES
1260 dpo/load_balance_map.c
1264 dpo/interface_rx_dpo.c
1265 dpo/interface_tx_dpo.c
1266 dpo/mpls_disposition.c
1267 dpo/mpls_label_dpo.c
1273 list(APPEND VNET_MULTIARCH_SOURCES
1275 dpo/mpls_disposition.c
1277 dpo/mpls_label_dpo.c
1278 dpo/interface_rx_dpo.c
1281 list(APPEND VNET_HEADERS
1293 ##############################################################################
1295 ##############################################################################
1297 list(APPEND VNET_SOURCES
1307 mfib/mfib_entry_cover.c
1308 mfib/mfib_entry_delegate.c
1309 mfib/mfib_entry_src.c
1310 mfib/mfib_entry_src_rr.c
1314 list(APPEND VNET_MULTIARCH_SOURCES
1318 list(APPEND VNET_HEADERS
1324 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1326 ##############################################################################
1328 ##############################################################################
1330 list(APPEND VNET_SOURCES
1337 list(APPEND VNET_HEADERS
1341 ##############################################################################
1343 ##############################################################################
1345 list(APPEND VNET_SOURCES
1348 qos/qos_egress_map.c
1350 qos/qos_record_node.c
1352 qos/qos_store_node.c
1357 list(APPEND VNET_MULTIARCH_SOURCES
1358 qos/qos_record_node.c
1362 list(APPEND VNET_API_FILES qos/qos.api)
1364 ##############################################################################
1366 ##############################################################################
1368 list(APPEND VNET_SOURCES
1369 bier/bier_bit_string.c
1372 bier/bier_fmask_db.c
1381 bier/bier_imp_node.c
1383 bier/bier_disp_entry.c
1384 bier/bier_disp_lookup_node.c
1385 bier/bier_disp_dispatch_node.c
1386 bier/bier_disp_table.c
1387 bier/bier_bift_table.c
1390 list(APPEND VNET_MULTIARCH_SOURCES
1391 bier/bier_disp_dispatch_node.c
1392 bier/bier_disp_lookup_node.c
1393 bier/bier_imp_node.c
1396 list(APPEND VNET_HEADERS
1403 list(APPEND VNET_API_FILES bier/bier.api)
1405 ##############################################################################
1407 ##############################################################################
1409 list (APPEND VNET_SOURCES
1415 list(APPEND VNET_HEADERS
1420 list(APPEND VNET_API_FILES syslog/syslog.api)
1422 ##############################################################################
1423 # Tunnel Endpoint Information Base
1424 ##############################################################################
1426 list (APPEND VNET_SOURCES
1432 list(APPEND VNET_HEADERS
1436 list(APPEND VNET_API_FILES teib/teib.api)
1438 ##############################################################################
1440 ##############################################################################
1442 list (APPEND VNET_SOURCES
1448 list(APPEND VNET_HEADERS
1452 list(APPEND VNET_API_FILES arp/arp.api)
1454 list (APPEND VNET_SOURCES
1458 ip6-nd/ip6_nd_proxy.c
1464 list(APPEND VNET_HEADERS
1468 list(APPEND VNET_API_FILES
1473 ##############################################################################
1475 ##############################################################################
1477 add_vpp_library(vnet
1478 SOURCES ${VNET_SOURCES}
1479 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1480 INSTALL_HEADERS ${VNET_HEADERS}
1481 API_FILES ${VNET_API_FILES}
1482 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1483 DEPENDS vpp_version_h api_headers
1486 ##############################################################################
1487 # vpp api test client library
1488 ##############################################################################
1490 add_vpp_library (vatclient
1491 SOURCES ip/ip_types_api.c
1495 ##############################################################################