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
589 list(APPEND VNET_MULTIARCH_SOURCES
599 list(APPEND VNET_API_FILES ipsec/ipsec.api)
601 list(APPEND VNET_SOURCES
605 list(APPEND VNET_HEADERS
608 ipsec/ipsec_spd_policy.h
616 ##############################################################################
617 # Layer 3 protocol: osi
618 ##############################################################################
619 list(APPEND VNET_SOURCES
625 list(APPEND VNET_HEADERS
629 ##############################################################################
630 # Layer 4 protocol: tcp
631 ##############################################################################
632 list(APPEND VNET_SOURCES
636 tcp/tcp_syn_filter4.c
646 list(APPEND VNET_MULTIARCH_SOURCES
649 tcp/tcp_syn_filter4.c
652 list(APPEND VNET_HEADERS
660 list(APPEND VNET_API_FILES tcp/tcp.api)
662 ##############################################################################
663 # Layer 4 protocol: udp
664 ##############################################################################
665 list(APPEND VNET_SOURCES
676 list(APPEND VNET_MULTIARCH_SOURCES
681 list(APPEND VNET_HEADERS
687 list(APPEND VNET_API_FILES udp/udp.api)
689 ##############################################################################
690 # Tunnel protocol: gre
691 ##############################################################################
692 list(APPEND VNET_SOURCES
700 list(APPEND VNET_MULTIARCH_SOURCES
705 list(APPEND VNET_HEADERS
711 list(APPEND VNET_API_FILES gre/gre.api)
713 ##############################################################################
714 # Tunnel protocol: ipip
715 ##############################################################################
716 list(APPEND VNET_SOURCES
724 list(APPEND VNET_MULTIARCH_SOURCES
728 list(APPEND VNET_HEADERS
732 list(APPEND VNET_API_FILES ipip/ipip.api)
734 ##############################################################################
735 # Tunnel protocol: l2tpv3
736 ##############################################################################
737 list(APPEND VNET_SOURCES
745 list(APPEND VNET_MULTIARCH_SOURCES
750 list(APPEND VNET_HEADERS
755 list(APPEND VNET_API_FILES l2tp/l2tp.api)
757 ##############################################################################
758 # Tunnel protocol: gre+mpls
759 ##############################################################################
760 list(APPEND VNET_SOURCES
772 list(APPEND VNET_MULTIARCH_SOURCES
779 list(APPEND VNET_HEADERS
787 list(APPEND VNET_API_FILES mpls/mpls.api)
789 ##############################################################################
790 # Tunnel protocol: vxlan-gbp
791 ##############################################################################
792 list(APPEND VNET_SOURCES
795 vxlan-gbp/vxlan_gbp_api.c
796 vxlan-gbp/vxlan_gbp.c
797 vxlan-gbp/vxlan_gbp_packet.c
800 list (APPEND VNET_MULTIARCH_SOURCES
805 list(APPEND VNET_HEADERS
806 vxlan-gbp/vxlan_gbp.h
807 vxlan-gbp/vxlan_gbp_packet.h
808 vxlan-gbp/vxlan_gbp_error.def
811 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
813 ##############################################################################
814 # Tunnel protocol: vxlan-gpe
815 ##############################################################################
817 list(APPEND VNET_SOURCES
818 vxlan-gpe/vxlan_gpe.c
821 vxlan-gpe/vxlan_gpe_api.c
824 list (APPEND VNET_MULTIARCH_SOURCES
828 list(APPEND VNET_HEADERS
829 vxlan-gpe/vxlan_gpe.h
830 vxlan-gpe/vxlan_gpe_packet.h
831 vxlan-gpe/vxlan_gpe_error.def
834 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
836 ##############################################################################
837 # LISP control plane: lisp-cp
838 ##############################################################################
840 list(APPEND VNET_SOURCES
842 lisp-cp/lisp_cp_dpo.c
844 lisp-cp/gid_dictionary.c
845 lisp-cp/lisp_msg_serdes.c
853 list(APPEND VNET_HEADERS
856 lisp-cp/gid_dictionary.h
857 lisp-cp/lisp_cp_messages.h
858 lisp-cp/lisp_msg_serdes.h
862 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
863 list(APPEND VNET_API_FILES lisp-cp/one.api)
865 ##############################################################################
866 # Tunnel protocol: lisp-gpe
867 ##############################################################################
869 list(APPEND VNET_SOURCES
871 lisp-gpe/lisp_gpe_sub_interface.c
872 lisp-gpe/lisp_gpe_adjacency.c
873 lisp-gpe/lisp_gpe_tunnel.c
874 lisp-gpe/lisp_gpe_fwd_entry.c
875 lisp-gpe/lisp_gpe_tenant.c
878 lisp-gpe/lisp_gpe_api.c
881 list(APPEND VNET_HEADERS
883 lisp-gpe/lisp_gpe_fwd_entry.h
884 lisp-gpe/lisp_gpe_tenant.h
885 lisp-gpe/lisp_gpe_packet.h
886 lisp-gpe/lisp_gpe_error.def
889 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
891 ##############################################################################
892 # ipv6 segment routing
893 ##############################################################################
895 list(APPEND VNET_SOURCES
898 srv6/sr_policy_rewrite.c
903 list(APPEND VNET_HEADERS
908 list(APPEND VNET_API_FILES srv6/sr.api)
910 ##############################################################################
911 # mpls segment routing
912 ##############################################################################
914 list(APPEND VNET_SOURCES
915 srmpls/sr_mpls_policy.c
916 srmpls/sr_mpls_steering.c
920 list(APPEND VNET_HEADERS
924 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
926 ##############################################################################
927 # IPFIX / netflow v10
928 ##############################################################################
929 list(APPEND VNET_SOURCES
930 ipfix-export/flow_report.c
931 ipfix-export/flow_api.c
934 list(APPEND VNET_HEADERS
935 ipfix-export/flow_report.h
936 ipfix-export/ipfix_info_elements.h
937 ipfix-export/ipfix_packet.h
940 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
942 ##############################################################################
944 ##############################################################################
945 list(APPEND VNET_SOURCES
952 list(APPEND VNET_HEADERS
956 list(APPEND VNET_API_FILES
960 ##############################################################################
961 # IPFIX classify code
962 ##############################################################################
964 list(APPEND VNET_SOURCES
965 ipfix-export/flow_report_classify.c
968 list(APPEND VNET_HEADERS
969 ipfix-export/flow_report_classify.h
972 ##############################################################################
974 ##############################################################################
976 list(APPEND VNET_SOURCES
977 lawful-intercept/lawful_intercept.c
978 lawful-intercept/node.c
981 list(APPEND VNET_MULTIARCH_SOURCES
982 lawful-intercept/node.c
985 list(APPEND VNET_HEADERS
986 lawful-intercept/lawful_intercept.h
989 ##############################################################################
990 # SPAN (port mirroring)
991 ##############################################################################
993 list(APPEND VNET_SOURCES
999 list(APPEND VNET_MULTIARCH_SOURCES
1003 list(APPEND VNET_HEADERS
1007 list(APPEND VNET_API_FILES span/span.api)
1009 ##############################################################################
1011 ##############################################################################
1013 list(APPEND VNET_SOURCES
1023 list(APPEND VNET_HEADERS
1028 list(APPEND VNET_API_FILES pg/pg.api)
1030 ##############################################################################
1032 ##############################################################################
1034 list(APPEND VNET_SOURCES
1035 devices/virtio/cli.c
1036 devices/virtio/device.c
1037 devices/virtio/format.c
1038 devices/virtio/node.c
1039 devices/virtio/pci.c
1040 devices/virtio/vhost_user.c
1041 devices/virtio/vhost_user_input.c
1042 devices/virtio/vhost_user_output.c
1043 devices/virtio/vhost_user_api.c
1044 devices/virtio/virtio.c
1045 devices/virtio/virtio_api.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 ##############################################################################