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 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_MULTIARCH_SOURCES vxlan/decap.c)
269 list(APPEND VNET_API_FILES vxlan/vxlan.api)
271 ##############################################################################
273 ##############################################################################
274 list(APPEND VNET_SOURCES
281 list(APPEND VNET_HEADERS
283 geneve/geneve_packet.h
284 geneve/geneve_error.def
287 list(APPEND VNET_API_FILES geneve/geneve.api)
289 ##############################################################################
291 ##############################################################################
292 list(APPEND VNET_SOURCES
299 list(APPEND VNET_HEADERS
303 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c)
304 list(APPEND VNET_API_FILES bonding/bond.api)
306 ##############################################################################
308 ##############################################################################
309 list(APPEND VNET_SOURCES
317 list(APPEND VNET_HEADERS
322 list(APPEND VNET_API_FILES lldp/lldp.api)
324 ##############################################################################
325 # Layer 2/3 "classify"
326 ##############################################################################
327 list(APPEND VNET_SOURCES
328 classify/vnet_classify.c
329 classify/ip_classify.c
330 classify/in_out_acl.c
331 classify/policer_classify.c
332 classify/flow_classify.c
333 classify/flow_classify_node.c
334 classify/vnet_classify.h
335 classify/classify_api.c
338 list(APPEND VNET_HEADERS
339 classify/vnet_classify.h
340 classify/in_out_acl.h
341 classify/policer_classify.h
342 classify/flow_classify.h
345 list(APPEND VNET_API_FILES classify/classify.api)
347 ##############################################################################
348 # Layer 3 protocols go here
349 ##############################################################################
351 ##############################################################################
352 # Layer 3 protocol: IP v4/v6
353 ##############################################################################
354 list(APPEND VNET_SOURCES
367 ip/ip4_source_and_port_range_check.c
368 ip/ip4_source_check.c
394 list(APPEND VNET_HEADERS
407 ip/ip6_hop_by_hop_packet.h
412 ip/ip_source_and_port_range_check.h
421 list(APPEND VNET_API_FILES
427 list(APPEND VNET_MULTIARCH_SOURCES ip/ip4_forward.c ip/ip4_input.c)
429 ##############################################################################
431 ##############################################################################
432 list(APPEND VNET_SOURCES
436 list(APPEND VNET_HEADERS
437 ethernet/arp_packet.h
441 ##############################################################################
442 # Bidirectional Forwarding Detection
443 ##############################################################################
445 list(APPEND VNET_HEADERS
452 list(APPEND VNET_SOURCES
461 list(APPEND VNET_API_FILES bfd/bfd.api)
463 ##############################################################################
464 # Layer 3 protocol: IPSec
465 ##############################################################################
466 list(APPEND VNET_SOURCES
481 ipsec/ikev2_payload.c
486 list(APPEND VNET_API_FILES ipsec/ipsec.api)
488 list(APPEND VNET_SOURCES
492 list(APPEND VNET_HEADERS
500 ##############################################################################
501 # Layer 3 protocol: osi
502 ##############################################################################
503 list(APPEND VNET_SOURCES
509 list(APPEND VNET_HEADERS
513 ##############################################################################
514 # Layer 4 protocol: tcp
515 ##############################################################################
516 list(APPEND VNET_SOURCES
520 tcp/tcp_syn_filter4.c
527 list(APPEND VNET_HEADERS
535 list(APPEND VNET_API_FILES tcp/tcp.api)
537 ##############################################################################
538 # Layer 4 protocol: udp
539 ##############################################################################
540 list(APPEND VNET_SOURCES
551 list(APPEND VNET_HEADERS
557 list(APPEND VNET_API_FILES udp/udp.api)
559 ##############################################################################
560 # Layer 4 protocol: sctp
561 ##############################################################################
562 list(APPEND VNET_SOURCES
571 list(APPEND VNET_HEADERS
578 list(APPEND VNET_API_FILES sctp/sctp.api)
580 ##############################################################################
581 # Tunnel protocol: gre
582 ##############################################################################
583 list(APPEND VNET_SOURCES
591 list(APPEND VNET_HEADERS
597 list(APPEND VNET_API_FILES gre/gre.api)
599 ##############################################################################
600 # Tunnel protocol: ipip
601 ##############################################################################
602 list(APPEND VNET_SOURCES
610 list(APPEND VNET_HEADERS
614 list(APPEND VNET_API_FILES ipip/ipip.api)
616 ##############################################################################
617 # Tunnel protocol: l2tpv3
618 ##############################################################################
619 list(APPEND VNET_SOURCES
627 list(APPEND VNET_HEADERS
632 list(APPEND VNET_API_FILES l2tp/l2tp.api)
634 ##############################################################################
635 # Tunnel protocol: gre+mpls
636 ##############################################################################
637 list(APPEND VNET_SOURCES
649 list(APPEND VNET_HEADERS
657 list(APPEND VNET_API_FILES mpls/mpls.api)
659 ##############################################################################
660 # Tunnel protocol: vxlan-gpe
661 ##############################################################################
663 list(APPEND VNET_SOURCES
664 vxlan-gpe/vxlan_gpe.c
667 vxlan-gpe/vxlan_gpe_api.c
670 list(APPEND VNET_HEADERS
671 vxlan-gpe/vxlan_gpe.h
672 vxlan-gpe/vxlan_gpe_packet.h
673 vxlan-gpe/vxlan_gpe_error.def
676 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
678 ##############################################################################
679 # Tunnel protocol: ipsec+gre
680 ##############################################################################
681 list(APPEND VNET_SOURCES
682 ipsec-gre/ipsec_gre.c
684 ipsec-gre/interface.c
685 ipsec-gre/ipsec_gre_api.c
688 list(APPEND VNET_HEADERS
689 ipsec-gre/ipsec_gre.h
693 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
695 ##############################################################################
696 # LISP control plane: lisp-cp
697 ##############################################################################
699 list(APPEND VNET_SOURCES
701 lisp-cp/lisp_cp_dpo.c
703 lisp-cp/gid_dictionary.c
704 lisp-cp/lisp_msg_serdes.c
712 list(APPEND VNET_HEADERS
715 lisp-cp/gid_dictionary.h
716 lisp-cp/lisp_cp_messages.h
717 lisp-cp/lisp_msg_serdes.h
721 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
722 list(APPEND VNET_API_FILES lisp-cp/one.api)
724 ##############################################################################
725 # Tunnel protocol: lisp-gpe
726 ##############################################################################
728 list(APPEND VNET_SOURCES
730 lisp-gpe/lisp_gpe_sub_interface.c
731 lisp-gpe/lisp_gpe_adjacency.c
732 lisp-gpe/lisp_gpe_tunnel.c
733 lisp-gpe/lisp_gpe_fwd_entry.c
734 lisp-gpe/lisp_gpe_tenant.c
737 lisp-gpe/lisp_gpe_api.c
740 list(APPEND VNET_HEADERS
742 lisp-gpe/lisp_gpe_fwd_entry.h
743 lisp-gpe/lisp_gpe_tenant.h
744 lisp-gpe/lisp_gpe_packet.h
745 lisp-gpe/lisp_gpe_error.def
748 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
750 ##############################################################################
752 ##############################################################################
753 list(APPEND VNET_SOURCES
755 dhcp/dhcp_client_detect.c
756 dhcp/dhcp6_client_common_dp.c
757 dhcp/dhcp6_pd_client_dp.c
758 dhcp/dhcp6_pd_client_cp.c
759 dhcp/dhcp6_ia_na_client_dp.c
760 dhcp/dhcp6_ia_na_client_cp.c
764 list(APPEND VNET_HEADERS
766 dhcp/dhcp6_client_common_dp.h
767 dhcp/dhcp6_pd_client_dp.h
768 dhcp/dhcp6_ia_na_client_dp.h
771 list(APPEND VNET_API_FILES
773 dhcp/dhcp6_pd_client_cp.api
774 dhcp/dhcp6_ia_na_client_cp.api
777 ##############################################################################
779 ##############################################################################
780 list(APPEND VNET_SOURCES
781 dhcp/dhcp6_proxy_node.c
782 dhcp/dhcp4_proxy_node.c
786 list(APPEND VNET_HEADERS
790 dhcp/dhcp6_proxy_error.def
791 dhcp/dhcp4_proxy_error.def
794 ##############################################################################
795 # ipv6 segment routing
796 ##############################################################################
798 list(APPEND VNET_SOURCES
801 srv6/sr_policy_rewrite.c
806 list(APPEND VNET_HEADERS
811 list(APPEND VNET_API_FILES srv6/sr.api)
813 ##############################################################################
814 # mpls segment routing
815 ##############################################################################
817 list(APPEND VNET_SOURCES
818 srmpls/sr_mpls_policy.c
819 srmpls/sr_mpls_steering.c
823 list(APPEND VNET_HEADERS
827 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
829 ##############################################################################
830 # IPFIX / netflow v10
831 ##############################################################################
832 list(APPEND VNET_SOURCES
833 ipfix-export/flow_report.c
834 ipfix-export/flow_api.c
837 list(APPEND VNET_HEADERS
838 ipfix-export/flow_report.h
839 ipfix-export/ipfix_info_elements.h
840 ipfix-export/ipfix_packet.h
843 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
845 ##############################################################################
846 # IPFIX classify code
847 ##############################################################################
849 list(APPEND VNET_SOURCES
850 ipfix-export/flow_report_classify.c
853 list(APPEND VNET_HEADERS
854 ipfix-export/flow_report_classify.h
857 ##############################################################################
859 ##############################################################################
861 list(APPEND VNET_SOURCES
862 lawful-intercept/lawful_intercept.c
863 lawful-intercept/node.c
866 list(APPEND VNET_HEADERS
867 lawful-intercept/lawful_intercept.h
870 ##############################################################################
871 # SPAN (port mirroring)
872 ##############################################################################
874 list(APPEND VNET_SOURCES
880 list(APPEND VNET_HEADERS
884 list(APPEND VNET_API_FILES span/span.api)
886 ##############################################################################
888 ##############################################################################
889 list(APPEND VNET_SOURCES
895 dns/resolver_process.c
898 list(APPEND VNET_HEADERS
902 list(APPEND VNET_API_FILES dns/dns.api)
904 ##############################################################################
906 ##############################################################################
908 list(APPEND VNET_SOURCES
918 list(APPEND VNET_HEADERS
923 list(APPEND VNET_API_FILES pg/pg.api)
925 ##############################################################################
927 ##############################################################################
929 list(APPEND VNET_SOURCES
930 devices/virtio/device.c
931 devices/virtio/node.c
932 devices/virtio/vhost_user.c
933 devices/virtio/vhost_user_input.c
934 devices/virtio/vhost_user_output.c
935 devices/virtio/vhost_user_api.c
936 devices/virtio/virtio.c
939 list(APPEND VNET_HEADERS
940 devices/virtio/virtio.h
941 devices/virtio/vhost_user.h
944 list(APPEND VNET_MULTIARCH_SOURCES
945 devices/virtio/vhost_user_input.c
946 devices/virtio/vhost_user_output.c
949 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
951 ##############################################################################
952 # tap interface (with virtio backend)
953 ##############################################################################
955 list(APPEND VNET_SOURCES
958 devices/tap/tapv2_api.c
961 list(APPEND VNET_HEADERS
965 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
967 ##############################################################################
968 # tap interface (with virtio backend)
969 ##############################################################################
971 list(APPEND VNET_SOURCES
972 devices/pipe/pipe_api.c
976 list(APPEND VNET_HEADERS
980 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
982 ##############################################################################
984 ##############################################################################
986 list(APPEND VNET_SOURCES
988 session/session_table.c
989 session/session_rules_table.c
990 session/session_lookup.c
991 session/session_node.c
993 session/application.c
994 session/session_cli.c
995 session/application_interface.c
996 session/application_namespace.c
997 session/segment_manager.c
998 session/session_test.c
999 session/session_api.c
1002 list(APPEND VNET_HEADERS
1004 session/session_table.h
1005 session/session_rules_table.h
1006 session/stream_session.h
1007 session/session_lookup.h
1008 session/application.h
1010 session/transport_interface.h
1011 session/application_interface.h
1012 session/application_namespace.h
1013 session/session_debug.h
1014 session/segment_manager.h
1015 session/mma_template.h
1016 session/mma_template.c
1021 list(APPEND VNET_API_FILES session/session.api)
1023 ##############################################################################
1024 # session layer applications
1025 ##############################################################################
1027 list(APPEND VNET_SOURCES
1028 session-apps/echo_client.c
1029 session-apps/echo_server.c
1030 session-apps/http_server.c
1031 session-apps/proxy.c
1034 list(APPEND VNET_HEADERS
1035 session-apps/echo_client.h
1036 session-apps/proxy.h
1039 ##############################################################################
1041 ##############################################################################
1043 list(APPEND VNET_SOURCES
1047 list(APPEND VNET_HEADERS
1051 ##############################################################################
1052 # Linux packet interface
1053 ##############################################################################
1055 list(APPEND VNET_SOURCES
1056 devices/af_packet/af_packet.c
1057 devices/af_packet/device.c
1058 devices/af_packet/node.c
1059 devices/af_packet/cli.c
1060 devices/af_packet/af_packet_api.c
1063 list(APPEND VNET_HEADERS
1064 devices/af_packet/af_packet.h
1067 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1069 ##############################################################################
1071 ##############################################################################
1073 list(APPEND VNET_SOURCES
1074 devices/netmap/netmap.c
1075 devices/netmap/device.c
1076 devices/netmap/node.c
1077 devices/netmap/cli.c
1078 devices/netmap/netmap_api.c
1081 list(APPEND VNET_HEADERS
1082 devices/netmap/netmap.h
1085 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1087 ##############################################################################
1088 # Driver feature graph arc support
1089 ##############################################################################
1091 list(APPEND VNET_SOURCES
1093 feature/feature_api.c
1094 feature/registration.c
1097 list(APPEND VNET_HEADERS
1101 list(APPEND VNET_API_FILES feature/feature.api)
1103 ##############################################################################
1104 # Unix kernel related
1105 ##############################################################################
1107 # FIXME: unix/hgshm.c
1109 list(APPEND VNET_SOURCES
1117 list(APPEND VNET_HEADERS
1123 list(APPEND VNET_API_FILES unix/tap.api)
1125 ##############################################################################
1127 ##############################################################################
1129 list(APPEND VNET_SOURCES
1142 fib/fib_entry_src_rr.c
1143 fib/fib_entry_src_interface.c
1144 fib/fib_entry_src_interpose.c
1145 fib/fib_entry_src_default_route.c
1146 fib/fib_entry_src_special.c
1147 fib/fib_entry_src_api.c
1148 fib/fib_entry_src_adj.c
1149 fib/fib_entry_src_mpls.c
1150 fib/fib_entry_src_lisp.c
1151 fib/fib_entry_cover.c
1152 fib/fib_entry_delegate.c
1157 fib/fib_attached_export.c
1162 list(APPEND VNET_HEADERS
1172 fib/fib_entry_delegate.h
1175 ##############################################################################
1177 ##############################################################################
1179 list(APPEND VNET_SOURCES
1192 list(APPEND VNET_HEADERS
1201 ##############################################################################
1202 # Data-Plane Objects
1203 ##############################################################################
1205 list(APPEND VNET_SOURCES
1213 dpo/load_balance_map.c
1217 dpo/interface_rx_dpo.c
1218 dpo/interface_tx_dpo.c
1219 dpo/mpls_disposition.c
1220 dpo/mpls_label_dpo.c
1225 list(APPEND VNET_HEADERS
1237 ##############################################################################
1239 ##############################################################################
1241 list(APPEND VNET_SOURCES
1253 list(APPEND VNET_HEADERS
1259 ##############################################################################
1261 ##############################################################################
1263 list(APPEND VNET_SOURCES
1270 list(APPEND VNET_HEADERS
1274 ##############################################################################
1276 ##############################################################################
1278 list(APPEND VNET_SOURCES
1281 qos/qos_egress_map.c
1286 list(APPEND VNET_API_FILES qos/qos.api)
1288 ##############################################################################
1290 ##############################################################################
1292 list(APPEND VNET_SOURCES
1293 bier/bier_bit_string.c
1296 bier/bier_fmask_db.c
1306 bier/bier_imp_node.c
1308 bier/bier_disp_entry.c
1309 bier/bier_disp_lookup_node.c
1310 bier/bier_disp_dispatch_node.c
1311 bier/bier_disp_table.c
1312 bier/bier_bift_table.c
1315 list(APPEND VNET_HEADERS
1322 list(APPEND VNET_API_FILES bier/bier.api)
1324 add_vpp_library(vnet
1325 SOURCES ${VNET_SOURCES}
1326 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1327 INSTALL_HEADERS ${VNET_HEADERS}
1328 API_FILES ${VNET_API_FILES}
1329 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}