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
118 ethernet/p2p_ethernet.c
119 ethernet/p2p_ethernet_input.c
120 ethernet/p2p_ethernet_api.c
123 list(APPEND VNET_MULTIARCH_SOURCES l2/l2_output.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_HEADERS
178 list(APPEND VNET_API_FILES l2/l2.api)
180 ##############################################################################
181 # Layer 2 protocol: SRP
182 ##############################################################################
183 list(APPEND VNET_SOURCES
190 list(APPEND VNET_HEADERS
195 ##############################################################################
196 # Layer 2 protocol: PPP
197 ##############################################################################
198 list(APPEND VNET_SOURCES
204 list(APPEND VNET_HEADERS
210 ##############################################################################
211 # Layer 2 protocol: HDLC
212 ##############################################################################
213 list(APPEND VNET_SOURCES
219 list(APPEND VNET_HEADERS
225 ##############################################################################
226 # Layer 2 protocol: LLC
227 ##############################################################################
228 list(APPEND VNET_SOURCES
234 list(APPEND VNET_HEADERS
238 ##############################################################################
239 # Layer 2 protocol: SNAP
240 ##############################################################################
241 list(APPEND VNET_SOURCES
247 list(APPEND VNET_HEADERS
251 ##############################################################################
253 ##############################################################################
254 list(APPEND VNET_SOURCES
261 list(APPEND VNET_HEADERS
264 vxlan/vxlan_error.def
267 list(APPEND VNET_API_FILES vxlan/vxlan.api)
269 ##############################################################################
271 ##############################################################################
272 list(APPEND VNET_SOURCES
279 list(APPEND VNET_HEADERS
281 geneve/geneve_packet.h
282 geneve/geneve_error.def
285 list(APPEND VNET_API_FILES geneve/geneve.api)
287 ##############################################################################
289 ##############################################################################
290 list(APPEND VNET_SOURCES
297 list(APPEND VNET_HEADERS
301 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c)
302 list(APPEND VNET_API_FILES bonding/bond.api)
304 ##############################################################################
306 ##############################################################################
307 list(APPEND VNET_SOURCES
315 list(APPEND VNET_HEADERS
320 list(APPEND VNET_API_FILES lldp/lldp.api)
322 ##############################################################################
323 # Layer 2/3 "classify"
324 ##############################################################################
325 list(APPEND VNET_SOURCES
326 classify/vnet_classify.c
327 classify/ip_classify.c
328 classify/in_out_acl.c
329 classify/policer_classify.c
330 classify/flow_classify.c
331 classify/flow_classify_node.c
332 classify/vnet_classify.h
333 classify/classify_api.c
336 list(APPEND VNET_HEADERS
337 classify/vnet_classify.h
338 classify/in_out_acl.h
339 classify/policer_classify.h
340 classify/flow_classify.h
343 list(APPEND VNET_API_FILES classify/classify.api)
345 ##############################################################################
346 # Layer 3 protocols go here
347 ##############################################################################
349 ##############################################################################
350 # Layer 3 protocol: IP v4/v6
351 ##############################################################################
352 list(APPEND VNET_SOURCES
365 ip/ip4_source_and_port_range_check.c
366 ip/ip4_source_check.c
392 list(APPEND VNET_HEADERS
405 ip/ip6_hop_by_hop_packet.h
410 ip/ip_source_and_port_range_check.h
419 list(APPEND VNET_API_FILES
425 list(APPEND VNET_MULTIARCH_SOURCES ip/ip4_forward.c ip/ip4_input.c)
427 ##############################################################################
429 ##############################################################################
430 list(APPEND VNET_SOURCES
434 list(APPEND VNET_HEADERS
435 ethernet/arp_packet.h
439 ##############################################################################
440 # Bidirectional Forwarding Detection
441 ##############################################################################
443 list(APPEND VNET_HEADERS
450 list(APPEND VNET_SOURCES
459 list(APPEND VNET_API_FILES bfd/bfd.api)
461 ##############################################################################
462 # Layer 3 protocol: IPSec
463 ##############################################################################
464 list(APPEND VNET_SOURCES
479 ipsec/ikev2_payload.c
484 list(APPEND VNET_API_FILES ipsec/ipsec.api)
486 list(APPEND VNET_SOURCES
490 list(APPEND VNET_HEADERS
498 ##############################################################################
499 # Layer 3 protocol: osi
500 ##############################################################################
501 list(APPEND VNET_SOURCES
507 list(APPEND VNET_HEADERS
511 ##############################################################################
512 # Layer 4 protocol: tcp
513 ##############################################################################
514 list(APPEND VNET_SOURCES
518 tcp/tcp_syn_filter4.c
525 list(APPEND VNET_HEADERS
533 list(APPEND VNET_API_FILES tcp/tcp.api)
535 ##############################################################################
536 # Layer 4 protocol: udp
537 ##############################################################################
538 list(APPEND VNET_SOURCES
549 list(APPEND VNET_HEADERS
555 list(APPEND VNET_API_FILES udp/udp.api)
557 ##############################################################################
558 # Layer 4 protocol: sctp
559 ##############################################################################
560 list(APPEND VNET_SOURCES
569 list(APPEND VNET_HEADERS
576 list(APPEND VNET_API_FILES sctp/sctp.api)
578 ##############################################################################
579 # Tunnel protocol: gre
580 ##############################################################################
581 list(APPEND VNET_SOURCES
589 list(APPEND VNET_HEADERS
595 list(APPEND VNET_API_FILES gre/gre.api)
597 ##############################################################################
598 # Tunnel protocol: ipip
599 ##############################################################################
600 list(APPEND VNET_SOURCES
608 list(APPEND VNET_HEADERS
612 list(APPEND VNET_API_FILES ipip/ipip.api)
614 ##############################################################################
615 # Tunnel protocol: l2tpv3
616 ##############################################################################
617 list(APPEND VNET_SOURCES
625 list(APPEND VNET_HEADERS
630 list(APPEND VNET_API_FILES l2tp/l2tp.api)
632 ##############################################################################
633 # Tunnel protocol: gre+mpls
634 ##############################################################################
635 list(APPEND VNET_SOURCES
647 list(APPEND VNET_HEADERS
655 list(APPEND VNET_API_FILES mpls/mpls.api)
657 ##############################################################################
658 # Tunnel protocol: vxlan-gpe
659 ##############################################################################
661 list(APPEND VNET_SOURCES
662 vxlan-gpe/vxlan_gpe.c
665 vxlan-gpe/vxlan_gpe_api.c
668 list(APPEND VNET_HEADERS
669 vxlan-gpe/vxlan_gpe.h
670 vxlan-gpe/vxlan_gpe_packet.h
671 vxlan-gpe/vxlan_gpe_error.def
674 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
676 ##############################################################################
677 # Tunnel protocol: ipsec+gre
678 ##############################################################################
679 list(APPEND VNET_SOURCES
680 ipsec-gre/ipsec_gre.c
682 ipsec-gre/interface.c
683 ipsec-gre/ipsec_gre_api.c
686 list(APPEND VNET_HEADERS
687 ipsec-gre/ipsec_gre.h
691 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
693 ##############################################################################
694 # LISP control plane: lisp-cp
695 ##############################################################################
697 list(APPEND VNET_SOURCES
699 lisp-cp/lisp_cp_dpo.c
701 lisp-cp/gid_dictionary.c
702 lisp-cp/lisp_msg_serdes.c
710 list(APPEND VNET_HEADERS
713 lisp-cp/gid_dictionary.h
714 lisp-cp/lisp_cp_messages.h
715 lisp-cp/lisp_msg_serdes.h
719 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
720 list(APPEND VNET_API_FILES lisp-cp/one.api)
722 ##############################################################################
723 # Tunnel protocol: lisp-gpe
724 ##############################################################################
726 list(APPEND VNET_SOURCES
728 lisp-gpe/lisp_gpe_sub_interface.c
729 lisp-gpe/lisp_gpe_adjacency.c
730 lisp-gpe/lisp_gpe_tunnel.c
731 lisp-gpe/lisp_gpe_fwd_entry.c
732 lisp-gpe/lisp_gpe_tenant.c
735 lisp-gpe/lisp_gpe_api.c
738 list(APPEND VNET_HEADERS
740 lisp-gpe/lisp_gpe_fwd_entry.h
741 lisp-gpe/lisp_gpe_tenant.h
742 lisp-gpe/lisp_gpe_packet.h
743 lisp-gpe/lisp_gpe_error.def
746 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
748 ##############################################################################
750 ##############################################################################
751 list(APPEND VNET_SOURCES
753 dhcp/dhcp_client_detect.c
754 dhcp/dhcp6_client_common_dp.c
755 dhcp/dhcp6_pd_client_dp.c
756 dhcp/dhcp6_pd_client_cp.c
757 dhcp/dhcp6_ia_na_client_dp.c
758 dhcp/dhcp6_ia_na_client_cp.c
762 list(APPEND VNET_HEADERS
764 dhcp/dhcp6_client_common_dp.h
765 dhcp/dhcp6_pd_client_dp.h
766 dhcp/dhcp6_ia_na_client_dp.h
769 list(APPEND VNET_API_FILES
771 dhcp/dhcp6_pd_client_cp.api
772 dhcp/dhcp6_ia_na_client_cp.api
775 ##############################################################################
777 ##############################################################################
778 list(APPEND VNET_SOURCES
779 dhcp/dhcp6_proxy_node.c
780 dhcp/dhcp4_proxy_node.c
784 list(APPEND VNET_HEADERS
788 dhcp/dhcp6_proxy_error.def
789 dhcp/dhcp4_proxy_error.def
792 ##############################################################################
793 # ipv6 segment routing
794 ##############################################################################
796 list(APPEND VNET_SOURCES
799 srv6/sr_policy_rewrite.c
804 list(APPEND VNET_HEADERS
809 list(APPEND VNET_API_FILES srv6/sr.api)
811 ##############################################################################
812 # mpls segment routing
813 ##############################################################################
815 list(APPEND VNET_SOURCES
816 srmpls/sr_mpls_policy.c
817 srmpls/sr_mpls_steering.c
821 list(APPEND VNET_HEADERS
825 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
827 ##############################################################################
828 # IPFIX / netflow v10
829 ##############################################################################
830 list(APPEND VNET_SOURCES
831 ipfix-export/flow_report.c
832 ipfix-export/flow_api.c
835 list(APPEND VNET_HEADERS
836 ipfix-export/flow_report.h
837 ipfix-export/ipfix_info_elements.h
838 ipfix-export/ipfix_packet.h
841 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
843 ##############################################################################
844 # IPFIX classify code
845 ##############################################################################
847 list(APPEND VNET_SOURCES
848 ipfix-export/flow_report_classify.c
851 list(APPEND VNET_HEADERS
852 ipfix-export/flow_report_classify.h
855 ##############################################################################
857 ##############################################################################
859 list(APPEND VNET_SOURCES
860 lawful-intercept/lawful_intercept.c
861 lawful-intercept/node.c
864 list(APPEND VNET_HEADERS
865 lawful-intercept/lawful_intercept.h
868 ##############################################################################
869 # SPAN (port mirroring)
870 ##############################################################################
872 list(APPEND VNET_SOURCES
878 list(APPEND VNET_HEADERS
882 list(APPEND VNET_API_FILES span/span.api)
884 ##############################################################################
886 ##############################################################################
887 list(APPEND VNET_SOURCES
893 dns/resolver_process.c
896 list(APPEND VNET_HEADERS
900 list(APPEND VNET_API_FILES dns/dns.api)
902 ##############################################################################
904 ##############################################################################
906 list(APPEND VNET_SOURCES
916 list(APPEND VNET_HEADERS
921 list(APPEND VNET_API_FILES pg/pg.api)
923 ##############################################################################
925 ##############################################################################
927 list(APPEND VNET_SOURCES
928 devices/virtio/device.c
929 devices/virtio/node.c
930 devices/virtio/vhost_user.c
931 devices/virtio/vhost_user_input.c
932 devices/virtio/vhost_user_output.c
933 devices/virtio/vhost_user_api.c
934 devices/virtio/virtio.c
937 list(APPEND VNET_HEADERS
938 devices/virtio/virtio.h
939 devices/virtio/vhost_user.h
942 list(APPEND VNET_MULTIARCH_SOURCES
943 devices/virtio/vhost_user_input.c
944 devices/virtio/vhost_user_output.c
947 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
949 ##############################################################################
950 # tap interface (with virtio backend)
951 ##############################################################################
953 list(APPEND VNET_SOURCES
956 devices/tap/tapv2_api.c
959 list(APPEND VNET_HEADERS
963 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
965 ##############################################################################
966 # tap interface (with virtio backend)
967 ##############################################################################
969 list(APPEND VNET_SOURCES
970 devices/pipe/pipe_api.c
974 list(APPEND VNET_HEADERS
978 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
980 ##############################################################################
982 ##############################################################################
984 list(APPEND VNET_SOURCES
986 session/session_table.c
987 session/session_rules_table.c
988 session/session_lookup.c
989 session/session_node.c
991 session/application.c
992 session/session_cli.c
993 session/application_interface.c
994 session/application_namespace.c
995 session/segment_manager.c
996 session/session_test.c
997 session/session_api.c
1000 list(APPEND VNET_HEADERS
1002 session/session_table.h
1003 session/session_rules_table.h
1004 session/stream_session.h
1005 session/session_lookup.h
1006 session/application.h
1008 session/transport_interface.h
1009 session/application_interface.h
1010 session/application_namespace.h
1011 session/session_debug.h
1012 session/segment_manager.h
1013 session/mma_template.h
1014 session/mma_template.c
1019 list(APPEND VNET_API_FILES session/session.api)
1021 ##############################################################################
1022 # session layer applications
1023 ##############################################################################
1025 list(APPEND VNET_SOURCES
1026 session-apps/echo_client.c
1027 session-apps/echo_server.c
1028 session-apps/http_server.c
1029 session-apps/proxy.c
1032 list(APPEND VNET_HEADERS
1033 session-apps/echo_client.h
1034 session-apps/proxy.h
1037 ##############################################################################
1039 ##############################################################################
1041 list(APPEND VNET_SOURCES
1045 list(APPEND VNET_HEADERS
1049 ##############################################################################
1050 # Linux packet interface
1051 ##############################################################################
1053 list(APPEND VNET_SOURCES
1054 devices/af_packet/af_packet.c
1055 devices/af_packet/device.c
1056 devices/af_packet/node.c
1057 devices/af_packet/cli.c
1058 devices/af_packet/af_packet_api.c
1061 list(APPEND VNET_HEADERS
1062 devices/af_packet/af_packet.h
1065 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1067 ##############################################################################
1069 ##############################################################################
1071 list(APPEND VNET_SOURCES
1072 devices/netmap/netmap.c
1073 devices/netmap/device.c
1074 devices/netmap/node.c
1075 devices/netmap/cli.c
1076 devices/netmap/netmap_api.c
1079 list(APPEND VNET_HEADERS
1080 devices/netmap/netmap.h
1083 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1085 ##############################################################################
1086 # Driver feature graph arc support
1087 ##############################################################################
1089 list(APPEND VNET_SOURCES
1091 feature/feature_api.c
1092 feature/registration.c
1095 list(APPEND VNET_HEADERS
1099 list(APPEND VNET_API_FILES feature/feature.api)
1101 ##############################################################################
1102 # Unix kernel related
1103 ##############################################################################
1105 # FIXME: unix/hgshm.c
1107 list(APPEND VNET_SOURCES
1115 list(APPEND VNET_HEADERS
1121 list(APPEND VNET_API_FILES unix/tap.api)
1123 ##############################################################################
1125 ##############################################################################
1127 list(APPEND VNET_SOURCES
1140 fib/fib_entry_src_rr.c
1141 fib/fib_entry_src_interface.c
1142 fib/fib_entry_src_interpose.c
1143 fib/fib_entry_src_default_route.c
1144 fib/fib_entry_src_special.c
1145 fib/fib_entry_src_api.c
1146 fib/fib_entry_src_adj.c
1147 fib/fib_entry_src_mpls.c
1148 fib/fib_entry_src_lisp.c
1149 fib/fib_entry_cover.c
1150 fib/fib_entry_delegate.c
1155 fib/fib_attached_export.c
1160 list(APPEND VNET_HEADERS
1170 fib/fib_entry_delegate.h
1173 ##############################################################################
1175 ##############################################################################
1177 list(APPEND VNET_SOURCES
1190 list(APPEND VNET_HEADERS
1199 ##############################################################################
1200 # Data-Plane Objects
1201 ##############################################################################
1203 list(APPEND VNET_SOURCES
1211 dpo/load_balance_map.c
1215 dpo/interface_rx_dpo.c
1216 dpo/interface_tx_dpo.c
1217 dpo/mpls_disposition.c
1218 dpo/mpls_label_dpo.c
1223 list(APPEND VNET_HEADERS
1235 ##############################################################################
1237 ##############################################################################
1239 list(APPEND VNET_SOURCES
1251 list(APPEND VNET_HEADERS
1257 ##############################################################################
1259 ##############################################################################
1261 list(APPEND VNET_SOURCES
1267 ##############################################################################
1269 ##############################################################################
1271 list(APPEND VNET_SOURCES
1274 qos/qos_egress_map.c
1279 list(APPEND VNET_API_FILES qos/qos.api)
1281 ##############################################################################
1283 ##############################################################################
1285 list(APPEND VNET_SOURCES
1286 bier/bier_bit_string.c
1289 bier/bier_fmask_db.c
1299 bier/bier_imp_node.c
1301 bier/bier_disp_entry.c
1302 bier/bier_disp_lookup_node.c
1303 bier/bier_disp_dispatch_node.c
1304 bier/bier_disp_table.c
1305 bier/bier_bift_table.c
1308 list(APPEND VNET_HEADERS
1315 list(APPEND VNET_API_FILES bier/bier.api)
1317 add_vpp_library(vnet
1318 SOURCES ${VNET_SOURCES}
1319 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1320 INSTALL_HEADERS ${VNET_HEADERS}
1321 API_FILES ${VNET_API_FILES}
1322 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}