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_HEADERS
65 list(APPEND VNET_API_FILES interface.api)
67 ##############################################################################
69 ##############################################################################
70 list(APPEND VNET_SOURCES
77 list(APPEND VNET_HEADERS
83 list(APPEND VNET_API_FILES policer/policer.api)
85 ##############################################################################
87 ##############################################################################
88 list(APPEND VNET_SOURCES
96 list(APPEND VNET_HEADERS
100 list(APPEND VNET_API_FILES cop/cop.api)
102 ##############################################################################
103 # Layer 2 protocols go here
104 ##############################################################################
106 ##############################################################################
107 # Layer 2 protocol: Ethernet
108 ##############################################################################
109 list(APPEND VNET_SOURCES
110 ethernet/ethernet_types_api.c
114 ethernet/mac_address.c
118 ethernet/p2p_ethernet.c
119 ethernet/p2p_ethernet_input.c
120 ethernet/p2p_ethernet_api.c
123 list(APPEND VNET_MULTIARCH_SOURCES ethernet/node.c)
125 list(APPEND VNET_HEADERS
131 ethernet/p2p_ethernet.h
134 list(APPEND VNET_API_FILES ethernet/p2p_ethernet.api)
136 ##############################################################################
137 # Layer 2 protocol: Ethernet bridging
138 ##############################################################################
139 list(APPEND VNET_SOURCES
144 l2/l2_input_classify.c
145 l2/l2_output_classify.c
161 list(APPEND VNET_MULTIARCH_SOURCES
167 list(APPEND VNET_HEADERS
184 list(APPEND VNET_API_FILES l2/l2.api)
186 ##############################################################################
187 # Layer 2 protocol: SRP
188 ##############################################################################
189 list(APPEND VNET_SOURCES
196 list(APPEND VNET_HEADERS
201 ##############################################################################
202 # Layer 2 protocol: PPP
203 ##############################################################################
204 list(APPEND VNET_SOURCES
210 list(APPEND VNET_HEADERS
216 ##############################################################################
217 # Layer 2 protocol: HDLC
218 ##############################################################################
219 list(APPEND VNET_SOURCES
225 list(APPEND VNET_HEADERS
231 ##############################################################################
232 # Layer 2 protocol: LLC
233 ##############################################################################
234 list(APPEND VNET_SOURCES
240 list(APPEND VNET_HEADERS
244 ##############################################################################
245 # Layer 2 protocol: SNAP
246 ##############################################################################
247 list(APPEND VNET_SOURCES
253 list(APPEND VNET_HEADERS
257 ##############################################################################
259 ##############################################################################
260 list(APPEND VNET_SOURCES
267 list(APPEND VNET_HEADERS
270 vxlan/vxlan_error.def
273 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
275 list(APPEND VNET_API_FILES vxlan/vxlan.api)
277 ##############################################################################
279 ##############################################################################
280 list(APPEND VNET_SOURCES
287 list(APPEND VNET_HEADERS
289 geneve/geneve_packet.h
290 geneve/geneve_error.def
293 list(APPEND VNET_API_FILES geneve/geneve.api)
295 ##############################################################################
297 ##############################################################################
298 list(APPEND VNET_SOURCES
305 list(APPEND VNET_HEADERS
309 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c)
310 list(APPEND VNET_API_FILES bonding/bond.api)
312 ##############################################################################
314 ##############################################################################
315 list(APPEND VNET_SOURCES
323 list(APPEND VNET_HEADERS
328 list(APPEND VNET_API_FILES lldp/lldp.api)
330 ##############################################################################
331 # Layer 2/3 "classify"
332 ##############################################################################
333 list(APPEND VNET_SOURCES
334 classify/vnet_classify.c
335 classify/ip_classify.c
336 classify/in_out_acl.c
337 classify/policer_classify.c
338 classify/flow_classify.c
339 classify/flow_classify_node.c
340 classify/vnet_classify.h
341 classify/classify_api.c
344 list(APPEND VNET_HEADERS
345 classify/vnet_classify.h
346 classify/in_out_acl.h
347 classify/policer_classify.h
348 classify/flow_classify.h
351 list(APPEND VNET_API_FILES classify/classify.api)
353 ##############################################################################
354 # Layer 3 protocols go here
355 ##############################################################################
357 ##############################################################################
358 # Layer 3 protocol: IP v4/v6
359 ##############################################################################
360 list(APPEND VNET_SOURCES
373 ip/ip4_source_and_port_range_check.c
374 ip/ip4_source_check.c
400 list(APPEND VNET_HEADERS
413 ip/ip6_hop_by_hop_packet.h
418 ip/ip_source_and_port_range_check.h
427 list(APPEND VNET_API_FILES
433 list(APPEND VNET_MULTIARCH_SOURCES ip/ip4_forward.c ip/ip4_input.c)
435 ##############################################################################
437 ##############################################################################
438 list(APPEND VNET_SOURCES
442 list(APPEND VNET_HEADERS
443 ethernet/arp_packet.h
447 ##############################################################################
448 # Bidirectional Forwarding Detection
449 ##############################################################################
451 list(APPEND VNET_HEADERS
458 list(APPEND VNET_SOURCES
467 list(APPEND VNET_API_FILES bfd/bfd.api)
469 ##############################################################################
470 # Layer 3 protocol: IPSec
471 ##############################################################################
472 list(APPEND VNET_SOURCES
487 ipsec/ikev2_payload.c
492 list(APPEND VNET_API_FILES ipsec/ipsec.api)
494 list(APPEND VNET_SOURCES
498 list(APPEND VNET_HEADERS
506 ##############################################################################
507 # Layer 3 protocol: osi
508 ##############################################################################
509 list(APPEND VNET_SOURCES
515 list(APPEND VNET_HEADERS
519 ##############################################################################
520 # Layer 4 protocol: tcp
521 ##############################################################################
522 list(APPEND VNET_SOURCES
526 tcp/tcp_syn_filter4.c
533 list(APPEND VNET_HEADERS
541 list(APPEND VNET_API_FILES tcp/tcp.api)
543 ##############################################################################
544 # Layer 4 protocol: udp
545 ##############################################################################
546 list(APPEND VNET_SOURCES
557 list(APPEND VNET_HEADERS
563 list(APPEND VNET_API_FILES udp/udp.api)
565 ##############################################################################
566 # Layer 4 protocol: sctp
567 ##############################################################################
568 list(APPEND VNET_SOURCES
577 list(APPEND VNET_HEADERS
584 list(APPEND VNET_API_FILES sctp/sctp.api)
586 ##############################################################################
587 # Tunnel protocol: gre
588 ##############################################################################
589 list(APPEND VNET_SOURCES
597 list(APPEND VNET_HEADERS
603 list(APPEND VNET_API_FILES gre/gre.api)
605 ##############################################################################
606 # Tunnel protocol: ipip
607 ##############################################################################
608 list(APPEND VNET_SOURCES
616 list(APPEND VNET_HEADERS
620 list(APPEND VNET_API_FILES ipip/ipip.api)
622 ##############################################################################
623 # Tunnel protocol: l2tpv3
624 ##############################################################################
625 list(APPEND VNET_SOURCES
633 list(APPEND VNET_HEADERS
638 list(APPEND VNET_API_FILES l2tp/l2tp.api)
640 ##############################################################################
641 # Tunnel protocol: gre+mpls
642 ##############################################################################
643 list(APPEND VNET_SOURCES
655 list(APPEND VNET_HEADERS
663 list(APPEND VNET_API_FILES mpls/mpls.api)
665 ##############################################################################
666 # Tunnel protocol: vxlan-gbp
667 ##############################################################################
668 list(APPEND VNET_SOURCES
671 vxlan-gbp/vxlan_gbp_api.c
672 vxlan-gbp/vxlan_gbp.c
675 list(APPEND VNET_HEADERS
676 vxlan-gbp/vxlan_gbp.h
677 vxlan-gbp/vxlan_gbp_packet.h
678 vxlan-gbp/vxlan_gbp_error.def
681 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
683 ##############################################################################
684 # Tunnel protocol: vxlan-gpe
685 ##############################################################################
687 list(APPEND VNET_SOURCES
688 vxlan-gpe/vxlan_gpe.c
691 vxlan-gpe/vxlan_gpe_api.c
694 list(APPEND VNET_HEADERS
695 vxlan-gpe/vxlan_gpe.h
696 vxlan-gpe/vxlan_gpe_packet.h
697 vxlan-gpe/vxlan_gpe_error.def
700 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
702 ##############################################################################
703 # Tunnel protocol: ipsec+gre
704 ##############################################################################
705 list(APPEND VNET_SOURCES
706 ipsec-gre/ipsec_gre.c
708 ipsec-gre/interface.c
709 ipsec-gre/ipsec_gre_api.c
712 list(APPEND VNET_HEADERS
713 ipsec-gre/ipsec_gre.h
717 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
719 ##############################################################################
720 # LISP control plane: lisp-cp
721 ##############################################################################
723 list(APPEND VNET_SOURCES
725 lisp-cp/lisp_cp_dpo.c
727 lisp-cp/gid_dictionary.c
728 lisp-cp/lisp_msg_serdes.c
736 list(APPEND VNET_HEADERS
739 lisp-cp/gid_dictionary.h
740 lisp-cp/lisp_cp_messages.h
741 lisp-cp/lisp_msg_serdes.h
745 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
746 list(APPEND VNET_API_FILES lisp-cp/one.api)
748 ##############################################################################
749 # Tunnel protocol: lisp-gpe
750 ##############################################################################
752 list(APPEND VNET_SOURCES
754 lisp-gpe/lisp_gpe_sub_interface.c
755 lisp-gpe/lisp_gpe_adjacency.c
756 lisp-gpe/lisp_gpe_tunnel.c
757 lisp-gpe/lisp_gpe_fwd_entry.c
758 lisp-gpe/lisp_gpe_tenant.c
761 lisp-gpe/lisp_gpe_api.c
764 list(APPEND VNET_HEADERS
766 lisp-gpe/lisp_gpe_fwd_entry.h
767 lisp-gpe/lisp_gpe_tenant.h
768 lisp-gpe/lisp_gpe_packet.h
769 lisp-gpe/lisp_gpe_error.def
772 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
774 ##############################################################################
776 ##############################################################################
777 list(APPEND VNET_SOURCES
779 dhcp/dhcp_client_detect.c
780 dhcp/dhcp6_client_common_dp.c
781 dhcp/dhcp6_pd_client_dp.c
782 dhcp/dhcp6_pd_client_cp.c
783 dhcp/dhcp6_ia_na_client_dp.c
784 dhcp/dhcp6_ia_na_client_cp.c
788 list(APPEND VNET_HEADERS
790 dhcp/dhcp6_client_common_dp.h
791 dhcp/dhcp6_pd_client_dp.h
792 dhcp/dhcp6_ia_na_client_dp.h
795 list(APPEND VNET_API_FILES
797 dhcp/dhcp6_pd_client_cp.api
798 dhcp/dhcp6_ia_na_client_cp.api
801 ##############################################################################
803 ##############################################################################
804 list(APPEND VNET_SOURCES
805 dhcp/dhcp6_proxy_node.c
806 dhcp/dhcp4_proxy_node.c
810 list(APPEND VNET_HEADERS
814 dhcp/dhcp6_proxy_error.def
815 dhcp/dhcp4_proxy_error.def
818 ##############################################################################
819 # ipv6 segment routing
820 ##############################################################################
822 list(APPEND VNET_SOURCES
825 srv6/sr_policy_rewrite.c
830 list(APPEND VNET_HEADERS
835 list(APPEND VNET_API_FILES srv6/sr.api)
837 ##############################################################################
838 # mpls segment routing
839 ##############################################################################
841 list(APPEND VNET_SOURCES
842 srmpls/sr_mpls_policy.c
843 srmpls/sr_mpls_steering.c
847 list(APPEND VNET_HEADERS
851 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
853 ##############################################################################
854 # IPFIX / netflow v10
855 ##############################################################################
856 list(APPEND VNET_SOURCES
857 ipfix-export/flow_report.c
858 ipfix-export/flow_api.c
861 list(APPEND VNET_HEADERS
862 ipfix-export/flow_report.h
863 ipfix-export/ipfix_info_elements.h
864 ipfix-export/ipfix_packet.h
867 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
869 ##############################################################################
870 # IPFIX classify code
871 ##############################################################################
873 list(APPEND VNET_SOURCES
874 ipfix-export/flow_report_classify.c
877 list(APPEND VNET_HEADERS
878 ipfix-export/flow_report_classify.h
881 ##############################################################################
883 ##############################################################################
885 list(APPEND VNET_SOURCES
886 lawful-intercept/lawful_intercept.c
887 lawful-intercept/node.c
890 list(APPEND VNET_HEADERS
891 lawful-intercept/lawful_intercept.h
894 ##############################################################################
895 # SPAN (port mirroring)
896 ##############################################################################
898 list(APPEND VNET_SOURCES
904 list(APPEND VNET_HEADERS
908 list(APPEND VNET_API_FILES span/span.api)
910 ##############################################################################
912 ##############################################################################
913 list(APPEND VNET_SOURCES
919 dns/resolver_process.c
922 list(APPEND VNET_HEADERS
926 list(APPEND VNET_API_FILES dns/dns.api)
928 ##############################################################################
930 ##############################################################################
932 list(APPEND VNET_SOURCES
942 list(APPEND VNET_HEADERS
947 list(APPEND VNET_API_FILES pg/pg.api)
949 ##############################################################################
951 ##############################################################################
953 list(APPEND VNET_SOURCES
954 devices/virtio/device.c
955 devices/virtio/node.c
956 devices/virtio/vhost_user.c
957 devices/virtio/vhost_user_input.c
958 devices/virtio/vhost_user_output.c
959 devices/virtio/vhost_user_api.c
960 devices/virtio/virtio.c
963 list(APPEND VNET_HEADERS
964 devices/virtio/virtio.h
965 devices/virtio/vhost_user.h
968 list(APPEND VNET_MULTIARCH_SOURCES
969 devices/virtio/vhost_user_input.c
970 devices/virtio/vhost_user_output.c
973 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
975 ##############################################################################
976 # tap interface (with virtio backend)
977 ##############################################################################
979 list(APPEND VNET_SOURCES
982 devices/tap/tapv2_api.c
985 list(APPEND VNET_HEADERS
989 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
991 ##############################################################################
992 # tap interface (with virtio backend)
993 ##############################################################################
995 list(APPEND VNET_SOURCES
996 devices/pipe/pipe_api.c
1000 list(APPEND VNET_HEADERS
1004 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1006 ##############################################################################
1007 # session managmeent
1008 ##############################################################################
1010 list(APPEND VNET_SOURCES
1012 session/session_table.c
1013 session/session_rules_table.c
1014 session/session_lookup.c
1015 session/session_node.c
1017 session/application.c
1018 session/session_cli.c
1019 session/application_interface.c
1020 session/application_namespace.c
1021 session/segment_manager.c
1022 session/session_test.c
1023 session/session_api.c
1026 list(APPEND VNET_HEADERS
1028 session/session_table.h
1029 session/session_rules_table.h
1030 session/stream_session.h
1031 session/session_lookup.h
1032 session/application.h
1034 session/transport_interface.h
1035 session/application_interface.h
1036 session/application_namespace.h
1037 session/session_debug.h
1038 session/segment_manager.h
1039 session/mma_template.h
1040 session/mma_template.c
1045 list(APPEND VNET_API_FILES session/session.api)
1047 ##############################################################################
1048 # session layer applications
1049 ##############################################################################
1051 list(APPEND VNET_SOURCES
1052 session-apps/echo_client.c
1053 session-apps/echo_server.c
1054 session-apps/http_server.c
1055 session-apps/proxy.c
1058 list(APPEND VNET_HEADERS
1059 session-apps/echo_client.h
1060 session-apps/proxy.h
1063 ##############################################################################
1065 ##############################################################################
1067 list(APPEND VNET_SOURCES
1071 list(APPEND VNET_HEADERS
1075 ##############################################################################
1076 # Linux packet interface
1077 ##############################################################################
1079 list(APPEND VNET_SOURCES
1080 devices/af_packet/af_packet.c
1081 devices/af_packet/device.c
1082 devices/af_packet/node.c
1083 devices/af_packet/cli.c
1084 devices/af_packet/af_packet_api.c
1087 list(APPEND VNET_HEADERS
1088 devices/af_packet/af_packet.h
1091 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1093 ##############################################################################
1095 ##############################################################################
1097 list(APPEND VNET_SOURCES
1098 devices/netmap/netmap.c
1099 devices/netmap/device.c
1100 devices/netmap/node.c
1101 devices/netmap/cli.c
1102 devices/netmap/netmap_api.c
1105 list(APPEND VNET_HEADERS
1106 devices/netmap/netmap.h
1109 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1111 ##############################################################################
1112 # Driver feature graph arc support
1113 ##############################################################################
1115 list(APPEND VNET_SOURCES
1117 feature/feature_api.c
1118 feature/registration.c
1121 list(APPEND VNET_HEADERS
1125 list(APPEND VNET_API_FILES feature/feature.api)
1127 ##############################################################################
1128 # Unix kernel related
1129 ##############################################################################
1131 # FIXME: unix/hgshm.c
1133 list(APPEND VNET_SOURCES
1141 list(APPEND VNET_HEADERS
1147 list(APPEND VNET_API_FILES unix/tap.api)
1149 ##############################################################################
1151 ##############################################################################
1153 list(APPEND VNET_SOURCES
1166 fib/fib_entry_src_rr.c
1167 fib/fib_entry_src_interface.c
1168 fib/fib_entry_src_interpose.c
1169 fib/fib_entry_src_default_route.c
1170 fib/fib_entry_src_special.c
1171 fib/fib_entry_src_api.c
1172 fib/fib_entry_src_adj.c
1173 fib/fib_entry_src_mpls.c
1174 fib/fib_entry_src_lisp.c
1175 fib/fib_entry_cover.c
1176 fib/fib_entry_delegate.c
1181 fib/fib_attached_export.c
1186 list(APPEND VNET_HEADERS
1196 fib/fib_entry_delegate.h
1199 ##############################################################################
1201 ##############################################################################
1203 list(APPEND VNET_SOURCES
1216 list(APPEND VNET_HEADERS
1225 ##############################################################################
1226 # Data-Plane Objects
1227 ##############################################################################
1229 list(APPEND VNET_SOURCES
1237 dpo/load_balance_map.c
1241 dpo/interface_rx_dpo.c
1242 dpo/interface_tx_dpo.c
1243 dpo/mpls_disposition.c
1244 dpo/mpls_label_dpo.c
1249 list(APPEND VNET_HEADERS
1261 ##############################################################################
1263 ##############################################################################
1265 list(APPEND VNET_SOURCES
1277 list(APPEND VNET_HEADERS
1283 ##############################################################################
1285 ##############################################################################
1287 list(APPEND VNET_SOURCES
1294 list(APPEND VNET_HEADERS
1298 ##############################################################################
1300 ##############################################################################
1302 list(APPEND VNET_SOURCES
1305 qos/qos_egress_map.c
1310 list(APPEND VNET_API_FILES qos/qos.api)
1312 ##############################################################################
1314 ##############################################################################
1316 list(APPEND VNET_SOURCES
1317 bier/bier_bit_string.c
1320 bier/bier_fmask_db.c
1330 bier/bier_imp_node.c
1332 bier/bier_disp_entry.c
1333 bier/bier_disp_lookup_node.c
1334 bier/bier_disp_dispatch_node.c
1335 bier/bier_disp_table.c
1336 bier/bier_bift_table.c
1339 list(APPEND VNET_HEADERS
1346 list(APPEND VNET_API_FILES bier/bier.api)
1348 ##############################################################################
1350 ##############################################################################
1352 add_vpp_library(vnet
1353 SOURCES ${VNET_SOURCES}
1354 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1355 INSTALL_HEADERS ${VNET_HEADERS}
1356 API_FILES ${VNET_API_FILES}
1357 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1361 ##############################################################################
1363 ##############################################################################
1365 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1366 if(VPP_BUILD_SESSION_ECHO_APPS)
1367 add_vpp_executable(tcp_echo
1368 SOURCES ../tests/vnet/session/tcp_echo.c
1369 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1373 add_vpp_executable(udp_echo
1374 SOURCES ../tests/vnet/session/udp_echo.c
1375 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1379 endif(VPP_BUILD_SESSION_ECHO_APPS)
1381 ##############################################################################