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
128 ethernet/mac_address.h
132 ethernet/p2p_ethernet.h
135 list(APPEND VNET_API_FILES ethernet/p2p_ethernet.api)
137 ##############################################################################
138 # Layer 2 protocol: Ethernet bridging
139 ##############################################################################
140 list(APPEND VNET_SOURCES
145 l2/l2_input_classify.c
146 l2/l2_output_classify.c
156 l2/l2_in_out_feat_arc.c
164 list(APPEND VNET_MULTIARCH_SOURCES
171 list(APPEND VNET_HEADERS
188 list(APPEND VNET_API_FILES l2/l2.api)
190 ##############################################################################
191 # Layer 2 protocol: SRP
192 ##############################################################################
193 list(APPEND VNET_SOURCES
200 list(APPEND VNET_HEADERS
205 ##############################################################################
206 # Layer 2 protocol: PPP
207 ##############################################################################
208 list(APPEND VNET_SOURCES
214 list(APPEND VNET_HEADERS
220 ##############################################################################
221 # Layer 2 protocol: HDLC
222 ##############################################################################
223 list(APPEND VNET_SOURCES
229 list(APPEND VNET_HEADERS
235 ##############################################################################
236 # Layer 2 protocol: LLC
237 ##############################################################################
238 list(APPEND VNET_SOURCES
244 list(APPEND VNET_HEADERS
248 ##############################################################################
249 # Layer 2 protocol: SNAP
250 ##############################################################################
251 list(APPEND VNET_SOURCES
257 list(APPEND VNET_HEADERS
261 ##############################################################################
263 ##############################################################################
264 list(APPEND VNET_SOURCES
271 list(APPEND VNET_HEADERS
274 vxlan/vxlan_error.def
277 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
279 list(APPEND VNET_API_FILES vxlan/vxlan.api)
281 ##############################################################################
283 ##############################################################################
284 list(APPEND VNET_SOURCES
291 list(APPEND VNET_HEADERS
293 geneve/geneve_packet.h
294 geneve/geneve_error.def
297 list(APPEND VNET_API_FILES geneve/geneve.api)
299 ##############################################################################
301 ##############################################################################
302 list(APPEND VNET_SOURCES
309 list(APPEND VNET_HEADERS
313 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
314 list(APPEND VNET_API_FILES bonding/bond.api)
316 ##############################################################################
318 ##############################################################################
319 list(APPEND VNET_SOURCES
327 list(APPEND VNET_HEADERS
332 list(APPEND VNET_API_FILES lldp/lldp.api)
334 ##############################################################################
335 # Layer 2/3 "classify"
336 ##############################################################################
337 list(APPEND VNET_SOURCES
338 classify/vnet_classify.c
339 classify/ip_classify.c
340 classify/in_out_acl.c
341 classify/policer_classify.c
342 classify/flow_classify.c
343 classify/flow_classify_node.c
344 classify/vnet_classify.h
345 classify/classify_api.c
348 list(APPEND VNET_HEADERS
349 classify/vnet_classify.h
350 classify/in_out_acl.h
351 classify/policer_classify.h
352 classify/flow_classify.h
355 list(APPEND VNET_API_FILES classify/classify.api)
357 ##############################################################################
358 # Layer 3 protocols go here
359 ##############################################################################
361 ##############################################################################
362 # Layer 3 protocol: IP v4/v6
363 ##############################################################################
364 list(APPEND VNET_SOURCES
377 ip/ip4_source_and_port_range_check.c
378 ip/ip4_source_check.c
404 list(APPEND VNET_HEADERS
417 ip/ip6_hop_by_hop_packet.h
422 ip/ip_source_and_port_range_check.h
431 list(APPEND VNET_API_FILES
437 list(APPEND VNET_MULTIARCH_SOURCES
443 ##############################################################################
445 ##############################################################################
446 list(APPEND VNET_SOURCES
450 list(APPEND VNET_HEADERS
451 ethernet/arp_packet.h
455 ##############################################################################
456 # Bidirectional Forwarding Detection
457 ##############################################################################
459 list(APPEND VNET_HEADERS
466 list(APPEND VNET_SOURCES
475 list(APPEND VNET_API_FILES bfd/bfd.api)
477 ##############################################################################
478 # Layer 3 protocol: IPSec
479 ##############################################################################
480 list(APPEND VNET_SOURCES
489 ipsec/ipsec_spd_policy.c
498 ipsec/ikev2_payload.c
503 list(APPEND VNET_MULTIARCH_SOURCES
513 list(APPEND VNET_API_FILES ipsec/ipsec.api)
515 list(APPEND VNET_SOURCES
519 list(APPEND VNET_HEADERS
527 ##############################################################################
528 # Layer 3 protocol: osi
529 ##############################################################################
530 list(APPEND VNET_SOURCES
536 list(APPEND VNET_HEADERS
540 ##############################################################################
541 # Layer 4 protocol: tcp
542 ##############################################################################
543 list(APPEND VNET_SOURCES
547 tcp/tcp_syn_filter4.c
555 list(APPEND VNET_HEADERS
563 list(APPEND VNET_API_FILES tcp/tcp.api)
565 ##############################################################################
566 # Layer 4 protocol: udp
567 ##############################################################################
568 list(APPEND VNET_SOURCES
579 list(APPEND VNET_HEADERS
585 list(APPEND VNET_API_FILES udp/udp.api)
587 ##############################################################################
588 # Layer 4 protocol: sctp
589 ##############################################################################
590 list(APPEND VNET_SOURCES
599 list(APPEND VNET_HEADERS
606 list(APPEND VNET_API_FILES sctp/sctp.api)
608 ##############################################################################
609 # Tunnel protocol: gre
610 ##############################################################################
611 list(APPEND VNET_SOURCES
619 list(APPEND VNET_HEADERS
625 list(APPEND VNET_API_FILES gre/gre.api)
627 ##############################################################################
628 # Tunnel protocol: ipip
629 ##############################################################################
630 list(APPEND VNET_SOURCES
638 list(APPEND VNET_HEADERS
642 list(APPEND VNET_API_FILES ipip/ipip.api)
644 ##############################################################################
645 # Tunnel protocol: l2tpv3
646 ##############################################################################
647 list(APPEND VNET_SOURCES
655 list(APPEND VNET_HEADERS
660 list(APPEND VNET_API_FILES l2tp/l2tp.api)
662 ##############################################################################
663 # Tunnel protocol: gre+mpls
664 ##############################################################################
665 list(APPEND VNET_SOURCES
677 list(APPEND VNET_HEADERS
685 list(APPEND VNET_API_FILES mpls/mpls.api)
687 ##############################################################################
688 # Tunnel protocol: vxlan-gbp
689 ##############################################################################
690 list(APPEND VNET_SOURCES
693 vxlan-gbp/vxlan_gbp_api.c
694 vxlan-gbp/vxlan_gbp.c
695 vxlan-gbp/vxlan_gbp_packet.c
698 list(APPEND VNET_HEADERS
699 vxlan-gbp/vxlan_gbp.h
700 vxlan-gbp/vxlan_gbp_packet.h
701 vxlan-gbp/vxlan_gbp_error.def
704 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
706 ##############################################################################
707 # Tunnel protocol: vxlan-gpe
708 ##############################################################################
710 list(APPEND VNET_SOURCES
711 vxlan-gpe/vxlan_gpe.c
714 vxlan-gpe/vxlan_gpe_api.c
717 list(APPEND VNET_HEADERS
718 vxlan-gpe/vxlan_gpe.h
719 vxlan-gpe/vxlan_gpe_packet.h
720 vxlan-gpe/vxlan_gpe_error.def
723 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
725 ##############################################################################
726 # Tunnel protocol: ipsec+gre
727 ##############################################################################
728 list(APPEND VNET_SOURCES
729 ipsec-gre/ipsec_gre.c
731 ipsec-gre/interface.c
732 ipsec-gre/ipsec_gre_api.c
735 list(APPEND VNET_HEADERS
736 ipsec-gre/ipsec_gre.h
740 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
742 ##############################################################################
743 # LISP control plane: lisp-cp
744 ##############################################################################
746 list(APPEND VNET_SOURCES
748 lisp-cp/lisp_cp_dpo.c
750 lisp-cp/gid_dictionary.c
751 lisp-cp/lisp_msg_serdes.c
759 list(APPEND VNET_HEADERS
762 lisp-cp/gid_dictionary.h
763 lisp-cp/lisp_cp_messages.h
764 lisp-cp/lisp_msg_serdes.h
768 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
769 list(APPEND VNET_API_FILES lisp-cp/one.api)
771 ##############################################################################
772 # Tunnel protocol: lisp-gpe
773 ##############################################################################
775 list(APPEND VNET_SOURCES
777 lisp-gpe/lisp_gpe_sub_interface.c
778 lisp-gpe/lisp_gpe_adjacency.c
779 lisp-gpe/lisp_gpe_tunnel.c
780 lisp-gpe/lisp_gpe_fwd_entry.c
781 lisp-gpe/lisp_gpe_tenant.c
784 lisp-gpe/lisp_gpe_api.c
787 list(APPEND VNET_HEADERS
789 lisp-gpe/lisp_gpe_fwd_entry.h
790 lisp-gpe/lisp_gpe_tenant.h
791 lisp-gpe/lisp_gpe_packet.h
792 lisp-gpe/lisp_gpe_error.def
795 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
797 ##############################################################################
799 ##############################################################################
800 list(APPEND VNET_SOURCES
802 dhcp/dhcp_client_detect.c
803 dhcp/dhcp6_client_common_dp.c
804 dhcp/dhcp6_pd_client_dp.c
805 dhcp/dhcp6_pd_client_cp.c
806 dhcp/dhcp6_ia_na_client_dp.c
807 dhcp/dhcp6_ia_na_client_cp.c
811 list(APPEND VNET_HEADERS
813 dhcp/dhcp6_client_common_dp.h
814 dhcp/dhcp6_pd_client_dp.h
815 dhcp/dhcp6_ia_na_client_dp.h
818 list(APPEND VNET_API_FILES
820 dhcp/dhcp6_pd_client_cp.api
821 dhcp/dhcp6_ia_na_client_cp.api
824 ##############################################################################
826 ##############################################################################
827 list(APPEND VNET_SOURCES
828 dhcp/dhcp6_proxy_node.c
829 dhcp/dhcp4_proxy_node.c
833 list(APPEND VNET_HEADERS
837 dhcp/dhcp6_proxy_error.def
838 dhcp/dhcp4_proxy_error.def
841 ##############################################################################
842 # ipv6 segment routing
843 ##############################################################################
845 list(APPEND VNET_SOURCES
848 srv6/sr_policy_rewrite.c
853 list(APPEND VNET_HEADERS
858 list(APPEND VNET_API_FILES srv6/sr.api)
860 ##############################################################################
861 # mpls segment routing
862 ##############################################################################
864 list(APPEND VNET_SOURCES
865 srmpls/sr_mpls_policy.c
866 srmpls/sr_mpls_steering.c
870 list(APPEND VNET_HEADERS
874 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
876 ##############################################################################
877 # IPFIX / netflow v10
878 ##############################################################################
879 list(APPEND VNET_SOURCES
880 ipfix-export/flow_report.c
881 ipfix-export/flow_api.c
884 list(APPEND VNET_HEADERS
885 ipfix-export/flow_report.h
886 ipfix-export/ipfix_info_elements.h
887 ipfix-export/ipfix_packet.h
890 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
892 ##############################################################################
893 # IPFIX classify code
894 ##############################################################################
896 list(APPEND VNET_SOURCES
897 ipfix-export/flow_report_classify.c
900 list(APPEND VNET_HEADERS
901 ipfix-export/flow_report_classify.h
904 ##############################################################################
906 ##############################################################################
908 list(APPEND VNET_SOURCES
909 lawful-intercept/lawful_intercept.c
910 lawful-intercept/node.c
913 list(APPEND VNET_HEADERS
914 lawful-intercept/lawful_intercept.h
917 ##############################################################################
918 # SPAN (port mirroring)
919 ##############################################################################
921 list(APPEND VNET_SOURCES
927 list(APPEND VNET_HEADERS
931 list(APPEND VNET_API_FILES span/span.api)
933 ##############################################################################
935 ##############################################################################
936 list(APPEND VNET_SOURCES
942 dns/resolver_process.c
945 list(APPEND VNET_HEADERS
949 list(APPEND VNET_API_FILES dns/dns.api)
951 ##############################################################################
953 ##############################################################################
955 list(APPEND VNET_SOURCES
965 list(APPEND VNET_HEADERS
970 list(APPEND VNET_API_FILES pg/pg.api)
972 ##############################################################################
974 ##############################################################################
976 list(APPEND VNET_SOURCES
977 devices/virtio/device.c
978 devices/virtio/node.c
979 devices/virtio/vhost_user.c
980 devices/virtio/vhost_user_input.c
981 devices/virtio/vhost_user_output.c
982 devices/virtio/vhost_user_api.c
983 devices/virtio/virtio.c
984 devices/virtio/virtio_api.c
989 list(APPEND VNET_HEADERS
991 devices/virtio/virtio.h
992 devices/virtio/vhost_user.h
995 list(APPEND VNET_MULTIARCH_SOURCES
996 devices/virtio/vhost_user_input.c
997 devices/virtio/vhost_user_output.c
1000 list(APPEND VNET_API_FILES
1001 devices/virtio/vhost_user.api
1002 devices/virtio/virtio.api
1005 ##############################################################################
1006 # tap interface (with virtio backend)
1007 ##############################################################################
1009 list(APPEND VNET_SOURCES
1012 devices/tap/tapv2_api.c
1015 list(APPEND VNET_HEADERS
1019 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1021 ##############################################################################
1022 # tap interface (with virtio backend)
1023 ##############################################################################
1025 list(APPEND VNET_SOURCES
1026 devices/pipe/pipe_api.c
1030 list(APPEND VNET_HEADERS
1034 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1036 ##############################################################################
1037 # session managmeent
1038 ##############################################################################
1040 list(APPEND VNET_SOURCES
1042 session/session_table.c
1043 session/session_rules_table.c
1044 session/session_lookup.c
1045 session/session_node.c
1047 session/application.c
1048 session/application_worker.c
1049 session/session_cli.c
1050 session/application_interface.c
1051 session/application_namespace.c
1052 session/segment_manager.c
1053 session/session_api.c
1056 list(APPEND VNET_HEADERS
1058 session/session_table.h
1059 session/session_rules_table.h
1060 session/session_types.h
1061 session/session_lookup.h
1062 session/application.h
1064 session/transport_types.h
1065 session/application_interface.h
1066 session/application_namespace.h
1067 session/session_debug.h
1068 session/segment_manager.h
1069 session/mma_template.h
1070 session/mma_template.c
1075 list(APPEND VNET_API_FILES session/session.api)
1077 ##############################################################################
1078 # session layer applications
1079 ##############################################################################
1081 list(APPEND VNET_SOURCES
1082 session-apps/echo_client.c
1083 session-apps/echo_server.c
1084 session-apps/http_server.c
1085 session-apps/proxy.c
1088 list(APPEND VNET_HEADERS
1089 session-apps/echo_client.h
1090 session-apps/proxy.h
1093 ##############################################################################
1095 ##############################################################################
1097 list(APPEND VNET_SOURCES
1101 list(APPEND VNET_HEADERS
1106 ##############################################################################
1107 # Linux packet interface
1108 ##############################################################################
1110 list(APPEND VNET_SOURCES
1111 devices/af_packet/af_packet.c
1112 devices/af_packet/device.c
1113 devices/af_packet/node.c
1114 devices/af_packet/cli.c
1115 devices/af_packet/af_packet_api.c
1118 list(APPEND VNET_HEADERS
1119 devices/af_packet/af_packet.h
1122 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1124 ##############################################################################
1126 ##############################################################################
1128 list(APPEND VNET_SOURCES
1129 devices/netmap/netmap.c
1130 devices/netmap/device.c
1131 devices/netmap/node.c
1132 devices/netmap/cli.c
1133 devices/netmap/netmap_api.c
1136 list(APPEND VNET_HEADERS
1137 devices/netmap/netmap.h
1140 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1142 ##############################################################################
1143 # Driver feature graph arc support
1144 ##############################################################################
1146 list(APPEND VNET_SOURCES
1148 feature/feature_api.c
1149 feature/registration.c
1152 list(APPEND VNET_HEADERS
1156 list(APPEND VNET_API_FILES feature/feature.api)
1158 ##############################################################################
1159 # Unix kernel related
1160 ##############################################################################
1162 # FIXME: unix/hgshm.c
1164 list(APPEND VNET_SOURCES
1169 list(APPEND VNET_HEADERS
1173 ##############################################################################
1175 ##############################################################################
1177 list(APPEND VNET_SOURCES
1189 fib/fib_entry_src_rr.c
1190 fib/fib_entry_src_interface.c
1191 fib/fib_entry_src_interpose.c
1192 fib/fib_entry_src_default_route.c
1193 fib/fib_entry_src_special.c
1194 fib/fib_entry_src_api.c
1195 fib/fib_entry_src_adj.c
1196 fib/fib_entry_src_mpls.c
1197 fib/fib_entry_src_lisp.c
1198 fib/fib_entry_cover.c
1199 fib/fib_entry_delegate.c
1204 fib/fib_attached_export.c
1209 list(APPEND VNET_HEADERS
1219 fib/fib_entry_delegate.h
1222 ##############################################################################
1224 ##############################################################################
1226 list(APPEND VNET_SOURCES
1239 list(APPEND VNET_HEADERS
1248 ##############################################################################
1249 # Data-Plane Objects
1250 ##############################################################################
1252 list(APPEND VNET_SOURCES
1260 dpo/load_balance_map.c
1264 dpo/interface_rx_dpo.c
1265 dpo/interface_tx_dpo.c
1266 dpo/mpls_disposition.c
1267 dpo/mpls_label_dpo.c
1272 list(APPEND VNET_HEADERS
1284 ##############################################################################
1286 ##############################################################################
1288 list(APPEND VNET_SOURCES
1297 mfib/mfib_entry_cover.c
1298 mfib/mfib_entry_delegate.c
1299 mfib/mfib_entry_src.c
1300 mfib/mfib_entry_src_rr.c
1304 list(APPEND VNET_HEADERS
1310 ##############################################################################
1312 ##############################################################################
1314 list(APPEND VNET_SOURCES
1321 list(APPEND VNET_HEADERS
1325 ##############################################################################
1327 ##############################################################################
1329 list(APPEND VNET_SOURCES
1332 qos/qos_egress_map.c
1337 list(APPEND VNET_API_FILES qos/qos.api)
1339 ##############################################################################
1341 ##############################################################################
1343 list(APPEND VNET_SOURCES
1344 bier/bier_bit_string.c
1347 bier/bier_fmask_db.c
1356 bier/bier_imp_node.c
1358 bier/bier_disp_entry.c
1359 bier/bier_disp_lookup_node.c
1360 bier/bier_disp_dispatch_node.c
1361 bier/bier_disp_table.c
1362 bier/bier_bift_table.c
1365 list(APPEND VNET_HEADERS
1372 list(APPEND VNET_API_FILES bier/bier.api)
1374 ##############################################################################
1376 ##############################################################################
1378 list (APPEND VNET_SOURCES
1384 list(APPEND VNET_HEADERS
1389 list(APPEND VNET_API_FILES syslog/syslog.api)
1391 ##############################################################################
1393 ##############################################################################
1395 add_vpp_library(vnet
1396 SOURCES ${VNET_SOURCES}
1397 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1398 INSTALL_HEADERS ${VNET_HEADERS}
1399 API_FILES ${VNET_API_FILES}
1400 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1404 ##############################################################################
1406 ##############################################################################
1408 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1409 if(VPP_BUILD_SESSION_ECHO_APPS)
1410 add_vpp_executable(tcp_echo
1411 SOURCES ../tests/vnet/session/tcp_echo.c
1412 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1416 add_vpp_executable(udp_echo
1417 SOURCES ../tests/vnet/session/udp_echo.c
1418 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1422 endif(VPP_BUILD_SESSION_ECHO_APPS)
1424 ##############################################################################