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
155 l2/l2_in_out_feat_arc.c
163 list(APPEND VNET_MULTIARCH_SOURCES
170 list(APPEND VNET_HEADERS
187 list(APPEND VNET_API_FILES l2/l2.api)
189 ##############################################################################
190 # Layer 2 protocol: SRP
191 ##############################################################################
192 list(APPEND VNET_SOURCES
199 list(APPEND VNET_HEADERS
204 ##############################################################################
205 # Layer 2 protocol: PPP
206 ##############################################################################
207 list(APPEND VNET_SOURCES
213 list(APPEND VNET_HEADERS
219 ##############################################################################
220 # Layer 2 protocol: HDLC
221 ##############################################################################
222 list(APPEND VNET_SOURCES
228 list(APPEND VNET_HEADERS
234 ##############################################################################
235 # Layer 2 protocol: LLC
236 ##############################################################################
237 list(APPEND VNET_SOURCES
243 list(APPEND VNET_HEADERS
247 ##############################################################################
248 # Layer 2 protocol: SNAP
249 ##############################################################################
250 list(APPEND VNET_SOURCES
256 list(APPEND VNET_HEADERS
260 ##############################################################################
262 ##############################################################################
263 list(APPEND VNET_SOURCES
270 list(APPEND VNET_HEADERS
273 vxlan/vxlan_error.def
276 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
278 list(APPEND VNET_API_FILES vxlan/vxlan.api)
280 ##############################################################################
282 ##############################################################################
283 list(APPEND VNET_SOURCES
290 list(APPEND VNET_HEADERS
292 geneve/geneve_packet.h
293 geneve/geneve_error.def
296 list(APPEND VNET_API_FILES geneve/geneve.api)
298 ##############################################################################
300 ##############################################################################
301 list(APPEND VNET_SOURCES
308 list(APPEND VNET_HEADERS
312 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
313 list(APPEND VNET_API_FILES bonding/bond.api)
315 ##############################################################################
317 ##############################################################################
318 list(APPEND VNET_SOURCES
326 list(APPEND VNET_HEADERS
331 list(APPEND VNET_API_FILES lldp/lldp.api)
333 ##############################################################################
334 # Layer 2/3 "classify"
335 ##############################################################################
336 list(APPEND VNET_SOURCES
337 classify/vnet_classify.c
338 classify/ip_classify.c
339 classify/in_out_acl.c
340 classify/policer_classify.c
341 classify/flow_classify.c
342 classify/flow_classify_node.c
343 classify/vnet_classify.h
344 classify/classify_api.c
347 list(APPEND VNET_HEADERS
348 classify/vnet_classify.h
349 classify/in_out_acl.h
350 classify/policer_classify.h
351 classify/flow_classify.h
354 list(APPEND VNET_API_FILES classify/classify.api)
356 ##############################################################################
357 # Layer 3 protocols go here
358 ##############################################################################
360 ##############################################################################
361 # Layer 3 protocol: IP v4/v6
362 ##############################################################################
363 list(APPEND VNET_SOURCES
376 ip/ip4_source_and_port_range_check.c
377 ip/ip4_source_check.c
403 list(APPEND VNET_HEADERS
416 ip/ip6_hop_by_hop_packet.h
421 ip/ip_source_and_port_range_check.h
430 list(APPEND VNET_API_FILES
436 list(APPEND VNET_MULTIARCH_SOURCES ip/ip4_forward.c ip/ip4_input.c)
438 ##############################################################################
440 ##############################################################################
441 list(APPEND VNET_SOURCES
445 list(APPEND VNET_HEADERS
446 ethernet/arp_packet.h
450 ##############################################################################
451 # Bidirectional Forwarding Detection
452 ##############################################################################
454 list(APPEND VNET_HEADERS
461 list(APPEND VNET_SOURCES
470 list(APPEND VNET_API_FILES bfd/bfd.api)
472 ##############################################################################
473 # Layer 3 protocol: IPSec
474 ##############################################################################
475 list(APPEND VNET_SOURCES
490 ipsec/ikev2_payload.c
495 list(APPEND VNET_MULTIARCH_SOURCES
502 list(APPEND VNET_API_FILES ipsec/ipsec.api)
504 list(APPEND VNET_SOURCES
508 list(APPEND VNET_HEADERS
516 ##############################################################################
517 # Layer 3 protocol: osi
518 ##############################################################################
519 list(APPEND VNET_SOURCES
525 list(APPEND VNET_HEADERS
529 ##############################################################################
530 # Layer 4 protocol: tcp
531 ##############################################################################
532 list(APPEND VNET_SOURCES
536 tcp/tcp_syn_filter4.c
544 list(APPEND VNET_HEADERS
552 list(APPEND VNET_API_FILES tcp/tcp.api)
554 ##############################################################################
555 # Layer 4 protocol: udp
556 ##############################################################################
557 list(APPEND VNET_SOURCES
568 list(APPEND VNET_HEADERS
574 list(APPEND VNET_API_FILES udp/udp.api)
576 ##############################################################################
577 # Layer 4 protocol: sctp
578 ##############################################################################
579 list(APPEND VNET_SOURCES
588 list(APPEND VNET_HEADERS
595 list(APPEND VNET_API_FILES sctp/sctp.api)
597 ##############################################################################
598 # Tunnel protocol: gre
599 ##############################################################################
600 list(APPEND VNET_SOURCES
608 list(APPEND VNET_HEADERS
614 list(APPEND VNET_API_FILES gre/gre.api)
616 ##############################################################################
617 # Tunnel protocol: ipip
618 ##############################################################################
619 list(APPEND VNET_SOURCES
627 list(APPEND VNET_HEADERS
631 list(APPEND VNET_API_FILES ipip/ipip.api)
633 ##############################################################################
634 # Tunnel protocol: l2tpv3
635 ##############################################################################
636 list(APPEND VNET_SOURCES
644 list(APPEND VNET_HEADERS
649 list(APPEND VNET_API_FILES l2tp/l2tp.api)
651 ##############################################################################
652 # Tunnel protocol: gre+mpls
653 ##############################################################################
654 list(APPEND VNET_SOURCES
666 list(APPEND VNET_HEADERS
674 list(APPEND VNET_API_FILES mpls/mpls.api)
676 ##############################################################################
677 # Tunnel protocol: vxlan-gbp
678 ##############################################################################
679 list(APPEND VNET_SOURCES
682 vxlan-gbp/vxlan_gbp_api.c
683 vxlan-gbp/vxlan_gbp.c
684 vxlan-gbp/vxlan_gbp_packet.c
687 list(APPEND VNET_HEADERS
688 vxlan-gbp/vxlan_gbp.h
689 vxlan-gbp/vxlan_gbp_packet.h
690 vxlan-gbp/vxlan_gbp_error.def
693 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
695 ##############################################################################
696 # Tunnel protocol: vxlan-gpe
697 ##############################################################################
699 list(APPEND VNET_SOURCES
700 vxlan-gpe/vxlan_gpe.c
703 vxlan-gpe/vxlan_gpe_api.c
706 list(APPEND VNET_HEADERS
707 vxlan-gpe/vxlan_gpe.h
708 vxlan-gpe/vxlan_gpe_packet.h
709 vxlan-gpe/vxlan_gpe_error.def
712 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
714 ##############################################################################
715 # Tunnel protocol: ipsec+gre
716 ##############################################################################
717 list(APPEND VNET_SOURCES
718 ipsec-gre/ipsec_gre.c
720 ipsec-gre/interface.c
721 ipsec-gre/ipsec_gre_api.c
724 list(APPEND VNET_HEADERS
725 ipsec-gre/ipsec_gre.h
729 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
731 ##############################################################################
732 # LISP control plane: lisp-cp
733 ##############################################################################
735 list(APPEND VNET_SOURCES
737 lisp-cp/lisp_cp_dpo.c
739 lisp-cp/gid_dictionary.c
740 lisp-cp/lisp_msg_serdes.c
748 list(APPEND VNET_HEADERS
751 lisp-cp/gid_dictionary.h
752 lisp-cp/lisp_cp_messages.h
753 lisp-cp/lisp_msg_serdes.h
757 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
758 list(APPEND VNET_API_FILES lisp-cp/one.api)
760 ##############################################################################
761 # Tunnel protocol: lisp-gpe
762 ##############################################################################
764 list(APPEND VNET_SOURCES
766 lisp-gpe/lisp_gpe_sub_interface.c
767 lisp-gpe/lisp_gpe_adjacency.c
768 lisp-gpe/lisp_gpe_tunnel.c
769 lisp-gpe/lisp_gpe_fwd_entry.c
770 lisp-gpe/lisp_gpe_tenant.c
773 lisp-gpe/lisp_gpe_api.c
776 list(APPEND VNET_HEADERS
778 lisp-gpe/lisp_gpe_fwd_entry.h
779 lisp-gpe/lisp_gpe_tenant.h
780 lisp-gpe/lisp_gpe_packet.h
781 lisp-gpe/lisp_gpe_error.def
784 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
786 ##############################################################################
788 ##############################################################################
789 list(APPEND VNET_SOURCES
791 dhcp/dhcp_client_detect.c
792 dhcp/dhcp6_client_common_dp.c
793 dhcp/dhcp6_pd_client_dp.c
794 dhcp/dhcp6_pd_client_cp.c
795 dhcp/dhcp6_ia_na_client_dp.c
796 dhcp/dhcp6_ia_na_client_cp.c
800 list(APPEND VNET_HEADERS
802 dhcp/dhcp6_client_common_dp.h
803 dhcp/dhcp6_pd_client_dp.h
804 dhcp/dhcp6_ia_na_client_dp.h
807 list(APPEND VNET_API_FILES
809 dhcp/dhcp6_pd_client_cp.api
810 dhcp/dhcp6_ia_na_client_cp.api
813 ##############################################################################
815 ##############################################################################
816 list(APPEND VNET_SOURCES
817 dhcp/dhcp6_proxy_node.c
818 dhcp/dhcp4_proxy_node.c
822 list(APPEND VNET_HEADERS
826 dhcp/dhcp6_proxy_error.def
827 dhcp/dhcp4_proxy_error.def
830 ##############################################################################
831 # ipv6 segment routing
832 ##############################################################################
834 list(APPEND VNET_SOURCES
837 srv6/sr_policy_rewrite.c
842 list(APPEND VNET_HEADERS
847 list(APPEND VNET_API_FILES srv6/sr.api)
849 ##############################################################################
850 # mpls segment routing
851 ##############################################################################
853 list(APPEND VNET_SOURCES
854 srmpls/sr_mpls_policy.c
855 srmpls/sr_mpls_steering.c
859 list(APPEND VNET_HEADERS
863 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
865 ##############################################################################
866 # IPFIX / netflow v10
867 ##############################################################################
868 list(APPEND VNET_SOURCES
869 ipfix-export/flow_report.c
870 ipfix-export/flow_api.c
873 list(APPEND VNET_HEADERS
874 ipfix-export/flow_report.h
875 ipfix-export/ipfix_info_elements.h
876 ipfix-export/ipfix_packet.h
879 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
881 ##############################################################################
882 # IPFIX classify code
883 ##############################################################################
885 list(APPEND VNET_SOURCES
886 ipfix-export/flow_report_classify.c
889 list(APPEND VNET_HEADERS
890 ipfix-export/flow_report_classify.h
893 ##############################################################################
895 ##############################################################################
897 list(APPEND VNET_SOURCES
898 lawful-intercept/lawful_intercept.c
899 lawful-intercept/node.c
902 list(APPEND VNET_HEADERS
903 lawful-intercept/lawful_intercept.h
906 ##############################################################################
907 # SPAN (port mirroring)
908 ##############################################################################
910 list(APPEND VNET_SOURCES
916 list(APPEND VNET_HEADERS
920 list(APPEND VNET_API_FILES span/span.api)
922 ##############################################################################
924 ##############################################################################
925 list(APPEND VNET_SOURCES
931 dns/resolver_process.c
934 list(APPEND VNET_HEADERS
938 list(APPEND VNET_API_FILES dns/dns.api)
940 ##############################################################################
942 ##############################################################################
944 list(APPEND VNET_SOURCES
954 list(APPEND VNET_HEADERS
959 list(APPEND VNET_API_FILES pg/pg.api)
961 ##############################################################################
963 ##############################################################################
965 list(APPEND VNET_SOURCES
966 devices/virtio/device.c
967 devices/virtio/node.c
968 devices/virtio/vhost_user.c
969 devices/virtio/vhost_user_input.c
970 devices/virtio/vhost_user_output.c
971 devices/virtio/vhost_user_api.c
972 devices/virtio/virtio.c
975 list(APPEND VNET_HEADERS
976 devices/virtio/virtio.h
977 devices/virtio/vhost_user.h
980 list(APPEND VNET_MULTIARCH_SOURCES
981 devices/virtio/vhost_user_input.c
982 devices/virtio/vhost_user_output.c
985 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
987 ##############################################################################
988 # tap interface (with virtio backend)
989 ##############################################################################
991 list(APPEND VNET_SOURCES
994 devices/tap/tapv2_api.c
997 list(APPEND VNET_HEADERS
1001 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1003 ##############################################################################
1004 # tap interface (with virtio backend)
1005 ##############################################################################
1007 list(APPEND VNET_SOURCES
1008 devices/pipe/pipe_api.c
1012 list(APPEND VNET_HEADERS
1016 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1018 ##############################################################################
1019 # session managmeent
1020 ##############################################################################
1022 list(APPEND VNET_SOURCES
1024 session/session_table.c
1025 session/session_rules_table.c
1026 session/session_lookup.c
1027 session/session_node.c
1029 session/application.c
1030 session/session_cli.c
1031 session/application_interface.c
1032 session/application_namespace.c
1033 session/segment_manager.c
1034 session/session_api.c
1037 list(APPEND VNET_HEADERS
1039 session/session_table.h
1040 session/session_rules_table.h
1041 session/stream_session.h
1042 session/session_lookup.h
1043 session/application.h
1045 session/transport_interface.h
1046 session/application_interface.h
1047 session/application_namespace.h
1048 session/session_debug.h
1049 session/segment_manager.h
1050 session/mma_template.h
1051 session/mma_template.c
1056 list(APPEND VNET_API_FILES session/session.api)
1058 ##############################################################################
1059 # session layer applications
1060 ##############################################################################
1062 list(APPEND VNET_SOURCES
1063 session-apps/echo_client.c
1064 session-apps/echo_server.c
1065 session-apps/http_server.c
1066 session-apps/proxy.c
1069 list(APPEND VNET_HEADERS
1070 session-apps/echo_client.h
1071 session-apps/proxy.h
1074 ##############################################################################
1076 ##############################################################################
1078 list(APPEND VNET_SOURCES
1082 list(APPEND VNET_HEADERS
1086 ##############################################################################
1087 # Linux packet interface
1088 ##############################################################################
1090 list(APPEND VNET_SOURCES
1091 devices/af_packet/af_packet.c
1092 devices/af_packet/device.c
1093 devices/af_packet/node.c
1094 devices/af_packet/cli.c
1095 devices/af_packet/af_packet_api.c
1098 list(APPEND VNET_HEADERS
1099 devices/af_packet/af_packet.h
1102 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1104 ##############################################################################
1106 ##############################################################################
1108 list(APPEND VNET_SOURCES
1109 devices/netmap/netmap.c
1110 devices/netmap/device.c
1111 devices/netmap/node.c
1112 devices/netmap/cli.c
1113 devices/netmap/netmap_api.c
1116 list(APPEND VNET_HEADERS
1117 devices/netmap/netmap.h
1120 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1122 ##############################################################################
1123 # Driver feature graph arc support
1124 ##############################################################################
1126 list(APPEND VNET_SOURCES
1128 feature/feature_api.c
1129 feature/registration.c
1132 list(APPEND VNET_HEADERS
1136 list(APPEND VNET_API_FILES feature/feature.api)
1138 ##############################################################################
1139 # Unix kernel related
1140 ##############################################################################
1142 # FIXME: unix/hgshm.c
1144 list(APPEND VNET_SOURCES
1151 list(APPEND VNET_HEADERS
1156 list(APPEND VNET_API_FILES unix/tap.api)
1158 ##############################################################################
1160 ##############################################################################
1162 list(APPEND VNET_SOURCES
1175 fib/fib_entry_src_rr.c
1176 fib/fib_entry_src_interface.c
1177 fib/fib_entry_src_interpose.c
1178 fib/fib_entry_src_default_route.c
1179 fib/fib_entry_src_special.c
1180 fib/fib_entry_src_api.c
1181 fib/fib_entry_src_adj.c
1182 fib/fib_entry_src_mpls.c
1183 fib/fib_entry_src_lisp.c
1184 fib/fib_entry_cover.c
1185 fib/fib_entry_delegate.c
1190 fib/fib_attached_export.c
1195 list(APPEND VNET_HEADERS
1205 fib/fib_entry_delegate.h
1208 ##############################################################################
1210 ##############################################################################
1212 list(APPEND VNET_SOURCES
1225 list(APPEND VNET_HEADERS
1234 ##############################################################################
1235 # Data-Plane Objects
1236 ##############################################################################
1238 list(APPEND VNET_SOURCES
1246 dpo/load_balance_map.c
1250 dpo/interface_rx_dpo.c
1251 dpo/interface_tx_dpo.c
1252 dpo/mpls_disposition.c
1253 dpo/mpls_label_dpo.c
1258 list(APPEND VNET_HEADERS
1270 ##############################################################################
1272 ##############################################################################
1274 list(APPEND VNET_SOURCES
1286 list(APPEND VNET_HEADERS
1292 ##############################################################################
1294 ##############################################################################
1296 list(APPEND VNET_SOURCES
1303 list(APPEND VNET_HEADERS
1307 ##############################################################################
1309 ##############################################################################
1311 list(APPEND VNET_SOURCES
1314 qos/qos_egress_map.c
1319 list(APPEND VNET_API_FILES qos/qos.api)
1321 ##############################################################################
1323 ##############################################################################
1325 list(APPEND VNET_SOURCES
1326 bier/bier_bit_string.c
1329 bier/bier_fmask_db.c
1339 bier/bier_imp_node.c
1341 bier/bier_disp_entry.c
1342 bier/bier_disp_lookup_node.c
1343 bier/bier_disp_dispatch_node.c
1344 bier/bier_disp_table.c
1345 bier/bier_bift_table.c
1348 list(APPEND VNET_HEADERS
1355 list(APPEND VNET_API_FILES bier/bier.api)
1357 ##############################################################################
1359 ##############################################################################
1361 list (APPEND VNET_SOURCES
1367 list(APPEND VNET_HEADERS
1372 list(APPEND VNET_API_FILES syslog/syslog.api)
1374 ##############################################################################
1376 ##############################################################################
1378 add_vpp_library(vnet
1379 SOURCES ${VNET_SOURCES}
1380 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1381 INSTALL_HEADERS ${VNET_HEADERS}
1382 API_FILES ${VNET_API_FILES}
1383 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1387 ##############################################################################
1389 ##############################################################################
1391 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1392 if(VPP_BUILD_SESSION_ECHO_APPS)
1393 add_vpp_executable(tcp_echo
1394 SOURCES ../tests/vnet/session/tcp_echo.c
1395 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1399 add_vpp_executable(udp_echo
1400 SOURCES ../tests/vnet/session/udp_echo.c
1401 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1405 endif(VPP_BUILD_SESSION_ECHO_APPS)
1407 ##############################################################################