1 # Copyright (c) 2018 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
42 list(APPEND VNET_MULTIARCH_SOURCES
48 list(APPEND VNET_HEADERS
72 list(APPEND VNET_API_FILES
78 ##############################################################################
80 ##############################################################################
81 list(APPEND VNET_SOURCES
88 list(APPEND VNET_MULTIARCH_SOURCES
92 list(APPEND VNET_HEADERS
98 list(APPEND VNET_API_FILES policer/policer.api)
100 ##############################################################################
102 ##############################################################################
103 list(APPEND VNET_SOURCES
111 list(APPEND VNET_MULTIARCH_SOURCES
117 list(APPEND VNET_HEADERS
121 list(APPEND VNET_API_FILES cop/cop.api)
123 ##############################################################################
124 # Layer 2 protocols go here
125 ##############################################################################
127 ##############################################################################
128 # Layer 2 protocol: Ethernet
129 ##############################################################################
130 list(APPEND VNET_SOURCES
131 ethernet/ethernet_types_api.c
135 ethernet/mac_address.c
139 ethernet/p2p_ethernet.c
140 ethernet/p2p_ethernet_input.c
141 ethernet/p2p_ethernet_api.c
144 list(APPEND VNET_MULTIARCH_SOURCES
146 ethernet/p2p_ethernet_input.c
149 list(APPEND VNET_HEADERS
152 ethernet/mac_address.h
156 ethernet/p2p_ethernet.h
159 list(APPEND VNET_API_FILES
160 ethernet/p2p_ethernet.api
161 ethernet/ethernet_types.api)
163 ##############################################################################
164 # Layer 2 protocol: Ethernet bridging
165 ##############################################################################
166 list(APPEND VNET_SOURCES
172 l2/l2_input_classify.c
173 l2/l2_output_classify.c
183 l2/l2_in_out_feat_arc.c
191 list(APPEND VNET_MULTIARCH_SOURCES
197 l2/l2_in_out_feat_arc.c
198 l2/l2_input_classify.c
200 l2/l2_output_classify.c
210 list(APPEND VNET_HEADERS
227 list(APPEND VNET_API_FILES l2/l2.api)
229 ##############################################################################
230 # Layer 2 protocol: SRP
231 ##############################################################################
232 list(APPEND VNET_SOURCES
239 list(APPEND VNET_HEADERS
244 ##############################################################################
245 # Layer 2 protocol: PPP
246 ##############################################################################
247 list(APPEND VNET_SOURCES
253 list(APPEND VNET_HEADERS
259 ##############################################################################
260 # Layer 2 protocol: HDLC
261 ##############################################################################
262 list(APPEND VNET_SOURCES
268 list(APPEND VNET_HEADERS
274 ##############################################################################
275 # Layer 2 protocol: LLC
276 ##############################################################################
277 list(APPEND VNET_SOURCES
283 list(APPEND VNET_HEADERS
287 ##############################################################################
288 # Layer 2 protocol: SNAP
289 ##############################################################################
290 list(APPEND VNET_SOURCES
296 list(APPEND VNET_HEADERS
300 ##############################################################################
302 ##############################################################################
303 list(APPEND VNET_SOURCES
310 list(APPEND VNET_MULTIARCH_SOURCES
314 list(APPEND VNET_HEADERS
317 vxlan/vxlan_error.def
320 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
322 list(APPEND VNET_API_FILES vxlan/vxlan.api)
324 ##############################################################################
326 ##############################################################################
327 list(APPEND VNET_SOURCES
334 list(APPEND VNET_MULTIARCH_SOURCES
339 list(APPEND VNET_HEADERS
341 geneve/geneve_packet.h
342 geneve/geneve_error.def
345 list(APPEND VNET_API_FILES geneve/geneve.api)
347 ##############################################################################
349 ##############################################################################
350 list(APPEND VNET_SOURCES
357 list(APPEND VNET_HEADERS
361 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
362 list(APPEND VNET_API_FILES bonding/bond.api)
364 ##############################################################################
366 ##############################################################################
367 list(APPEND VNET_SOURCES
375 list(APPEND VNET_HEADERS
380 list(APPEND VNET_API_FILES lldp/lldp.api)
382 ##############################################################################
383 # Layer 2/3 "classify"
384 ##############################################################################
385 list(APPEND VNET_SOURCES
386 classify/vnet_classify.c
387 classify/trace_classify.h
388 classify/ip_classify.c
389 classify/in_out_acl.c
390 classify/policer_classify.c
391 classify/flow_classify.c
392 classify/flow_classify_node.c
393 classify/vnet_classify.h
394 classify/classify_api.c
397 list(APPEND VNET_MULTIARCH_SOURCES
398 classify/ip_classify.c
399 classify/flow_classify_node.c
402 list(APPEND VNET_HEADERS
403 classify/vnet_classify.h
404 classify/trace_classify.h
405 classify/in_out_acl.h
406 classify/policer_classify.h
407 classify/flow_classify.h
410 list(APPEND VNET_API_FILES classify/classify.api)
412 ##############################################################################
413 # Layer 3 protocols go here
414 ##############################################################################
416 ##############################################################################
417 # Layer 3 protocol: IP v4/v6
418 ##############################################################################
419 list(APPEND VNET_SOURCES
432 ip/ip4_source_and_port_range_check.c
433 ip/ip4_source_check.c
434 ip/reass/ip4_full_reass.c
435 ip/reass/ip4_sv_reass.c
445 ip/reass/ip6_full_reass.c
446 ip/reass/ip6_sv_reass.c
463 list(APPEND VNET_MULTIARCH_SOURCES
464 ip/ip4_source_check.c
466 ip/reass/ip4_full_reass.c
468 ip/reass/ip6_full_reass.c
469 ip/reass/ip4_sv_reass.c
471 ip/reass/ip6_full_reass.c
472 ip/reass/ip6_sv_reass.c
479 list(APPEND VNET_HEADERS
492 ip/ip6_hop_by_hop_packet.h
497 ip/ip_source_and_port_range_check.h
506 list(APPEND VNET_API_FILES
512 list(APPEND VNET_MULTIARCH_SOURCES
518 ##############################################################################
520 ##############################################################################
521 list(APPEND VNET_SOURCES
525 list(APPEND VNET_HEADERS
526 ethernet/arp_packet.h
530 ##############################################################################
531 # Bidirectional Forwarding Detection
532 ##############################################################################
534 list(APPEND VNET_HEADERS
541 list(APPEND VNET_SOURCES
550 list(APPEND VNET_API_FILES bfd/bfd.api)
552 ##############################################################################
554 ##############################################################################
556 list(APPEND VNET_SOURCES
562 list(APPEND VNET_HEADERS
566 ##############################################################################
567 # Layer 3 protocol: IPSec
568 ##############################################################################
569 list(APPEND VNET_SOURCES
579 ipsec/ipsec_spd_policy.c
590 list(APPEND VNET_MULTIARCH_SOURCES
601 list(APPEND VNET_API_FILES ipsec/ipsec.api)
603 list(APPEND VNET_SOURCES
607 list(APPEND VNET_HEADERS
610 ipsec/ipsec_spd_policy.h
618 ##############################################################################
619 # Layer 3 protocol: osi
620 ##############################################################################
621 list(APPEND VNET_SOURCES
627 list(APPEND VNET_HEADERS
631 ##############################################################################
632 # Layer 4 protocol: tcp
633 ##############################################################################
634 list(APPEND VNET_SOURCES
638 tcp/tcp_syn_filter4.c
648 list(APPEND VNET_MULTIARCH_SOURCES
651 tcp/tcp_syn_filter4.c
654 list(APPEND VNET_HEADERS
662 list(APPEND VNET_API_FILES tcp/tcp.api)
664 ##############################################################################
665 # Layer 4 protocol: udp
666 ##############################################################################
667 list(APPEND VNET_SOURCES
678 list(APPEND VNET_MULTIARCH_SOURCES
683 list(APPEND VNET_HEADERS
689 list(APPEND VNET_API_FILES udp/udp.api)
691 ##############################################################################
692 # Tunnel protocol: gre
693 ##############################################################################
694 list(APPEND VNET_SOURCES
702 list(APPEND VNET_MULTIARCH_SOURCES
707 list(APPEND VNET_HEADERS
713 list(APPEND VNET_API_FILES gre/gre.api)
715 ##############################################################################
716 # Tunnel protocol: ipip
717 ##############################################################################
718 list(APPEND VNET_SOURCES
726 list(APPEND VNET_MULTIARCH_SOURCES
730 list(APPEND VNET_HEADERS
734 list(APPEND VNET_API_FILES ipip/ipip.api)
736 ##############################################################################
737 # Tunnel protocol: l2tpv3
738 ##############################################################################
739 list(APPEND VNET_SOURCES
747 list(APPEND VNET_MULTIARCH_SOURCES
752 list(APPEND VNET_HEADERS
757 list(APPEND VNET_API_FILES l2tp/l2tp.api)
759 ##############################################################################
760 # Tunnel protocol: gre+mpls
761 ##############################################################################
762 list(APPEND VNET_SOURCES
774 list(APPEND VNET_MULTIARCH_SOURCES
781 list(APPEND VNET_HEADERS
789 list(APPEND VNET_API_FILES mpls/mpls.api)
791 ##############################################################################
792 # Tunnel protocol: vxlan-gbp
793 ##############################################################################
794 list(APPEND VNET_SOURCES
797 vxlan-gbp/vxlan_gbp_api.c
798 vxlan-gbp/vxlan_gbp.c
799 vxlan-gbp/vxlan_gbp_packet.c
802 list (APPEND VNET_MULTIARCH_SOURCES
807 list(APPEND VNET_HEADERS
808 vxlan-gbp/vxlan_gbp.h
809 vxlan-gbp/vxlan_gbp_packet.h
810 vxlan-gbp/vxlan_gbp_error.def
813 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
815 ##############################################################################
816 # Tunnel protocol: vxlan-gpe
817 ##############################################################################
819 list(APPEND VNET_SOURCES
820 vxlan-gpe/vxlan_gpe.c
823 vxlan-gpe/vxlan_gpe_api.c
826 list (APPEND VNET_MULTIARCH_SOURCES
830 list(APPEND VNET_HEADERS
831 vxlan-gpe/vxlan_gpe.h
832 vxlan-gpe/vxlan_gpe_packet.h
833 vxlan-gpe/vxlan_gpe_error.def
836 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
838 ##############################################################################
839 # LISP control plane: lisp-cp
840 ##############################################################################
842 list(APPEND VNET_SOURCES
844 lisp-cp/lisp_cp_dpo.c
846 lisp-cp/gid_dictionary.c
847 lisp-cp/lisp_msg_serdes.c
855 list(APPEND VNET_HEADERS
858 lisp-cp/gid_dictionary.h
859 lisp-cp/lisp_cp_messages.h
860 lisp-cp/lisp_msg_serdes.h
864 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
865 list(APPEND VNET_API_FILES lisp-cp/one.api)
867 ##############################################################################
868 # Tunnel protocol: lisp-gpe
869 ##############################################################################
871 list(APPEND VNET_SOURCES
873 lisp-gpe/lisp_gpe_sub_interface.c
874 lisp-gpe/lisp_gpe_adjacency.c
875 lisp-gpe/lisp_gpe_tunnel.c
876 lisp-gpe/lisp_gpe_fwd_entry.c
877 lisp-gpe/lisp_gpe_tenant.c
880 lisp-gpe/lisp_gpe_api.c
883 list(APPEND VNET_HEADERS
885 lisp-gpe/lisp_gpe_fwd_entry.h
886 lisp-gpe/lisp_gpe_tenant.h
887 lisp-gpe/lisp_gpe_packet.h
888 lisp-gpe/lisp_gpe_error.def
891 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
893 ##############################################################################
894 # ipv6 segment routing
895 ##############################################################################
897 list(APPEND VNET_SOURCES
900 srv6/sr_policy_rewrite.c
905 list(APPEND VNET_HEADERS
910 list(APPEND VNET_API_FILES srv6/sr.api)
912 ##############################################################################
913 # mpls segment routing
914 ##############################################################################
916 list(APPEND VNET_SOURCES
917 srmpls/sr_mpls_policy.c
918 srmpls/sr_mpls_steering.c
922 list(APPEND VNET_HEADERS
926 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
928 ##############################################################################
929 # IPFIX / netflow v10
930 ##############################################################################
931 list(APPEND VNET_SOURCES
932 ipfix-export/flow_report.c
933 ipfix-export/flow_api.c
936 list(APPEND VNET_HEADERS
937 ipfix-export/flow_report.h
938 ipfix-export/ipfix_info_elements.h
939 ipfix-export/ipfix_packet.h
942 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
944 ##############################################################################
945 # IPFIX classify code
946 ##############################################################################
948 list(APPEND VNET_SOURCES
949 ipfix-export/flow_report_classify.c
952 list(APPEND VNET_HEADERS
953 ipfix-export/flow_report_classify.h
956 ##############################################################################
958 ##############################################################################
960 list(APPEND VNET_SOURCES
961 lawful-intercept/lawful_intercept.c
962 lawful-intercept/node.c
965 list(APPEND VNET_MULTIARCH_SOURCES
966 lawful-intercept/node.c
969 list(APPEND VNET_HEADERS
970 lawful-intercept/lawful_intercept.h
973 ##############################################################################
974 # SPAN (port mirroring)
975 ##############################################################################
977 list(APPEND VNET_SOURCES
983 list(APPEND VNET_MULTIARCH_SOURCES
987 list(APPEND VNET_HEADERS
991 list(APPEND VNET_API_FILES span/span.api)
993 ##############################################################################
995 ##############################################################################
997 list(APPEND VNET_SOURCES
1007 list(APPEND VNET_HEADERS
1012 list(APPEND VNET_API_FILES pg/pg.api)
1014 ##############################################################################
1016 ##############################################################################
1018 list(APPEND VNET_SOURCES
1019 devices/virtio/device.c
1020 devices/virtio/node.c
1021 devices/virtio/vhost_user.c
1022 devices/virtio/vhost_user_input.c
1023 devices/virtio/vhost_user_output.c
1024 devices/virtio/vhost_user_api.c
1025 devices/virtio/virtio.c
1026 devices/virtio/virtio_api.c
1027 devices/virtio/cli.c
1028 devices/virtio/pci.c
1031 list(APPEND VNET_HEADERS
1032 devices/virtio/pci.h
1033 devices/virtio/virtio.h
1034 devices/virtio/vhost_user.h
1037 list(APPEND VNET_MULTIARCH_SOURCES
1038 devices/virtio/vhost_user_input.c
1039 devices/virtio/vhost_user_output.c
1040 devices/netmap/node.c
1041 devices/virtio/node.c
1042 devices/af_packet/node.c
1043 devices/virtio/device.c
1046 list(APPEND VNET_API_FILES
1047 devices/virtio/vhost_user.api
1048 devices/virtio/virtio.api
1051 ##############################################################################
1052 # tap interface (with virtio backend)
1053 ##############################################################################
1055 list(APPEND VNET_SOURCES
1058 devices/tap/tapv2_api.c
1061 list(APPEND VNET_HEADERS
1065 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1067 ##############################################################################
1068 # tap interface (with virtio backend)
1069 ##############################################################################
1071 list(APPEND VNET_SOURCES
1072 devices/pipe/pipe_api.c
1076 list(APPEND VNET_HEADERS
1080 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1082 ##############################################################################
1083 # session managmeent
1084 ##############################################################################
1086 list(APPEND VNET_SOURCES
1088 session/session_table.c
1089 session/session_rules_table.c
1090 session/session_lookup.c
1091 session/session_node.c
1093 session/application.c
1094 session/application_worker.c
1095 session/session_cli.c
1096 session/application_interface.c
1097 session/application_local.c
1098 session/application_namespace.c
1099 session/segment_manager.c
1100 session/session_api.c
1103 list(APPEND VNET_HEADERS
1105 session/session_table.h
1106 session/session_rules_table.h
1107 session/session_types.h
1108 session/session_lookup.h
1109 session/application.h
1111 session/transport_types.h
1112 session/application_interface.h
1113 session/application_local.h
1114 session/application_namespace.h
1115 session/session_debug.h
1116 session/segment_manager.h
1117 session/mma_template.h
1118 session/mma_template.c
1123 list(APPEND VNET_API_FILES session/session.api)
1125 ##############################################################################
1127 ##############################################################################
1129 list(APPEND VNET_SOURCES
1133 list(APPEND VNET_HEADERS
1138 ##############################################################################
1139 # Linux packet interface
1140 ##############################################################################
1142 list(APPEND VNET_SOURCES
1143 devices/af_packet/af_packet.c
1144 devices/af_packet/device.c
1145 devices/af_packet/node.c
1146 devices/af_packet/cli.c
1147 devices/af_packet/af_packet_api.c
1150 list(APPEND VNET_MULTIARCH_SOURCES
1151 devices/netmap/device.c
1152 devices/af_packet/device.c
1155 list(APPEND VNET_HEADERS
1156 devices/af_packet/af_packet.h
1159 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1161 ##############################################################################
1163 ##############################################################################
1165 list(APPEND VNET_SOURCES
1166 devices/netmap/netmap.c
1167 devices/netmap/device.c
1168 devices/netmap/node.c
1169 devices/netmap/cli.c
1170 devices/netmap/netmap_api.c
1173 list(APPEND VNET_HEADERS
1174 devices/netmap/netmap.h
1177 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1179 ##############################################################################
1180 # Driver feature graph arc support
1181 ##############################################################################
1183 list(APPEND VNET_SOURCES
1185 feature/feature_api.c
1186 feature/registration.c
1189 list(APPEND VNET_HEADERS
1193 list(APPEND VNET_API_FILES feature/feature.api)
1195 ##############################################################################
1196 # Unix kernel related
1197 ##############################################################################
1199 # FIXME: unix/hgshm.c
1201 list(APPEND VNET_SOURCES
1206 list(APPEND VNET_HEADERS
1210 ##############################################################################
1212 ##############################################################################
1214 list(APPEND VNET_SOURCES
1226 fib/fib_entry_src_rr.c
1227 fib/fib_entry_src_interface.c
1228 fib/fib_entry_src_interpose.c
1229 fib/fib_entry_src_default_route.c
1230 fib/fib_entry_src_special.c
1231 fib/fib_entry_src_api.c
1232 fib/fib_entry_src_adj.c
1233 fib/fib_entry_src_mpls.c
1234 fib/fib_entry_src_lisp.c
1235 fib/fib_entry_cover.c
1236 fib/fib_entry_delegate.c
1237 fib/fib_entry_track.c
1242 fib/fib_attached_export.c
1247 list(APPEND VNET_HEADERS
1257 fib/fib_entry_delegate.h
1260 list(APPEND VNET_API_FILES fib/fib_types.api)
1262 ##############################################################################
1264 ##############################################################################
1266 list(APPEND VNET_SOURCES
1270 adj/adj_midchain_delegate.c
1280 list(APPEND VNET_MULTIARCH_SOURCES
1285 list(APPEND VNET_HEADERS
1295 ##############################################################################
1296 # Data-Plane Objects
1297 ##############################################################################
1299 list(APPEND VNET_SOURCES
1307 dpo/load_balance_map.c
1311 dpo/interface_rx_dpo.c
1312 dpo/interface_tx_dpo.c
1313 dpo/mpls_disposition.c
1314 dpo/mpls_label_dpo.c
1320 list(APPEND VNET_MULTIARCH_SOURCES
1322 dpo/mpls_disposition.c
1324 dpo/mpls_label_dpo.c
1325 dpo/interface_rx_dpo.c
1328 list(APPEND VNET_HEADERS
1340 ##############################################################################
1342 ##############################################################################
1344 list(APPEND VNET_SOURCES
1354 mfib/mfib_entry_cover.c
1355 mfib/mfib_entry_delegate.c
1356 mfib/mfib_entry_src.c
1357 mfib/mfib_entry_src_rr.c
1361 list(APPEND VNET_MULTIARCH_SOURCES
1365 list(APPEND VNET_HEADERS
1371 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1373 ##############################################################################
1375 ##############################################################################
1377 list(APPEND VNET_SOURCES
1384 list(APPEND VNET_HEADERS
1388 ##############################################################################
1390 ##############################################################################
1392 list(APPEND VNET_SOURCES
1395 qos/qos_egress_map.c
1397 qos/qos_record_node.c
1399 qos/qos_store_node.c
1404 list(APPEND VNET_MULTIARCH_SOURCES
1405 qos/qos_record_node.c
1409 list(APPEND VNET_API_FILES qos/qos.api)
1411 ##############################################################################
1413 ##############################################################################
1415 list(APPEND VNET_SOURCES
1416 bier/bier_bit_string.c
1419 bier/bier_fmask_db.c
1428 bier/bier_imp_node.c
1430 bier/bier_disp_entry.c
1431 bier/bier_disp_lookup_node.c
1432 bier/bier_disp_dispatch_node.c
1433 bier/bier_disp_table.c
1434 bier/bier_bift_table.c
1437 list(APPEND VNET_MULTIARCH_SOURCES
1438 bier/bier_disp_dispatch_node.c
1439 bier/bier_disp_lookup_node.c
1440 bier/bier_imp_node.c
1443 list(APPEND VNET_HEADERS
1450 list(APPEND VNET_API_FILES bier/bier.api)
1452 ##############################################################################
1454 ##############################################################################
1456 list (APPEND VNET_SOURCES
1462 list(APPEND VNET_HEADERS
1467 list(APPEND VNET_API_FILES syslog/syslog.api)
1469 ##############################################################################
1471 ##############################################################################
1473 add_vpp_library(vnet
1474 SOURCES ${VNET_SOURCES}
1475 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1476 INSTALL_HEADERS ${VNET_HEADERS}
1477 API_FILES ${VNET_API_FILES}
1478 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1482 ##############################################################################