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_MULTIARCH_SOURCES
296 list(APPEND VNET_HEADERS
298 geneve/geneve_packet.h
299 geneve/geneve_error.def
302 list(APPEND VNET_API_FILES geneve/geneve.api)
304 ##############################################################################
306 ##############################################################################
307 list(APPEND VNET_SOURCES
314 list(APPEND VNET_HEADERS
318 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
319 list(APPEND VNET_API_FILES bonding/bond.api)
321 ##############################################################################
323 ##############################################################################
324 list(APPEND VNET_SOURCES
332 list(APPEND VNET_HEADERS
337 list(APPEND VNET_API_FILES lldp/lldp.api)
339 ##############################################################################
340 # Layer 2/3 "classify"
341 ##############################################################################
342 list(APPEND VNET_SOURCES
343 classify/vnet_classify.c
344 classify/ip_classify.c
345 classify/in_out_acl.c
346 classify/policer_classify.c
347 classify/flow_classify.c
348 classify/flow_classify_node.c
349 classify/vnet_classify.h
350 classify/classify_api.c
353 list(APPEND VNET_HEADERS
354 classify/vnet_classify.h
355 classify/in_out_acl.h
356 classify/policer_classify.h
357 classify/flow_classify.h
360 list(APPEND VNET_API_FILES classify/classify.api)
362 ##############################################################################
363 # Layer 3 protocols go here
364 ##############################################################################
366 ##############################################################################
367 # Layer 3 protocol: IP v4/v6
368 ##############################################################################
369 list(APPEND VNET_SOURCES
382 ip/ip4_source_and_port_range_check.c
383 ip/ip4_source_check.c
409 list(APPEND VNET_HEADERS
422 ip/ip6_hop_by_hop_packet.h
427 ip/ip_source_and_port_range_check.h
436 list(APPEND VNET_API_FILES
442 list(APPEND VNET_MULTIARCH_SOURCES
448 ##############################################################################
450 ##############################################################################
451 list(APPEND VNET_SOURCES
455 list(APPEND VNET_HEADERS
456 ethernet/arp_packet.h
460 ##############################################################################
461 # Bidirectional Forwarding Detection
462 ##############################################################################
464 list(APPEND VNET_HEADERS
471 list(APPEND VNET_SOURCES
480 list(APPEND VNET_API_FILES bfd/bfd.api)
482 ##############################################################################
483 # Layer 3 protocol: IPSec
484 ##############################################################################
485 list(APPEND VNET_SOURCES
494 ipsec/ipsec_spd_policy.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
522 ipsec/ipsec_spd_policy.h
529 ##############################################################################
530 # Layer 3 protocol: osi
531 ##############################################################################
532 list(APPEND VNET_SOURCES
538 list(APPEND VNET_HEADERS
542 ##############################################################################
543 # Layer 4 protocol: tcp
544 ##############################################################################
545 list(APPEND VNET_SOURCES
549 tcp/tcp_syn_filter4.c
557 list(APPEND VNET_HEADERS
565 list(APPEND VNET_API_FILES tcp/tcp.api)
567 ##############################################################################
568 # Layer 4 protocol: udp
569 ##############################################################################
570 list(APPEND VNET_SOURCES
581 list(APPEND VNET_HEADERS
587 list(APPEND VNET_API_FILES udp/udp.api)
589 ##############################################################################
590 # Layer 4 protocol: sctp
591 ##############################################################################
592 list(APPEND VNET_SOURCES
598 sctp/sctp_output_node.c
602 list(APPEND VNET_MULTIARCH_SOURCES
603 sctp/sctp_output_node.c
607 list(APPEND VNET_HEADERS
614 list(APPEND VNET_API_FILES sctp/sctp.api)
616 ##############################################################################
617 # Tunnel protocol: gre
618 ##############################################################################
619 list(APPEND VNET_SOURCES
627 list(APPEND VNET_MULTIARCH_SOURCES
632 list(APPEND VNET_HEADERS
638 list(APPEND VNET_API_FILES gre/gre.api)
640 ##############################################################################
641 # Tunnel protocol: ipip
642 ##############################################################################
643 list(APPEND VNET_SOURCES
651 list(APPEND VNET_MULTIARCH_SOURCES
655 list(APPEND VNET_HEADERS
659 list(APPEND VNET_API_FILES ipip/ipip.api)
661 ##############################################################################
662 # Tunnel protocol: l2tpv3
663 ##############################################################################
664 list(APPEND VNET_SOURCES
672 list(APPEND VNET_HEADERS
677 list(APPEND VNET_API_FILES l2tp/l2tp.api)
679 ##############################################################################
680 # Tunnel protocol: gre+mpls
681 ##############################################################################
682 list(APPEND VNET_SOURCES
694 list(APPEND VNET_MULTIARCH_SOURCES
701 list(APPEND VNET_HEADERS
709 list(APPEND VNET_API_FILES mpls/mpls.api)
711 ##############################################################################
712 # Tunnel protocol: vxlan-gbp
713 ##############################################################################
714 list(APPEND VNET_SOURCES
717 vxlan-gbp/vxlan_gbp_api.c
718 vxlan-gbp/vxlan_gbp.c
719 vxlan-gbp/vxlan_gbp_packet.c
722 list(APPEND VNET_HEADERS
723 vxlan-gbp/vxlan_gbp.h
724 vxlan-gbp/vxlan_gbp_packet.h
725 vxlan-gbp/vxlan_gbp_error.def
728 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
730 ##############################################################################
731 # Tunnel protocol: vxlan-gpe
732 ##############################################################################
734 list(APPEND VNET_SOURCES
735 vxlan-gpe/vxlan_gpe.c
738 vxlan-gpe/vxlan_gpe_api.c
741 list(APPEND VNET_HEADERS
742 vxlan-gpe/vxlan_gpe.h
743 vxlan-gpe/vxlan_gpe_packet.h
744 vxlan-gpe/vxlan_gpe_error.def
747 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
749 ##############################################################################
750 # Tunnel protocol: ipsec+gre
751 ##############################################################################
752 list(APPEND VNET_SOURCES
753 ipsec-gre/ipsec_gre.c
755 ipsec-gre/interface.c
756 ipsec-gre/ipsec_gre_api.c
759 list(APPEND VNET_HEADERS
760 ipsec-gre/ipsec_gre.h
764 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
766 ##############################################################################
767 # LISP control plane: lisp-cp
768 ##############################################################################
770 list(APPEND VNET_SOURCES
772 lisp-cp/lisp_cp_dpo.c
774 lisp-cp/gid_dictionary.c
775 lisp-cp/lisp_msg_serdes.c
783 list(APPEND VNET_HEADERS
786 lisp-cp/gid_dictionary.h
787 lisp-cp/lisp_cp_messages.h
788 lisp-cp/lisp_msg_serdes.h
792 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
793 list(APPEND VNET_API_FILES lisp-cp/one.api)
795 ##############################################################################
796 # Tunnel protocol: lisp-gpe
797 ##############################################################################
799 list(APPEND VNET_SOURCES
801 lisp-gpe/lisp_gpe_sub_interface.c
802 lisp-gpe/lisp_gpe_adjacency.c
803 lisp-gpe/lisp_gpe_tunnel.c
804 lisp-gpe/lisp_gpe_fwd_entry.c
805 lisp-gpe/lisp_gpe_tenant.c
808 lisp-gpe/lisp_gpe_api.c
811 list(APPEND VNET_HEADERS
813 lisp-gpe/lisp_gpe_fwd_entry.h
814 lisp-gpe/lisp_gpe_tenant.h
815 lisp-gpe/lisp_gpe_packet.h
816 lisp-gpe/lisp_gpe_error.def
819 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
821 ##############################################################################
823 ##############################################################################
824 list(APPEND VNET_SOURCES
826 dhcp/dhcp_client_detect.c
827 dhcp/dhcp6_client_common_dp.c
828 dhcp/dhcp6_pd_client_dp.c
829 dhcp/dhcp6_pd_client_cp.c
830 dhcp/dhcp6_ia_na_client_dp.c
831 dhcp/dhcp6_ia_na_client_cp.c
835 list(APPEND VNET_HEADERS
837 dhcp/dhcp6_client_common_dp.h
838 dhcp/dhcp6_pd_client_dp.h
839 dhcp/dhcp6_ia_na_client_dp.h
842 list(APPEND VNET_API_FILES
844 dhcp/dhcp6_pd_client_cp.api
845 dhcp/dhcp6_ia_na_client_cp.api
848 ##############################################################################
850 ##############################################################################
851 list(APPEND VNET_SOURCES
852 dhcp/dhcp6_proxy_node.c
853 dhcp/dhcp4_proxy_node.c
857 list(APPEND VNET_HEADERS
861 dhcp/dhcp6_proxy_error.def
862 dhcp/dhcp4_proxy_error.def
865 ##############################################################################
866 # ipv6 segment routing
867 ##############################################################################
869 list(APPEND VNET_SOURCES
872 srv6/sr_policy_rewrite.c
877 list(APPEND VNET_HEADERS
882 list(APPEND VNET_API_FILES srv6/sr.api)
884 ##############################################################################
885 # mpls segment routing
886 ##############################################################################
888 list(APPEND VNET_SOURCES
889 srmpls/sr_mpls_policy.c
890 srmpls/sr_mpls_steering.c
894 list(APPEND VNET_HEADERS
898 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
900 ##############################################################################
901 # IPFIX / netflow v10
902 ##############################################################################
903 list(APPEND VNET_SOURCES
904 ipfix-export/flow_report.c
905 ipfix-export/flow_api.c
908 list(APPEND VNET_HEADERS
909 ipfix-export/flow_report.h
910 ipfix-export/ipfix_info_elements.h
911 ipfix-export/ipfix_packet.h
914 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
916 ##############################################################################
917 # IPFIX classify code
918 ##############################################################################
920 list(APPEND VNET_SOURCES
921 ipfix-export/flow_report_classify.c
924 list(APPEND VNET_HEADERS
925 ipfix-export/flow_report_classify.h
928 ##############################################################################
930 ##############################################################################
932 list(APPEND VNET_SOURCES
933 lawful-intercept/lawful_intercept.c
934 lawful-intercept/node.c
937 list(APPEND VNET_HEADERS
938 lawful-intercept/lawful_intercept.h
941 ##############################################################################
942 # SPAN (port mirroring)
943 ##############################################################################
945 list(APPEND VNET_SOURCES
951 list(APPEND VNET_MULTIARCH_SOURCES
955 list(APPEND VNET_HEADERS
959 list(APPEND VNET_API_FILES span/span.api)
961 ##############################################################################
963 ##############################################################################
964 list(APPEND VNET_SOURCES
970 dns/resolver_process.c
973 list(APPEND VNET_HEADERS
977 list(APPEND VNET_API_FILES dns/dns.api)
979 ##############################################################################
981 ##############################################################################
983 list(APPEND VNET_SOURCES
993 list(APPEND VNET_HEADERS
998 list(APPEND VNET_API_FILES pg/pg.api)
1000 ##############################################################################
1002 ##############################################################################
1004 list(APPEND VNET_SOURCES
1005 devices/virtio/device.c
1006 devices/virtio/node.c
1007 devices/virtio/vhost_user.c
1008 devices/virtio/vhost_user_input.c
1009 devices/virtio/vhost_user_output.c
1010 devices/virtio/vhost_user_api.c
1011 devices/virtio/virtio.c
1012 devices/virtio/virtio_api.c
1013 devices/virtio/cli.c
1014 devices/virtio/pci.c
1017 list(APPEND VNET_HEADERS
1018 devices/virtio/pci.h
1019 devices/virtio/virtio.h
1020 devices/virtio/vhost_user.h
1023 list(APPEND VNET_MULTIARCH_SOURCES
1024 devices/virtio/vhost_user_input.c
1025 devices/virtio/vhost_user_output.c
1026 devices/netmap/node.c
1027 devices/virtio/node.c
1028 devices/af_packet/node.c
1031 list(APPEND VNET_API_FILES
1032 devices/virtio/vhost_user.api
1033 devices/virtio/virtio.api
1036 ##############################################################################
1037 # tap interface (with virtio backend)
1038 ##############################################################################
1040 list(APPEND VNET_SOURCES
1043 devices/tap/tapv2_api.c
1046 list(APPEND VNET_HEADERS
1050 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1052 ##############################################################################
1053 # tap interface (with virtio backend)
1054 ##############################################################################
1056 list(APPEND VNET_SOURCES
1057 devices/pipe/pipe_api.c
1061 list(APPEND VNET_HEADERS
1065 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1067 ##############################################################################
1068 # session managmeent
1069 ##############################################################################
1071 list(APPEND VNET_SOURCES
1073 session/session_table.c
1074 session/session_rules_table.c
1075 session/session_lookup.c
1076 session/session_node.c
1078 session/application.c
1079 session/application_worker.c
1080 session/session_cli.c
1081 session/application_interface.c
1082 session/application_local.c
1083 session/application_namespace.c
1084 session/segment_manager.c
1085 session/session_api.c
1088 list(APPEND VNET_HEADERS
1090 session/session_table.h
1091 session/session_rules_table.h
1092 session/session_types.h
1093 session/session_lookup.h
1094 session/application.h
1096 session/transport_types.h
1097 session/application_interface.h
1098 session/application_local.h
1099 session/application_namespace.h
1100 session/session_debug.h
1101 session/segment_manager.h
1102 session/mma_template.h
1103 session/mma_template.c
1108 list(APPEND VNET_API_FILES session/session.api)
1110 ##############################################################################
1111 # session layer applications
1112 ##############################################################################
1114 list(APPEND VNET_SOURCES
1115 session-apps/echo_client.c
1116 session-apps/echo_server.c
1117 session-apps/http_server.c
1118 session-apps/proxy.c
1121 list(APPEND VNET_HEADERS
1122 session-apps/echo_client.h
1123 session-apps/proxy.h
1126 ##############################################################################
1128 ##############################################################################
1130 list(APPEND VNET_SOURCES
1134 list(APPEND VNET_HEADERS
1139 ##############################################################################
1140 # Linux packet interface
1141 ##############################################################################
1143 list(APPEND VNET_SOURCES
1144 devices/af_packet/af_packet.c
1145 devices/af_packet/device.c
1146 devices/af_packet/node.c
1147 devices/af_packet/cli.c
1148 devices/af_packet/af_packet_api.c
1151 list(APPEND VNET_HEADERS
1152 devices/af_packet/af_packet.h
1155 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1157 ##############################################################################
1159 ##############################################################################
1161 list(APPEND VNET_SOURCES
1162 devices/netmap/netmap.c
1163 devices/netmap/device.c
1164 devices/netmap/node.c
1165 devices/netmap/cli.c
1166 devices/netmap/netmap_api.c
1169 list(APPEND VNET_HEADERS
1170 devices/netmap/netmap.h
1173 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1175 ##############################################################################
1176 # Driver feature graph arc support
1177 ##############################################################################
1179 list(APPEND VNET_SOURCES
1181 feature/feature_api.c
1182 feature/registration.c
1185 list(APPEND VNET_HEADERS
1189 list(APPEND VNET_API_FILES feature/feature.api)
1191 ##############################################################################
1192 # Unix kernel related
1193 ##############################################################################
1195 # FIXME: unix/hgshm.c
1197 list(APPEND VNET_SOURCES
1202 list(APPEND VNET_HEADERS
1206 ##############################################################################
1208 ##############################################################################
1210 list(APPEND VNET_SOURCES
1222 fib/fib_entry_src_rr.c
1223 fib/fib_entry_src_interface.c
1224 fib/fib_entry_src_interpose.c
1225 fib/fib_entry_src_default_route.c
1226 fib/fib_entry_src_special.c
1227 fib/fib_entry_src_api.c
1228 fib/fib_entry_src_adj.c
1229 fib/fib_entry_src_mpls.c
1230 fib/fib_entry_src_lisp.c
1231 fib/fib_entry_cover.c
1232 fib/fib_entry_delegate.c
1237 fib/fib_attached_export.c
1242 list(APPEND VNET_HEADERS
1252 fib/fib_entry_delegate.h
1255 ##############################################################################
1257 ##############################################################################
1259 list(APPEND VNET_SOURCES
1272 list(APPEND VNET_MULTIARCH_SOURCES
1277 list(APPEND VNET_HEADERS
1286 ##############################################################################
1287 # Data-Plane Objects
1288 ##############################################################################
1290 list(APPEND VNET_SOURCES
1298 dpo/load_balance_map.c
1302 dpo/interface_rx_dpo.c
1303 dpo/interface_tx_dpo.c
1304 dpo/mpls_disposition.c
1305 dpo/mpls_label_dpo.c
1310 list(APPEND VNET_HEADERS
1322 ##############################################################################
1324 ##############################################################################
1326 list(APPEND VNET_SOURCES
1335 mfib/mfib_entry_cover.c
1336 mfib/mfib_entry_delegate.c
1337 mfib/mfib_entry_src.c
1338 mfib/mfib_entry_src_rr.c
1342 list(APPEND VNET_HEADERS
1348 ##############################################################################
1350 ##############################################################################
1352 list(APPEND VNET_SOURCES
1359 list(APPEND VNET_HEADERS
1363 ##############################################################################
1365 ##############################################################################
1367 list(APPEND VNET_SOURCES
1370 qos/qos_egress_map.c
1372 qos/qos_record_node.c
1377 list(APPEND VNET_MULTIARCH_SOURCES
1378 qos/qos_record_node.c
1382 list(APPEND VNET_API_FILES qos/qos.api)
1384 ##############################################################################
1386 ##############################################################################
1388 list(APPEND VNET_SOURCES
1389 bier/bier_bit_string.c
1392 bier/bier_fmask_db.c
1401 bier/bier_imp_node.c
1403 bier/bier_disp_entry.c
1404 bier/bier_disp_lookup_node.c
1405 bier/bier_disp_dispatch_node.c
1406 bier/bier_disp_table.c
1407 bier/bier_bift_table.c
1410 list(APPEND VNET_MULTIARCH_SOURCES
1411 bier/bier_disp_dispatch_node.c
1412 bier/bier_disp_lookup_node.c
1413 bier/bier_imp_node.c
1416 list(APPEND VNET_HEADERS
1423 list(APPEND VNET_API_FILES bier/bier.api)
1425 ##############################################################################
1427 ##############################################################################
1429 list (APPEND VNET_SOURCES
1435 list(APPEND VNET_HEADERS
1440 list(APPEND VNET_API_FILES syslog/syslog.api)
1442 ##############################################################################
1444 ##############################################################################
1446 add_vpp_library(vnet
1447 SOURCES ${VNET_SOURCES}
1448 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1449 INSTALL_HEADERS ${VNET_HEADERS}
1450 API_FILES ${VNET_API_FILES}
1451 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1455 ##############################################################################
1457 ##############################################################################
1459 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1460 if(VPP_BUILD_SESSION_ECHO_APPS)
1461 add_vpp_executable(tcp_echo
1462 SOURCES ../tests/vnet/session/tcp_echo.c
1463 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1467 add_vpp_executable(udp_echo
1468 SOURCES ../tests/vnet/session/udp_echo.c
1469 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1473 endif(VPP_BUILD_SESSION_ECHO_APPS)
1475 ##############################################################################