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 list(APPEND VNET_MULTIARCH_SOURCES
508 list(APPEND VNET_API_FILES ipsec/ipsec.api)
510 list(APPEND VNET_SOURCES
514 list(APPEND VNET_HEADERS
517 ipsec/ipsec_spd_policy.h
524 ##############################################################################
525 # Layer 3 protocol: osi
526 ##############################################################################
527 list(APPEND VNET_SOURCES
533 list(APPEND VNET_HEADERS
537 ##############################################################################
538 # Layer 4 protocol: tcp
539 ##############################################################################
540 list(APPEND VNET_SOURCES
544 tcp/tcp_syn_filter4.c
552 list(APPEND VNET_HEADERS
560 list(APPEND VNET_API_FILES tcp/tcp.api)
562 ##############################################################################
563 # Layer 4 protocol: udp
564 ##############################################################################
565 list(APPEND VNET_SOURCES
576 list(APPEND VNET_HEADERS
582 list(APPEND VNET_API_FILES udp/udp.api)
584 ##############################################################################
585 # Layer 4 protocol: sctp
586 ##############################################################################
587 list(APPEND VNET_SOURCES
596 list(APPEND VNET_HEADERS
603 list(APPEND VNET_API_FILES sctp/sctp.api)
605 ##############################################################################
606 # Tunnel protocol: gre
607 ##############################################################################
608 list(APPEND VNET_SOURCES
616 list(APPEND VNET_MULTIARCH_SOURCES
621 list(APPEND VNET_HEADERS
627 list(APPEND VNET_API_FILES gre/gre.api)
629 ##############################################################################
630 # Tunnel protocol: ipip
631 ##############################################################################
632 list(APPEND VNET_SOURCES
640 list(APPEND VNET_HEADERS
644 list(APPEND VNET_API_FILES ipip/ipip.api)
646 ##############################################################################
647 # Tunnel protocol: l2tpv3
648 ##############################################################################
649 list(APPEND VNET_SOURCES
657 list(APPEND VNET_HEADERS
662 list(APPEND VNET_API_FILES l2tp/l2tp.api)
664 ##############################################################################
665 # Tunnel protocol: gre+mpls
666 ##############################################################################
667 list(APPEND VNET_SOURCES
679 list(APPEND VNET_HEADERS
687 list(APPEND VNET_API_FILES mpls/mpls.api)
689 ##############################################################################
690 # Tunnel protocol: vxlan-gbp
691 ##############################################################################
692 list(APPEND VNET_SOURCES
695 vxlan-gbp/vxlan_gbp_api.c
696 vxlan-gbp/vxlan_gbp.c
697 vxlan-gbp/vxlan_gbp_packet.c
700 list(APPEND VNET_HEADERS
701 vxlan-gbp/vxlan_gbp.h
702 vxlan-gbp/vxlan_gbp_packet.h
703 vxlan-gbp/vxlan_gbp_error.def
706 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
708 ##############################################################################
709 # Tunnel protocol: vxlan-gpe
710 ##############################################################################
712 list(APPEND VNET_SOURCES
713 vxlan-gpe/vxlan_gpe.c
716 vxlan-gpe/vxlan_gpe_api.c
719 list(APPEND VNET_HEADERS
720 vxlan-gpe/vxlan_gpe.h
721 vxlan-gpe/vxlan_gpe_packet.h
722 vxlan-gpe/vxlan_gpe_error.def
725 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
727 ##############################################################################
728 # Tunnel protocol: ipsec+gre
729 ##############################################################################
730 list(APPEND VNET_SOURCES
731 ipsec-gre/ipsec_gre.c
733 ipsec-gre/interface.c
734 ipsec-gre/ipsec_gre_api.c
737 list(APPEND VNET_HEADERS
738 ipsec-gre/ipsec_gre.h
742 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
744 ##############################################################################
745 # LISP control plane: lisp-cp
746 ##############################################################################
748 list(APPEND VNET_SOURCES
750 lisp-cp/lisp_cp_dpo.c
752 lisp-cp/gid_dictionary.c
753 lisp-cp/lisp_msg_serdes.c
761 list(APPEND VNET_HEADERS
764 lisp-cp/gid_dictionary.h
765 lisp-cp/lisp_cp_messages.h
766 lisp-cp/lisp_msg_serdes.h
770 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
771 list(APPEND VNET_API_FILES lisp-cp/one.api)
773 ##############################################################################
774 # Tunnel protocol: lisp-gpe
775 ##############################################################################
777 list(APPEND VNET_SOURCES
779 lisp-gpe/lisp_gpe_sub_interface.c
780 lisp-gpe/lisp_gpe_adjacency.c
781 lisp-gpe/lisp_gpe_tunnel.c
782 lisp-gpe/lisp_gpe_fwd_entry.c
783 lisp-gpe/lisp_gpe_tenant.c
786 lisp-gpe/lisp_gpe_api.c
789 list(APPEND VNET_HEADERS
791 lisp-gpe/lisp_gpe_fwd_entry.h
792 lisp-gpe/lisp_gpe_tenant.h
793 lisp-gpe/lisp_gpe_packet.h
794 lisp-gpe/lisp_gpe_error.def
797 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
799 ##############################################################################
801 ##############################################################################
802 list(APPEND VNET_SOURCES
804 dhcp/dhcp_client_detect.c
805 dhcp/dhcp6_client_common_dp.c
806 dhcp/dhcp6_pd_client_dp.c
807 dhcp/dhcp6_pd_client_cp.c
808 dhcp/dhcp6_ia_na_client_dp.c
809 dhcp/dhcp6_ia_na_client_cp.c
813 list(APPEND VNET_HEADERS
815 dhcp/dhcp6_client_common_dp.h
816 dhcp/dhcp6_pd_client_dp.h
817 dhcp/dhcp6_ia_na_client_dp.h
820 list(APPEND VNET_API_FILES
822 dhcp/dhcp6_pd_client_cp.api
823 dhcp/dhcp6_ia_na_client_cp.api
826 ##############################################################################
828 ##############################################################################
829 list(APPEND VNET_SOURCES
830 dhcp/dhcp6_proxy_node.c
831 dhcp/dhcp4_proxy_node.c
835 list(APPEND VNET_HEADERS
839 dhcp/dhcp6_proxy_error.def
840 dhcp/dhcp4_proxy_error.def
843 ##############################################################################
844 # ipv6 segment routing
845 ##############################################################################
847 list(APPEND VNET_SOURCES
850 srv6/sr_policy_rewrite.c
855 list(APPEND VNET_HEADERS
860 list(APPEND VNET_API_FILES srv6/sr.api)
862 ##############################################################################
863 # mpls segment routing
864 ##############################################################################
866 list(APPEND VNET_SOURCES
867 srmpls/sr_mpls_policy.c
868 srmpls/sr_mpls_steering.c
872 list(APPEND VNET_HEADERS
876 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
878 ##############################################################################
879 # IPFIX / netflow v10
880 ##############################################################################
881 list(APPEND VNET_SOURCES
882 ipfix-export/flow_report.c
883 ipfix-export/flow_api.c
886 list(APPEND VNET_HEADERS
887 ipfix-export/flow_report.h
888 ipfix-export/ipfix_info_elements.h
889 ipfix-export/ipfix_packet.h
892 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
894 ##############################################################################
895 # IPFIX classify code
896 ##############################################################################
898 list(APPEND VNET_SOURCES
899 ipfix-export/flow_report_classify.c
902 list(APPEND VNET_HEADERS
903 ipfix-export/flow_report_classify.h
906 ##############################################################################
908 ##############################################################################
910 list(APPEND VNET_SOURCES
911 lawful-intercept/lawful_intercept.c
912 lawful-intercept/node.c
915 list(APPEND VNET_HEADERS
916 lawful-intercept/lawful_intercept.h
919 ##############################################################################
920 # SPAN (port mirroring)
921 ##############################################################################
923 list(APPEND VNET_SOURCES
929 list(APPEND VNET_HEADERS
933 list(APPEND VNET_API_FILES span/span.api)
935 ##############################################################################
937 ##############################################################################
938 list(APPEND VNET_SOURCES
944 dns/resolver_process.c
947 list(APPEND VNET_HEADERS
951 list(APPEND VNET_API_FILES dns/dns.api)
953 ##############################################################################
955 ##############################################################################
957 list(APPEND VNET_SOURCES
967 list(APPEND VNET_HEADERS
972 list(APPEND VNET_API_FILES pg/pg.api)
974 ##############################################################################
976 ##############################################################################
978 list(APPEND VNET_SOURCES
979 devices/virtio/device.c
980 devices/virtio/node.c
981 devices/virtio/vhost_user.c
982 devices/virtio/vhost_user_input.c
983 devices/virtio/vhost_user_output.c
984 devices/virtio/vhost_user_api.c
985 devices/virtio/virtio.c
986 devices/virtio/virtio_api.c
991 list(APPEND VNET_HEADERS
993 devices/virtio/virtio.h
994 devices/virtio/vhost_user.h
997 list(APPEND VNET_MULTIARCH_SOURCES
998 devices/virtio/vhost_user_input.c
999 devices/virtio/vhost_user_output.c
1000 devices/netmap/node.c
1001 devices/virtio/node.c
1002 devices/af_packet/node.c
1005 list(APPEND VNET_API_FILES
1006 devices/virtio/vhost_user.api
1007 devices/virtio/virtio.api
1010 ##############################################################################
1011 # tap interface (with virtio backend)
1012 ##############################################################################
1014 list(APPEND VNET_SOURCES
1017 devices/tap/tapv2_api.c
1020 list(APPEND VNET_HEADERS
1024 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1026 ##############################################################################
1027 # tap interface (with virtio backend)
1028 ##############################################################################
1030 list(APPEND VNET_SOURCES
1031 devices/pipe/pipe_api.c
1035 list(APPEND VNET_HEADERS
1039 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1041 ##############################################################################
1042 # session managmeent
1043 ##############################################################################
1045 list(APPEND VNET_SOURCES
1047 session/session_table.c
1048 session/session_rules_table.c
1049 session/session_lookup.c
1050 session/session_node.c
1052 session/application.c
1053 session/application_worker.c
1054 session/session_cli.c
1055 session/application_interface.c
1056 session/application_local.c
1057 session/application_namespace.c
1058 session/segment_manager.c
1059 session/session_api.c
1062 list(APPEND VNET_HEADERS
1064 session/session_table.h
1065 session/session_rules_table.h
1066 session/session_types.h
1067 session/session_lookup.h
1068 session/application.h
1070 session/transport_types.h
1071 session/application_interface.h
1072 session/application_local.h
1073 session/application_namespace.h
1074 session/session_debug.h
1075 session/segment_manager.h
1076 session/mma_template.h
1077 session/mma_template.c
1082 list(APPEND VNET_API_FILES session/session.api)
1084 ##############################################################################
1085 # session layer applications
1086 ##############################################################################
1088 list(APPEND VNET_SOURCES
1089 session-apps/echo_client.c
1090 session-apps/echo_server.c
1091 session-apps/http_server.c
1092 session-apps/proxy.c
1095 list(APPEND VNET_HEADERS
1096 session-apps/echo_client.h
1097 session-apps/proxy.h
1100 ##############################################################################
1102 ##############################################################################
1104 list(APPEND VNET_SOURCES
1108 list(APPEND VNET_HEADERS
1113 ##############################################################################
1114 # Linux packet interface
1115 ##############################################################################
1117 list(APPEND VNET_SOURCES
1118 devices/af_packet/af_packet.c
1119 devices/af_packet/device.c
1120 devices/af_packet/node.c
1121 devices/af_packet/cli.c
1122 devices/af_packet/af_packet_api.c
1125 list(APPEND VNET_HEADERS
1126 devices/af_packet/af_packet.h
1129 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1131 ##############################################################################
1133 ##############################################################################
1135 list(APPEND VNET_SOURCES
1136 devices/netmap/netmap.c
1137 devices/netmap/device.c
1138 devices/netmap/node.c
1139 devices/netmap/cli.c
1140 devices/netmap/netmap_api.c
1143 list(APPEND VNET_HEADERS
1144 devices/netmap/netmap.h
1147 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1149 ##############################################################################
1150 # Driver feature graph arc support
1151 ##############################################################################
1153 list(APPEND VNET_SOURCES
1155 feature/feature_api.c
1156 feature/registration.c
1159 list(APPEND VNET_HEADERS
1163 list(APPEND VNET_API_FILES feature/feature.api)
1165 ##############################################################################
1166 # Unix kernel related
1167 ##############################################################################
1169 # FIXME: unix/hgshm.c
1171 list(APPEND VNET_SOURCES
1176 list(APPEND VNET_HEADERS
1180 ##############################################################################
1182 ##############################################################################
1184 list(APPEND VNET_SOURCES
1196 fib/fib_entry_src_rr.c
1197 fib/fib_entry_src_interface.c
1198 fib/fib_entry_src_interpose.c
1199 fib/fib_entry_src_default_route.c
1200 fib/fib_entry_src_special.c
1201 fib/fib_entry_src_api.c
1202 fib/fib_entry_src_adj.c
1203 fib/fib_entry_src_mpls.c
1204 fib/fib_entry_src_lisp.c
1205 fib/fib_entry_cover.c
1206 fib/fib_entry_delegate.c
1211 fib/fib_attached_export.c
1216 list(APPEND VNET_HEADERS
1226 fib/fib_entry_delegate.h
1229 ##############################################################################
1231 ##############################################################################
1233 list(APPEND VNET_SOURCES
1246 list(APPEND VNET_MULTIARCH_SOURCES
1251 list(APPEND VNET_HEADERS
1260 ##############################################################################
1261 # Data-Plane Objects
1262 ##############################################################################
1264 list(APPEND VNET_SOURCES
1272 dpo/load_balance_map.c
1276 dpo/interface_rx_dpo.c
1277 dpo/interface_tx_dpo.c
1278 dpo/mpls_disposition.c
1279 dpo/mpls_label_dpo.c
1284 list(APPEND VNET_HEADERS
1296 ##############################################################################
1298 ##############################################################################
1300 list(APPEND VNET_SOURCES
1309 mfib/mfib_entry_cover.c
1310 mfib/mfib_entry_delegate.c
1311 mfib/mfib_entry_src.c
1312 mfib/mfib_entry_src_rr.c
1316 list(APPEND VNET_HEADERS
1322 ##############################################################################
1324 ##############################################################################
1326 list(APPEND VNET_SOURCES
1333 list(APPEND VNET_HEADERS
1337 ##############################################################################
1339 ##############################################################################
1341 list(APPEND VNET_SOURCES
1344 qos/qos_egress_map.c
1349 list(APPEND VNET_API_FILES qos/qos.api)
1351 ##############################################################################
1353 ##############################################################################
1355 list(APPEND VNET_SOURCES
1356 bier/bier_bit_string.c
1359 bier/bier_fmask_db.c
1368 bier/bier_imp_node.c
1370 bier/bier_disp_entry.c
1371 bier/bier_disp_lookup_node.c
1372 bier/bier_disp_dispatch_node.c
1373 bier/bier_disp_table.c
1374 bier/bier_bift_table.c
1377 list(APPEND VNET_HEADERS
1384 list(APPEND VNET_API_FILES bier/bier.api)
1386 ##############################################################################
1388 ##############################################################################
1390 list (APPEND VNET_SOURCES
1396 list(APPEND VNET_HEADERS
1401 list(APPEND VNET_API_FILES syslog/syslog.api)
1403 ##############################################################################
1405 ##############################################################################
1407 add_vpp_library(vnet
1408 SOURCES ${VNET_SOURCES}
1409 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1410 INSTALL_HEADERS ${VNET_HEADERS}
1411 API_FILES ${VNET_API_FILES}
1412 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1416 ##############################################################################
1418 ##############################################################################
1420 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1421 if(VPP_BUILD_SESSION_ECHO_APPS)
1422 add_vpp_executable(tcp_echo
1423 SOURCES ../tests/vnet/session/tcp_echo.c
1424 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1428 add_vpp_executable(udp_echo
1429 SOURCES ../tests/vnet/session/udp_echo.c
1430 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1434 endif(VPP_BUILD_SESSION_ECHO_APPS)
1436 ##############################################################################