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
161 list(APPEND VNET_MULTIARCH_SOURCES l2/l2_output.c l2/l2_learn.c)
163 list(APPEND VNET_HEADERS
180 list(APPEND VNET_API_FILES l2/l2.api)
182 ##############################################################################
183 # Layer 2 protocol: SRP
184 ##############################################################################
185 list(APPEND VNET_SOURCES
192 list(APPEND VNET_HEADERS
197 ##############################################################################
198 # Layer 2 protocol: PPP
199 ##############################################################################
200 list(APPEND VNET_SOURCES
206 list(APPEND VNET_HEADERS
212 ##############################################################################
213 # Layer 2 protocol: HDLC
214 ##############################################################################
215 list(APPEND VNET_SOURCES
221 list(APPEND VNET_HEADERS
227 ##############################################################################
228 # Layer 2 protocol: LLC
229 ##############################################################################
230 list(APPEND VNET_SOURCES
236 list(APPEND VNET_HEADERS
240 ##############################################################################
241 # Layer 2 protocol: SNAP
242 ##############################################################################
243 list(APPEND VNET_SOURCES
249 list(APPEND VNET_HEADERS
253 ##############################################################################
255 ##############################################################################
256 list(APPEND VNET_SOURCES
263 list(APPEND VNET_HEADERS
266 vxlan/vxlan_error.def
269 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
271 list(APPEND VNET_API_FILES vxlan/vxlan.api)
273 ##############################################################################
275 ##############################################################################
276 list(APPEND VNET_SOURCES
283 list(APPEND VNET_HEADERS
285 geneve/geneve_packet.h
286 geneve/geneve_error.def
289 list(APPEND VNET_API_FILES geneve/geneve.api)
291 ##############################################################################
293 ##############################################################################
294 list(APPEND VNET_SOURCES
301 list(APPEND VNET_HEADERS
305 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c)
306 list(APPEND VNET_API_FILES bonding/bond.api)
308 ##############################################################################
310 ##############################################################################
311 list(APPEND VNET_SOURCES
319 list(APPEND VNET_HEADERS
324 list(APPEND VNET_API_FILES lldp/lldp.api)
326 ##############################################################################
327 # Layer 2/3 "classify"
328 ##############################################################################
329 list(APPEND VNET_SOURCES
330 classify/vnet_classify.c
331 classify/ip_classify.c
332 classify/in_out_acl.c
333 classify/policer_classify.c
334 classify/flow_classify.c
335 classify/flow_classify_node.c
336 classify/vnet_classify.h
337 classify/classify_api.c
340 list(APPEND VNET_HEADERS
341 classify/vnet_classify.h
342 classify/in_out_acl.h
343 classify/policer_classify.h
344 classify/flow_classify.h
347 list(APPEND VNET_API_FILES classify/classify.api)
349 ##############################################################################
350 # Layer 3 protocols go here
351 ##############################################################################
353 ##############################################################################
354 # Layer 3 protocol: IP v4/v6
355 ##############################################################################
356 list(APPEND VNET_SOURCES
369 ip/ip4_source_and_port_range_check.c
370 ip/ip4_source_check.c
396 list(APPEND VNET_HEADERS
409 ip/ip6_hop_by_hop_packet.h
414 ip/ip_source_and_port_range_check.h
423 list(APPEND VNET_API_FILES
429 list(APPEND VNET_MULTIARCH_SOURCES ip/ip4_forward.c ip/ip4_input.c)
431 ##############################################################################
433 ##############################################################################
434 list(APPEND VNET_SOURCES
438 list(APPEND VNET_HEADERS
439 ethernet/arp_packet.h
443 ##############################################################################
444 # Bidirectional Forwarding Detection
445 ##############################################################################
447 list(APPEND VNET_HEADERS
454 list(APPEND VNET_SOURCES
463 list(APPEND VNET_API_FILES bfd/bfd.api)
465 ##############################################################################
466 # Layer 3 protocol: IPSec
467 ##############################################################################
468 list(APPEND VNET_SOURCES
483 ipsec/ikev2_payload.c
488 list(APPEND VNET_API_FILES ipsec/ipsec.api)
490 list(APPEND VNET_SOURCES
494 list(APPEND VNET_HEADERS
502 ##############################################################################
503 # Layer 3 protocol: osi
504 ##############################################################################
505 list(APPEND VNET_SOURCES
511 list(APPEND VNET_HEADERS
515 ##############################################################################
516 # Layer 4 protocol: tcp
517 ##############################################################################
518 list(APPEND VNET_SOURCES
522 tcp/tcp_syn_filter4.c
529 list(APPEND VNET_HEADERS
537 list(APPEND VNET_API_FILES tcp/tcp.api)
539 ##############################################################################
540 # Layer 4 protocol: udp
541 ##############################################################################
542 list(APPEND VNET_SOURCES
553 list(APPEND VNET_HEADERS
559 list(APPEND VNET_API_FILES udp/udp.api)
561 ##############################################################################
562 # Layer 4 protocol: sctp
563 ##############################################################################
564 list(APPEND VNET_SOURCES
573 list(APPEND VNET_HEADERS
580 list(APPEND VNET_API_FILES sctp/sctp.api)
582 ##############################################################################
583 # Tunnel protocol: gre
584 ##############################################################################
585 list(APPEND VNET_SOURCES
593 list(APPEND VNET_HEADERS
599 list(APPEND VNET_API_FILES gre/gre.api)
601 ##############################################################################
602 # Tunnel protocol: ipip
603 ##############################################################################
604 list(APPEND VNET_SOURCES
612 list(APPEND VNET_HEADERS
616 list(APPEND VNET_API_FILES ipip/ipip.api)
618 ##############################################################################
619 # Tunnel protocol: l2tpv3
620 ##############################################################################
621 list(APPEND VNET_SOURCES
629 list(APPEND VNET_HEADERS
634 list(APPEND VNET_API_FILES l2tp/l2tp.api)
636 ##############################################################################
637 # Tunnel protocol: gre+mpls
638 ##############################################################################
639 list(APPEND VNET_SOURCES
651 list(APPEND VNET_HEADERS
659 list(APPEND VNET_API_FILES mpls/mpls.api)
661 ##############################################################################
662 # Tunnel protocol: vxlan-gbp
663 ##############################################################################
664 list(APPEND VNET_SOURCES
667 vxlan-gbp/vxlan_gbp_api.c
668 vxlan-gbp/vxlan_gbp.c
671 list(APPEND VNET_HEADERS
672 vxlan-gbp/vxlan_gbp.h
673 vxlan-gbp/vxlan_gbp_packet.h
674 vxlan-gbp/vxlan_gbp_error.def
677 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
679 ##############################################################################
680 # Tunnel protocol: vxlan-gpe
681 ##############################################################################
683 list(APPEND VNET_SOURCES
684 vxlan-gpe/vxlan_gpe.c
687 vxlan-gpe/vxlan_gpe_api.c
690 list(APPEND VNET_HEADERS
691 vxlan-gpe/vxlan_gpe.h
692 vxlan-gpe/vxlan_gpe_packet.h
693 vxlan-gpe/vxlan_gpe_error.def
696 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
698 ##############################################################################
699 # Tunnel protocol: ipsec+gre
700 ##############################################################################
701 list(APPEND VNET_SOURCES
702 ipsec-gre/ipsec_gre.c
704 ipsec-gre/interface.c
705 ipsec-gre/ipsec_gre_api.c
708 list(APPEND VNET_HEADERS
709 ipsec-gre/ipsec_gre.h
713 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
715 ##############################################################################
716 # LISP control plane: lisp-cp
717 ##############################################################################
719 list(APPEND VNET_SOURCES
721 lisp-cp/lisp_cp_dpo.c
723 lisp-cp/gid_dictionary.c
724 lisp-cp/lisp_msg_serdes.c
732 list(APPEND VNET_HEADERS
735 lisp-cp/gid_dictionary.h
736 lisp-cp/lisp_cp_messages.h
737 lisp-cp/lisp_msg_serdes.h
741 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
742 list(APPEND VNET_API_FILES lisp-cp/one.api)
744 ##############################################################################
745 # Tunnel protocol: lisp-gpe
746 ##############################################################################
748 list(APPEND VNET_SOURCES
750 lisp-gpe/lisp_gpe_sub_interface.c
751 lisp-gpe/lisp_gpe_adjacency.c
752 lisp-gpe/lisp_gpe_tunnel.c
753 lisp-gpe/lisp_gpe_fwd_entry.c
754 lisp-gpe/lisp_gpe_tenant.c
757 lisp-gpe/lisp_gpe_api.c
760 list(APPEND VNET_HEADERS
762 lisp-gpe/lisp_gpe_fwd_entry.h
763 lisp-gpe/lisp_gpe_tenant.h
764 lisp-gpe/lisp_gpe_packet.h
765 lisp-gpe/lisp_gpe_error.def
768 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
770 ##############################################################################
772 ##############################################################################
773 list(APPEND VNET_SOURCES
775 dhcp/dhcp_client_detect.c
776 dhcp/dhcp6_client_common_dp.c
777 dhcp/dhcp6_pd_client_dp.c
778 dhcp/dhcp6_pd_client_cp.c
779 dhcp/dhcp6_ia_na_client_dp.c
780 dhcp/dhcp6_ia_na_client_cp.c
784 list(APPEND VNET_HEADERS
786 dhcp/dhcp6_client_common_dp.h
787 dhcp/dhcp6_pd_client_dp.h
788 dhcp/dhcp6_ia_na_client_dp.h
791 list(APPEND VNET_API_FILES
793 dhcp/dhcp6_pd_client_cp.api
794 dhcp/dhcp6_ia_na_client_cp.api
797 ##############################################################################
799 ##############################################################################
800 list(APPEND VNET_SOURCES
801 dhcp/dhcp6_proxy_node.c
802 dhcp/dhcp4_proxy_node.c
806 list(APPEND VNET_HEADERS
810 dhcp/dhcp6_proxy_error.def
811 dhcp/dhcp4_proxy_error.def
814 ##############################################################################
815 # ipv6 segment routing
816 ##############################################################################
818 list(APPEND VNET_SOURCES
821 srv6/sr_policy_rewrite.c
826 list(APPEND VNET_HEADERS
831 list(APPEND VNET_API_FILES srv6/sr.api)
833 ##############################################################################
834 # mpls segment routing
835 ##############################################################################
837 list(APPEND VNET_SOURCES
838 srmpls/sr_mpls_policy.c
839 srmpls/sr_mpls_steering.c
843 list(APPEND VNET_HEADERS
847 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
849 ##############################################################################
850 # IPFIX / netflow v10
851 ##############################################################################
852 list(APPEND VNET_SOURCES
853 ipfix-export/flow_report.c
854 ipfix-export/flow_api.c
857 list(APPEND VNET_HEADERS
858 ipfix-export/flow_report.h
859 ipfix-export/ipfix_info_elements.h
860 ipfix-export/ipfix_packet.h
863 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
865 ##############################################################################
866 # IPFIX classify code
867 ##############################################################################
869 list(APPEND VNET_SOURCES
870 ipfix-export/flow_report_classify.c
873 list(APPEND VNET_HEADERS
874 ipfix-export/flow_report_classify.h
877 ##############################################################################
879 ##############################################################################
881 list(APPEND VNET_SOURCES
882 lawful-intercept/lawful_intercept.c
883 lawful-intercept/node.c
886 list(APPEND VNET_HEADERS
887 lawful-intercept/lawful_intercept.h
890 ##############################################################################
891 # SPAN (port mirroring)
892 ##############################################################################
894 list(APPEND VNET_SOURCES
900 list(APPEND VNET_HEADERS
904 list(APPEND VNET_API_FILES span/span.api)
906 ##############################################################################
908 ##############################################################################
909 list(APPEND VNET_SOURCES
915 dns/resolver_process.c
918 list(APPEND VNET_HEADERS
922 list(APPEND VNET_API_FILES dns/dns.api)
924 ##############################################################################
926 ##############################################################################
928 list(APPEND VNET_SOURCES
938 list(APPEND VNET_HEADERS
943 list(APPEND VNET_API_FILES pg/pg.api)
945 ##############################################################################
947 ##############################################################################
949 list(APPEND VNET_SOURCES
950 devices/virtio/device.c
951 devices/virtio/node.c
952 devices/virtio/vhost_user.c
953 devices/virtio/vhost_user_input.c
954 devices/virtio/vhost_user_output.c
955 devices/virtio/vhost_user_api.c
956 devices/virtio/virtio.c
959 list(APPEND VNET_HEADERS
960 devices/virtio/virtio.h
961 devices/virtio/vhost_user.h
964 list(APPEND VNET_MULTIARCH_SOURCES
965 devices/virtio/vhost_user_input.c
966 devices/virtio/vhost_user_output.c
969 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
971 ##############################################################################
972 # tap interface (with virtio backend)
973 ##############################################################################
975 list(APPEND VNET_SOURCES
978 devices/tap/tapv2_api.c
981 list(APPEND VNET_HEADERS
985 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
987 ##############################################################################
988 # tap interface (with virtio backend)
989 ##############################################################################
991 list(APPEND VNET_SOURCES
992 devices/pipe/pipe_api.c
996 list(APPEND VNET_HEADERS
1000 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1002 ##############################################################################
1003 # session managmeent
1004 ##############################################################################
1006 list(APPEND VNET_SOURCES
1008 session/session_table.c
1009 session/session_rules_table.c
1010 session/session_lookup.c
1011 session/session_node.c
1013 session/application.c
1014 session/session_cli.c
1015 session/application_interface.c
1016 session/application_namespace.c
1017 session/segment_manager.c
1018 session/session_test.c
1019 session/session_api.c
1022 list(APPEND VNET_HEADERS
1024 session/session_table.h
1025 session/session_rules_table.h
1026 session/stream_session.h
1027 session/session_lookup.h
1028 session/application.h
1030 session/transport_interface.h
1031 session/application_interface.h
1032 session/application_namespace.h
1033 session/session_debug.h
1034 session/segment_manager.h
1035 session/mma_template.h
1036 session/mma_template.c
1041 list(APPEND VNET_API_FILES session/session.api)
1043 ##############################################################################
1044 # session layer applications
1045 ##############################################################################
1047 list(APPEND VNET_SOURCES
1048 session-apps/echo_client.c
1049 session-apps/echo_server.c
1050 session-apps/http_server.c
1051 session-apps/proxy.c
1054 list(APPEND VNET_HEADERS
1055 session-apps/echo_client.h
1056 session-apps/proxy.h
1059 ##############################################################################
1061 ##############################################################################
1063 list(APPEND VNET_SOURCES
1067 list(APPEND VNET_HEADERS
1071 ##############################################################################
1072 # Linux packet interface
1073 ##############################################################################
1075 list(APPEND VNET_SOURCES
1076 devices/af_packet/af_packet.c
1077 devices/af_packet/device.c
1078 devices/af_packet/node.c
1079 devices/af_packet/cli.c
1080 devices/af_packet/af_packet_api.c
1083 list(APPEND VNET_HEADERS
1084 devices/af_packet/af_packet.h
1087 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1089 ##############################################################################
1091 ##############################################################################
1093 list(APPEND VNET_SOURCES
1094 devices/netmap/netmap.c
1095 devices/netmap/device.c
1096 devices/netmap/node.c
1097 devices/netmap/cli.c
1098 devices/netmap/netmap_api.c
1101 list(APPEND VNET_HEADERS
1102 devices/netmap/netmap.h
1105 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1107 ##############################################################################
1108 # Driver feature graph arc support
1109 ##############################################################################
1111 list(APPEND VNET_SOURCES
1113 feature/feature_api.c
1114 feature/registration.c
1117 list(APPEND VNET_HEADERS
1121 list(APPEND VNET_API_FILES feature/feature.api)
1123 ##############################################################################
1124 # Unix kernel related
1125 ##############################################################################
1127 # FIXME: unix/hgshm.c
1129 list(APPEND VNET_SOURCES
1137 list(APPEND VNET_HEADERS
1143 list(APPEND VNET_API_FILES unix/tap.api)
1145 ##############################################################################
1147 ##############################################################################
1149 list(APPEND VNET_SOURCES
1162 fib/fib_entry_src_rr.c
1163 fib/fib_entry_src_interface.c
1164 fib/fib_entry_src_interpose.c
1165 fib/fib_entry_src_default_route.c
1166 fib/fib_entry_src_special.c
1167 fib/fib_entry_src_api.c
1168 fib/fib_entry_src_adj.c
1169 fib/fib_entry_src_mpls.c
1170 fib/fib_entry_src_lisp.c
1171 fib/fib_entry_cover.c
1172 fib/fib_entry_delegate.c
1177 fib/fib_attached_export.c
1182 list(APPEND VNET_HEADERS
1192 fib/fib_entry_delegate.h
1195 ##############################################################################
1197 ##############################################################################
1199 list(APPEND VNET_SOURCES
1212 list(APPEND VNET_HEADERS
1221 ##############################################################################
1222 # Data-Plane Objects
1223 ##############################################################################
1225 list(APPEND VNET_SOURCES
1233 dpo/load_balance_map.c
1237 dpo/interface_rx_dpo.c
1238 dpo/interface_tx_dpo.c
1239 dpo/mpls_disposition.c
1240 dpo/mpls_label_dpo.c
1245 list(APPEND VNET_HEADERS
1257 ##############################################################################
1259 ##############################################################################
1261 list(APPEND VNET_SOURCES
1273 list(APPEND VNET_HEADERS
1279 ##############################################################################
1281 ##############################################################################
1283 list(APPEND VNET_SOURCES
1290 list(APPEND VNET_HEADERS
1294 ##############################################################################
1296 ##############################################################################
1298 list(APPEND VNET_SOURCES
1301 qos/qos_egress_map.c
1306 list(APPEND VNET_API_FILES qos/qos.api)
1308 ##############################################################################
1310 ##############################################################################
1312 list(APPEND VNET_SOURCES
1313 bier/bier_bit_string.c
1316 bier/bier_fmask_db.c
1326 bier/bier_imp_node.c
1328 bier/bier_disp_entry.c
1329 bier/bier_disp_lookup_node.c
1330 bier/bier_disp_dispatch_node.c
1331 bier/bier_disp_table.c
1332 bier/bier_bift_table.c
1335 list(APPEND VNET_HEADERS
1342 list(APPEND VNET_API_FILES bier/bier.api)
1344 ##############################################################################
1346 ##############################################################################
1348 add_vpp_library(vnet
1349 SOURCES ${VNET_SOURCES}
1350 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1351 INSTALL_HEADERS ${VNET_HEADERS}
1352 API_FILES ${VNET_API_FILES}
1353 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1357 ##############################################################################
1359 ##############################################################################
1361 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1362 if(VPP_BUILD_SESSION_ECHO_APPS)
1363 add_vpp_executable(tcp_echo
1364 SOURCES ../tests/vnet/session/tcp_echo.c
1365 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1369 add_vpp_executable(udp_echo
1370 SOURCES ../tests/vnet/session/udp_echo.c
1371 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1375 endif(VPP_BUILD_SESSION_ECHO_APPS)
1377 ##############################################################################