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
46 list(APPEND VNET_MULTIARCH_SOURCES
52 list(APPEND VNET_HEADERS
61 interface/rx_queue_funcs.h
62 interface/tx_queue_funcs.h
79 ethernet/ethernet_format_fns.h
82 list(APPEND VNET_API_FILES
90 ##############################################################################
92 ##############################################################################
93 list(APPEND VNET_SOURCES
100 list(APPEND VNET_MULTIARCH_SOURCES
104 list(APPEND VNET_HEADERS
110 list(APPEND VNET_API_FILES
112 policer/policer_types.api
115 ##############################################################################
116 # Layer 2 protocols go here
117 ##############################################################################
119 ##############################################################################
120 # Layer 2 protocol: Ethernet
121 ##############################################################################
122 list(APPEND VNET_SOURCES
123 ethernet/arp_packet.c
124 ethernet/ethernet_types_api.c
128 ethernet/mac_address.c
132 ethernet/p2p_ethernet.c
133 ethernet/p2p_ethernet_input.c
134 ethernet/p2p_ethernet_api.c
137 list(APPEND VNET_MULTIARCH_SOURCES
139 ethernet/p2p_ethernet_input.c
142 list(APPEND VNET_HEADERS
145 ethernet/mac_address.h
149 ethernet/p2p_ethernet.h
150 ethernet/arp_packet.h
153 list(APPEND VNET_API_FILES
154 ethernet/p2p_ethernet.api
155 ethernet/ethernet_types.api)
157 ##############################################################################
158 # Layer 2 protocol: Ethernet bridging
159 ##############################################################################
160 list(APPEND VNET_SOURCES
167 l2/l2_input_classify.c
168 l2/l2_output_classify.c
179 l2/l2_in_out_feat_arc.c
187 list(APPEND VNET_MULTIARCH_SOURCES
193 l2/l2_in_out_feat_arc.c
194 l2/l2_input_classify.c
196 l2/l2_output_classify.c
206 list(APPEND VNET_HEADERS
223 list(APPEND VNET_API_FILES l2/l2.api)
225 ##############################################################################
226 # Layer 2 protocol: SRP
227 ##############################################################################
228 list(APPEND VNET_SOURCES
235 list(APPEND VNET_HEADERS
240 ##############################################################################
241 # Layer 2 protocol: PPP
242 ##############################################################################
243 list(APPEND VNET_SOURCES
249 list(APPEND VNET_HEADERS
255 ##############################################################################
256 # Layer 2 protocol: HDLC
257 ##############################################################################
258 list(APPEND VNET_SOURCES
264 list(APPEND VNET_HEADERS
270 ##############################################################################
271 # Layer 2 protocol: LLC
272 ##############################################################################
273 list(APPEND VNET_SOURCES
279 list(APPEND VNET_HEADERS
283 ##############################################################################
284 # Layer 2 protocol: SNAP
285 ##############################################################################
286 list(APPEND VNET_SOURCES
292 list(APPEND VNET_HEADERS
296 ##############################################################################
298 ##############################################################################
299 list(APPEND VNET_SOURCES
306 list(APPEND VNET_MULTIARCH_SOURCES
310 list(APPEND VNET_HEADERS
313 vxlan/vxlan_error.def
316 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
318 list(APPEND VNET_API_FILES vxlan/vxlan.api)
320 ##############################################################################
322 ##############################################################################
323 list(APPEND VNET_SOURCES
330 list(APPEND VNET_HEADERS
334 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
335 list(APPEND VNET_API_FILES bonding/bond.api)
337 ##############################################################################
338 # Layer 2/3 "classify"
339 ##############################################################################
340 list(APPEND VNET_SOURCES
341 classify/vnet_classify.c
342 classify/trace_classify.h
343 classify/ip_classify.c
344 classify/in_out_acl.c
345 classify/policer_classify.c
346 classify/flow_classify.c
347 classify/flow_classify_node.c
348 classify/vnet_classify.h
349 classify/classify_api.c
352 list(APPEND VNET_MULTIARCH_SOURCES
353 classify/ip_classify.c
354 classify/flow_classify_node.c
357 list(APPEND VNET_HEADERS
358 classify/vnet_classify.h
359 classify/trace_classify.h
360 classify/in_out_acl.h
361 classify/policer_classify.h
362 classify/flow_classify.h
365 list(APPEND VNET_API_FILES classify/classify.api)
367 ##############################################################################
368 # Layer 3 protocols go here
369 ##############################################################################
371 ##############################################################################
372 # Layer 3 protocol: IP v4/v6
373 ##############################################################################
374 list(APPEND VNET_SOURCES
388 ip/ip4_source_and_port_range_check.c
389 ip/reass/ip4_full_reass.c
390 ip/reass/ip4_sv_reass.c
400 ip/reass/ip6_full_reass.c
401 ip/reass/ip6_sv_reass.c
404 ip/ip_container_proxy.c
411 ip/ip_path_mtu_node.c
421 list(APPEND VNET_MULTIARCH_SOURCES
423 ip/reass/ip4_full_reass.c
425 ip/reass/ip6_full_reass.c
426 ip/reass/ip4_sv_reass.c
428 ip/reass/ip6_full_reass.c
429 ip/reass/ip6_sv_reass.c
434 ip/ip_path_mtu_node.c
437 list(APPEND VNET_HEADERS
452 ip/ip6_hop_by_hop_packet.h
456 ip/ip_container_proxy.h
461 ip/ip_source_and_port_range_check.h
470 list(APPEND VNET_API_FILES
475 list(APPEND VNET_MULTIARCH_SOURCES
481 ##############################################################################
483 ##############################################################################
484 list(APPEND VNET_SOURCES
485 ip-neighbor/ip_neighbor.c
486 ip-neighbor/ip_neighbor_api.c
487 ip-neighbor/ip_neighbor_dp.c
488 ip-neighbor/ip_neighbor_types.c
489 ip-neighbor/ip_neighbor_watch.c
490 ip-neighbor/ip4_neighbor.c
491 ip-neighbor/ip6_neighbor.c
494 list(APPEND VNET_HEADERS
495 ip-neighbor/ip_neighbor.h
496 ip-neighbor/ip_neighbor_types.h
499 list(APPEND VNET_API_FILES
500 ip-neighbor/ip_neighbor.api
503 ##############################################################################
504 # Bidirectional Forwarding Detection
505 ##############################################################################
507 list(APPEND VNET_HEADERS
514 list(APPEND VNET_SOURCES
523 list(APPEND VNET_API_FILES bfd/bfd.api)
525 ##############################################################################
527 ##############################################################################
529 list(APPEND VNET_SOURCES
537 list(APPEND VNET_HEADERS
541 list(APPEND VNET_MULTIARCH_SOURCES crypto/node.c)
543 list(APPEND VNET_API_FILES crypto/crypto.api)
545 ##############################################################################
546 # Layer 3 protocol: IPSec
547 ##############################################################################
548 list(APPEND VNET_SOURCES
552 ipsec/ipsec_handoff.c
558 ipsec/ipsec_spd_policy.c
567 ipsec/ipsec_types_api.c
570 list(APPEND VNET_MULTIARCH_SOURCES
575 ipsec/ipsec_handoff.c
581 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
582 list(APPEND VNET_API_FILES ipsec/ipsec.api)
584 list(APPEND VNET_SOURCES
588 list(APPEND VNET_HEADERS
591 ipsec/ipsec_spd_policy.h
594 ipsec/ipsec_types_api.h
600 ##############################################################################
601 # Layer 3 protocol: osi
602 ##############################################################################
603 list(APPEND VNET_SOURCES
609 list(APPEND VNET_HEADERS
613 ##############################################################################
614 # Layer 4 protocol: tcp
615 ##############################################################################
616 list(APPEND VNET_SOURCES
620 tcp/tcp_syn_filter4.c
633 list(APPEND VNET_MULTIARCH_SOURCES
636 tcp/tcp_syn_filter4.c
639 list(APPEND VNET_HEADERS
652 list(APPEND VNET_API_FILES tcp/tcp.api)
654 ##############################################################################
655 # Layer 4 protocol: udp
656 ##############################################################################
657 list(APPEND VNET_SOURCES
669 list(APPEND VNET_MULTIARCH_SOURCES
674 list(APPEND VNET_HEADERS
682 list(APPEND VNET_API_FILES udp/udp.api)
684 ##############################################################################
685 # Tunnel protocol: gre
686 ##############################################################################
687 list(APPEND VNET_SOURCES
695 list(APPEND VNET_MULTIARCH_SOURCES
700 list(APPEND VNET_HEADERS
706 list(APPEND VNET_API_FILES gre/gre.api)
708 ##############################################################################
709 # Tunnel protocol: ipip
710 ##############################################################################
711 list(APPEND VNET_SOURCES
719 list(APPEND VNET_MULTIARCH_SOURCES
723 list(APPEND VNET_HEADERS
727 list(APPEND VNET_API_FILES
731 ##############################################################################
733 ##############################################################################
734 list(APPEND VNET_SOURCES
736 tunnel/tunnel_types_api.c
739 list(APPEND VNET_API_FILES
740 tunnel/tunnel_types.api
743 list(APPEND VNET_HEADERS
748 ##############################################################################
749 # Tunnel protocol: gre+mpls
750 ##############################################################################
751 list(APPEND VNET_SOURCES
763 list(APPEND VNET_MULTIARCH_SOURCES
770 list(APPEND VNET_HEADERS
778 list(APPEND VNET_API_FILES mpls/mpls.api)
780 ##############################################################################
781 # Tunnel protocol: vxlan-gbp
782 ##############################################################################
783 list(APPEND VNET_SOURCES
786 vxlan-gbp/vxlan_gbp_api.c
787 vxlan-gbp/vxlan_gbp.c
788 vxlan-gbp/vxlan_gbp_packet.c
791 list (APPEND VNET_MULTIARCH_SOURCES
796 list(APPEND VNET_HEADERS
797 vxlan-gbp/vxlan_gbp.h
798 vxlan-gbp/vxlan_gbp_packet.h
799 vxlan-gbp/vxlan_gbp_error.def
802 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
804 ##############################################################################
805 # Tunnel protocol: vxlan-gpe
806 ##############################################################################
808 list(APPEND VNET_SOURCES
809 vxlan-gpe/vxlan_gpe.c
812 vxlan-gpe/vxlan_gpe_api.c
815 list (APPEND VNET_MULTIARCH_SOURCES
819 list(APPEND VNET_HEADERS
820 vxlan-gpe/vxlan_gpe.h
821 vxlan-gpe/vxlan_gpe_packet.h
822 vxlan-gpe/vxlan_gpe_error.def
825 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
827 ##############################################################################
828 # ipv6 segment routing
829 ##############################################################################
831 list(APPEND VNET_SOURCES
834 srv6/sr_policy_rewrite.c
839 list(APPEND VNET_HEADERS
844 list(APPEND VNET_API_FILES
849 ##############################################################################
850 # mpls segment routing
851 ##############################################################################
853 list(APPEND VNET_SOURCES
854 srmpls/sr_mpls_policy.c
855 srmpls/sr_mpls_steering.c
859 list(APPEND VNET_HEADERS
863 list(APPEND VNET_API_FILES
867 ##############################################################################
868 # IPFIX / netflow v10
869 ##############################################################################
870 list(APPEND VNET_SOURCES
871 ipfix-export/flow_report.c
872 ipfix-export/flow_api.c
875 list(APPEND VNET_HEADERS
876 ipfix-export/flow_report.h
877 ipfix-export/ipfix_info_elements.h
878 ipfix-export/ipfix_packet.h
881 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
883 ##############################################################################
885 ##############################################################################
886 list(APPEND VNET_SOURCES
893 list(APPEND VNET_HEADERS
896 gso/hdr_offset_parser.h
900 list(APPEND VNET_API_FILES
904 ##############################################################################
905 # IPFIX classify code
906 ##############################################################################
908 list(APPEND VNET_SOURCES
909 ipfix-export/flow_report_classify.c
912 list(APPEND VNET_HEADERS
913 ipfix-export/flow_report_classify.h
916 ##############################################################################
918 ##############################################################################
920 list(APPEND VNET_SOURCES
921 lawful-intercept/lawful_intercept.c
922 lawful-intercept/node.c
925 list(APPEND VNET_MULTIARCH_SOURCES
926 lawful-intercept/node.c
929 list(APPEND VNET_HEADERS
930 lawful-intercept/lawful_intercept.h
933 ##############################################################################
934 # SPAN (port mirroring)
935 ##############################################################################
937 list(APPEND VNET_SOURCES
943 list(APPEND VNET_MULTIARCH_SOURCES
947 list(APPEND VNET_HEADERS
951 list(APPEND VNET_API_FILES span/span.api)
953 ##############################################################################
955 ##############################################################################
957 list(APPEND VNET_SOURCES
967 list(APPEND VNET_HEADERS
972 list(APPEND VNET_API_FILES pg/pg.api)
974 ##############################################################################
976 ##############################################################################
978 list(APPEND VNET_SOURCES
980 devices/virtio/device.c
981 devices/virtio/format.c
982 devices/virtio/node.c
984 devices/virtio/vhost_user.c
985 devices/virtio/vhost_user_input.c
986 devices/virtio/vhost_user_output.c
987 devices/virtio/vhost_user_api.c
988 devices/virtio/virtio.c
989 devices/virtio/virtio_api.c
990 devices/virtio/virtio_pci_legacy.c
991 devices/virtio/virtio_pci_modern.c
992 devices/virtio/virtio_process.c
993 devices/virtio/virtio_types_api.c
996 list(APPEND VNET_HEADERS
998 devices/virtio/virtio.h
999 devices/virtio/virtio_buffering.h
1000 devices/virtio/virtio_std.h
1001 devices/virtio/virtio_pci_legacy.h
1002 devices/virtio/virtio_pci_modern.h
1003 devices/virtio/vhost_std.h
1004 devices/virtio/vhost_user.h
1005 devices/virtio/virtio_types_api.h
1008 list(APPEND VNET_MULTIARCH_SOURCES
1009 devices/virtio/vhost_user_input.c
1010 devices/virtio/vhost_user_output.c
1011 devices/virtio/node.c
1012 devices/af_packet/node.c
1013 devices/virtio/device.c
1016 list(APPEND VNET_API_FILES
1017 devices/virtio/vhost_user.api
1018 devices/virtio/virtio.api
1019 devices/virtio/virtio_types.api
1022 ##############################################################################
1023 # tap interface (with virtio backend)
1024 ##############################################################################
1026 list(APPEND VNET_SOURCES
1029 devices/tap/tapv2_api.c
1032 list(APPEND VNET_HEADERS
1036 list(APPEND VNET_API_FILES
1037 devices/tap/tapv2.api
1040 ##############################################################################
1041 # tap interface (with virtio backend)
1042 ##############################################################################
1044 list(APPEND VNET_SOURCES
1045 devices/pipe/pipe_api.c
1049 list(APPEND VNET_HEADERS
1053 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1055 ##############################################################################
1056 # session managmeent
1057 ##############################################################################
1059 list(APPEND VNET_SOURCES
1061 session/session_debug.c
1062 session/session_table.c
1063 session/session_rules_table.c
1064 session/session_lookup.c
1065 session/session_node.c
1067 session/application.c
1068 session/application_worker.c
1069 session/session_cli.c
1070 session/application_interface.c
1071 session/application_local.c
1072 session/application_namespace.c
1073 session/segment_manager.c
1074 session/session_api.c
1077 list(APPEND VNET_HEADERS
1079 session/session_table.h
1080 session/session_rules_table.h
1081 session/session_types.h
1082 session/session_lookup.h
1083 session/application.h
1085 session/transport_types.h
1086 session/application_interface.h
1087 session/application_local.h
1088 session/application_namespace.h
1089 session/session_debug.h
1090 session/segment_manager.h
1091 session/mma_template.h
1092 session/mma_template.c
1097 list(APPEND VNET_API_FILES session/session.api)
1099 ##############################################################################
1101 ##############################################################################
1103 list(APPEND VNET_SOURCES
1107 list(APPEND VNET_HEADERS
1112 ##############################################################################
1113 # Linux packet interface
1114 ##############################################################################
1116 list(APPEND VNET_SOURCES
1117 devices/af_packet/af_packet.c
1118 devices/af_packet/device.c
1119 devices/af_packet/node.c
1120 devices/af_packet/cli.c
1121 devices/af_packet/af_packet_api.c
1124 list(APPEND VNET_MULTIARCH_SOURCES
1125 devices/af_packet/device.c
1128 list(APPEND VNET_HEADERS
1129 devices/af_packet/af_packet.h
1132 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1134 ##############################################################################
1135 # Driver feature graph arc support
1136 ##############################################################################
1138 list(APPEND VNET_SOURCES
1140 feature/feature_api.c
1141 feature/registration.c
1144 list(APPEND VNET_HEADERS
1148 list(APPEND VNET_API_FILES feature/feature.api)
1150 ##############################################################################
1151 # Unix kernel related
1152 ##############################################################################
1154 # FIXME: unix/hgshm.c
1156 list(APPEND VNET_SOURCES
1161 list(APPEND VNET_HEADERS
1165 ##############################################################################
1167 ##############################################################################
1169 list(APPEND VNET_SOURCES
1181 fib/fib_entry_src_adj.c
1182 fib/fib_entry_src_api.c
1183 fib/fib_entry_src_drop.c
1184 fib/fib_entry_src_interface.c
1185 fib/fib_entry_src_interpose.c
1186 fib/fib_entry_src_lisp.c
1187 fib/fib_entry_src_mpls.c
1188 fib/fib_entry_src_simple.c
1189 fib/fib_entry_src_rr.c
1190 fib/fib_entry_cover.c
1191 fib/fib_entry_delegate.c
1192 fib/fib_entry_track.c
1199 fib/fib_attached_export.c
1204 list(APPEND VNET_HEADERS
1214 fib/fib_entry_delegate.h
1219 list(APPEND VNET_API_FILES
1224 ##############################################################################
1226 ##############################################################################
1228 list(APPEND VNET_SOURCES
1232 adj/adj_midchain_node.c
1233 adj/adj_midchain_delegate.c
1243 list(APPEND VNET_MULTIARCH_SOURCES
1246 adj/adj_midchain_node.c
1249 list(APPEND VNET_HEADERS
1259 ##############################################################################
1260 # Data-Plane Objects
1261 ##############################################################################
1263 list(APPEND VNET_SOURCES
1271 dpo/load_balance_map.c
1275 dpo/interface_rx_dpo.c
1276 dpo/interface_tx_dpo.c
1277 dpo/mpls_disposition.c
1278 dpo/mpls_label_dpo.c
1284 list(APPEND VNET_MULTIARCH_SOURCES
1286 dpo/mpls_disposition.c
1288 dpo/mpls_label_dpo.c
1289 dpo/interface_rx_dpo.c
1292 list(APPEND VNET_HEADERS
1304 ##############################################################################
1306 ##############################################################################
1308 list(APPEND VNET_SOURCES
1318 mfib/mfib_entry_cover.c
1319 mfib/mfib_entry_delegate.c
1320 mfib/mfib_entry_src.c
1321 mfib/mfib_entry_src_rr.c
1325 list(APPEND VNET_MULTIARCH_SOURCES
1329 list(APPEND VNET_HEADERS
1335 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1337 ##############################################################################
1339 ##############################################################################
1341 list(APPEND VNET_SOURCES
1347 list(APPEND VNET_HEADERS
1351 ##############################################################################
1353 ##############################################################################
1355 list(APPEND VNET_SOURCES
1358 qos/qos_egress_map.c
1360 qos/qos_record_node.c
1362 qos/qos_store_node.c
1367 list(APPEND VNET_MULTIARCH_SOURCES
1368 qos/qos_record_node.c
1372 list(APPEND VNET_API_FILES qos/qos.api)
1374 ##############################################################################
1376 ##############################################################################
1378 list(APPEND VNET_SOURCES
1379 bier/bier_bit_string.c
1382 bier/bier_fmask_db.c
1391 bier/bier_imp_node.c
1393 bier/bier_disp_entry.c
1394 bier/bier_disp_lookup_node.c
1395 bier/bier_disp_dispatch_node.c
1396 bier/bier_disp_table.c
1397 bier/bier_bift_table.c
1400 list(APPEND VNET_MULTIARCH_SOURCES
1401 bier/bier_disp_dispatch_node.c
1402 bier/bier_disp_lookup_node.c
1403 bier/bier_imp_node.c
1406 list(APPEND VNET_HEADERS
1413 list(APPEND VNET_API_FILES bier/bier.api)
1415 ##############################################################################
1417 ##############################################################################
1419 list (APPEND VNET_SOURCES
1425 list(APPEND VNET_HEADERS
1430 list(APPEND VNET_API_FILES syslog/syslog.api)
1432 ##############################################################################
1433 # Tunnel Endpoint Information Base
1434 ##############################################################################
1436 list (APPEND VNET_SOURCES
1442 list(APPEND VNET_HEADERS
1446 list(APPEND VNET_API_FILES teib/teib.api)
1448 ##############################################################################
1450 ##############################################################################
1452 list (APPEND VNET_SOURCES
1458 list(APPEND VNET_HEADERS
1462 list(APPEND VNET_API_FILES arp/arp.api)
1464 list (APPEND VNET_SOURCES
1468 ip6-nd/ip6_nd_proxy.c
1474 list(APPEND VNET_HEADERS
1478 list(APPEND VNET_API_FILES
1483 ##############################################################################
1485 ##############################################################################
1487 add_vpp_library(vnet
1488 SOURCES ${VNET_SOURCES}
1489 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1490 INSTALL_HEADERS ${VNET_HEADERS}
1491 API_FILES ${VNET_API_FILES}
1492 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1493 DEPENDS vpp_version_h api_headers
1496 ##############################################################################
1497 # vpp api test client library
1498 ##############################################################################
1500 add_vpp_library (vatclient
1501 SOURCES ip/ip_types_api.c
1505 ##############################################################################
1507 ##############################################################################
1508 add_vpp_test_library(vnet
1512 ##############################################################################