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.
17 unset(VNET_MULTIARCH_SOURCES)
19 option(VPP_IP_FIB_MTRIE_16 "IP FIB's MTRIE Stride is 16-8-8 (if not set it's 8-8-8-8)" ON)
21 ##############################################################################
23 ##############################################################################
24 list(APPEND VNET_SOURCES
49 list(APPEND VNET_MULTIARCH_SOURCES
55 list(APPEND VNET_HEADERS
64 interface/rx_queue_funcs.h
65 interface/tx_queue_funcs.h
81 ethernet/ethernet_format_fns.h
82 ethernet/ethernet_types_api.h
85 list(APPEND VNET_API_FILES
93 ##############################################################################
95 ##############################################################################
96 list(APPEND VNET_SOURCES
100 policer/policer_api.c
103 list(APPEND VNET_MULTIARCH_SOURCES
107 list(APPEND VNET_HEADERS
113 list(APPEND VNET_API_FILES
115 policer/policer_types.api
118 ##############################################################################
119 # Layer 2 protocols go here
120 ##############################################################################
122 ##############################################################################
123 # Layer 2 protocol: Ethernet
124 ##############################################################################
125 list(APPEND VNET_SOURCES
126 ethernet/arp_packet.c
127 ethernet/ethernet_types_api.c
131 ethernet/mac_address.c
135 ethernet/p2p_ethernet.c
136 ethernet/p2p_ethernet_input.c
137 ethernet/p2p_ethernet_api.c
140 list(APPEND VNET_MULTIARCH_SOURCES
142 ethernet/p2p_ethernet_input.c
145 list(APPEND VNET_HEADERS
148 ethernet/mac_address.h
152 ethernet/p2p_ethernet.h
153 ethernet/arp_packet.h
156 list(APPEND VNET_API_FILES
157 ethernet/p2p_ethernet.api
158 ethernet/ethernet_types.api)
160 ##############################################################################
161 # Layer 2 protocol: Ethernet bridging
162 ##############################################################################
163 list(APPEND VNET_SOURCES
170 l2/l2_input_classify.c
171 l2/l2_output_classify.c
182 l2/l2_in_out_feat_arc.c
190 list(APPEND VNET_MULTIARCH_SOURCES
196 l2/l2_in_out_feat_arc.c
197 l2/l2_input_classify.c
199 l2/l2_output_classify.c
209 list(APPEND VNET_HEADERS
226 list(APPEND VNET_API_FILES l2/l2.api)
228 ##############################################################################
229 # Layer 2 protocol: SRP
230 ##############################################################################
231 list(APPEND VNET_SOURCES
238 list(APPEND VNET_HEADERS
243 ##############################################################################
244 # Layer 2 protocol: PPP
245 ##############################################################################
246 list(APPEND VNET_SOURCES
252 list(APPEND VNET_HEADERS
258 ##############################################################################
259 # Layer 2 protocol: HDLC
260 ##############################################################################
261 list(APPEND VNET_SOURCES
267 list(APPEND VNET_HEADERS
273 ##############################################################################
274 # Layer 2 protocol: LLC
275 ##############################################################################
276 list(APPEND VNET_SOURCES
282 list(APPEND VNET_HEADERS
286 ##############################################################################
287 # Layer 2 protocol: SNAP
288 ##############################################################################
289 list(APPEND VNET_SOURCES
295 list(APPEND VNET_HEADERS
299 ##############################################################################
301 ##############################################################################
302 list(APPEND VNET_SOURCES
309 list(APPEND VNET_MULTIARCH_SOURCES
313 list(APPEND VNET_HEADERS
316 vxlan/vxlan_error.def
319 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
321 list(APPEND VNET_API_FILES vxlan/vxlan.api)
323 ##############################################################################
325 ##############################################################################
326 list(APPEND VNET_SOURCES
333 list(APPEND VNET_HEADERS
337 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
338 list(APPEND VNET_API_FILES bonding/bond.api)
340 ##############################################################################
341 # Layer 2/3 "classify"
342 ##############################################################################
343 list(APPEND VNET_SOURCES
344 classify/vnet_classify.c
345 classify/trace_classify.h
346 classify/ip_classify.c
347 classify/in_out_acl.c
348 classify/policer_classify.c
349 classify/flow_classify.c
350 classify/flow_classify_node.c
351 classify/vnet_classify.h
352 classify/classify_api.c
355 list(APPEND VNET_MULTIARCH_SOURCES
356 classify/ip_classify.c
357 classify/flow_classify_node.c
360 list(APPEND VNET_HEADERS
361 classify/vnet_classify.h
362 classify/trace_classify.h
363 classify/in_out_acl.h
364 classify/policer_classify.h
365 classify/flow_classify.h
368 list(APPEND VNET_API_FILES classify/classify.api)
370 ##############################################################################
371 # Layer 3 protocols go here
372 ##############################################################################
374 ##############################################################################
375 # Layer 3 protocol: IP v4/v6
376 ##############################################################################
377 list(APPEND VNET_SOURCES
391 ip/ip4_source_and_port_range_check.c
392 ip/reass/ip4_full_reass.c
393 ip/reass/ip4_sv_reass.c
403 ip/reass/ip6_full_reass.c
404 ip/reass/ip6_sv_reass.c
407 ip/ip_container_proxy.c
414 ip/ip_path_mtu_node.c
425 list(APPEND VNET_MULTIARCH_SOURCES
427 ip/reass/ip4_full_reass.c
429 ip/reass/ip6_full_reass.c
430 ip/reass/ip4_sv_reass.c
432 ip/reass/ip6_full_reass.c
433 ip/reass/ip6_sv_reass.c
438 ip/ip_path_mtu_node.c
441 list(APPEND VNET_HEADERS
454 ip/ip6_hop_by_hop_packet.h
458 ip/ip_container_proxy.h
464 ip/ip_source_and_port_range_check.h
471 ip/reass/ip4_sv_reass.h
472 ip/reass/ip6_sv_reass.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
676 list(APPEND VNET_MULTIARCH_SOURCES
681 list(APPEND VNET_HEADERS
690 list(APPEND VNET_API_FILES udp/udp.api)
692 ##############################################################################
693 # Tunnel protocol: gre
694 ##############################################################################
695 list(APPEND VNET_SOURCES
703 list(APPEND VNET_MULTIARCH_SOURCES
708 list(APPEND VNET_HEADERS
714 list(APPEND VNET_API_FILES gre/gre.api)
716 ##############################################################################
717 # Tunnel protocol: ipip
718 ##############################################################################
719 list(APPEND VNET_SOURCES
727 list(APPEND VNET_MULTIARCH_SOURCES
731 list(APPEND VNET_HEADERS
735 list(APPEND VNET_API_FILES
739 ##############################################################################
741 ##############################################################################
742 list(APPEND VNET_SOURCES
744 tunnel/tunnel_types_api.c
747 list(APPEND VNET_API_FILES
748 tunnel/tunnel_types.api
751 list(APPEND VNET_HEADERS
754 tunnel/tunnel_types_api.h
757 ##############################################################################
758 # Tunnel protocol: gre+mpls
759 ##############################################################################
760 list(APPEND VNET_SOURCES
772 list(APPEND VNET_MULTIARCH_SOURCES
779 list(APPEND VNET_HEADERS
787 list(APPEND VNET_API_FILES mpls/mpls.api)
789 ##############################################################################
790 # Tunnel protocol: vxlan-gpe
791 ##############################################################################
793 list(APPEND VNET_SOURCES
794 vxlan-gpe/vxlan_gpe.c
797 vxlan-gpe/vxlan_gpe_api.c
800 list (APPEND VNET_MULTIARCH_SOURCES
804 list(APPEND VNET_HEADERS
805 vxlan-gpe/vxlan_gpe.h
806 vxlan-gpe/vxlan_gpe_packet.h
807 vxlan-gpe/vxlan_gpe_error.def
810 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
812 ##############################################################################
813 # ipv6 segment routing
814 ##############################################################################
816 list(APPEND VNET_SOURCES
819 srv6/sr_policy_rewrite.c
827 list(APPEND VNET_HEADERS
833 list(APPEND VNET_API_FILES
839 ##############################################################################
840 # mpls segment routing
841 ##############################################################################
843 list(APPEND VNET_SOURCES
844 srmpls/sr_mpls_policy.c
845 srmpls/sr_mpls_steering.c
849 list(APPEND VNET_HEADERS
853 list(APPEND VNET_API_FILES
857 ##############################################################################
858 # IPFIX / netflow v10
859 ##############################################################################
860 list(APPEND VNET_SOURCES
861 ipfix-export/flow_report.c
862 ipfix-export/flow_api.c
865 list(APPEND VNET_HEADERS
866 ipfix-export/flow_report.h
867 ipfix-export/ipfix_info_elements.h
868 ipfix-export/ipfix_packet.h
871 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
873 ##############################################################################
875 ##############################################################################
876 list(APPEND VNET_SOURCES
884 list(APPEND VNET_HEADERS
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_pre_input.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
1189 fib/fib_entry_src_adj.c
1190 fib/fib_entry_src_api.c
1191 fib/fib_entry_src_drop.c
1192 fib/fib_entry_src_interface.c
1193 fib/fib_entry_src_interpose.c
1194 fib/fib_entry_src_lisp.c
1195 fib/fib_entry_src_mpls.c
1196 fib/fib_entry_src_simple.c
1197 fib/fib_entry_src_rr.c
1198 fib/fib_entry_cover.c
1199 fib/fib_entry_delegate.c
1200 fib/fib_entry_track.c
1207 fib/fib_attached_export.c
1212 list(APPEND VNET_HEADERS
1215 fib/fib_entry_track.h
1226 fib/fib_entry_delegate.h
1233 list(APPEND VNET_API_FILES
1238 ##############################################################################
1240 ##############################################################################
1242 list(APPEND VNET_SOURCES
1246 adj/adj_midchain_node.c
1247 adj/adj_midchain_delegate.c
1257 list(APPEND VNET_MULTIARCH_SOURCES
1260 adj/adj_midchain_node.c
1263 list(APPEND VNET_HEADERS
1273 ##############################################################################
1274 # Data-Plane Objects
1275 ##############################################################################
1277 list(APPEND VNET_SOURCES
1285 dpo/load_balance_map.c
1289 dpo/interface_rx_dpo.c
1290 dpo/interface_tx_dpo.c
1291 dpo/mpls_disposition.c
1292 dpo/mpls_label_dpo.c
1298 list(APPEND VNET_MULTIARCH_SOURCES
1300 dpo/mpls_disposition.c
1302 dpo/mpls_label_dpo.c
1303 dpo/interface_rx_dpo.c
1306 list(APPEND VNET_HEADERS
1308 dpo/load_balance_map.h
1319 ##############################################################################
1321 ##############################################################################
1323 list(APPEND VNET_SOURCES
1333 mfib/mfib_entry_cover.c
1334 mfib/mfib_entry_delegate.c
1335 mfib/mfib_entry_src.c
1336 mfib/mfib_entry_src_rr.c
1340 list(APPEND VNET_MULTIARCH_SOURCES
1344 list(APPEND VNET_HEADERS
1350 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1352 ##############################################################################
1354 ##############################################################################
1356 list(APPEND VNET_SOURCES
1362 list(APPEND VNET_HEADERS
1366 ##############################################################################
1368 ##############################################################################
1370 list(APPEND VNET_SOURCES
1373 qos/qos_egress_map.c
1375 qos/qos_record_node.c
1377 qos/qos_store_node.c
1382 list(APPEND VNET_MULTIARCH_SOURCES
1383 qos/qos_record_node.c
1387 list(APPEND VNET_API_FILES qos/qos.api)
1389 ##############################################################################
1391 ##############################################################################
1393 list(APPEND VNET_SOURCES
1394 bier/bier_bit_string.c
1397 bier/bier_fmask_db.c
1406 bier/bier_imp_node.c
1408 bier/bier_disp_entry.c
1409 bier/bier_disp_lookup_node.c
1410 bier/bier_disp_dispatch_node.c
1411 bier/bier_disp_table.c
1412 bier/bier_bift_table.c
1415 list(APPEND VNET_MULTIARCH_SOURCES
1416 bier/bier_disp_dispatch_node.c
1417 bier/bier_disp_lookup_node.c
1418 bier/bier_imp_node.c
1421 list(APPEND VNET_HEADERS
1422 bier/bier_bit_string.h
1425 bier/bier_hdr_inlines.h
1431 list(APPEND VNET_API_FILES bier/bier.api)
1433 ##############################################################################
1435 ##############################################################################
1437 list (APPEND VNET_SOURCES
1443 list(APPEND VNET_HEADERS
1448 list(APPEND VNET_API_FILES syslog/syslog.api)
1450 ##############################################################################
1451 # Tunnel Endpoint Information Base
1452 ##############################################################################
1454 list (APPEND VNET_SOURCES
1460 list(APPEND VNET_HEADERS
1464 list(APPEND VNET_API_FILES teib/teib.api)
1466 ##############################################################################
1468 ##############################################################################
1470 list (APPEND VNET_SOURCES
1476 list(APPEND VNET_HEADERS
1480 list(APPEND VNET_API_FILES arp/arp.api)
1482 list (APPEND VNET_SOURCES
1486 ip6-nd/ip6_nd_proxy.c
1487 ip6-nd/ip6_nd_mirror_proxy.c
1493 list(APPEND VNET_HEADERS
1497 list(APPEND VNET_API_FILES
1502 ##############################################################################
1504 ##############################################################################
1506 add_vpp_library(vnet
1507 SOURCES ${VNET_SOURCES}
1508 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1509 INSTALL_HEADERS ${VNET_HEADERS}
1510 API_FILES ${VNET_API_FILES}
1511 LINK_LIBRARIES vppinfra svm vlib
1512 DEPENDS vpp_version_h api_headers
1515 ##############################################################################
1516 # vpp api test client library
1517 ##############################################################################
1519 add_vpp_library (vatclient
1520 SOURCES ip/ip_types_api.c
1524 add_vat_test_library(vnet
1528 ip6-nd/ip6_nd_test.c
1529 srmpls/sr_mpls_test.c
1530 session/session_test.c
1535 ##############################################################################
1537 ##############################################################################
1538 add_vpp_test_library(vnet
1542 ##############################################################################