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/ip_classify.c
388 classify/in_out_acl.c
389 classify/policer_classify.c
390 classify/flow_classify.c
391 classify/flow_classify_node.c
392 classify/vnet_classify.h
393 classify/classify_api.c
396 list(APPEND VNET_MULTIARCH_SOURCES
397 classify/ip_classify.c
398 classify/flow_classify_node.c
401 list(APPEND VNET_HEADERS
402 classify/vnet_classify.h
403 classify/in_out_acl.h
404 classify/policer_classify.h
405 classify/flow_classify.h
408 list(APPEND VNET_API_FILES classify/classify.api)
410 ##############################################################################
411 # Layer 3 protocols go here
412 ##############################################################################
414 ##############################################################################
415 # Layer 3 protocol: IP v4/v6
416 ##############################################################################
417 list(APPEND VNET_SOURCES
430 ip/ip4_source_and_port_range_check.c
431 ip/ip4_source_check.c
459 list(APPEND VNET_MULTIARCH_SOURCES
460 ip/ip4_source_check.c
471 list(APPEND VNET_HEADERS
484 ip/ip6_hop_by_hop_packet.h
489 ip/ip_source_and_port_range_check.h
498 list(APPEND VNET_API_FILES
504 list(APPEND VNET_MULTIARCH_SOURCES
510 ##############################################################################
512 ##############################################################################
513 list(APPEND VNET_SOURCES
517 list(APPEND VNET_HEADERS
518 ethernet/arp_packet.h
522 ##############################################################################
523 # Bidirectional Forwarding Detection
524 ##############################################################################
526 list(APPEND VNET_HEADERS
533 list(APPEND VNET_SOURCES
542 list(APPEND VNET_API_FILES bfd/bfd.api)
544 ##############################################################################
546 ##############################################################################
548 list(APPEND VNET_SOURCES
554 list(APPEND VNET_HEADERS
558 ##############################################################################
559 # Layer 3 protocol: IPSec
560 ##############################################################################
561 list(APPEND VNET_SOURCES
571 ipsec/ipsec_spd_policy.c
582 list(APPEND VNET_MULTIARCH_SOURCES
593 list(APPEND VNET_API_FILES ipsec/ipsec.api)
595 list(APPEND VNET_SOURCES
599 list(APPEND VNET_HEADERS
602 ipsec/ipsec_spd_policy.h
610 ##############################################################################
611 # Layer 3 protocol: osi
612 ##############################################################################
613 list(APPEND VNET_SOURCES
619 list(APPEND VNET_HEADERS
623 ##############################################################################
624 # Layer 4 protocol: tcp
625 ##############################################################################
626 list(APPEND VNET_SOURCES
630 tcp/tcp_syn_filter4.c
639 list(APPEND VNET_MULTIARCH_SOURCES
642 tcp/tcp_syn_filter4.c
645 list(APPEND VNET_HEADERS
653 list(APPEND VNET_API_FILES tcp/tcp.api)
655 ##############################################################################
656 # Layer 4 protocol: udp
657 ##############################################################################
658 list(APPEND VNET_SOURCES
669 list(APPEND VNET_MULTIARCH_SOURCES
674 list(APPEND VNET_HEADERS
680 list(APPEND VNET_API_FILES udp/udp.api)
682 ##############################################################################
683 # Tunnel protocol: gre
684 ##############################################################################
685 list(APPEND VNET_SOURCES
693 list(APPEND VNET_MULTIARCH_SOURCES
698 list(APPEND VNET_HEADERS
704 list(APPEND VNET_API_FILES gre/gre.api)
706 ##############################################################################
707 # Tunnel protocol: ipip
708 ##############################################################################
709 list(APPEND VNET_SOURCES
717 list(APPEND VNET_MULTIARCH_SOURCES
721 list(APPEND VNET_HEADERS
725 list(APPEND VNET_API_FILES ipip/ipip.api)
727 ##############################################################################
728 # Tunnel protocol: l2tpv3
729 ##############################################################################
730 list(APPEND VNET_SOURCES
738 list(APPEND VNET_MULTIARCH_SOURCES
743 list(APPEND VNET_HEADERS
748 list(APPEND VNET_API_FILES l2tp/l2tp.api)
750 ##############################################################################
751 # Tunnel protocol: gre+mpls
752 ##############################################################################
753 list(APPEND VNET_SOURCES
765 list(APPEND VNET_MULTIARCH_SOURCES
772 list(APPEND VNET_HEADERS
780 list(APPEND VNET_API_FILES mpls/mpls.api)
782 ##############################################################################
783 # Tunnel protocol: vxlan-gbp
784 ##############################################################################
785 list(APPEND VNET_SOURCES
788 vxlan-gbp/vxlan_gbp_api.c
789 vxlan-gbp/vxlan_gbp.c
790 vxlan-gbp/vxlan_gbp_packet.c
793 list (APPEND VNET_MULTIARCH_SOURCES
798 list(APPEND VNET_HEADERS
799 vxlan-gbp/vxlan_gbp.h
800 vxlan-gbp/vxlan_gbp_packet.h
801 vxlan-gbp/vxlan_gbp_error.def
804 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
806 ##############################################################################
807 # Tunnel protocol: vxlan-gpe
808 ##############################################################################
810 list(APPEND VNET_SOURCES
811 vxlan-gpe/vxlan_gpe.c
814 vxlan-gpe/vxlan_gpe_api.c
817 list (APPEND VNET_MULTIARCH_SOURCES
821 list(APPEND VNET_HEADERS
822 vxlan-gpe/vxlan_gpe.h
823 vxlan-gpe/vxlan_gpe_packet.h
824 vxlan-gpe/vxlan_gpe_error.def
827 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
829 ##############################################################################
830 # LISP control plane: lisp-cp
831 ##############################################################################
833 list(APPEND VNET_SOURCES
835 lisp-cp/lisp_cp_dpo.c
837 lisp-cp/gid_dictionary.c
838 lisp-cp/lisp_msg_serdes.c
846 list(APPEND VNET_HEADERS
849 lisp-cp/gid_dictionary.h
850 lisp-cp/lisp_cp_messages.h
851 lisp-cp/lisp_msg_serdes.h
855 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
856 list(APPEND VNET_API_FILES lisp-cp/one.api)
858 ##############################################################################
859 # Tunnel protocol: lisp-gpe
860 ##############################################################################
862 list(APPEND VNET_SOURCES
864 lisp-gpe/lisp_gpe_sub_interface.c
865 lisp-gpe/lisp_gpe_adjacency.c
866 lisp-gpe/lisp_gpe_tunnel.c
867 lisp-gpe/lisp_gpe_fwd_entry.c
868 lisp-gpe/lisp_gpe_tenant.c
871 lisp-gpe/lisp_gpe_api.c
874 list(APPEND VNET_HEADERS
876 lisp-gpe/lisp_gpe_fwd_entry.h
877 lisp-gpe/lisp_gpe_tenant.h
878 lisp-gpe/lisp_gpe_packet.h
879 lisp-gpe/lisp_gpe_error.def
882 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
884 ##############################################################################
886 ##############################################################################
887 list(APPEND VNET_SOURCES
889 dhcp/dhcp_client_detect.c
890 dhcp/dhcp6_client_common_dp.c
891 dhcp/dhcp6_pd_client_dp.c
892 dhcp/dhcp6_pd_client_cp.c
893 dhcp/dhcp6_ia_na_client_dp.c
894 dhcp/dhcp6_ia_na_client_cp.c
898 list(APPEND VNET_MULTIARCH_SOURCES
899 dhcp/dhcp_client_detect.c
902 list(APPEND VNET_HEADERS
904 dhcp/dhcp6_client_common_dp.h
905 dhcp/dhcp6_pd_client_dp.h
906 dhcp/dhcp6_ia_na_client_dp.h
909 list(APPEND VNET_API_FILES
911 dhcp/dhcp6_pd_client_cp.api
912 dhcp/dhcp6_ia_na_client_cp.api
915 ##############################################################################
917 ##############################################################################
918 list(APPEND VNET_SOURCES
919 dhcp/dhcp6_proxy_node.c
920 dhcp/dhcp4_proxy_node.c
924 list(APPEND VNET_HEADERS
928 dhcp/dhcp6_proxy_error.def
929 dhcp/dhcp4_proxy_error.def
932 ##############################################################################
933 # ipv6 segment routing
934 ##############################################################################
936 list(APPEND VNET_SOURCES
939 srv6/sr_policy_rewrite.c
944 list(APPEND VNET_HEADERS
949 list(APPEND VNET_API_FILES srv6/sr.api)
951 ##############################################################################
952 # mpls segment routing
953 ##############################################################################
955 list(APPEND VNET_SOURCES
956 srmpls/sr_mpls_policy.c
957 srmpls/sr_mpls_steering.c
961 list(APPEND VNET_HEADERS
965 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
967 ##############################################################################
968 # IPFIX / netflow v10
969 ##############################################################################
970 list(APPEND VNET_SOURCES
971 ipfix-export/flow_report.c
972 ipfix-export/flow_api.c
975 list(APPEND VNET_HEADERS
976 ipfix-export/flow_report.h
977 ipfix-export/ipfix_info_elements.h
978 ipfix-export/ipfix_packet.h
981 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
983 ##############################################################################
984 # IPFIX classify code
985 ##############################################################################
987 list(APPEND VNET_SOURCES
988 ipfix-export/flow_report_classify.c
991 list(APPEND VNET_HEADERS
992 ipfix-export/flow_report_classify.h
995 ##############################################################################
997 ##############################################################################
999 list(APPEND VNET_SOURCES
1000 lawful-intercept/lawful_intercept.c
1001 lawful-intercept/node.c
1004 list(APPEND VNET_MULTIARCH_SOURCES
1005 lawful-intercept/node.c
1008 list(APPEND VNET_HEADERS
1009 lawful-intercept/lawful_intercept.h
1012 ##############################################################################
1013 # SPAN (port mirroring)
1014 ##############################################################################
1016 list(APPEND VNET_SOURCES
1022 list(APPEND VNET_MULTIARCH_SOURCES
1026 list(APPEND VNET_HEADERS
1030 list(APPEND VNET_API_FILES span/span.api)
1032 ##############################################################################
1034 ##############################################################################
1035 list(APPEND VNET_SOURCES
1041 dns/resolver_process.c
1044 list(APPEND VNET_HEADERS
1048 list(APPEND VNET_API_FILES dns/dns.api)
1050 ##############################################################################
1052 ##############################################################################
1054 list(APPEND VNET_SOURCES
1064 list(APPEND VNET_HEADERS
1069 list(APPEND VNET_API_FILES pg/pg.api)
1071 ##############################################################################
1073 ##############################################################################
1075 list(APPEND VNET_SOURCES
1076 devices/virtio/device.c
1077 devices/virtio/node.c
1078 devices/virtio/vhost_user.c
1079 devices/virtio/vhost_user_input.c
1080 devices/virtio/vhost_user_output.c
1081 devices/virtio/vhost_user_api.c
1082 devices/virtio/virtio.c
1083 devices/virtio/virtio_api.c
1084 devices/virtio/cli.c
1085 devices/virtio/pci.c
1088 list(APPEND VNET_HEADERS
1089 devices/virtio/pci.h
1090 devices/virtio/virtio.h
1091 devices/virtio/vhost_user.h
1094 list(APPEND VNET_MULTIARCH_SOURCES
1095 devices/virtio/vhost_user_input.c
1096 devices/virtio/vhost_user_output.c
1097 devices/netmap/node.c
1098 devices/virtio/node.c
1099 devices/af_packet/node.c
1100 devices/virtio/device.c
1103 list(APPEND VNET_API_FILES
1104 devices/virtio/vhost_user.api
1105 devices/virtio/virtio.api
1108 ##############################################################################
1109 # tap interface (with virtio backend)
1110 ##############################################################################
1112 list(APPEND VNET_SOURCES
1115 devices/tap/tapv2_api.c
1118 list(APPEND VNET_HEADERS
1122 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1124 ##############################################################################
1125 # tap interface (with virtio backend)
1126 ##############################################################################
1128 list(APPEND VNET_SOURCES
1129 devices/pipe/pipe_api.c
1133 list(APPEND VNET_HEADERS
1137 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1139 ##############################################################################
1140 # session managmeent
1141 ##############################################################################
1143 list(APPEND VNET_SOURCES
1145 session/session_table.c
1146 session/session_rules_table.c
1147 session/session_lookup.c
1148 session/session_node.c
1150 session/application.c
1151 session/application_worker.c
1152 session/session_cli.c
1153 session/application_interface.c
1154 session/application_local.c
1155 session/application_namespace.c
1156 session/segment_manager.c
1157 session/session_api.c
1160 list(APPEND VNET_HEADERS
1162 session/session_table.h
1163 session/session_rules_table.h
1164 session/session_types.h
1165 session/session_lookup.h
1166 session/application.h
1168 session/transport_types.h
1169 session/application_interface.h
1170 session/application_local.h
1171 session/application_namespace.h
1172 session/session_debug.h
1173 session/segment_manager.h
1174 session/mma_template.h
1175 session/mma_template.c
1180 list(APPEND VNET_API_FILES session/session.api)
1182 ##############################################################################
1184 ##############################################################################
1186 list(APPEND VNET_SOURCES
1190 list(APPEND VNET_HEADERS
1195 ##############################################################################
1196 # Linux packet interface
1197 ##############################################################################
1199 list(APPEND VNET_SOURCES
1200 devices/af_packet/af_packet.c
1201 devices/af_packet/device.c
1202 devices/af_packet/node.c
1203 devices/af_packet/cli.c
1204 devices/af_packet/af_packet_api.c
1207 list(APPEND VNET_MULTIARCH_SOURCES
1208 devices/netmap/device.c
1209 devices/af_packet/device.c
1212 list(APPEND VNET_HEADERS
1213 devices/af_packet/af_packet.h
1216 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1218 ##############################################################################
1220 ##############################################################################
1222 list(APPEND VNET_SOURCES
1223 devices/netmap/netmap.c
1224 devices/netmap/device.c
1225 devices/netmap/node.c
1226 devices/netmap/cli.c
1227 devices/netmap/netmap_api.c
1230 list(APPEND VNET_HEADERS
1231 devices/netmap/netmap.h
1234 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1236 ##############################################################################
1237 # Driver feature graph arc support
1238 ##############################################################################
1240 list(APPEND VNET_SOURCES
1242 feature/feature_api.c
1243 feature/registration.c
1246 list(APPEND VNET_HEADERS
1250 list(APPEND VNET_API_FILES feature/feature.api)
1252 ##############################################################################
1253 # Unix kernel related
1254 ##############################################################################
1256 # FIXME: unix/hgshm.c
1258 list(APPEND VNET_SOURCES
1263 list(APPEND VNET_HEADERS
1267 ##############################################################################
1269 ##############################################################################
1271 list(APPEND VNET_SOURCES
1283 fib/fib_entry_src_rr.c
1284 fib/fib_entry_src_interface.c
1285 fib/fib_entry_src_interpose.c
1286 fib/fib_entry_src_default_route.c
1287 fib/fib_entry_src_special.c
1288 fib/fib_entry_src_api.c
1289 fib/fib_entry_src_adj.c
1290 fib/fib_entry_src_mpls.c
1291 fib/fib_entry_src_lisp.c
1292 fib/fib_entry_cover.c
1293 fib/fib_entry_delegate.c
1294 fib/fib_entry_track.c
1299 fib/fib_attached_export.c
1304 list(APPEND VNET_HEADERS
1314 fib/fib_entry_delegate.h
1317 list(APPEND VNET_API_FILES fib/fib_types.api)
1319 ##############################################################################
1321 ##############################################################################
1323 list(APPEND VNET_SOURCES
1327 adj/adj_midchain_delegate.c
1337 list(APPEND VNET_MULTIARCH_SOURCES
1342 list(APPEND VNET_HEADERS
1351 ##############################################################################
1352 # Data-Plane Objects
1353 ##############################################################################
1355 list(APPEND VNET_SOURCES
1363 dpo/load_balance_map.c
1367 dpo/interface_rx_dpo.c
1368 dpo/interface_tx_dpo.c
1369 dpo/mpls_disposition.c
1370 dpo/mpls_label_dpo.c
1376 list(APPEND VNET_MULTIARCH_SOURCES
1378 dpo/mpls_disposition.c
1380 dpo/mpls_label_dpo.c
1381 dpo/interface_rx_dpo.c
1384 list(APPEND VNET_HEADERS
1396 ##############################################################################
1398 ##############################################################################
1400 list(APPEND VNET_SOURCES
1410 mfib/mfib_entry_cover.c
1411 mfib/mfib_entry_delegate.c
1412 mfib/mfib_entry_src.c
1413 mfib/mfib_entry_src_rr.c
1417 list(APPEND VNET_MULTIARCH_SOURCES
1421 list(APPEND VNET_HEADERS
1427 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1429 ##############################################################################
1431 ##############################################################################
1433 list(APPEND VNET_SOURCES
1440 list(APPEND VNET_HEADERS
1444 ##############################################################################
1446 ##############################################################################
1448 list(APPEND VNET_SOURCES
1451 qos/qos_egress_map.c
1453 qos/qos_record_node.c
1458 list(APPEND VNET_MULTIARCH_SOURCES
1459 qos/qos_record_node.c
1463 list(APPEND VNET_API_FILES qos/qos.api)
1465 ##############################################################################
1467 ##############################################################################
1469 list(APPEND VNET_SOURCES
1470 bier/bier_bit_string.c
1473 bier/bier_fmask_db.c
1482 bier/bier_imp_node.c
1484 bier/bier_disp_entry.c
1485 bier/bier_disp_lookup_node.c
1486 bier/bier_disp_dispatch_node.c
1487 bier/bier_disp_table.c
1488 bier/bier_bift_table.c
1491 list(APPEND VNET_MULTIARCH_SOURCES
1492 bier/bier_disp_dispatch_node.c
1493 bier/bier_disp_lookup_node.c
1494 bier/bier_imp_node.c
1497 list(APPEND VNET_HEADERS
1504 list(APPEND VNET_API_FILES bier/bier.api)
1506 ##############################################################################
1508 ##############################################################################
1510 list (APPEND VNET_SOURCES
1516 list(APPEND VNET_HEADERS
1521 list(APPEND VNET_API_FILES syslog/syslog.api)
1523 ##############################################################################
1525 ##############################################################################
1527 add_vpp_library(vnet
1528 SOURCES ${VNET_SOURCES}
1529 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1530 INSTALL_HEADERS ${VNET_HEADERS}
1531 API_FILES ${VNET_API_FILES}
1532 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1536 ##############################################################################