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
77 ##############################################################################
79 ##############################################################################
80 list(APPEND VNET_SOURCES
87 list(APPEND VNET_MULTIARCH_SOURCES
91 list(APPEND VNET_HEADERS
97 list(APPEND VNET_API_FILES policer/policer.api)
99 ##############################################################################
101 ##############################################################################
102 list(APPEND VNET_SOURCES
110 list(APPEND VNET_MULTIARCH_SOURCES
116 list(APPEND VNET_HEADERS
120 list(APPEND VNET_API_FILES cop/cop.api)
122 ##############################################################################
123 # Layer 2 protocols go here
124 ##############################################################################
126 ##############################################################################
127 # Layer 2 protocol: Ethernet
128 ##############################################################################
129 list(APPEND VNET_SOURCES
130 ethernet/ethernet_types_api.c
134 ethernet/mac_address.c
138 ethernet/p2p_ethernet.c
139 ethernet/p2p_ethernet_input.c
140 ethernet/p2p_ethernet_api.c
143 list(APPEND VNET_MULTIARCH_SOURCES
145 ethernet/p2p_ethernet_input.c
148 list(APPEND VNET_HEADERS
151 ethernet/mac_address.h
155 ethernet/p2p_ethernet.h
158 list(APPEND VNET_API_FILES ethernet/p2p_ethernet.api)
160 ##############################################################################
161 # Layer 2 protocol: Ethernet bridging
162 ##############################################################################
163 list(APPEND VNET_SOURCES
169 l2/l2_input_classify.c
170 l2/l2_output_classify.c
180 l2/l2_in_out_feat_arc.c
188 list(APPEND VNET_MULTIARCH_SOURCES
194 l2/l2_in_out_feat_arc.c
195 l2/l2_input_classify.c
197 l2/l2_output_classify.c
207 list(APPEND VNET_HEADERS
224 list(APPEND VNET_API_FILES l2/l2.api)
226 ##############################################################################
227 # Layer 2 protocol: SRP
228 ##############################################################################
229 list(APPEND VNET_SOURCES
236 list(APPEND VNET_HEADERS
241 ##############################################################################
242 # Layer 2 protocol: PPP
243 ##############################################################################
244 list(APPEND VNET_SOURCES
250 list(APPEND VNET_HEADERS
256 ##############################################################################
257 # Layer 2 protocol: HDLC
258 ##############################################################################
259 list(APPEND VNET_SOURCES
265 list(APPEND VNET_HEADERS
271 ##############################################################################
272 # Layer 2 protocol: LLC
273 ##############################################################################
274 list(APPEND VNET_SOURCES
280 list(APPEND VNET_HEADERS
284 ##############################################################################
285 # Layer 2 protocol: SNAP
286 ##############################################################################
287 list(APPEND VNET_SOURCES
293 list(APPEND VNET_HEADERS
297 ##############################################################################
299 ##############################################################################
300 list(APPEND VNET_SOURCES
307 list(APPEND VNET_MULTIARCH_SOURCES
311 list(APPEND VNET_HEADERS
314 vxlan/vxlan_error.def
317 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
319 list(APPEND VNET_API_FILES vxlan/vxlan.api)
321 ##############################################################################
323 ##############################################################################
324 list(APPEND VNET_SOURCES
331 list(APPEND VNET_MULTIARCH_SOURCES
336 list(APPEND VNET_HEADERS
338 geneve/geneve_packet.h
339 geneve/geneve_error.def
342 list(APPEND VNET_API_FILES geneve/geneve.api)
344 ##############################################################################
346 ##############################################################################
347 list(APPEND VNET_SOURCES
354 list(APPEND VNET_HEADERS
358 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
359 list(APPEND VNET_API_FILES bonding/bond.api)
361 ##############################################################################
363 ##############################################################################
364 list(APPEND VNET_SOURCES
372 list(APPEND VNET_HEADERS
377 list(APPEND VNET_API_FILES lldp/lldp.api)
379 ##############################################################################
380 # Layer 2/3 "classify"
381 ##############################################################################
382 list(APPEND VNET_SOURCES
383 classify/vnet_classify.c
384 classify/ip_classify.c
385 classify/in_out_acl.c
386 classify/policer_classify.c
387 classify/flow_classify.c
388 classify/flow_classify_node.c
389 classify/vnet_classify.h
390 classify/classify_api.c
393 list(APPEND VNET_MULTIARCH_SOURCES
394 classify/ip_classify.c
395 classify/flow_classify_node.c
398 list(APPEND VNET_HEADERS
399 classify/vnet_classify.h
400 classify/in_out_acl.h
401 classify/policer_classify.h
402 classify/flow_classify.h
405 list(APPEND VNET_API_FILES classify/classify.api)
407 ##############################################################################
408 # Layer 3 protocols go here
409 ##############################################################################
411 ##############################################################################
412 # Layer 3 protocol: IP v4/v6
413 ##############################################################################
414 list(APPEND VNET_SOURCES
427 ip/ip4_source_and_port_range_check.c
428 ip/ip4_source_check.c
456 list(APPEND VNET_MULTIARCH_SOURCES
457 ip/ip4_source_check.c
468 list(APPEND VNET_HEADERS
481 ip/ip6_hop_by_hop_packet.h
486 ip/ip_source_and_port_range_check.h
495 list(APPEND VNET_API_FILES
501 list(APPEND VNET_MULTIARCH_SOURCES
507 ##############################################################################
509 ##############################################################################
510 list(APPEND VNET_SOURCES
514 list(APPEND VNET_HEADERS
515 ethernet/arp_packet.h
519 ##############################################################################
520 # Bidirectional Forwarding Detection
521 ##############################################################################
523 list(APPEND VNET_HEADERS
530 list(APPEND VNET_SOURCES
539 list(APPEND VNET_API_FILES bfd/bfd.api)
541 ##############################################################################
543 ##############################################################################
545 list(APPEND VNET_SOURCES
551 list(APPEND VNET_HEADERS
555 ##############################################################################
556 # Layer 3 protocol: IPSec
557 ##############################################################################
558 list(APPEND VNET_SOURCES
568 ipsec/ipsec_spd_policy.c
579 list(APPEND VNET_MULTIARCH_SOURCES
590 list(APPEND VNET_API_FILES ipsec/ipsec.api)
592 list(APPEND VNET_SOURCES
596 list(APPEND VNET_HEADERS
599 ipsec/ipsec_spd_policy.h
607 ##############################################################################
608 # Layer 3 protocol: osi
609 ##############################################################################
610 list(APPEND VNET_SOURCES
616 list(APPEND VNET_HEADERS
620 ##############################################################################
621 # Layer 4 protocol: tcp
622 ##############################################################################
623 list(APPEND VNET_SOURCES
627 tcp/tcp_syn_filter4.c
636 list(APPEND VNET_MULTIARCH_SOURCES
639 tcp/tcp_syn_filter4.c
642 list(APPEND VNET_HEADERS
650 list(APPEND VNET_API_FILES tcp/tcp.api)
652 ##############################################################################
653 # Layer 4 protocol: udp
654 ##############################################################################
655 list(APPEND VNET_SOURCES
666 list(APPEND VNET_MULTIARCH_SOURCES
671 list(APPEND VNET_HEADERS
677 list(APPEND VNET_API_FILES udp/udp.api)
679 ##############################################################################
680 # Layer 4 protocol: sctp
681 ##############################################################################
682 list(APPEND VNET_SOURCES
688 sctp/sctp_output_node.c
692 list(APPEND VNET_MULTIARCH_SOURCES
693 sctp/sctp_output_node.c
697 list(APPEND VNET_HEADERS
704 list(APPEND VNET_API_FILES sctp/sctp.api)
706 ##############################################################################
707 # Tunnel protocol: gre
708 ##############################################################################
709 list(APPEND VNET_SOURCES
717 list(APPEND VNET_MULTIARCH_SOURCES
722 list(APPEND VNET_HEADERS
728 list(APPEND VNET_API_FILES gre/gre.api)
730 ##############################################################################
731 # Tunnel protocol: ipip
732 ##############################################################################
733 list(APPEND VNET_SOURCES
741 list(APPEND VNET_MULTIARCH_SOURCES
745 list(APPEND VNET_HEADERS
749 list(APPEND VNET_API_FILES ipip/ipip.api)
751 ##############################################################################
752 # Tunnel protocol: l2tpv3
753 ##############################################################################
754 list(APPEND VNET_SOURCES
762 list(APPEND VNET_MULTIARCH_SOURCES
767 list(APPEND VNET_HEADERS
772 list(APPEND VNET_API_FILES l2tp/l2tp.api)
774 ##############################################################################
775 # Tunnel protocol: gre+mpls
776 ##############################################################################
777 list(APPEND VNET_SOURCES
789 list(APPEND VNET_MULTIARCH_SOURCES
796 list(APPEND VNET_HEADERS
804 list(APPEND VNET_API_FILES mpls/mpls.api)
806 ##############################################################################
807 # Tunnel protocol: vxlan-gbp
808 ##############################################################################
809 list(APPEND VNET_SOURCES
812 vxlan-gbp/vxlan_gbp_api.c
813 vxlan-gbp/vxlan_gbp.c
814 vxlan-gbp/vxlan_gbp_packet.c
817 list (APPEND VNET_MULTIARCH_SOURCES
822 list(APPEND VNET_HEADERS
823 vxlan-gbp/vxlan_gbp.h
824 vxlan-gbp/vxlan_gbp_packet.h
825 vxlan-gbp/vxlan_gbp_error.def
828 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
830 ##############################################################################
831 # Tunnel protocol: vxlan-gpe
832 ##############################################################################
834 list(APPEND VNET_SOURCES
835 vxlan-gpe/vxlan_gpe.c
838 vxlan-gpe/vxlan_gpe_api.c
841 list (APPEND VNET_MULTIARCH_SOURCES
845 list(APPEND VNET_HEADERS
846 vxlan-gpe/vxlan_gpe.h
847 vxlan-gpe/vxlan_gpe_packet.h
848 vxlan-gpe/vxlan_gpe_error.def
851 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
853 ##############################################################################
854 # LISP control plane: lisp-cp
855 ##############################################################################
857 list(APPEND VNET_SOURCES
859 lisp-cp/lisp_cp_dpo.c
861 lisp-cp/gid_dictionary.c
862 lisp-cp/lisp_msg_serdes.c
870 list(APPEND VNET_HEADERS
873 lisp-cp/gid_dictionary.h
874 lisp-cp/lisp_cp_messages.h
875 lisp-cp/lisp_msg_serdes.h
879 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
880 list(APPEND VNET_API_FILES lisp-cp/one.api)
882 ##############################################################################
883 # Tunnel protocol: lisp-gpe
884 ##############################################################################
886 list(APPEND VNET_SOURCES
888 lisp-gpe/lisp_gpe_sub_interface.c
889 lisp-gpe/lisp_gpe_adjacency.c
890 lisp-gpe/lisp_gpe_tunnel.c
891 lisp-gpe/lisp_gpe_fwd_entry.c
892 lisp-gpe/lisp_gpe_tenant.c
895 lisp-gpe/lisp_gpe_api.c
898 list(APPEND VNET_HEADERS
900 lisp-gpe/lisp_gpe_fwd_entry.h
901 lisp-gpe/lisp_gpe_tenant.h
902 lisp-gpe/lisp_gpe_packet.h
903 lisp-gpe/lisp_gpe_error.def
906 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
908 ##############################################################################
910 ##############################################################################
911 list(APPEND VNET_SOURCES
913 dhcp/dhcp_client_detect.c
914 dhcp/dhcp6_client_common_dp.c
915 dhcp/dhcp6_pd_client_dp.c
916 dhcp/dhcp6_pd_client_cp.c
917 dhcp/dhcp6_ia_na_client_dp.c
918 dhcp/dhcp6_ia_na_client_cp.c
922 list(APPEND VNET_MULTIARCH_SOURCES
923 dhcp/dhcp_client_detect.c
926 list(APPEND VNET_HEADERS
928 dhcp/dhcp6_client_common_dp.h
929 dhcp/dhcp6_pd_client_dp.h
930 dhcp/dhcp6_ia_na_client_dp.h
933 list(APPEND VNET_API_FILES
935 dhcp/dhcp6_pd_client_cp.api
936 dhcp/dhcp6_ia_na_client_cp.api
939 ##############################################################################
941 ##############################################################################
942 list(APPEND VNET_SOURCES
943 dhcp/dhcp6_proxy_node.c
944 dhcp/dhcp4_proxy_node.c
948 list(APPEND VNET_HEADERS
952 dhcp/dhcp6_proxy_error.def
953 dhcp/dhcp4_proxy_error.def
956 ##############################################################################
957 # ipv6 segment routing
958 ##############################################################################
960 list(APPEND VNET_SOURCES
963 srv6/sr_policy_rewrite.c
968 list(APPEND VNET_HEADERS
973 list(APPEND VNET_API_FILES srv6/sr.api)
975 ##############################################################################
976 # mpls segment routing
977 ##############################################################################
979 list(APPEND VNET_SOURCES
980 srmpls/sr_mpls_policy.c
981 srmpls/sr_mpls_steering.c
985 list(APPEND VNET_HEADERS
989 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
991 ##############################################################################
992 # IPFIX / netflow v10
993 ##############################################################################
994 list(APPEND VNET_SOURCES
995 ipfix-export/flow_report.c
996 ipfix-export/flow_api.c
999 list(APPEND VNET_HEADERS
1000 ipfix-export/flow_report.h
1001 ipfix-export/ipfix_info_elements.h
1002 ipfix-export/ipfix_packet.h
1005 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
1007 ##############################################################################
1008 # IPFIX classify code
1009 ##############################################################################
1011 list(APPEND VNET_SOURCES
1012 ipfix-export/flow_report_classify.c
1015 list(APPEND VNET_HEADERS
1016 ipfix-export/flow_report_classify.h
1019 ##############################################################################
1021 ##############################################################################
1023 list(APPEND VNET_SOURCES
1024 lawful-intercept/lawful_intercept.c
1025 lawful-intercept/node.c
1028 list(APPEND VNET_MULTIARCH_SOURCES
1029 lawful-intercept/node.c
1032 list(APPEND VNET_HEADERS
1033 lawful-intercept/lawful_intercept.h
1036 ##############################################################################
1037 # SPAN (port mirroring)
1038 ##############################################################################
1040 list(APPEND VNET_SOURCES
1046 list(APPEND VNET_MULTIARCH_SOURCES
1050 list(APPEND VNET_HEADERS
1054 list(APPEND VNET_API_FILES span/span.api)
1056 ##############################################################################
1058 ##############################################################################
1059 list(APPEND VNET_SOURCES
1065 dns/resolver_process.c
1068 list(APPEND VNET_HEADERS
1072 list(APPEND VNET_API_FILES dns/dns.api)
1074 ##############################################################################
1076 ##############################################################################
1078 list(APPEND VNET_SOURCES
1088 list(APPEND VNET_HEADERS
1093 list(APPEND VNET_API_FILES pg/pg.api)
1095 ##############################################################################
1097 ##############################################################################
1099 list(APPEND VNET_SOURCES
1100 devices/virtio/device.c
1101 devices/virtio/node.c
1102 devices/virtio/vhost_user.c
1103 devices/virtio/vhost_user_input.c
1104 devices/virtio/vhost_user_output.c
1105 devices/virtio/vhost_user_api.c
1106 devices/virtio/virtio.c
1107 devices/virtio/virtio_api.c
1108 devices/virtio/cli.c
1109 devices/virtio/pci.c
1112 list(APPEND VNET_HEADERS
1113 devices/virtio/pci.h
1114 devices/virtio/virtio.h
1115 devices/virtio/vhost_user.h
1118 list(APPEND VNET_MULTIARCH_SOURCES
1119 devices/virtio/vhost_user_input.c
1120 devices/virtio/vhost_user_output.c
1121 devices/netmap/node.c
1122 devices/virtio/node.c
1123 devices/af_packet/node.c
1124 devices/virtio/device.c
1127 list(APPEND VNET_API_FILES
1128 devices/virtio/vhost_user.api
1129 devices/virtio/virtio.api
1132 ##############################################################################
1133 # tap interface (with virtio backend)
1134 ##############################################################################
1136 list(APPEND VNET_SOURCES
1139 devices/tap/tapv2_api.c
1142 list(APPEND VNET_HEADERS
1146 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1148 ##############################################################################
1149 # tap interface (with virtio backend)
1150 ##############################################################################
1152 list(APPEND VNET_SOURCES
1153 devices/pipe/pipe_api.c
1157 list(APPEND VNET_HEADERS
1161 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1163 ##############################################################################
1164 # session managmeent
1165 ##############################################################################
1167 list(APPEND VNET_SOURCES
1169 session/session_table.c
1170 session/session_rules_table.c
1171 session/session_lookup.c
1172 session/session_node.c
1174 session/application.c
1175 session/application_worker.c
1176 session/session_cli.c
1177 session/application_interface.c
1178 session/application_local.c
1179 session/application_namespace.c
1180 session/segment_manager.c
1181 session/session_api.c
1184 list(APPEND VNET_HEADERS
1186 session/session_table.h
1187 session/session_rules_table.h
1188 session/session_types.h
1189 session/session_lookup.h
1190 session/application.h
1192 session/transport_types.h
1193 session/application_interface.h
1194 session/application_local.h
1195 session/application_namespace.h
1196 session/session_debug.h
1197 session/segment_manager.h
1198 session/mma_template.h
1199 session/mma_template.c
1204 list(APPEND VNET_API_FILES session/session.api)
1206 ##############################################################################
1208 ##############################################################################
1210 list(APPEND VNET_SOURCES
1214 list(APPEND VNET_HEADERS
1219 ##############################################################################
1220 # Linux packet interface
1221 ##############################################################################
1223 list(APPEND VNET_SOURCES
1224 devices/af_packet/af_packet.c
1225 devices/af_packet/device.c
1226 devices/af_packet/node.c
1227 devices/af_packet/cli.c
1228 devices/af_packet/af_packet_api.c
1231 list(APPEND VNET_MULTIARCH_SOURCES
1232 devices/netmap/device.c
1233 devices/af_packet/device.c
1236 list(APPEND VNET_HEADERS
1237 devices/af_packet/af_packet.h
1240 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1242 ##############################################################################
1244 ##############################################################################
1246 list(APPEND VNET_SOURCES
1247 devices/netmap/netmap.c
1248 devices/netmap/device.c
1249 devices/netmap/node.c
1250 devices/netmap/cli.c
1251 devices/netmap/netmap_api.c
1254 list(APPEND VNET_HEADERS
1255 devices/netmap/netmap.h
1258 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1260 ##############################################################################
1261 # Driver feature graph arc support
1262 ##############################################################################
1264 list(APPEND VNET_SOURCES
1266 feature/feature_api.c
1267 feature/registration.c
1270 list(APPEND VNET_HEADERS
1274 list(APPEND VNET_API_FILES feature/feature.api)
1276 ##############################################################################
1277 # Unix kernel related
1278 ##############################################################################
1280 # FIXME: unix/hgshm.c
1282 list(APPEND VNET_SOURCES
1287 list(APPEND VNET_HEADERS
1291 ##############################################################################
1293 ##############################################################################
1295 list(APPEND VNET_SOURCES
1307 fib/fib_entry_src_rr.c
1308 fib/fib_entry_src_interface.c
1309 fib/fib_entry_src_interpose.c
1310 fib/fib_entry_src_default_route.c
1311 fib/fib_entry_src_special.c
1312 fib/fib_entry_src_api.c
1313 fib/fib_entry_src_adj.c
1314 fib/fib_entry_src_mpls.c
1315 fib/fib_entry_src_lisp.c
1316 fib/fib_entry_cover.c
1317 fib/fib_entry_delegate.c
1322 fib/fib_attached_export.c
1327 list(APPEND VNET_HEADERS
1337 fib/fib_entry_delegate.h
1340 ##############################################################################
1342 ##############################################################################
1344 list(APPEND VNET_SOURCES
1348 adj/adj_midchain_delegate.c
1358 list(APPEND VNET_MULTIARCH_SOURCES
1363 list(APPEND VNET_HEADERS
1372 ##############################################################################
1373 # Data-Plane Objects
1374 ##############################################################################
1376 list(APPEND VNET_SOURCES
1384 dpo/load_balance_map.c
1388 dpo/interface_rx_dpo.c
1389 dpo/interface_tx_dpo.c
1390 dpo/mpls_disposition.c
1391 dpo/mpls_label_dpo.c
1396 list(APPEND VNET_MULTIARCH_SOURCES
1398 dpo/mpls_disposition.c
1400 dpo/mpls_label_dpo.c
1401 dpo/interface_rx_dpo.c
1404 list(APPEND VNET_HEADERS
1416 ##############################################################################
1418 ##############################################################################
1420 list(APPEND VNET_SOURCES
1430 mfib/mfib_entry_cover.c
1431 mfib/mfib_entry_delegate.c
1432 mfib/mfib_entry_src.c
1433 mfib/mfib_entry_src_rr.c
1437 list(APPEND VNET_MULTIARCH_SOURCES
1441 list(APPEND VNET_HEADERS
1447 ##############################################################################
1449 ##############################################################################
1451 list(APPEND VNET_SOURCES
1458 list(APPEND VNET_HEADERS
1462 ##############################################################################
1464 ##############################################################################
1466 list(APPEND VNET_SOURCES
1469 qos/qos_egress_map.c
1471 qos/qos_record_node.c
1476 list(APPEND VNET_MULTIARCH_SOURCES
1477 qos/qos_record_node.c
1481 list(APPEND VNET_API_FILES qos/qos.api)
1483 ##############################################################################
1485 ##############################################################################
1487 list(APPEND VNET_SOURCES
1488 bier/bier_bit_string.c
1491 bier/bier_fmask_db.c
1500 bier/bier_imp_node.c
1502 bier/bier_disp_entry.c
1503 bier/bier_disp_lookup_node.c
1504 bier/bier_disp_dispatch_node.c
1505 bier/bier_disp_table.c
1506 bier/bier_bift_table.c
1509 list(APPEND VNET_MULTIARCH_SOURCES
1510 bier/bier_disp_dispatch_node.c
1511 bier/bier_disp_lookup_node.c
1512 bier/bier_imp_node.c
1515 list(APPEND VNET_HEADERS
1522 list(APPEND VNET_API_FILES bier/bier.api)
1524 ##############################################################################
1526 ##############################################################################
1528 list (APPEND VNET_SOURCES
1534 list(APPEND VNET_HEADERS
1539 list(APPEND VNET_API_FILES syslog/syslog.api)
1541 ##############################################################################
1543 ##############################################################################
1545 add_vpp_library(vnet
1546 SOURCES ${VNET_SOURCES}
1547 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1548 INSTALL_HEADERS ${VNET_HEADERS}
1549 API_FILES ${VNET_API_FILES}
1550 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1554 ##############################################################################