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 ##############################################################################
945 ##############################################################################
946 list(APPEND VNET_SOURCES
953 list(APPEND VNET_HEADERS
957 list(APPEND VNET_API_FILES
961 ##############################################################################
962 # IPFIX classify code
963 ##############################################################################
965 list(APPEND VNET_SOURCES
966 ipfix-export/flow_report_classify.c
969 list(APPEND VNET_HEADERS
970 ipfix-export/flow_report_classify.h
973 ##############################################################################
975 ##############################################################################
977 list(APPEND VNET_SOURCES
978 lawful-intercept/lawful_intercept.c
979 lawful-intercept/node.c
982 list(APPEND VNET_MULTIARCH_SOURCES
983 lawful-intercept/node.c
986 list(APPEND VNET_HEADERS
987 lawful-intercept/lawful_intercept.h
990 ##############################################################################
991 # SPAN (port mirroring)
992 ##############################################################################
994 list(APPEND VNET_SOURCES
1000 list(APPEND VNET_MULTIARCH_SOURCES
1004 list(APPEND VNET_HEADERS
1008 list(APPEND VNET_API_FILES span/span.api)
1010 ##############################################################################
1012 ##############################################################################
1014 list(APPEND VNET_SOURCES
1024 list(APPEND VNET_HEADERS
1029 list(APPEND VNET_API_FILES pg/pg.api)
1031 ##############################################################################
1033 ##############################################################################
1035 list(APPEND VNET_SOURCES
1036 devices/virtio/device.c
1037 devices/virtio/node.c
1038 devices/virtio/vhost_user.c
1039 devices/virtio/vhost_user_input.c
1040 devices/virtio/vhost_user_output.c
1041 devices/virtio/vhost_user_api.c
1042 devices/virtio/virtio.c
1043 devices/virtio/virtio_api.c
1044 devices/virtio/cli.c
1045 devices/virtio/pci.c
1048 list(APPEND VNET_HEADERS
1049 devices/virtio/pci.h
1050 devices/virtio/virtio.h
1051 devices/virtio/vhost_user.h
1054 list(APPEND VNET_MULTIARCH_SOURCES
1055 devices/virtio/vhost_user_input.c
1056 devices/virtio/vhost_user_output.c
1057 devices/netmap/node.c
1058 devices/virtio/node.c
1059 devices/af_packet/node.c
1060 devices/virtio/device.c
1063 list(APPEND VNET_API_FILES
1064 devices/virtio/vhost_user.api
1065 devices/virtio/virtio.api
1068 ##############################################################################
1069 # tap interface (with virtio backend)
1070 ##############################################################################
1072 list(APPEND VNET_SOURCES
1075 devices/tap/tapv2_api.c
1078 list(APPEND VNET_HEADERS
1082 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1084 ##############################################################################
1085 # tap interface (with virtio backend)
1086 ##############################################################################
1088 list(APPEND VNET_SOURCES
1089 devices/pipe/pipe_api.c
1093 list(APPEND VNET_HEADERS
1097 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1099 ##############################################################################
1100 # session managmeent
1101 ##############################################################################
1103 list(APPEND VNET_SOURCES
1105 session/session_table.c
1106 session/session_rules_table.c
1107 session/session_lookup.c
1108 session/session_node.c
1110 session/application.c
1111 session/application_worker.c
1112 session/session_cli.c
1113 session/application_interface.c
1114 session/application_local.c
1115 session/application_namespace.c
1116 session/segment_manager.c
1117 session/session_api.c
1120 list(APPEND VNET_HEADERS
1122 session/session_table.h
1123 session/session_rules_table.h
1124 session/session_types.h
1125 session/session_lookup.h
1126 session/application.h
1128 session/transport_types.h
1129 session/application_interface.h
1130 session/application_local.h
1131 session/application_namespace.h
1132 session/session_debug.h
1133 session/segment_manager.h
1134 session/mma_template.h
1135 session/mma_template.c
1140 list(APPEND VNET_API_FILES session/session.api)
1142 ##############################################################################
1144 ##############################################################################
1146 list(APPEND VNET_SOURCES
1150 list(APPEND VNET_HEADERS
1155 ##############################################################################
1156 # Linux packet interface
1157 ##############################################################################
1159 list(APPEND VNET_SOURCES
1160 devices/af_packet/af_packet.c
1161 devices/af_packet/device.c
1162 devices/af_packet/node.c
1163 devices/af_packet/cli.c
1164 devices/af_packet/af_packet_api.c
1167 list(APPEND VNET_MULTIARCH_SOURCES
1168 devices/netmap/device.c
1169 devices/af_packet/device.c
1172 list(APPEND VNET_HEADERS
1173 devices/af_packet/af_packet.h
1176 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1178 ##############################################################################
1180 ##############################################################################
1182 list(APPEND VNET_SOURCES
1183 devices/netmap/netmap.c
1184 devices/netmap/device.c
1185 devices/netmap/node.c
1186 devices/netmap/cli.c
1187 devices/netmap/netmap_api.c
1190 list(APPEND VNET_HEADERS
1191 devices/netmap/netmap.h
1194 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1196 ##############################################################################
1197 # Driver feature graph arc support
1198 ##############################################################################
1200 list(APPEND VNET_SOURCES
1202 feature/feature_api.c
1203 feature/registration.c
1206 list(APPEND VNET_HEADERS
1210 list(APPEND VNET_API_FILES feature/feature.api)
1212 ##############################################################################
1213 # Unix kernel related
1214 ##############################################################################
1216 # FIXME: unix/hgshm.c
1218 list(APPEND VNET_SOURCES
1223 list(APPEND VNET_HEADERS
1227 ##############################################################################
1229 ##############################################################################
1231 list(APPEND VNET_SOURCES
1243 fib/fib_entry_src_rr.c
1244 fib/fib_entry_src_interface.c
1245 fib/fib_entry_src_interpose.c
1246 fib/fib_entry_src_default_route.c
1247 fib/fib_entry_src_special.c
1248 fib/fib_entry_src_api.c
1249 fib/fib_entry_src_adj.c
1250 fib/fib_entry_src_mpls.c
1251 fib/fib_entry_src_lisp.c
1252 fib/fib_entry_cover.c
1253 fib/fib_entry_delegate.c
1254 fib/fib_entry_track.c
1259 fib/fib_attached_export.c
1264 list(APPEND VNET_HEADERS
1274 fib/fib_entry_delegate.h
1277 list(APPEND VNET_API_FILES fib/fib_types.api)
1279 ##############################################################################
1281 ##############################################################################
1283 list(APPEND VNET_SOURCES
1287 adj/adj_midchain_delegate.c
1297 list(APPEND VNET_MULTIARCH_SOURCES
1302 list(APPEND VNET_HEADERS
1312 ##############################################################################
1313 # Data-Plane Objects
1314 ##############################################################################
1316 list(APPEND VNET_SOURCES
1324 dpo/load_balance_map.c
1328 dpo/interface_rx_dpo.c
1329 dpo/interface_tx_dpo.c
1330 dpo/mpls_disposition.c
1331 dpo/mpls_label_dpo.c
1337 list(APPEND VNET_MULTIARCH_SOURCES
1339 dpo/mpls_disposition.c
1341 dpo/mpls_label_dpo.c
1342 dpo/interface_rx_dpo.c
1345 list(APPEND VNET_HEADERS
1357 ##############################################################################
1359 ##############################################################################
1361 list(APPEND VNET_SOURCES
1371 mfib/mfib_entry_cover.c
1372 mfib/mfib_entry_delegate.c
1373 mfib/mfib_entry_src.c
1374 mfib/mfib_entry_src_rr.c
1378 list(APPEND VNET_MULTIARCH_SOURCES
1382 list(APPEND VNET_HEADERS
1388 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1390 ##############################################################################
1392 ##############################################################################
1394 list(APPEND VNET_SOURCES
1401 list(APPEND VNET_HEADERS
1405 ##############################################################################
1407 ##############################################################################
1409 list(APPEND VNET_SOURCES
1412 qos/qos_egress_map.c
1414 qos/qos_record_node.c
1416 qos/qos_store_node.c
1421 list(APPEND VNET_MULTIARCH_SOURCES
1422 qos/qos_record_node.c
1426 list(APPEND VNET_API_FILES qos/qos.api)
1428 ##############################################################################
1430 ##############################################################################
1432 list(APPEND VNET_SOURCES
1433 bier/bier_bit_string.c
1436 bier/bier_fmask_db.c
1445 bier/bier_imp_node.c
1447 bier/bier_disp_entry.c
1448 bier/bier_disp_lookup_node.c
1449 bier/bier_disp_dispatch_node.c
1450 bier/bier_disp_table.c
1451 bier/bier_bift_table.c
1454 list(APPEND VNET_MULTIARCH_SOURCES
1455 bier/bier_disp_dispatch_node.c
1456 bier/bier_disp_lookup_node.c
1457 bier/bier_imp_node.c
1460 list(APPEND VNET_HEADERS
1467 list(APPEND VNET_API_FILES bier/bier.api)
1469 ##############################################################################
1471 ##############################################################################
1473 list (APPEND VNET_SOURCES
1479 list(APPEND VNET_HEADERS
1484 list(APPEND VNET_API_FILES syslog/syslog.api)
1486 ##############################################################################
1488 ##############################################################################
1490 add_vpp_library(vnet
1491 SOURCES ${VNET_SOURCES}
1492 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1493 INSTALL_HEADERS ${VNET_HEADERS}
1494 API_FILES ${VNET_API_FILES}
1495 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1499 ##############################################################################