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
43 list(APPEND VNET_HEADERS
67 list(APPEND VNET_API_FILES interface.api)
69 ##############################################################################
71 ##############################################################################
72 list(APPEND VNET_SOURCES
79 list(APPEND VNET_HEADERS
85 list(APPEND VNET_API_FILES policer/policer.api)
87 ##############################################################################
89 ##############################################################################
90 list(APPEND VNET_SOURCES
98 list(APPEND VNET_HEADERS
102 list(APPEND VNET_API_FILES cop/cop.api)
104 ##############################################################################
105 # Layer 2 protocols go here
106 ##############################################################################
108 ##############################################################################
109 # Layer 2 protocol: Ethernet
110 ##############################################################################
111 list(APPEND VNET_SOURCES
112 ethernet/ethernet_types_api.c
116 ethernet/mac_address.c
120 ethernet/p2p_ethernet.c
121 ethernet/p2p_ethernet_input.c
122 ethernet/p2p_ethernet_api.c
125 list(APPEND VNET_MULTIARCH_SOURCES l2/l2_output.c)
127 list(APPEND VNET_HEADERS
133 ethernet/p2p_ethernet.h
136 list(APPEND VNET_API_FILES ethernet/p2p_ethernet.api)
138 ##############################################################################
139 # Layer 2 protocol: Ethernet bridging
140 ##############################################################################
141 list(APPEND VNET_SOURCES
146 l2/l2_input_classify.c
147 l2/l2_output_classify.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-gpe
663 ##############################################################################
665 list(APPEND VNET_SOURCES
666 vxlan-gpe/vxlan_gpe.c
669 vxlan-gpe/vxlan_gpe_api.c
672 list(APPEND VNET_HEADERS
673 vxlan-gpe/vxlan_gpe.h
674 vxlan-gpe/vxlan_gpe_packet.h
675 vxlan-gpe/vxlan_gpe_error.def
678 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
680 ##############################################################################
681 # Tunnel protocol: ipsec+gre
682 ##############################################################################
683 list(APPEND VNET_SOURCES
684 ipsec-gre/ipsec_gre.c
686 ipsec-gre/interface.c
687 ipsec-gre/ipsec_gre_api.c
690 list(APPEND VNET_HEADERS
691 ipsec-gre/ipsec_gre.h
695 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
697 ##############################################################################
698 # LISP control plane: lisp-cp
699 ##############################################################################
701 list(APPEND VNET_SOURCES
703 lisp-cp/lisp_cp_dpo.c
705 lisp-cp/gid_dictionary.c
706 lisp-cp/lisp_msg_serdes.c
714 list(APPEND VNET_HEADERS
717 lisp-cp/gid_dictionary.h
718 lisp-cp/lisp_cp_messages.h
719 lisp-cp/lisp_msg_serdes.h
723 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
724 list(APPEND VNET_API_FILES lisp-cp/one.api)
726 ##############################################################################
727 # Tunnel protocol: lisp-gpe
728 ##############################################################################
730 list(APPEND VNET_SOURCES
732 lisp-gpe/lisp_gpe_sub_interface.c
733 lisp-gpe/lisp_gpe_adjacency.c
734 lisp-gpe/lisp_gpe_tunnel.c
735 lisp-gpe/lisp_gpe_fwd_entry.c
736 lisp-gpe/lisp_gpe_tenant.c
739 lisp-gpe/lisp_gpe_api.c
742 list(APPEND VNET_HEADERS
744 lisp-gpe/lisp_gpe_fwd_entry.h
745 lisp-gpe/lisp_gpe_tenant.h
746 lisp-gpe/lisp_gpe_packet.h
747 lisp-gpe/lisp_gpe_error.def
750 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
752 ##############################################################################
754 ##############################################################################
755 list(APPEND VNET_SOURCES
757 dhcp/dhcp_client_detect.c
758 dhcp/dhcp6_client_common_dp.c
759 dhcp/dhcp6_pd_client_dp.c
760 dhcp/dhcp6_pd_client_cp.c
761 dhcp/dhcp6_ia_na_client_dp.c
762 dhcp/dhcp6_ia_na_client_cp.c
766 list(APPEND VNET_HEADERS
768 dhcp/dhcp6_client_common_dp.h
769 dhcp/dhcp6_pd_client_dp.h
770 dhcp/dhcp6_ia_na_client_dp.h
773 list(APPEND VNET_API_FILES
775 dhcp/dhcp6_pd_client_cp.api
776 dhcp/dhcp6_ia_na_client_cp.api
779 ##############################################################################
781 ##############################################################################
782 list(APPEND VNET_SOURCES
783 dhcp/dhcp6_proxy_node.c
784 dhcp/dhcp4_proxy_node.c
788 list(APPEND VNET_HEADERS
792 dhcp/dhcp6_proxy_error.def
793 dhcp/dhcp4_proxy_error.def
796 ##############################################################################
797 # ipv6 segment routing
798 ##############################################################################
800 list(APPEND VNET_SOURCES
803 srv6/sr_policy_rewrite.c
808 list(APPEND VNET_HEADERS
813 list(APPEND VNET_API_FILES srv6/sr.api)
815 ##############################################################################
816 # mpls segment routing
817 ##############################################################################
819 list(APPEND VNET_SOURCES
820 srmpls/sr_mpls_policy.c
821 srmpls/sr_mpls_steering.c
825 list(APPEND VNET_HEADERS
829 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
831 ##############################################################################
832 # IPFIX / netflow v10
833 ##############################################################################
834 list(APPEND VNET_SOURCES
835 ipfix-export/flow_report.c
836 ipfix-export/flow_api.c
839 list(APPEND VNET_HEADERS
840 ipfix-export/flow_report.h
841 ipfix-export/ipfix_info_elements.h
842 ipfix-export/ipfix_packet.h
845 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
847 ##############################################################################
848 # IPFIX classify code
849 ##############################################################################
851 list(APPEND VNET_SOURCES
852 ipfix-export/flow_report_classify.c
855 list(APPEND VNET_HEADERS
856 ipfix-export/flow_report_classify.h
859 ##############################################################################
861 ##############################################################################
863 list(APPEND VNET_SOURCES
864 lawful-intercept/lawful_intercept.c
865 lawful-intercept/node.c
868 list(APPEND VNET_HEADERS
869 lawful-intercept/lawful_intercept.h
872 ##############################################################################
873 # SPAN (port mirroring)
874 ##############################################################################
876 list(APPEND VNET_SOURCES
882 list(APPEND VNET_HEADERS
886 list(APPEND VNET_API_FILES span/span.api)
888 ##############################################################################
890 ##############################################################################
891 list(APPEND VNET_SOURCES
897 dns/resolver_process.c
900 list(APPEND VNET_HEADERS
904 list(APPEND VNET_API_FILES dns/dns.api)
906 ##############################################################################
908 ##############################################################################
910 list(APPEND VNET_SOURCES
920 list(APPEND VNET_HEADERS
925 list(APPEND VNET_API_FILES pg/pg.api)
927 ##############################################################################
929 ##############################################################################
931 list(APPEND VNET_SOURCES
932 devices/virtio/device.c
933 devices/virtio/node.c
934 devices/virtio/vhost_user.c
935 devices/virtio/vhost_user_input.c
936 devices/virtio/vhost_user_output.c
937 devices/virtio/vhost_user_api.c
938 devices/virtio/virtio.c
941 list(APPEND VNET_HEADERS
942 devices/virtio/virtio.h
943 devices/virtio/vhost_user.h
946 list(APPEND VNET_MULTIARCH_SOURCES
947 devices/virtio/vhost_user_input.c
948 devices/virtio/vhost_user_output.c
951 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
953 ##############################################################################
954 # tap interface (with virtio backend)
955 ##############################################################################
957 list(APPEND VNET_SOURCES
960 devices/tap/tapv2_api.c
963 list(APPEND VNET_HEADERS
967 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
969 ##############################################################################
970 # tap interface (with virtio backend)
971 ##############################################################################
973 list(APPEND VNET_SOURCES
974 devices/pipe/pipe_api.c
978 list(APPEND VNET_HEADERS
982 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
984 ##############################################################################
986 ##############################################################################
988 list(APPEND VNET_SOURCES
990 session/session_table.c
991 session/session_rules_table.c
992 session/session_lookup.c
993 session/session_node.c
995 session/application.c
996 session/session_cli.c
997 session/application_interface.c
998 session/application_namespace.c
999 session/segment_manager.c
1000 session/session_test.c
1001 session/session_api.c
1004 list(APPEND VNET_HEADERS
1006 session/session_table.h
1007 session/session_rules_table.h
1008 session/stream_session.h
1009 session/session_lookup.h
1010 session/application.h
1012 session/transport_interface.h
1013 session/application_interface.h
1014 session/application_namespace.h
1015 session/session_debug.h
1016 session/segment_manager.h
1017 session/mma_template.h
1018 session/mma_template.c
1023 list(APPEND VNET_API_FILES session/session.api)
1025 ##############################################################################
1026 # session layer applications
1027 ##############################################################################
1029 list(APPEND VNET_SOURCES
1030 session-apps/echo_client.c
1031 session-apps/echo_server.c
1032 session-apps/http_server.c
1033 session-apps/proxy.c
1036 list(APPEND VNET_HEADERS
1037 session-apps/echo_client.h
1038 session-apps/proxy.h
1041 ##############################################################################
1043 ##############################################################################
1045 list(APPEND VNET_SOURCES
1049 list(APPEND VNET_HEADERS
1053 ##############################################################################
1054 # Linux packet interface
1055 ##############################################################################
1057 list(APPEND VNET_SOURCES
1058 devices/af_packet/af_packet.c
1059 devices/af_packet/device.c
1060 devices/af_packet/node.c
1061 devices/af_packet/cli.c
1062 devices/af_packet/af_packet_api.c
1065 list(APPEND VNET_HEADERS
1066 devices/af_packet/af_packet.h
1069 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1071 ##############################################################################
1073 ##############################################################################
1075 list(APPEND VNET_SOURCES
1076 devices/netmap/netmap.c
1077 devices/netmap/device.c
1078 devices/netmap/node.c
1079 devices/netmap/cli.c
1080 devices/netmap/netmap_api.c
1083 list(APPEND VNET_HEADERS
1084 devices/netmap/netmap.h
1087 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1089 ##############################################################################
1090 # Driver feature graph arc support
1091 ##############################################################################
1093 list(APPEND VNET_SOURCES
1095 feature/feature_api.c
1096 feature/registration.c
1099 list(APPEND VNET_HEADERS
1103 list(APPEND VNET_API_FILES feature/feature.api)
1105 ##############################################################################
1106 # Unix kernel related
1107 ##############################################################################
1109 # FIXME: unix/hgshm.c
1111 list(APPEND VNET_SOURCES
1119 list(APPEND VNET_HEADERS
1125 list(APPEND VNET_API_FILES unix/tap.api)
1127 ##############################################################################
1129 ##############################################################################
1131 list(APPEND VNET_SOURCES
1144 fib/fib_entry_src_rr.c
1145 fib/fib_entry_src_interface.c
1146 fib/fib_entry_src_interpose.c
1147 fib/fib_entry_src_default_route.c
1148 fib/fib_entry_src_special.c
1149 fib/fib_entry_src_api.c
1150 fib/fib_entry_src_adj.c
1151 fib/fib_entry_src_mpls.c
1152 fib/fib_entry_src_lisp.c
1153 fib/fib_entry_cover.c
1154 fib/fib_entry_delegate.c
1159 fib/fib_attached_export.c
1164 list(APPEND VNET_HEADERS
1174 fib/fib_entry_delegate.h
1177 ##############################################################################
1179 ##############################################################################
1181 list(APPEND VNET_SOURCES
1194 list(APPEND VNET_HEADERS
1203 ##############################################################################
1204 # Data-Plane Objects
1205 ##############################################################################
1207 list(APPEND VNET_SOURCES
1215 dpo/load_balance_map.c
1219 dpo/interface_rx_dpo.c
1220 dpo/interface_tx_dpo.c
1221 dpo/mpls_disposition.c
1222 dpo/mpls_label_dpo.c
1227 list(APPEND VNET_HEADERS
1239 ##############################################################################
1241 ##############################################################################
1243 list(APPEND VNET_SOURCES
1255 list(APPEND VNET_HEADERS
1261 ##############################################################################
1263 ##############################################################################
1265 list(APPEND VNET_SOURCES
1272 list(APPEND VNET_HEADERS
1276 ##############################################################################
1278 ##############################################################################
1280 list(APPEND VNET_SOURCES
1283 qos/qos_egress_map.c
1288 list(APPEND VNET_API_FILES qos/qos.api)
1290 ##############################################################################
1292 ##############################################################################
1294 list(APPEND VNET_SOURCES
1295 bier/bier_bit_string.c
1298 bier/bier_fmask_db.c
1308 bier/bier_imp_node.c
1310 bier/bier_disp_entry.c
1311 bier/bier_disp_lookup_node.c
1312 bier/bier_disp_dispatch_node.c
1313 bier/bier_disp_table.c
1314 bier/bier_bift_table.c
1317 list(APPEND VNET_HEADERS
1324 list(APPEND VNET_API_FILES bier/bier.api)
1326 add_vpp_library(vnet
1327 SOURCES ${VNET_SOURCES}
1328 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1329 INSTALL_HEADERS ${VNET_HEADERS}
1330 API_FILES ${VNET_API_FILES}
1331 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}