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
522 ipsec/ipsec_spd_policy.h
531 ##############################################################################
532 # Layer 3 protocol: osi
533 ##############################################################################
534 list(APPEND VNET_SOURCES
540 list(APPEND VNET_HEADERS
544 ##############################################################################
545 # Layer 4 protocol: tcp
546 ##############################################################################
547 list(APPEND VNET_SOURCES
551 tcp/tcp_syn_filter4.c
559 list(APPEND VNET_HEADERS
567 list(APPEND VNET_API_FILES tcp/tcp.api)
569 ##############################################################################
570 # Layer 4 protocol: udp
571 ##############################################################################
572 list(APPEND VNET_SOURCES
583 list(APPEND VNET_HEADERS
589 list(APPEND VNET_API_FILES udp/udp.api)
591 ##############################################################################
592 # Layer 4 protocol: sctp
593 ##############################################################################
594 list(APPEND VNET_SOURCES
603 list(APPEND VNET_HEADERS
610 list(APPEND VNET_API_FILES sctp/sctp.api)
612 ##############################################################################
613 # Tunnel protocol: gre
614 ##############################################################################
615 list(APPEND VNET_SOURCES
623 list(APPEND VNET_HEADERS
629 list(APPEND VNET_API_FILES gre/gre.api)
631 ##############################################################################
632 # Tunnel protocol: ipip
633 ##############################################################################
634 list(APPEND VNET_SOURCES
642 list(APPEND VNET_HEADERS
646 list(APPEND VNET_API_FILES ipip/ipip.api)
648 ##############################################################################
649 # Tunnel protocol: l2tpv3
650 ##############################################################################
651 list(APPEND VNET_SOURCES
659 list(APPEND VNET_HEADERS
664 list(APPEND VNET_API_FILES l2tp/l2tp.api)
666 ##############################################################################
667 # Tunnel protocol: gre+mpls
668 ##############################################################################
669 list(APPEND VNET_SOURCES
681 list(APPEND VNET_HEADERS
689 list(APPEND VNET_API_FILES mpls/mpls.api)
691 ##############################################################################
692 # Tunnel protocol: vxlan-gbp
693 ##############################################################################
694 list(APPEND VNET_SOURCES
697 vxlan-gbp/vxlan_gbp_api.c
698 vxlan-gbp/vxlan_gbp.c
699 vxlan-gbp/vxlan_gbp_packet.c
702 list(APPEND VNET_HEADERS
703 vxlan-gbp/vxlan_gbp.h
704 vxlan-gbp/vxlan_gbp_packet.h
705 vxlan-gbp/vxlan_gbp_error.def
708 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
710 ##############################################################################
711 # Tunnel protocol: vxlan-gpe
712 ##############################################################################
714 list(APPEND VNET_SOURCES
715 vxlan-gpe/vxlan_gpe.c
718 vxlan-gpe/vxlan_gpe_api.c
721 list(APPEND VNET_HEADERS
722 vxlan-gpe/vxlan_gpe.h
723 vxlan-gpe/vxlan_gpe_packet.h
724 vxlan-gpe/vxlan_gpe_error.def
727 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
729 ##############################################################################
730 # Tunnel protocol: ipsec+gre
731 ##############################################################################
732 list(APPEND VNET_SOURCES
733 ipsec-gre/ipsec_gre.c
735 ipsec-gre/interface.c
736 ipsec-gre/ipsec_gre_api.c
739 list(APPEND VNET_HEADERS
740 ipsec-gre/ipsec_gre.h
744 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
746 ##############################################################################
747 # LISP control plane: lisp-cp
748 ##############################################################################
750 list(APPEND VNET_SOURCES
752 lisp-cp/lisp_cp_dpo.c
754 lisp-cp/gid_dictionary.c
755 lisp-cp/lisp_msg_serdes.c
763 list(APPEND VNET_HEADERS
766 lisp-cp/gid_dictionary.h
767 lisp-cp/lisp_cp_messages.h
768 lisp-cp/lisp_msg_serdes.h
772 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
773 list(APPEND VNET_API_FILES lisp-cp/one.api)
775 ##############################################################################
776 # Tunnel protocol: lisp-gpe
777 ##############################################################################
779 list(APPEND VNET_SOURCES
781 lisp-gpe/lisp_gpe_sub_interface.c
782 lisp-gpe/lisp_gpe_adjacency.c
783 lisp-gpe/lisp_gpe_tunnel.c
784 lisp-gpe/lisp_gpe_fwd_entry.c
785 lisp-gpe/lisp_gpe_tenant.c
788 lisp-gpe/lisp_gpe_api.c
791 list(APPEND VNET_HEADERS
793 lisp-gpe/lisp_gpe_fwd_entry.h
794 lisp-gpe/lisp_gpe_tenant.h
795 lisp-gpe/lisp_gpe_packet.h
796 lisp-gpe/lisp_gpe_error.def
799 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
801 ##############################################################################
803 ##############################################################################
804 list(APPEND VNET_SOURCES
806 dhcp/dhcp_client_detect.c
807 dhcp/dhcp6_client_common_dp.c
808 dhcp/dhcp6_pd_client_dp.c
809 dhcp/dhcp6_pd_client_cp.c
810 dhcp/dhcp6_ia_na_client_dp.c
811 dhcp/dhcp6_ia_na_client_cp.c
815 list(APPEND VNET_HEADERS
817 dhcp/dhcp6_client_common_dp.h
818 dhcp/dhcp6_pd_client_dp.h
819 dhcp/dhcp6_ia_na_client_dp.h
822 list(APPEND VNET_API_FILES
824 dhcp/dhcp6_pd_client_cp.api
825 dhcp/dhcp6_ia_na_client_cp.api
828 ##############################################################################
830 ##############################################################################
831 list(APPEND VNET_SOURCES
832 dhcp/dhcp6_proxy_node.c
833 dhcp/dhcp4_proxy_node.c
837 list(APPEND VNET_HEADERS
841 dhcp/dhcp6_proxy_error.def
842 dhcp/dhcp4_proxy_error.def
845 ##############################################################################
846 # ipv6 segment routing
847 ##############################################################################
849 list(APPEND VNET_SOURCES
852 srv6/sr_policy_rewrite.c
857 list(APPEND VNET_HEADERS
862 list(APPEND VNET_API_FILES srv6/sr.api)
864 ##############################################################################
865 # mpls segment routing
866 ##############################################################################
868 list(APPEND VNET_SOURCES
869 srmpls/sr_mpls_policy.c
870 srmpls/sr_mpls_steering.c
874 list(APPEND VNET_HEADERS
878 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
880 ##############################################################################
881 # IPFIX / netflow v10
882 ##############################################################################
883 list(APPEND VNET_SOURCES
884 ipfix-export/flow_report.c
885 ipfix-export/flow_api.c
888 list(APPEND VNET_HEADERS
889 ipfix-export/flow_report.h
890 ipfix-export/ipfix_info_elements.h
891 ipfix-export/ipfix_packet.h
894 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
896 ##############################################################################
897 # IPFIX classify code
898 ##############################################################################
900 list(APPEND VNET_SOURCES
901 ipfix-export/flow_report_classify.c
904 list(APPEND VNET_HEADERS
905 ipfix-export/flow_report_classify.h
908 ##############################################################################
910 ##############################################################################
912 list(APPEND VNET_SOURCES
913 lawful-intercept/lawful_intercept.c
914 lawful-intercept/node.c
917 list(APPEND VNET_HEADERS
918 lawful-intercept/lawful_intercept.h
921 ##############################################################################
922 # SPAN (port mirroring)
923 ##############################################################################
925 list(APPEND VNET_SOURCES
931 list(APPEND VNET_HEADERS
935 list(APPEND VNET_API_FILES span/span.api)
937 ##############################################################################
939 ##############################################################################
940 list(APPEND VNET_SOURCES
946 dns/resolver_process.c
949 list(APPEND VNET_HEADERS
953 list(APPEND VNET_API_FILES dns/dns.api)
955 ##############################################################################
957 ##############################################################################
959 list(APPEND VNET_SOURCES
969 list(APPEND VNET_HEADERS
974 list(APPEND VNET_API_FILES pg/pg.api)
976 ##############################################################################
978 ##############################################################################
980 list(APPEND VNET_SOURCES
981 devices/virtio/device.c
982 devices/virtio/node.c
983 devices/virtio/vhost_user.c
984 devices/virtio/vhost_user_input.c
985 devices/virtio/vhost_user_output.c
986 devices/virtio/vhost_user_api.c
987 devices/virtio/virtio.c
988 devices/virtio/virtio_api.c
993 list(APPEND VNET_HEADERS
995 devices/virtio/virtio.h
996 devices/virtio/vhost_user.h
999 list(APPEND VNET_MULTIARCH_SOURCES
1000 devices/virtio/vhost_user_input.c
1001 devices/virtio/vhost_user_output.c
1004 list(APPEND VNET_API_FILES
1005 devices/virtio/vhost_user.api
1006 devices/virtio/virtio.api
1009 ##############################################################################
1010 # tap interface (with virtio backend)
1011 ##############################################################################
1013 list(APPEND VNET_SOURCES
1016 devices/tap/tapv2_api.c
1019 list(APPEND VNET_HEADERS
1023 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1025 ##############################################################################
1026 # tap interface (with virtio backend)
1027 ##############################################################################
1029 list(APPEND VNET_SOURCES
1030 devices/pipe/pipe_api.c
1034 list(APPEND VNET_HEADERS
1038 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1040 ##############################################################################
1041 # session managmeent
1042 ##############################################################################
1044 list(APPEND VNET_SOURCES
1046 session/session_table.c
1047 session/session_rules_table.c
1048 session/session_lookup.c
1049 session/session_node.c
1051 session/application.c
1052 session/application_worker.c
1053 session/session_cli.c
1054 session/application_interface.c
1055 session/application_local.c
1056 session/application_namespace.c
1057 session/segment_manager.c
1058 session/session_api.c
1061 list(APPEND VNET_HEADERS
1063 session/session_table.h
1064 session/session_rules_table.h
1065 session/session_types.h
1066 session/session_lookup.h
1067 session/application.h
1069 session/transport_types.h
1070 session/application_interface.h
1071 session/application_local.h
1072 session/application_namespace.h
1073 session/session_debug.h
1074 session/segment_manager.h
1075 session/mma_template.h
1076 session/mma_template.c
1081 list(APPEND VNET_API_FILES session/session.api)
1083 ##############################################################################
1084 # session layer applications
1085 ##############################################################################
1087 list(APPEND VNET_SOURCES
1088 session-apps/echo_client.c
1089 session-apps/echo_server.c
1090 session-apps/http_server.c
1091 session-apps/proxy.c
1094 list(APPEND VNET_HEADERS
1095 session-apps/echo_client.h
1096 session-apps/proxy.h
1099 ##############################################################################
1101 ##############################################################################
1103 list(APPEND VNET_SOURCES
1107 list(APPEND VNET_HEADERS
1112 ##############################################################################
1113 # Linux packet interface
1114 ##############################################################################
1116 list(APPEND VNET_SOURCES
1117 devices/af_packet/af_packet.c
1118 devices/af_packet/device.c
1119 devices/af_packet/node.c
1120 devices/af_packet/cli.c
1121 devices/af_packet/af_packet_api.c
1124 list(APPEND VNET_HEADERS
1125 devices/af_packet/af_packet.h
1128 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1130 ##############################################################################
1132 ##############################################################################
1134 list(APPEND VNET_SOURCES
1135 devices/netmap/netmap.c
1136 devices/netmap/device.c
1137 devices/netmap/node.c
1138 devices/netmap/cli.c
1139 devices/netmap/netmap_api.c
1142 list(APPEND VNET_HEADERS
1143 devices/netmap/netmap.h
1146 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1148 ##############################################################################
1149 # Driver feature graph arc support
1150 ##############################################################################
1152 list(APPEND VNET_SOURCES
1154 feature/feature_api.c
1155 feature/registration.c
1158 list(APPEND VNET_HEADERS
1162 list(APPEND VNET_API_FILES feature/feature.api)
1164 ##############################################################################
1165 # Unix kernel related
1166 ##############################################################################
1168 # FIXME: unix/hgshm.c
1170 list(APPEND VNET_SOURCES
1175 list(APPEND VNET_HEADERS
1179 ##############################################################################
1181 ##############################################################################
1183 list(APPEND VNET_SOURCES
1195 fib/fib_entry_src_rr.c
1196 fib/fib_entry_src_interface.c
1197 fib/fib_entry_src_interpose.c
1198 fib/fib_entry_src_default_route.c
1199 fib/fib_entry_src_special.c
1200 fib/fib_entry_src_api.c
1201 fib/fib_entry_src_adj.c
1202 fib/fib_entry_src_mpls.c
1203 fib/fib_entry_src_lisp.c
1204 fib/fib_entry_cover.c
1205 fib/fib_entry_delegate.c
1210 fib/fib_attached_export.c
1215 list(APPEND VNET_HEADERS
1225 fib/fib_entry_delegate.h
1228 ##############################################################################
1230 ##############################################################################
1232 list(APPEND VNET_SOURCES
1245 list(APPEND VNET_HEADERS
1254 ##############################################################################
1255 # Data-Plane Objects
1256 ##############################################################################
1258 list(APPEND VNET_SOURCES
1266 dpo/load_balance_map.c
1270 dpo/interface_rx_dpo.c
1271 dpo/interface_tx_dpo.c
1272 dpo/mpls_disposition.c
1273 dpo/mpls_label_dpo.c
1278 list(APPEND VNET_HEADERS
1290 ##############################################################################
1292 ##############################################################################
1294 list(APPEND VNET_SOURCES
1303 mfib/mfib_entry_cover.c
1304 mfib/mfib_entry_delegate.c
1305 mfib/mfib_entry_src.c
1306 mfib/mfib_entry_src_rr.c
1310 list(APPEND VNET_HEADERS
1316 ##############################################################################
1318 ##############################################################################
1320 list(APPEND VNET_SOURCES
1327 list(APPEND VNET_HEADERS
1331 ##############################################################################
1333 ##############################################################################
1335 list(APPEND VNET_SOURCES
1338 qos/qos_egress_map.c
1343 list(APPEND VNET_API_FILES qos/qos.api)
1345 ##############################################################################
1347 ##############################################################################
1349 list(APPEND VNET_SOURCES
1350 bier/bier_bit_string.c
1353 bier/bier_fmask_db.c
1362 bier/bier_imp_node.c
1364 bier/bier_disp_entry.c
1365 bier/bier_disp_lookup_node.c
1366 bier/bier_disp_dispatch_node.c
1367 bier/bier_disp_table.c
1368 bier/bier_bift_table.c
1371 list(APPEND VNET_HEADERS
1378 list(APPEND VNET_API_FILES bier/bier.api)
1380 ##############################################################################
1382 ##############################################################################
1384 list (APPEND VNET_SOURCES
1390 list(APPEND VNET_HEADERS
1395 list(APPEND VNET_API_FILES syslog/syslog.api)
1397 ##############################################################################
1399 ##############################################################################
1401 add_vpp_library(vnet
1402 SOURCES ${VNET_SOURCES}
1403 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1404 INSTALL_HEADERS ${VNET_HEADERS}
1405 API_FILES ${VNET_API_FILES}
1406 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1410 ##############################################################################
1412 ##############################################################################
1414 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1415 if(VPP_BUILD_SESSION_ECHO_APPS)
1416 add_vpp_executable(tcp_echo
1417 SOURCES ../tests/vnet/session/tcp_echo.c
1418 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1422 add_vpp_executable(udp_echo
1423 SOURCES ../tests/vnet/session/udp_echo.c
1424 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1428 endif(VPP_BUILD_SESSION_ECHO_APPS)
1430 ##############################################################################