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
155 l2/l2_in_out_feat_arc.c
163 list(APPEND VNET_MULTIARCH_SOURCES
169 list(APPEND VNET_HEADERS
186 list(APPEND VNET_API_FILES l2/l2.api)
188 ##############################################################################
189 # Layer 2 protocol: SRP
190 ##############################################################################
191 list(APPEND VNET_SOURCES
198 list(APPEND VNET_HEADERS
203 ##############################################################################
204 # Layer 2 protocol: PPP
205 ##############################################################################
206 list(APPEND VNET_SOURCES
212 list(APPEND VNET_HEADERS
218 ##############################################################################
219 # Layer 2 protocol: HDLC
220 ##############################################################################
221 list(APPEND VNET_SOURCES
227 list(APPEND VNET_HEADERS
233 ##############################################################################
234 # Layer 2 protocol: LLC
235 ##############################################################################
236 list(APPEND VNET_SOURCES
242 list(APPEND VNET_HEADERS
246 ##############################################################################
247 # Layer 2 protocol: SNAP
248 ##############################################################################
249 list(APPEND VNET_SOURCES
255 list(APPEND VNET_HEADERS
259 ##############################################################################
261 ##############################################################################
262 list(APPEND VNET_SOURCES
269 list(APPEND VNET_HEADERS
272 vxlan/vxlan_error.def
275 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
277 list(APPEND VNET_API_FILES vxlan/vxlan.api)
279 ##############################################################################
281 ##############################################################################
282 list(APPEND VNET_SOURCES
289 list(APPEND VNET_HEADERS
291 geneve/geneve_packet.h
292 geneve/geneve_error.def
295 list(APPEND VNET_API_FILES geneve/geneve.api)
297 ##############################################################################
299 ##############################################################################
300 list(APPEND VNET_SOURCES
307 list(APPEND VNET_HEADERS
311 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
312 list(APPEND VNET_API_FILES bonding/bond.api)
314 ##############################################################################
316 ##############################################################################
317 list(APPEND VNET_SOURCES
325 list(APPEND VNET_HEADERS
330 list(APPEND VNET_API_FILES lldp/lldp.api)
332 ##############################################################################
333 # Layer 2/3 "classify"
334 ##############################################################################
335 list(APPEND VNET_SOURCES
336 classify/vnet_classify.c
337 classify/ip_classify.c
338 classify/in_out_acl.c
339 classify/policer_classify.c
340 classify/flow_classify.c
341 classify/flow_classify_node.c
342 classify/vnet_classify.h
343 classify/classify_api.c
346 list(APPEND VNET_HEADERS
347 classify/vnet_classify.h
348 classify/in_out_acl.h
349 classify/policer_classify.h
350 classify/flow_classify.h
353 list(APPEND VNET_API_FILES classify/classify.api)
355 ##############################################################################
356 # Layer 3 protocols go here
357 ##############################################################################
359 ##############################################################################
360 # Layer 3 protocol: IP v4/v6
361 ##############################################################################
362 list(APPEND VNET_SOURCES
375 ip/ip4_source_and_port_range_check.c
376 ip/ip4_source_check.c
402 list(APPEND VNET_HEADERS
415 ip/ip6_hop_by_hop_packet.h
420 ip/ip_source_and_port_range_check.h
429 list(APPEND VNET_API_FILES
435 list(APPEND VNET_MULTIARCH_SOURCES ip/ip4_forward.c ip/ip4_input.c)
437 ##############################################################################
439 ##############################################################################
440 list(APPEND VNET_SOURCES
444 list(APPEND VNET_HEADERS
445 ethernet/arp_packet.h
449 ##############################################################################
450 # Bidirectional Forwarding Detection
451 ##############################################################################
453 list(APPEND VNET_HEADERS
460 list(APPEND VNET_SOURCES
469 list(APPEND VNET_API_FILES bfd/bfd.api)
471 ##############################################################################
472 # Layer 3 protocol: IPSec
473 ##############################################################################
474 list(APPEND VNET_SOURCES
489 ipsec/ikev2_payload.c
494 list(APPEND VNET_API_FILES ipsec/ipsec.api)
496 list(APPEND VNET_SOURCES
500 list(APPEND VNET_HEADERS
508 ##############################################################################
509 # Layer 3 protocol: osi
510 ##############################################################################
511 list(APPEND VNET_SOURCES
517 list(APPEND VNET_HEADERS
521 ##############################################################################
522 # Layer 4 protocol: tcp
523 ##############################################################################
524 list(APPEND VNET_SOURCES
528 tcp/tcp_syn_filter4.c
535 list(APPEND VNET_HEADERS
543 list(APPEND VNET_API_FILES tcp/tcp.api)
545 ##############################################################################
546 # Layer 4 protocol: udp
547 ##############################################################################
548 list(APPEND VNET_SOURCES
559 list(APPEND VNET_HEADERS
565 list(APPEND VNET_API_FILES udp/udp.api)
567 ##############################################################################
568 # Layer 4 protocol: sctp
569 ##############################################################################
570 list(APPEND VNET_SOURCES
579 list(APPEND VNET_HEADERS
586 list(APPEND VNET_API_FILES sctp/sctp.api)
588 ##############################################################################
589 # Tunnel protocol: gre
590 ##############################################################################
591 list(APPEND VNET_SOURCES
599 list(APPEND VNET_HEADERS
605 list(APPEND VNET_API_FILES gre/gre.api)
607 ##############################################################################
608 # Tunnel protocol: ipip
609 ##############################################################################
610 list(APPEND VNET_SOURCES
618 list(APPEND VNET_HEADERS
622 list(APPEND VNET_API_FILES ipip/ipip.api)
624 ##############################################################################
625 # Tunnel protocol: l2tpv3
626 ##############################################################################
627 list(APPEND VNET_SOURCES
635 list(APPEND VNET_HEADERS
640 list(APPEND VNET_API_FILES l2tp/l2tp.api)
642 ##############################################################################
643 # Tunnel protocol: gre+mpls
644 ##############################################################################
645 list(APPEND VNET_SOURCES
657 list(APPEND VNET_HEADERS
665 list(APPEND VNET_API_FILES mpls/mpls.api)
667 ##############################################################################
668 # Tunnel protocol: vxlan-gbp
669 ##############################################################################
670 list(APPEND VNET_SOURCES
673 vxlan-gbp/vxlan_gbp_api.c
674 vxlan-gbp/vxlan_gbp.c
677 list(APPEND VNET_HEADERS
678 vxlan-gbp/vxlan_gbp.h
679 vxlan-gbp/vxlan_gbp_packet.h
680 vxlan-gbp/vxlan_gbp_error.def
683 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
685 ##############################################################################
686 # Tunnel protocol: vxlan-gpe
687 ##############################################################################
689 list(APPEND VNET_SOURCES
690 vxlan-gpe/vxlan_gpe.c
693 vxlan-gpe/vxlan_gpe_api.c
696 list(APPEND VNET_HEADERS
697 vxlan-gpe/vxlan_gpe.h
698 vxlan-gpe/vxlan_gpe_packet.h
699 vxlan-gpe/vxlan_gpe_error.def
702 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
704 ##############################################################################
705 # Tunnel protocol: ipsec+gre
706 ##############################################################################
707 list(APPEND VNET_SOURCES
708 ipsec-gre/ipsec_gre.c
710 ipsec-gre/interface.c
711 ipsec-gre/ipsec_gre_api.c
714 list(APPEND VNET_HEADERS
715 ipsec-gre/ipsec_gre.h
719 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
721 ##############################################################################
722 # LISP control plane: lisp-cp
723 ##############################################################################
725 list(APPEND VNET_SOURCES
727 lisp-cp/lisp_cp_dpo.c
729 lisp-cp/gid_dictionary.c
730 lisp-cp/lisp_msg_serdes.c
738 list(APPEND VNET_HEADERS
741 lisp-cp/gid_dictionary.h
742 lisp-cp/lisp_cp_messages.h
743 lisp-cp/lisp_msg_serdes.h
747 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
748 list(APPEND VNET_API_FILES lisp-cp/one.api)
750 ##############################################################################
751 # Tunnel protocol: lisp-gpe
752 ##############################################################################
754 list(APPEND VNET_SOURCES
756 lisp-gpe/lisp_gpe_sub_interface.c
757 lisp-gpe/lisp_gpe_adjacency.c
758 lisp-gpe/lisp_gpe_tunnel.c
759 lisp-gpe/lisp_gpe_fwd_entry.c
760 lisp-gpe/lisp_gpe_tenant.c
763 lisp-gpe/lisp_gpe_api.c
766 list(APPEND VNET_HEADERS
768 lisp-gpe/lisp_gpe_fwd_entry.h
769 lisp-gpe/lisp_gpe_tenant.h
770 lisp-gpe/lisp_gpe_packet.h
771 lisp-gpe/lisp_gpe_error.def
774 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
776 ##############################################################################
778 ##############################################################################
779 list(APPEND VNET_SOURCES
781 dhcp/dhcp_client_detect.c
782 dhcp/dhcp6_client_common_dp.c
783 dhcp/dhcp6_pd_client_dp.c
784 dhcp/dhcp6_pd_client_cp.c
785 dhcp/dhcp6_ia_na_client_dp.c
786 dhcp/dhcp6_ia_na_client_cp.c
790 list(APPEND VNET_HEADERS
792 dhcp/dhcp6_client_common_dp.h
793 dhcp/dhcp6_pd_client_dp.h
794 dhcp/dhcp6_ia_na_client_dp.h
797 list(APPEND VNET_API_FILES
799 dhcp/dhcp6_pd_client_cp.api
800 dhcp/dhcp6_ia_na_client_cp.api
803 ##############################################################################
805 ##############################################################################
806 list(APPEND VNET_SOURCES
807 dhcp/dhcp6_proxy_node.c
808 dhcp/dhcp4_proxy_node.c
812 list(APPEND VNET_HEADERS
816 dhcp/dhcp6_proxy_error.def
817 dhcp/dhcp4_proxy_error.def
820 ##############################################################################
821 # ipv6 segment routing
822 ##############################################################################
824 list(APPEND VNET_SOURCES
827 srv6/sr_policy_rewrite.c
832 list(APPEND VNET_HEADERS
837 list(APPEND VNET_API_FILES srv6/sr.api)
839 ##############################################################################
840 # mpls segment routing
841 ##############################################################################
843 list(APPEND VNET_SOURCES
844 srmpls/sr_mpls_policy.c
845 srmpls/sr_mpls_steering.c
849 list(APPEND VNET_HEADERS
853 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
855 ##############################################################################
856 # IPFIX / netflow v10
857 ##############################################################################
858 list(APPEND VNET_SOURCES
859 ipfix-export/flow_report.c
860 ipfix-export/flow_api.c
863 list(APPEND VNET_HEADERS
864 ipfix-export/flow_report.h
865 ipfix-export/ipfix_info_elements.h
866 ipfix-export/ipfix_packet.h
869 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
871 ##############################################################################
872 # IPFIX classify code
873 ##############################################################################
875 list(APPEND VNET_SOURCES
876 ipfix-export/flow_report_classify.c
879 list(APPEND VNET_HEADERS
880 ipfix-export/flow_report_classify.h
883 ##############################################################################
885 ##############################################################################
887 list(APPEND VNET_SOURCES
888 lawful-intercept/lawful_intercept.c
889 lawful-intercept/node.c
892 list(APPEND VNET_HEADERS
893 lawful-intercept/lawful_intercept.h
896 ##############################################################################
897 # SPAN (port mirroring)
898 ##############################################################################
900 list(APPEND VNET_SOURCES
906 list(APPEND VNET_HEADERS
910 list(APPEND VNET_API_FILES span/span.api)
912 ##############################################################################
914 ##############################################################################
915 list(APPEND VNET_SOURCES
921 dns/resolver_process.c
924 list(APPEND VNET_HEADERS
928 list(APPEND VNET_API_FILES dns/dns.api)
930 ##############################################################################
932 ##############################################################################
934 list(APPEND VNET_SOURCES
944 list(APPEND VNET_HEADERS
949 list(APPEND VNET_API_FILES pg/pg.api)
951 ##############################################################################
953 ##############################################################################
955 list(APPEND VNET_SOURCES
956 devices/virtio/device.c
957 devices/virtio/node.c
958 devices/virtio/vhost_user.c
959 devices/virtio/vhost_user_input.c
960 devices/virtio/vhost_user_output.c
961 devices/virtio/vhost_user_api.c
962 devices/virtio/virtio.c
965 list(APPEND VNET_HEADERS
966 devices/virtio/virtio.h
967 devices/virtio/vhost_user.h
970 list(APPEND VNET_MULTIARCH_SOURCES
971 devices/virtio/vhost_user_input.c
972 devices/virtio/vhost_user_output.c
975 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
977 ##############################################################################
978 # tap interface (with virtio backend)
979 ##############################################################################
981 list(APPEND VNET_SOURCES
984 devices/tap/tapv2_api.c
987 list(APPEND VNET_HEADERS
991 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
993 ##############################################################################
994 # tap interface (with virtio backend)
995 ##############################################################################
997 list(APPEND VNET_SOURCES
998 devices/pipe/pipe_api.c
1002 list(APPEND VNET_HEADERS
1006 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1008 ##############################################################################
1009 # session managmeent
1010 ##############################################################################
1012 list(APPEND VNET_SOURCES
1014 session/session_table.c
1015 session/session_rules_table.c
1016 session/session_lookup.c
1017 session/session_node.c
1019 session/application.c
1020 session/session_cli.c
1021 session/application_interface.c
1022 session/application_namespace.c
1023 session/segment_manager.c
1024 session/session_test.c
1025 session/session_api.c
1028 list(APPEND VNET_HEADERS
1030 session/session_table.h
1031 session/session_rules_table.h
1032 session/stream_session.h
1033 session/session_lookup.h
1034 session/application.h
1036 session/transport_interface.h
1037 session/application_interface.h
1038 session/application_namespace.h
1039 session/session_debug.h
1040 session/segment_manager.h
1041 session/mma_template.h
1042 session/mma_template.c
1047 list(APPEND VNET_API_FILES session/session.api)
1049 ##############################################################################
1050 # session layer applications
1051 ##############################################################################
1053 list(APPEND VNET_SOURCES
1054 session-apps/echo_client.c
1055 session-apps/echo_server.c
1056 session-apps/http_server.c
1057 session-apps/proxy.c
1060 list(APPEND VNET_HEADERS
1061 session-apps/echo_client.h
1062 session-apps/proxy.h
1065 ##############################################################################
1067 ##############################################################################
1069 list(APPEND VNET_SOURCES
1073 list(APPEND VNET_HEADERS
1077 ##############################################################################
1078 # Linux packet interface
1079 ##############################################################################
1081 list(APPEND VNET_SOURCES
1082 devices/af_packet/af_packet.c
1083 devices/af_packet/device.c
1084 devices/af_packet/node.c
1085 devices/af_packet/cli.c
1086 devices/af_packet/af_packet_api.c
1089 list(APPEND VNET_HEADERS
1090 devices/af_packet/af_packet.h
1093 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1095 ##############################################################################
1097 ##############################################################################
1099 list(APPEND VNET_SOURCES
1100 devices/netmap/netmap.c
1101 devices/netmap/device.c
1102 devices/netmap/node.c
1103 devices/netmap/cli.c
1104 devices/netmap/netmap_api.c
1107 list(APPEND VNET_HEADERS
1108 devices/netmap/netmap.h
1111 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1113 ##############################################################################
1114 # Driver feature graph arc support
1115 ##############################################################################
1117 list(APPEND VNET_SOURCES
1119 feature/feature_api.c
1120 feature/registration.c
1123 list(APPEND VNET_HEADERS
1127 list(APPEND VNET_API_FILES feature/feature.api)
1129 ##############################################################################
1130 # Unix kernel related
1131 ##############################################################################
1133 # FIXME: unix/hgshm.c
1135 list(APPEND VNET_SOURCES
1143 list(APPEND VNET_HEADERS
1149 list(APPEND VNET_API_FILES unix/tap.api)
1151 ##############################################################################
1153 ##############################################################################
1155 list(APPEND VNET_SOURCES
1168 fib/fib_entry_src_rr.c
1169 fib/fib_entry_src_interface.c
1170 fib/fib_entry_src_interpose.c
1171 fib/fib_entry_src_default_route.c
1172 fib/fib_entry_src_special.c
1173 fib/fib_entry_src_api.c
1174 fib/fib_entry_src_adj.c
1175 fib/fib_entry_src_mpls.c
1176 fib/fib_entry_src_lisp.c
1177 fib/fib_entry_cover.c
1178 fib/fib_entry_delegate.c
1183 fib/fib_attached_export.c
1188 list(APPEND VNET_HEADERS
1198 fib/fib_entry_delegate.h
1201 ##############################################################################
1203 ##############################################################################
1205 list(APPEND VNET_SOURCES
1218 list(APPEND VNET_HEADERS
1227 ##############################################################################
1228 # Data-Plane Objects
1229 ##############################################################################
1231 list(APPEND VNET_SOURCES
1239 dpo/load_balance_map.c
1243 dpo/interface_rx_dpo.c
1244 dpo/interface_tx_dpo.c
1245 dpo/mpls_disposition.c
1246 dpo/mpls_label_dpo.c
1251 list(APPEND VNET_HEADERS
1263 ##############################################################################
1265 ##############################################################################
1267 list(APPEND VNET_SOURCES
1279 list(APPEND VNET_HEADERS
1285 ##############################################################################
1287 ##############################################################################
1289 list(APPEND VNET_SOURCES
1296 list(APPEND VNET_HEADERS
1300 ##############################################################################
1302 ##############################################################################
1304 list(APPEND VNET_SOURCES
1307 qos/qos_egress_map.c
1312 list(APPEND VNET_API_FILES qos/qos.api)
1314 ##############################################################################
1316 ##############################################################################
1318 list(APPEND VNET_SOURCES
1319 bier/bier_bit_string.c
1322 bier/bier_fmask_db.c
1332 bier/bier_imp_node.c
1334 bier/bier_disp_entry.c
1335 bier/bier_disp_lookup_node.c
1336 bier/bier_disp_dispatch_node.c
1337 bier/bier_disp_table.c
1338 bier/bier_bift_table.c
1341 list(APPEND VNET_HEADERS
1348 list(APPEND VNET_API_FILES bier/bier.api)
1350 ##############################################################################
1352 ##############################################################################
1354 add_vpp_library(vnet
1355 SOURCES ${VNET_SOURCES}
1356 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1357 INSTALL_HEADERS ${VNET_HEADERS}
1358 API_FILES ${VNET_API_FILES}
1359 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1363 ##############################################################################
1365 ##############################################################################
1367 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1368 if(VPP_BUILD_SESSION_ECHO_APPS)
1369 add_vpp_executable(tcp_echo
1370 SOURCES ../tests/vnet/session/tcp_echo.c
1371 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1375 add_vpp_executable(udp_echo
1376 SOURCES ../tests/vnet/session/udp_echo.c
1377 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1381 endif(VPP_BUILD_SESSION_ECHO_APPS)
1383 ##############################################################################