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
507 list(APPEND VNET_API_FILES
513 list(APPEND VNET_MULTIARCH_SOURCES
519 ##############################################################################
521 ##############################################################################
522 list(APPEND VNET_SOURCES
526 list(APPEND VNET_HEADERS
527 ethernet/arp_packet.h
531 ##############################################################################
532 # Bidirectional Forwarding Detection
533 ##############################################################################
535 list(APPEND VNET_HEADERS
542 list(APPEND VNET_SOURCES
551 list(APPEND VNET_API_FILES bfd/bfd.api)
553 ##############################################################################
555 ##############################################################################
557 list(APPEND VNET_SOURCES
563 list(APPEND VNET_HEADERS
567 ##############################################################################
568 # Layer 3 protocol: IPSec
569 ##############################################################################
570 list(APPEND VNET_SOURCES
578 ipsec/ipsec_spd_policy.c
587 ipsec/ipsec_types_api.c
590 list(APPEND VNET_MULTIARCH_SOURCES
600 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
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
613 ipsec/ipsec_types_api.h
619 ##############################################################################
620 # Layer 3 protocol: osi
621 ##############################################################################
622 list(APPEND VNET_SOURCES
628 list(APPEND VNET_HEADERS
632 ##############################################################################
633 # Layer 4 protocol: tcp
634 ##############################################################################
635 list(APPEND VNET_SOURCES
639 tcp/tcp_syn_filter4.c
649 list(APPEND VNET_MULTIARCH_SOURCES
652 tcp/tcp_syn_filter4.c
655 list(APPEND VNET_HEADERS
663 list(APPEND VNET_API_FILES tcp/tcp.api)
665 ##############################################################################
666 # Layer 4 protocol: udp
667 ##############################################################################
668 list(APPEND VNET_SOURCES
679 list(APPEND VNET_MULTIARCH_SOURCES
684 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 ipip/ipip.api)
737 ##############################################################################
738 # Tunnel protocol: l2tpv3
739 ##############################################################################
740 list(APPEND VNET_SOURCES
748 list(APPEND VNET_MULTIARCH_SOURCES
753 list(APPEND VNET_HEADERS
758 list(APPEND VNET_API_FILES l2tp/l2tp.api)
760 ##############################################################################
761 # Tunnel protocol: gre+mpls
762 ##############################################################################
763 list(APPEND VNET_SOURCES
775 list(APPEND VNET_MULTIARCH_SOURCES
782 list(APPEND VNET_HEADERS
790 list(APPEND VNET_API_FILES mpls/mpls.api)
792 ##############################################################################
793 # Tunnel protocol: vxlan-gbp
794 ##############################################################################
795 list(APPEND VNET_SOURCES
798 vxlan-gbp/vxlan_gbp_api.c
799 vxlan-gbp/vxlan_gbp.c
800 vxlan-gbp/vxlan_gbp_packet.c
803 list (APPEND VNET_MULTIARCH_SOURCES
808 list(APPEND VNET_HEADERS
809 vxlan-gbp/vxlan_gbp.h
810 vxlan-gbp/vxlan_gbp_packet.h
811 vxlan-gbp/vxlan_gbp_error.def
814 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
816 ##############################################################################
817 # Tunnel protocol: vxlan-gpe
818 ##############################################################################
820 list(APPEND VNET_SOURCES
821 vxlan-gpe/vxlan_gpe.c
824 vxlan-gpe/vxlan_gpe_api.c
827 list (APPEND VNET_MULTIARCH_SOURCES
831 list(APPEND VNET_HEADERS
832 vxlan-gpe/vxlan_gpe.h
833 vxlan-gpe/vxlan_gpe_packet.h
834 vxlan-gpe/vxlan_gpe_error.def
837 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
839 ##############################################################################
840 # LISP control plane: lisp-cp
841 ##############################################################################
843 list(APPEND VNET_SOURCES
845 lisp-cp/lisp_cp_dpo.c
847 lisp-cp/gid_dictionary.c
848 lisp-cp/lisp_msg_serdes.c
856 list(APPEND VNET_HEADERS
859 lisp-cp/gid_dictionary.h
860 lisp-cp/lisp_cp_messages.h
861 lisp-cp/lisp_msg_serdes.h
865 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
866 list(APPEND VNET_API_FILES lisp-cp/one.api)
868 ##############################################################################
869 # Tunnel protocol: lisp-gpe
870 ##############################################################################
872 list(APPEND VNET_SOURCES
874 lisp-gpe/lisp_gpe_sub_interface.c
875 lisp-gpe/lisp_gpe_adjacency.c
876 lisp-gpe/lisp_gpe_tunnel.c
877 lisp-gpe/lisp_gpe_fwd_entry.c
878 lisp-gpe/lisp_gpe_tenant.c
881 lisp-gpe/lisp_gpe_api.c
884 list(APPEND VNET_HEADERS
886 lisp-gpe/lisp_gpe_fwd_entry.h
887 lisp-gpe/lisp_gpe_tenant.h
888 lisp-gpe/lisp_gpe_packet.h
889 lisp-gpe/lisp_gpe_error.def
892 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
894 ##############################################################################
895 # ipv6 segment routing
896 ##############################################################################
898 list(APPEND VNET_SOURCES
901 srv6/sr_policy_rewrite.c
906 list(APPEND VNET_HEADERS
911 list(APPEND VNET_API_FILES srv6/sr.api)
913 ##############################################################################
914 # mpls segment routing
915 ##############################################################################
917 list(APPEND VNET_SOURCES
918 srmpls/sr_mpls_policy.c
919 srmpls/sr_mpls_steering.c
923 list(APPEND VNET_HEADERS
927 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
929 ##############################################################################
930 # IPFIX / netflow v10
931 ##############################################################################
932 list(APPEND VNET_SOURCES
933 ipfix-export/flow_report.c
934 ipfix-export/flow_api.c
937 list(APPEND VNET_HEADERS
938 ipfix-export/flow_report.h
939 ipfix-export/ipfix_info_elements.h
940 ipfix-export/ipfix_packet.h
943 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
945 ##############################################################################
947 ##############################################################################
948 list(APPEND VNET_SOURCES
955 list(APPEND VNET_HEADERS
959 list(APPEND VNET_API_FILES
963 ##############################################################################
964 # IPFIX classify code
965 ##############################################################################
967 list(APPEND VNET_SOURCES
968 ipfix-export/flow_report_classify.c
971 list(APPEND VNET_HEADERS
972 ipfix-export/flow_report_classify.h
975 ##############################################################################
977 ##############################################################################
979 list(APPEND VNET_SOURCES
980 lawful-intercept/lawful_intercept.c
981 lawful-intercept/node.c
984 list(APPEND VNET_MULTIARCH_SOURCES
985 lawful-intercept/node.c
988 list(APPEND VNET_HEADERS
989 lawful-intercept/lawful_intercept.h
992 ##############################################################################
993 # SPAN (port mirroring)
994 ##############################################################################
996 list(APPEND VNET_SOURCES
1002 list(APPEND VNET_MULTIARCH_SOURCES
1006 list(APPEND VNET_HEADERS
1010 list(APPEND VNET_API_FILES span/span.api)
1012 ##############################################################################
1014 ##############################################################################
1016 list(APPEND VNET_SOURCES
1026 list(APPEND VNET_HEADERS
1031 list(APPEND VNET_API_FILES pg/pg.api)
1033 ##############################################################################
1035 ##############################################################################
1037 list(APPEND VNET_SOURCES
1038 devices/virtio/cli.c
1039 devices/virtio/device.c
1040 devices/virtio/format.c
1041 devices/virtio/node.c
1042 devices/virtio/pci.c
1043 devices/virtio/vhost_user.c
1044 devices/virtio/vhost_user_input.c
1045 devices/virtio/vhost_user_output.c
1046 devices/virtio/vhost_user_api.c
1047 devices/virtio/virtio.c
1048 devices/virtio/virtio_api.c
1051 list(APPEND VNET_HEADERS
1052 devices/virtio/pci.h
1053 devices/virtio/virtio.h
1054 devices/virtio/vhost_user.h
1057 list(APPEND VNET_MULTIARCH_SOURCES
1058 devices/virtio/vhost_user_input.c
1059 devices/virtio/vhost_user_output.c
1060 devices/netmap/node.c
1061 devices/virtio/node.c
1062 devices/af_packet/node.c
1063 devices/virtio/device.c
1066 list(APPEND VNET_API_FILES
1067 devices/virtio/vhost_user.api
1068 devices/virtio/virtio.api
1071 ##############################################################################
1072 # tap interface (with virtio backend)
1073 ##############################################################################
1075 list(APPEND VNET_SOURCES
1078 devices/tap/tapv2_api.c
1081 list(APPEND VNET_HEADERS
1085 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1087 ##############################################################################
1088 # tap interface (with virtio backend)
1089 ##############################################################################
1091 list(APPEND VNET_SOURCES
1092 devices/pipe/pipe_api.c
1096 list(APPEND VNET_HEADERS
1100 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1102 ##############################################################################
1103 # session managmeent
1104 ##############################################################################
1106 list(APPEND VNET_SOURCES
1108 session/session_table.c
1109 session/session_rules_table.c
1110 session/session_lookup.c
1111 session/session_node.c
1113 session/application.c
1114 session/application_worker.c
1115 session/session_cli.c
1116 session/application_interface.c
1117 session/application_local.c
1118 session/application_namespace.c
1119 session/segment_manager.c
1120 session/session_api.c
1123 list(APPEND VNET_HEADERS
1125 session/session_table.h
1126 session/session_rules_table.h
1127 session/session_types.h
1128 session/session_lookup.h
1129 session/application.h
1131 session/transport_types.h
1132 session/application_interface.h
1133 session/application_local.h
1134 session/application_namespace.h
1135 session/session_debug.h
1136 session/segment_manager.h
1137 session/mma_template.h
1138 session/mma_template.c
1143 list(APPEND VNET_API_FILES session/session.api)
1145 ##############################################################################
1147 ##############################################################################
1149 list(APPEND VNET_SOURCES
1153 list(APPEND VNET_HEADERS
1158 ##############################################################################
1159 # Linux packet interface
1160 ##############################################################################
1162 list(APPEND VNET_SOURCES
1163 devices/af_packet/af_packet.c
1164 devices/af_packet/device.c
1165 devices/af_packet/node.c
1166 devices/af_packet/cli.c
1167 devices/af_packet/af_packet_api.c
1170 list(APPEND VNET_MULTIARCH_SOURCES
1171 devices/netmap/device.c
1172 devices/af_packet/device.c
1175 list(APPEND VNET_HEADERS
1176 devices/af_packet/af_packet.h
1179 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1181 ##############################################################################
1183 ##############################################################################
1185 list(APPEND VNET_SOURCES
1186 devices/netmap/netmap.c
1187 devices/netmap/device.c
1188 devices/netmap/node.c
1189 devices/netmap/cli.c
1190 devices/netmap/netmap_api.c
1193 list(APPEND VNET_HEADERS
1194 devices/netmap/netmap.h
1197 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1199 ##############################################################################
1200 # Driver feature graph arc support
1201 ##############################################################################
1203 list(APPEND VNET_SOURCES
1205 feature/feature_api.c
1206 feature/registration.c
1209 list(APPEND VNET_HEADERS
1213 list(APPEND VNET_API_FILES feature/feature.api)
1215 ##############################################################################
1216 # Unix kernel related
1217 ##############################################################################
1219 # FIXME: unix/hgshm.c
1221 list(APPEND VNET_SOURCES
1226 list(APPEND VNET_HEADERS
1230 ##############################################################################
1232 ##############################################################################
1234 list(APPEND VNET_SOURCES
1246 fib/fib_entry_src_rr.c
1247 fib/fib_entry_src_interface.c
1248 fib/fib_entry_src_interpose.c
1249 fib/fib_entry_src_default_route.c
1250 fib/fib_entry_src_special.c
1251 fib/fib_entry_src_api.c
1252 fib/fib_entry_src_adj.c
1253 fib/fib_entry_src_mpls.c
1254 fib/fib_entry_src_lisp.c
1255 fib/fib_entry_cover.c
1256 fib/fib_entry_delegate.c
1257 fib/fib_entry_track.c
1262 fib/fib_attached_export.c
1267 list(APPEND VNET_HEADERS
1277 fib/fib_entry_delegate.h
1280 list(APPEND VNET_API_FILES fib/fib_types.api)
1282 ##############################################################################
1284 ##############################################################################
1286 list(APPEND VNET_SOURCES
1290 adj/adj_midchain_delegate.c
1300 list(APPEND VNET_MULTIARCH_SOURCES
1305 list(APPEND VNET_HEADERS
1315 ##############################################################################
1316 # Data-Plane Objects
1317 ##############################################################################
1319 list(APPEND VNET_SOURCES
1327 dpo/load_balance_map.c
1331 dpo/interface_rx_dpo.c
1332 dpo/interface_tx_dpo.c
1333 dpo/mpls_disposition.c
1334 dpo/mpls_label_dpo.c
1340 list(APPEND VNET_MULTIARCH_SOURCES
1342 dpo/mpls_disposition.c
1344 dpo/mpls_label_dpo.c
1345 dpo/interface_rx_dpo.c
1348 list(APPEND VNET_HEADERS
1360 ##############################################################################
1362 ##############################################################################
1364 list(APPEND VNET_SOURCES
1374 mfib/mfib_entry_cover.c
1375 mfib/mfib_entry_delegate.c
1376 mfib/mfib_entry_src.c
1377 mfib/mfib_entry_src_rr.c
1381 list(APPEND VNET_MULTIARCH_SOURCES
1385 list(APPEND VNET_HEADERS
1391 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1393 ##############################################################################
1395 ##############################################################################
1397 list(APPEND VNET_SOURCES
1404 list(APPEND VNET_HEADERS
1408 ##############################################################################
1410 ##############################################################################
1412 list(APPEND VNET_SOURCES
1415 qos/qos_egress_map.c
1417 qos/qos_record_node.c
1419 qos/qos_store_node.c
1424 list(APPEND VNET_MULTIARCH_SOURCES
1425 qos/qos_record_node.c
1429 list(APPEND VNET_API_FILES qos/qos.api)
1431 ##############################################################################
1433 ##############################################################################
1435 list(APPEND VNET_SOURCES
1436 bier/bier_bit_string.c
1439 bier/bier_fmask_db.c
1448 bier/bier_imp_node.c
1450 bier/bier_disp_entry.c
1451 bier/bier_disp_lookup_node.c
1452 bier/bier_disp_dispatch_node.c
1453 bier/bier_disp_table.c
1454 bier/bier_bift_table.c
1457 list(APPEND VNET_MULTIARCH_SOURCES
1458 bier/bier_disp_dispatch_node.c
1459 bier/bier_disp_lookup_node.c
1460 bier/bier_imp_node.c
1463 list(APPEND VNET_HEADERS
1470 list(APPEND VNET_API_FILES bier/bier.api)
1472 ##############################################################################
1474 ##############################################################################
1476 list (APPEND VNET_SOURCES
1482 list(APPEND VNET_HEADERS
1487 list(APPEND VNET_API_FILES syslog/syslog.api)
1489 ##############################################################################
1491 ##############################################################################
1493 add_vpp_library(vnet
1494 SOURCES ${VNET_SOURCES}
1495 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1496 INSTALL_HEADERS ${VNET_HEADERS}
1497 API_FILES ${VNET_API_FILES}
1498 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1502 ##############################################################################