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
462 list(APPEND VNET_MULTIARCH_SOURCES
463 ip/ip4_source_check.c
465 ip/reass/ip4_full_reass.c
467 ip/reass/ip6_full_reass.c
468 ip/reass/ip4_sv_reass.c
470 ip/reass/ip6_full_reass.c
471 ip/reass/ip6_sv_reass.c
478 list(APPEND VNET_HEADERS
491 ip/ip6_hop_by_hop_packet.h
496 ip/ip_source_and_port_range_check.h
505 list(APPEND VNET_API_FILES
511 list(APPEND VNET_MULTIARCH_SOURCES
517 ##############################################################################
519 ##############################################################################
520 list(APPEND VNET_SOURCES
524 list(APPEND VNET_HEADERS
525 ethernet/arp_packet.h
529 ##############################################################################
530 # Bidirectional Forwarding Detection
531 ##############################################################################
533 list(APPEND VNET_HEADERS
540 list(APPEND VNET_SOURCES
549 list(APPEND VNET_API_FILES bfd/bfd.api)
551 ##############################################################################
553 ##############################################################################
555 list(APPEND VNET_SOURCES
561 list(APPEND VNET_HEADERS
565 ##############################################################################
566 # Layer 3 protocol: IPSec
567 ##############################################################################
568 list(APPEND VNET_SOURCES
576 ipsec/ipsec_spd_policy.c
587 list(APPEND VNET_MULTIARCH_SOURCES
597 list(APPEND VNET_API_FILES ipsec/ipsec.api)
599 list(APPEND VNET_SOURCES
603 list(APPEND VNET_HEADERS
606 ipsec/ipsec_spd_policy.h
614 ##############################################################################
615 # Layer 3 protocol: osi
616 ##############################################################################
617 list(APPEND VNET_SOURCES
623 list(APPEND VNET_HEADERS
627 ##############################################################################
628 # Layer 4 protocol: tcp
629 ##############################################################################
630 list(APPEND VNET_SOURCES
634 tcp/tcp_syn_filter4.c
644 list(APPEND VNET_MULTIARCH_SOURCES
647 tcp/tcp_syn_filter4.c
650 list(APPEND VNET_HEADERS
658 list(APPEND VNET_API_FILES tcp/tcp.api)
660 ##############################################################################
661 # Layer 4 protocol: udp
662 ##############################################################################
663 list(APPEND VNET_SOURCES
674 list(APPEND VNET_MULTIARCH_SOURCES
679 list(APPEND VNET_HEADERS
685 list(APPEND VNET_API_FILES udp/udp.api)
687 ##############################################################################
688 # Tunnel protocol: gre
689 ##############################################################################
690 list(APPEND VNET_SOURCES
698 list(APPEND VNET_MULTIARCH_SOURCES
703 list(APPEND VNET_HEADERS
709 list(APPEND VNET_API_FILES gre/gre.api)
711 ##############################################################################
712 # Tunnel protocol: ipip
713 ##############################################################################
714 list(APPEND VNET_SOURCES
722 list(APPEND VNET_MULTIARCH_SOURCES
726 list(APPEND VNET_HEADERS
730 list(APPEND VNET_API_FILES ipip/ipip.api)
732 ##############################################################################
733 # Tunnel protocol: l2tpv3
734 ##############################################################################
735 list(APPEND VNET_SOURCES
743 list(APPEND VNET_MULTIARCH_SOURCES
748 list(APPEND VNET_HEADERS
753 list(APPEND VNET_API_FILES l2tp/l2tp.api)
755 ##############################################################################
756 # Tunnel protocol: gre+mpls
757 ##############################################################################
758 list(APPEND VNET_SOURCES
770 list(APPEND VNET_MULTIARCH_SOURCES
777 list(APPEND VNET_HEADERS
785 list(APPEND VNET_API_FILES mpls/mpls.api)
787 ##############################################################################
788 # Tunnel protocol: vxlan-gbp
789 ##############################################################################
790 list(APPEND VNET_SOURCES
793 vxlan-gbp/vxlan_gbp_api.c
794 vxlan-gbp/vxlan_gbp.c
795 vxlan-gbp/vxlan_gbp_packet.c
798 list (APPEND VNET_MULTIARCH_SOURCES
803 list(APPEND VNET_HEADERS
804 vxlan-gbp/vxlan_gbp.h
805 vxlan-gbp/vxlan_gbp_packet.h
806 vxlan-gbp/vxlan_gbp_error.def
809 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
811 ##############################################################################
812 # Tunnel protocol: vxlan-gpe
813 ##############################################################################
815 list(APPEND VNET_SOURCES
816 vxlan-gpe/vxlan_gpe.c
819 vxlan-gpe/vxlan_gpe_api.c
822 list (APPEND VNET_MULTIARCH_SOURCES
826 list(APPEND VNET_HEADERS
827 vxlan-gpe/vxlan_gpe.h
828 vxlan-gpe/vxlan_gpe_packet.h
829 vxlan-gpe/vxlan_gpe_error.def
832 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
834 ##############################################################################
835 # LISP control plane: lisp-cp
836 ##############################################################################
838 list(APPEND VNET_SOURCES
840 lisp-cp/lisp_cp_dpo.c
842 lisp-cp/gid_dictionary.c
843 lisp-cp/lisp_msg_serdes.c
851 list(APPEND VNET_HEADERS
854 lisp-cp/gid_dictionary.h
855 lisp-cp/lisp_cp_messages.h
856 lisp-cp/lisp_msg_serdes.h
860 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
861 list(APPEND VNET_API_FILES lisp-cp/one.api)
863 ##############################################################################
864 # Tunnel protocol: lisp-gpe
865 ##############################################################################
867 list(APPEND VNET_SOURCES
869 lisp-gpe/lisp_gpe_sub_interface.c
870 lisp-gpe/lisp_gpe_adjacency.c
871 lisp-gpe/lisp_gpe_tunnel.c
872 lisp-gpe/lisp_gpe_fwd_entry.c
873 lisp-gpe/lisp_gpe_tenant.c
876 lisp-gpe/lisp_gpe_api.c
879 list(APPEND VNET_HEADERS
881 lisp-gpe/lisp_gpe_fwd_entry.h
882 lisp-gpe/lisp_gpe_tenant.h
883 lisp-gpe/lisp_gpe_packet.h
884 lisp-gpe/lisp_gpe_error.def
887 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
889 ##############################################################################
890 # ipv6 segment routing
891 ##############################################################################
893 list(APPEND VNET_SOURCES
896 srv6/sr_policy_rewrite.c
901 list(APPEND VNET_HEADERS
906 list(APPEND VNET_API_FILES srv6/sr.api)
908 ##############################################################################
909 # mpls segment routing
910 ##############################################################################
912 list(APPEND VNET_SOURCES
913 srmpls/sr_mpls_policy.c
914 srmpls/sr_mpls_steering.c
918 list(APPEND VNET_HEADERS
922 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
924 ##############################################################################
925 # IPFIX / netflow v10
926 ##############################################################################
927 list(APPEND VNET_SOURCES
928 ipfix-export/flow_report.c
929 ipfix-export/flow_api.c
932 list(APPEND VNET_HEADERS
933 ipfix-export/flow_report.h
934 ipfix-export/ipfix_info_elements.h
935 ipfix-export/ipfix_packet.h
938 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
940 ##############################################################################
942 ##############################################################################
943 list(APPEND VNET_SOURCES
950 list(APPEND VNET_HEADERS
954 list(APPEND VNET_API_FILES
958 ##############################################################################
959 # IPFIX classify code
960 ##############################################################################
962 list(APPEND VNET_SOURCES
963 ipfix-export/flow_report_classify.c
966 list(APPEND VNET_HEADERS
967 ipfix-export/flow_report_classify.h
970 ##############################################################################
972 ##############################################################################
974 list(APPEND VNET_SOURCES
975 lawful-intercept/lawful_intercept.c
976 lawful-intercept/node.c
979 list(APPEND VNET_MULTIARCH_SOURCES
980 lawful-intercept/node.c
983 list(APPEND VNET_HEADERS
984 lawful-intercept/lawful_intercept.h
987 ##############################################################################
988 # SPAN (port mirroring)
989 ##############################################################################
991 list(APPEND VNET_SOURCES
997 list(APPEND VNET_MULTIARCH_SOURCES
1001 list(APPEND VNET_HEADERS
1005 list(APPEND VNET_API_FILES span/span.api)
1007 ##############################################################################
1009 ##############################################################################
1011 list(APPEND VNET_SOURCES
1021 list(APPEND VNET_HEADERS
1026 list(APPEND VNET_API_FILES pg/pg.api)
1028 ##############################################################################
1030 ##############################################################################
1032 list(APPEND VNET_SOURCES
1033 devices/virtio/device.c
1034 devices/virtio/node.c
1035 devices/virtio/vhost_user.c
1036 devices/virtio/vhost_user_input.c
1037 devices/virtio/vhost_user_output.c
1038 devices/virtio/vhost_user_api.c
1039 devices/virtio/virtio.c
1040 devices/virtio/virtio_api.c
1041 devices/virtio/cli.c
1042 devices/virtio/pci.c
1045 list(APPEND VNET_HEADERS
1046 devices/virtio/pci.h
1047 devices/virtio/virtio.h
1048 devices/virtio/vhost_user.h
1051 list(APPEND VNET_MULTIARCH_SOURCES
1052 devices/virtio/vhost_user_input.c
1053 devices/virtio/vhost_user_output.c
1054 devices/netmap/node.c
1055 devices/virtio/node.c
1056 devices/af_packet/node.c
1057 devices/virtio/device.c
1060 list(APPEND VNET_API_FILES
1061 devices/virtio/vhost_user.api
1062 devices/virtio/virtio.api
1065 ##############################################################################
1066 # tap interface (with virtio backend)
1067 ##############################################################################
1069 list(APPEND VNET_SOURCES
1072 devices/tap/tapv2_api.c
1075 list(APPEND VNET_HEADERS
1079 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1081 ##############################################################################
1082 # tap interface (with virtio backend)
1083 ##############################################################################
1085 list(APPEND VNET_SOURCES
1086 devices/pipe/pipe_api.c
1090 list(APPEND VNET_HEADERS
1094 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1096 ##############################################################################
1097 # session managmeent
1098 ##############################################################################
1100 list(APPEND VNET_SOURCES
1102 session/session_table.c
1103 session/session_rules_table.c
1104 session/session_lookup.c
1105 session/session_node.c
1107 session/application.c
1108 session/application_worker.c
1109 session/session_cli.c
1110 session/application_interface.c
1111 session/application_local.c
1112 session/application_namespace.c
1113 session/segment_manager.c
1114 session/session_api.c
1117 list(APPEND VNET_HEADERS
1119 session/session_table.h
1120 session/session_rules_table.h
1121 session/session_types.h
1122 session/session_lookup.h
1123 session/application.h
1125 session/transport_types.h
1126 session/application_interface.h
1127 session/application_local.h
1128 session/application_namespace.h
1129 session/session_debug.h
1130 session/segment_manager.h
1131 session/mma_template.h
1132 session/mma_template.c
1137 list(APPEND VNET_API_FILES session/session.api)
1139 ##############################################################################
1141 ##############################################################################
1143 list(APPEND VNET_SOURCES
1147 list(APPEND VNET_HEADERS
1152 ##############################################################################
1153 # Linux packet interface
1154 ##############################################################################
1156 list(APPEND VNET_SOURCES
1157 devices/af_packet/af_packet.c
1158 devices/af_packet/device.c
1159 devices/af_packet/node.c
1160 devices/af_packet/cli.c
1161 devices/af_packet/af_packet_api.c
1164 list(APPEND VNET_MULTIARCH_SOURCES
1165 devices/netmap/device.c
1166 devices/af_packet/device.c
1169 list(APPEND VNET_HEADERS
1170 devices/af_packet/af_packet.h
1173 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1175 ##############################################################################
1177 ##############################################################################
1179 list(APPEND VNET_SOURCES
1180 devices/netmap/netmap.c
1181 devices/netmap/device.c
1182 devices/netmap/node.c
1183 devices/netmap/cli.c
1184 devices/netmap/netmap_api.c
1187 list(APPEND VNET_HEADERS
1188 devices/netmap/netmap.h
1191 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1193 ##############################################################################
1194 # Driver feature graph arc support
1195 ##############################################################################
1197 list(APPEND VNET_SOURCES
1199 feature/feature_api.c
1200 feature/registration.c
1203 list(APPEND VNET_HEADERS
1207 list(APPEND VNET_API_FILES feature/feature.api)
1209 ##############################################################################
1210 # Unix kernel related
1211 ##############################################################################
1213 # FIXME: unix/hgshm.c
1215 list(APPEND VNET_SOURCES
1220 list(APPEND VNET_HEADERS
1224 ##############################################################################
1226 ##############################################################################
1228 list(APPEND VNET_SOURCES
1240 fib/fib_entry_src_rr.c
1241 fib/fib_entry_src_interface.c
1242 fib/fib_entry_src_interpose.c
1243 fib/fib_entry_src_default_route.c
1244 fib/fib_entry_src_special.c
1245 fib/fib_entry_src_api.c
1246 fib/fib_entry_src_adj.c
1247 fib/fib_entry_src_mpls.c
1248 fib/fib_entry_src_lisp.c
1249 fib/fib_entry_cover.c
1250 fib/fib_entry_delegate.c
1251 fib/fib_entry_track.c
1256 fib/fib_attached_export.c
1261 list(APPEND VNET_HEADERS
1271 fib/fib_entry_delegate.h
1274 list(APPEND VNET_API_FILES fib/fib_types.api)
1276 ##############################################################################
1278 ##############################################################################
1280 list(APPEND VNET_SOURCES
1284 adj/adj_midchain_delegate.c
1294 list(APPEND VNET_MULTIARCH_SOURCES
1299 list(APPEND VNET_HEADERS
1309 ##############################################################################
1310 # Data-Plane Objects
1311 ##############################################################################
1313 list(APPEND VNET_SOURCES
1321 dpo/load_balance_map.c
1325 dpo/interface_rx_dpo.c
1326 dpo/interface_tx_dpo.c
1327 dpo/mpls_disposition.c
1328 dpo/mpls_label_dpo.c
1334 list(APPEND VNET_MULTIARCH_SOURCES
1336 dpo/mpls_disposition.c
1338 dpo/mpls_label_dpo.c
1339 dpo/interface_rx_dpo.c
1342 list(APPEND VNET_HEADERS
1354 ##############################################################################
1356 ##############################################################################
1358 list(APPEND VNET_SOURCES
1368 mfib/mfib_entry_cover.c
1369 mfib/mfib_entry_delegate.c
1370 mfib/mfib_entry_src.c
1371 mfib/mfib_entry_src_rr.c
1375 list(APPEND VNET_MULTIARCH_SOURCES
1379 list(APPEND VNET_HEADERS
1385 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1387 ##############################################################################
1389 ##############################################################################
1391 list(APPEND VNET_SOURCES
1398 list(APPEND VNET_HEADERS
1402 ##############################################################################
1404 ##############################################################################
1406 list(APPEND VNET_SOURCES
1409 qos/qos_egress_map.c
1411 qos/qos_record_node.c
1413 qos/qos_store_node.c
1418 list(APPEND VNET_MULTIARCH_SOURCES
1419 qos/qos_record_node.c
1423 list(APPEND VNET_API_FILES qos/qos.api)
1425 ##############################################################################
1427 ##############################################################################
1429 list(APPEND VNET_SOURCES
1430 bier/bier_bit_string.c
1433 bier/bier_fmask_db.c
1442 bier/bier_imp_node.c
1444 bier/bier_disp_entry.c
1445 bier/bier_disp_lookup_node.c
1446 bier/bier_disp_dispatch_node.c
1447 bier/bier_disp_table.c
1448 bier/bier_bift_table.c
1451 list(APPEND VNET_MULTIARCH_SOURCES
1452 bier/bier_disp_dispatch_node.c
1453 bier/bier_disp_lookup_node.c
1454 bier/bier_imp_node.c
1457 list(APPEND VNET_HEADERS
1464 list(APPEND VNET_API_FILES bier/bier.api)
1466 ##############################################################################
1468 ##############################################################################
1470 list (APPEND VNET_SOURCES
1476 list(APPEND VNET_HEADERS
1481 list(APPEND VNET_API_FILES syslog/syslog.api)
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}
1496 ##############################################################################