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
578 ipsec/ipsec_spd_policy.c
589 list(APPEND VNET_MULTIARCH_SOURCES
600 list(APPEND VNET_API_FILES ipsec/ipsec.api)
602 list(APPEND VNET_SOURCES
606 list(APPEND VNET_HEADERS
609 ipsec/ipsec_spd_policy.h
617 ##############################################################################
618 # Layer 3 protocol: osi
619 ##############################################################################
620 list(APPEND VNET_SOURCES
626 list(APPEND VNET_HEADERS
630 ##############################################################################
631 # Layer 4 protocol: tcp
632 ##############################################################################
633 list(APPEND VNET_SOURCES
637 tcp/tcp_syn_filter4.c
647 list(APPEND VNET_MULTIARCH_SOURCES
650 tcp/tcp_syn_filter4.c
653 list(APPEND VNET_HEADERS
661 list(APPEND VNET_API_FILES tcp/tcp.api)
663 ##############################################################################
664 # Layer 4 protocol: udp
665 ##############################################################################
666 list(APPEND VNET_SOURCES
677 list(APPEND VNET_MULTIARCH_SOURCES
682 list(APPEND VNET_HEADERS
688 list(APPEND VNET_API_FILES udp/udp.api)
690 ##############################################################################
691 # Tunnel protocol: gre
692 ##############################################################################
693 list(APPEND VNET_SOURCES
701 list(APPEND VNET_MULTIARCH_SOURCES
706 list(APPEND VNET_HEADERS
712 list(APPEND VNET_API_FILES gre/gre.api)
714 ##############################################################################
715 # Tunnel protocol: ipip
716 ##############################################################################
717 list(APPEND VNET_SOURCES
725 list(APPEND VNET_MULTIARCH_SOURCES
729 list(APPEND VNET_HEADERS
733 list(APPEND VNET_API_FILES ipip/ipip.api)
735 ##############################################################################
736 # Tunnel protocol: l2tpv3
737 ##############################################################################
738 list(APPEND VNET_SOURCES
746 list(APPEND VNET_MULTIARCH_SOURCES
751 list(APPEND VNET_HEADERS
756 list(APPEND VNET_API_FILES l2tp/l2tp.api)
758 ##############################################################################
759 # Tunnel protocol: gre+mpls
760 ##############################################################################
761 list(APPEND VNET_SOURCES
773 list(APPEND VNET_MULTIARCH_SOURCES
780 list(APPEND VNET_HEADERS
788 list(APPEND VNET_API_FILES mpls/mpls.api)
790 ##############################################################################
791 # Tunnel protocol: vxlan-gbp
792 ##############################################################################
793 list(APPEND VNET_SOURCES
796 vxlan-gbp/vxlan_gbp_api.c
797 vxlan-gbp/vxlan_gbp.c
798 vxlan-gbp/vxlan_gbp_packet.c
801 list (APPEND VNET_MULTIARCH_SOURCES
806 list(APPEND VNET_HEADERS
807 vxlan-gbp/vxlan_gbp.h
808 vxlan-gbp/vxlan_gbp_packet.h
809 vxlan-gbp/vxlan_gbp_error.def
812 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
814 ##############################################################################
815 # Tunnel protocol: vxlan-gpe
816 ##############################################################################
818 list(APPEND VNET_SOURCES
819 vxlan-gpe/vxlan_gpe.c
822 vxlan-gpe/vxlan_gpe_api.c
825 list (APPEND VNET_MULTIARCH_SOURCES
829 list(APPEND VNET_HEADERS
830 vxlan-gpe/vxlan_gpe.h
831 vxlan-gpe/vxlan_gpe_packet.h
832 vxlan-gpe/vxlan_gpe_error.def
835 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
837 ##############################################################################
838 # LISP control plane: lisp-cp
839 ##############################################################################
841 list(APPEND VNET_SOURCES
843 lisp-cp/lisp_cp_dpo.c
845 lisp-cp/gid_dictionary.c
846 lisp-cp/lisp_msg_serdes.c
854 list(APPEND VNET_HEADERS
857 lisp-cp/gid_dictionary.h
858 lisp-cp/lisp_cp_messages.h
859 lisp-cp/lisp_msg_serdes.h
863 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
864 list(APPEND VNET_API_FILES lisp-cp/one.api)
866 ##############################################################################
867 # Tunnel protocol: lisp-gpe
868 ##############################################################################
870 list(APPEND VNET_SOURCES
872 lisp-gpe/lisp_gpe_sub_interface.c
873 lisp-gpe/lisp_gpe_adjacency.c
874 lisp-gpe/lisp_gpe_tunnel.c
875 lisp-gpe/lisp_gpe_fwd_entry.c
876 lisp-gpe/lisp_gpe_tenant.c
879 lisp-gpe/lisp_gpe_api.c
882 list(APPEND VNET_HEADERS
884 lisp-gpe/lisp_gpe_fwd_entry.h
885 lisp-gpe/lisp_gpe_tenant.h
886 lisp-gpe/lisp_gpe_packet.h
887 lisp-gpe/lisp_gpe_error.def
890 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
892 ##############################################################################
893 # ipv6 segment routing
894 ##############################################################################
896 list(APPEND VNET_SOURCES
899 srv6/sr_policy_rewrite.c
904 list(APPEND VNET_HEADERS
909 list(APPEND VNET_API_FILES srv6/sr.api)
911 ##############################################################################
912 # mpls segment routing
913 ##############################################################################
915 list(APPEND VNET_SOURCES
916 srmpls/sr_mpls_policy.c
917 srmpls/sr_mpls_steering.c
921 list(APPEND VNET_HEADERS
925 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
927 ##############################################################################
928 # IPFIX / netflow v10
929 ##############################################################################
930 list(APPEND VNET_SOURCES
931 ipfix-export/flow_report.c
932 ipfix-export/flow_api.c
935 list(APPEND VNET_HEADERS
936 ipfix-export/flow_report.h
937 ipfix-export/ipfix_info_elements.h
938 ipfix-export/ipfix_packet.h
941 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
943 ##############################################################################
944 # IPFIX classify code
945 ##############################################################################
947 list(APPEND VNET_SOURCES
948 ipfix-export/flow_report_classify.c
951 list(APPEND VNET_HEADERS
952 ipfix-export/flow_report_classify.h
955 ##############################################################################
957 ##############################################################################
959 list(APPEND VNET_SOURCES
960 lawful-intercept/lawful_intercept.c
961 lawful-intercept/node.c
964 list(APPEND VNET_MULTIARCH_SOURCES
965 lawful-intercept/node.c
968 list(APPEND VNET_HEADERS
969 lawful-intercept/lawful_intercept.h
972 ##############################################################################
973 # SPAN (port mirroring)
974 ##############################################################################
976 list(APPEND VNET_SOURCES
982 list(APPEND VNET_MULTIARCH_SOURCES
986 list(APPEND VNET_HEADERS
990 list(APPEND VNET_API_FILES span/span.api)
992 ##############################################################################
994 ##############################################################################
996 list(APPEND VNET_SOURCES
1006 list(APPEND VNET_HEADERS
1011 list(APPEND VNET_API_FILES pg/pg.api)
1013 ##############################################################################
1015 ##############################################################################
1017 list(APPEND VNET_SOURCES
1018 devices/virtio/device.c
1019 devices/virtio/node.c
1020 devices/virtio/vhost_user.c
1021 devices/virtio/vhost_user_input.c
1022 devices/virtio/vhost_user_output.c
1023 devices/virtio/vhost_user_api.c
1024 devices/virtio/virtio.c
1025 devices/virtio/virtio_api.c
1026 devices/virtio/cli.c
1027 devices/virtio/pci.c
1030 list(APPEND VNET_HEADERS
1031 devices/virtio/pci.h
1032 devices/virtio/virtio.h
1033 devices/virtio/vhost_user.h
1036 list(APPEND VNET_MULTIARCH_SOURCES
1037 devices/virtio/vhost_user_input.c
1038 devices/virtio/vhost_user_output.c
1039 devices/netmap/node.c
1040 devices/virtio/node.c
1041 devices/af_packet/node.c
1042 devices/virtio/device.c
1045 list(APPEND VNET_API_FILES
1046 devices/virtio/vhost_user.api
1047 devices/virtio/virtio.api
1050 ##############################################################################
1051 # tap interface (with virtio backend)
1052 ##############################################################################
1054 list(APPEND VNET_SOURCES
1057 devices/tap/tapv2_api.c
1060 list(APPEND VNET_HEADERS
1064 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1066 ##############################################################################
1067 # tap interface (with virtio backend)
1068 ##############################################################################
1070 list(APPEND VNET_SOURCES
1071 devices/pipe/pipe_api.c
1075 list(APPEND VNET_HEADERS
1079 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1081 ##############################################################################
1082 # session managmeent
1083 ##############################################################################
1085 list(APPEND VNET_SOURCES
1087 session/session_table.c
1088 session/session_rules_table.c
1089 session/session_lookup.c
1090 session/session_node.c
1092 session/application.c
1093 session/application_worker.c
1094 session/session_cli.c
1095 session/application_interface.c
1096 session/application_local.c
1097 session/application_namespace.c
1098 session/segment_manager.c
1099 session/session_api.c
1102 list(APPEND VNET_HEADERS
1104 session/session_table.h
1105 session/session_rules_table.h
1106 session/session_types.h
1107 session/session_lookup.h
1108 session/application.h
1110 session/transport_types.h
1111 session/application_interface.h
1112 session/application_local.h
1113 session/application_namespace.h
1114 session/session_debug.h
1115 session/segment_manager.h
1116 session/mma_template.h
1117 session/mma_template.c
1122 list(APPEND VNET_API_FILES session/session.api)
1124 ##############################################################################
1126 ##############################################################################
1128 list(APPEND VNET_SOURCES
1132 list(APPEND VNET_HEADERS
1137 ##############################################################################
1138 # Linux packet interface
1139 ##############################################################################
1141 list(APPEND VNET_SOURCES
1142 devices/af_packet/af_packet.c
1143 devices/af_packet/device.c
1144 devices/af_packet/node.c
1145 devices/af_packet/cli.c
1146 devices/af_packet/af_packet_api.c
1149 list(APPEND VNET_MULTIARCH_SOURCES
1150 devices/netmap/device.c
1151 devices/af_packet/device.c
1154 list(APPEND VNET_HEADERS
1155 devices/af_packet/af_packet.h
1158 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1160 ##############################################################################
1162 ##############################################################################
1164 list(APPEND VNET_SOURCES
1165 devices/netmap/netmap.c
1166 devices/netmap/device.c
1167 devices/netmap/node.c
1168 devices/netmap/cli.c
1169 devices/netmap/netmap_api.c
1172 list(APPEND VNET_HEADERS
1173 devices/netmap/netmap.h
1176 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1178 ##############################################################################
1179 # Driver feature graph arc support
1180 ##############################################################################
1182 list(APPEND VNET_SOURCES
1184 feature/feature_api.c
1185 feature/registration.c
1188 list(APPEND VNET_HEADERS
1192 list(APPEND VNET_API_FILES feature/feature.api)
1194 ##############################################################################
1195 # Unix kernel related
1196 ##############################################################################
1198 # FIXME: unix/hgshm.c
1200 list(APPEND VNET_SOURCES
1205 list(APPEND VNET_HEADERS
1209 ##############################################################################
1211 ##############################################################################
1213 list(APPEND VNET_SOURCES
1225 fib/fib_entry_src_rr.c
1226 fib/fib_entry_src_interface.c
1227 fib/fib_entry_src_interpose.c
1228 fib/fib_entry_src_default_route.c
1229 fib/fib_entry_src_special.c
1230 fib/fib_entry_src_api.c
1231 fib/fib_entry_src_adj.c
1232 fib/fib_entry_src_mpls.c
1233 fib/fib_entry_src_lisp.c
1234 fib/fib_entry_cover.c
1235 fib/fib_entry_delegate.c
1236 fib/fib_entry_track.c
1241 fib/fib_attached_export.c
1246 list(APPEND VNET_HEADERS
1256 fib/fib_entry_delegate.h
1259 list(APPEND VNET_API_FILES fib/fib_types.api)
1261 ##############################################################################
1263 ##############################################################################
1265 list(APPEND VNET_SOURCES
1269 adj/adj_midchain_delegate.c
1279 list(APPEND VNET_MULTIARCH_SOURCES
1284 list(APPEND VNET_HEADERS
1294 ##############################################################################
1295 # Data-Plane Objects
1296 ##############################################################################
1298 list(APPEND VNET_SOURCES
1306 dpo/load_balance_map.c
1310 dpo/interface_rx_dpo.c
1311 dpo/interface_tx_dpo.c
1312 dpo/mpls_disposition.c
1313 dpo/mpls_label_dpo.c
1319 list(APPEND VNET_MULTIARCH_SOURCES
1321 dpo/mpls_disposition.c
1323 dpo/mpls_label_dpo.c
1324 dpo/interface_rx_dpo.c
1327 list(APPEND VNET_HEADERS
1339 ##############################################################################
1341 ##############################################################################
1343 list(APPEND VNET_SOURCES
1353 mfib/mfib_entry_cover.c
1354 mfib/mfib_entry_delegate.c
1355 mfib/mfib_entry_src.c
1356 mfib/mfib_entry_src_rr.c
1360 list(APPEND VNET_MULTIARCH_SOURCES
1364 list(APPEND VNET_HEADERS
1370 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1372 ##############################################################################
1374 ##############################################################################
1376 list(APPEND VNET_SOURCES
1383 list(APPEND VNET_HEADERS
1387 ##############################################################################
1389 ##############################################################################
1391 list(APPEND VNET_SOURCES
1394 qos/qos_egress_map.c
1396 qos/qos_record_node.c
1398 qos/qos_store_node.c
1403 list(APPEND VNET_MULTIARCH_SOURCES
1404 qos/qos_record_node.c
1408 list(APPEND VNET_API_FILES qos/qos.api)
1410 ##############################################################################
1412 ##############################################################################
1414 list(APPEND VNET_SOURCES
1415 bier/bier_bit_string.c
1418 bier/bier_fmask_db.c
1427 bier/bier_imp_node.c
1429 bier/bier_disp_entry.c
1430 bier/bier_disp_lookup_node.c
1431 bier/bier_disp_dispatch_node.c
1432 bier/bier_disp_table.c
1433 bier/bier_bift_table.c
1436 list(APPEND VNET_MULTIARCH_SOURCES
1437 bier/bier_disp_dispatch_node.c
1438 bier/bier_disp_lookup_node.c
1439 bier/bier_imp_node.c
1442 list(APPEND VNET_HEADERS
1449 list(APPEND VNET_API_FILES bier/bier.api)
1451 ##############################################################################
1453 ##############################################################################
1455 list (APPEND VNET_SOURCES
1461 list(APPEND VNET_HEADERS
1466 list(APPEND VNET_API_FILES syslog/syslog.api)
1468 ##############################################################################
1470 ##############################################################################
1472 add_vpp_library(vnet
1473 SOURCES ${VNET_SOURCES}
1474 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1475 INSTALL_HEADERS ${VNET_HEADERS}
1476 API_FILES ${VNET_API_FILES}
1477 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1481 ##############################################################################