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_MULTIARCH_SOURCES
501 list(APPEND VNET_API_FILES ipsec/ipsec.api)
503 list(APPEND VNET_SOURCES
507 list(APPEND VNET_HEADERS
515 ##############################################################################
516 # Layer 3 protocol: osi
517 ##############################################################################
518 list(APPEND VNET_SOURCES
524 list(APPEND VNET_HEADERS
528 ##############################################################################
529 # Layer 4 protocol: tcp
530 ##############################################################################
531 list(APPEND VNET_SOURCES
535 tcp/tcp_syn_filter4.c
542 list(APPEND VNET_HEADERS
550 list(APPEND VNET_API_FILES tcp/tcp.api)
552 ##############################################################################
553 # Layer 4 protocol: udp
554 ##############################################################################
555 list(APPEND VNET_SOURCES
566 list(APPEND VNET_HEADERS
572 list(APPEND VNET_API_FILES udp/udp.api)
574 ##############################################################################
575 # Layer 4 protocol: sctp
576 ##############################################################################
577 list(APPEND VNET_SOURCES
586 list(APPEND VNET_HEADERS
593 list(APPEND VNET_API_FILES sctp/sctp.api)
595 ##############################################################################
596 # Tunnel protocol: gre
597 ##############################################################################
598 list(APPEND VNET_SOURCES
606 list(APPEND VNET_HEADERS
612 list(APPEND VNET_API_FILES gre/gre.api)
614 ##############################################################################
615 # Tunnel protocol: ipip
616 ##############################################################################
617 list(APPEND VNET_SOURCES
625 list(APPEND VNET_HEADERS
629 list(APPEND VNET_API_FILES ipip/ipip.api)
631 ##############################################################################
632 # Tunnel protocol: l2tpv3
633 ##############################################################################
634 list(APPEND VNET_SOURCES
642 list(APPEND VNET_HEADERS
647 list(APPEND VNET_API_FILES l2tp/l2tp.api)
649 ##############################################################################
650 # Tunnel protocol: gre+mpls
651 ##############################################################################
652 list(APPEND VNET_SOURCES
664 list(APPEND VNET_HEADERS
672 list(APPEND VNET_API_FILES mpls/mpls.api)
674 ##############################################################################
675 # Tunnel protocol: vxlan-gbp
676 ##############################################################################
677 list(APPEND VNET_SOURCES
680 vxlan-gbp/vxlan_gbp_api.c
681 vxlan-gbp/vxlan_gbp.c
684 list(APPEND VNET_HEADERS
685 vxlan-gbp/vxlan_gbp.h
686 vxlan-gbp/vxlan_gbp_packet.h
687 vxlan-gbp/vxlan_gbp_error.def
690 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
692 ##############################################################################
693 # Tunnel protocol: vxlan-gpe
694 ##############################################################################
696 list(APPEND VNET_SOURCES
697 vxlan-gpe/vxlan_gpe.c
700 vxlan-gpe/vxlan_gpe_api.c
703 list(APPEND VNET_HEADERS
704 vxlan-gpe/vxlan_gpe.h
705 vxlan-gpe/vxlan_gpe_packet.h
706 vxlan-gpe/vxlan_gpe_error.def
709 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
711 ##############################################################################
712 # Tunnel protocol: ipsec+gre
713 ##############################################################################
714 list(APPEND VNET_SOURCES
715 ipsec-gre/ipsec_gre.c
717 ipsec-gre/interface.c
718 ipsec-gre/ipsec_gre_api.c
721 list(APPEND VNET_HEADERS
722 ipsec-gre/ipsec_gre.h
726 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
728 ##############################################################################
729 # LISP control plane: lisp-cp
730 ##############################################################################
732 list(APPEND VNET_SOURCES
734 lisp-cp/lisp_cp_dpo.c
736 lisp-cp/gid_dictionary.c
737 lisp-cp/lisp_msg_serdes.c
745 list(APPEND VNET_HEADERS
748 lisp-cp/gid_dictionary.h
749 lisp-cp/lisp_cp_messages.h
750 lisp-cp/lisp_msg_serdes.h
754 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
755 list(APPEND VNET_API_FILES lisp-cp/one.api)
757 ##############################################################################
758 # Tunnel protocol: lisp-gpe
759 ##############################################################################
761 list(APPEND VNET_SOURCES
763 lisp-gpe/lisp_gpe_sub_interface.c
764 lisp-gpe/lisp_gpe_adjacency.c
765 lisp-gpe/lisp_gpe_tunnel.c
766 lisp-gpe/lisp_gpe_fwd_entry.c
767 lisp-gpe/lisp_gpe_tenant.c
770 lisp-gpe/lisp_gpe_api.c
773 list(APPEND VNET_HEADERS
775 lisp-gpe/lisp_gpe_fwd_entry.h
776 lisp-gpe/lisp_gpe_tenant.h
777 lisp-gpe/lisp_gpe_packet.h
778 lisp-gpe/lisp_gpe_error.def
781 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
783 ##############################################################################
785 ##############################################################################
786 list(APPEND VNET_SOURCES
788 dhcp/dhcp_client_detect.c
789 dhcp/dhcp6_client_common_dp.c
790 dhcp/dhcp6_pd_client_dp.c
791 dhcp/dhcp6_pd_client_cp.c
792 dhcp/dhcp6_ia_na_client_dp.c
793 dhcp/dhcp6_ia_na_client_cp.c
797 list(APPEND VNET_HEADERS
799 dhcp/dhcp6_client_common_dp.h
800 dhcp/dhcp6_pd_client_dp.h
801 dhcp/dhcp6_ia_na_client_dp.h
804 list(APPEND VNET_API_FILES
806 dhcp/dhcp6_pd_client_cp.api
807 dhcp/dhcp6_ia_na_client_cp.api
810 ##############################################################################
812 ##############################################################################
813 list(APPEND VNET_SOURCES
814 dhcp/dhcp6_proxy_node.c
815 dhcp/dhcp4_proxy_node.c
819 list(APPEND VNET_HEADERS
823 dhcp/dhcp6_proxy_error.def
824 dhcp/dhcp4_proxy_error.def
827 ##############################################################################
828 # ipv6 segment routing
829 ##############################################################################
831 list(APPEND VNET_SOURCES
834 srv6/sr_policy_rewrite.c
839 list(APPEND VNET_HEADERS
844 list(APPEND VNET_API_FILES srv6/sr.api)
846 ##############################################################################
847 # mpls segment routing
848 ##############################################################################
850 list(APPEND VNET_SOURCES
851 srmpls/sr_mpls_policy.c
852 srmpls/sr_mpls_steering.c
856 list(APPEND VNET_HEADERS
860 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
862 ##############################################################################
863 # IPFIX / netflow v10
864 ##############################################################################
865 list(APPEND VNET_SOURCES
866 ipfix-export/flow_report.c
867 ipfix-export/flow_api.c
870 list(APPEND VNET_HEADERS
871 ipfix-export/flow_report.h
872 ipfix-export/ipfix_info_elements.h
873 ipfix-export/ipfix_packet.h
876 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
878 ##############################################################################
879 # IPFIX classify code
880 ##############################################################################
882 list(APPEND VNET_SOURCES
883 ipfix-export/flow_report_classify.c
886 list(APPEND VNET_HEADERS
887 ipfix-export/flow_report_classify.h
890 ##############################################################################
892 ##############################################################################
894 list(APPEND VNET_SOURCES
895 lawful-intercept/lawful_intercept.c
896 lawful-intercept/node.c
899 list(APPEND VNET_HEADERS
900 lawful-intercept/lawful_intercept.h
903 ##############################################################################
904 # SPAN (port mirroring)
905 ##############################################################################
907 list(APPEND VNET_SOURCES
913 list(APPEND VNET_HEADERS
917 list(APPEND VNET_API_FILES span/span.api)
919 ##############################################################################
921 ##############################################################################
922 list(APPEND VNET_SOURCES
928 dns/resolver_process.c
931 list(APPEND VNET_HEADERS
935 list(APPEND VNET_API_FILES dns/dns.api)
937 ##############################################################################
939 ##############################################################################
941 list(APPEND VNET_SOURCES
951 list(APPEND VNET_HEADERS
956 list(APPEND VNET_API_FILES pg/pg.api)
958 ##############################################################################
960 ##############################################################################
962 list(APPEND VNET_SOURCES
963 devices/virtio/device.c
964 devices/virtio/node.c
965 devices/virtio/vhost_user.c
966 devices/virtio/vhost_user_input.c
967 devices/virtio/vhost_user_output.c
968 devices/virtio/vhost_user_api.c
969 devices/virtio/virtio.c
972 list(APPEND VNET_HEADERS
973 devices/virtio/virtio.h
974 devices/virtio/vhost_user.h
977 list(APPEND VNET_MULTIARCH_SOURCES
978 devices/virtio/vhost_user_input.c
979 devices/virtio/vhost_user_output.c
982 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
984 ##############################################################################
985 # tap interface (with virtio backend)
986 ##############################################################################
988 list(APPEND VNET_SOURCES
991 devices/tap/tapv2_api.c
994 list(APPEND VNET_HEADERS
998 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1000 ##############################################################################
1001 # tap interface (with virtio backend)
1002 ##############################################################################
1004 list(APPEND VNET_SOURCES
1005 devices/pipe/pipe_api.c
1009 list(APPEND VNET_HEADERS
1013 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1015 ##############################################################################
1016 # session managmeent
1017 ##############################################################################
1019 list(APPEND VNET_SOURCES
1021 session/session_table.c
1022 session/session_rules_table.c
1023 session/session_lookup.c
1024 session/session_node.c
1026 session/application.c
1027 session/session_cli.c
1028 session/application_interface.c
1029 session/application_namespace.c
1030 session/segment_manager.c
1031 session/session_api.c
1034 list(APPEND VNET_HEADERS
1036 session/session_table.h
1037 session/session_rules_table.h
1038 session/stream_session.h
1039 session/session_lookup.h
1040 session/application.h
1042 session/transport_interface.h
1043 session/application_interface.h
1044 session/application_namespace.h
1045 session/session_debug.h
1046 session/segment_manager.h
1047 session/mma_template.h
1048 session/mma_template.c
1053 list(APPEND VNET_API_FILES session/session.api)
1055 ##############################################################################
1056 # session layer applications
1057 ##############################################################################
1059 list(APPEND VNET_SOURCES
1060 session-apps/echo_client.c
1061 session-apps/echo_server.c
1062 session-apps/http_server.c
1063 session-apps/proxy.c
1066 list(APPEND VNET_HEADERS
1067 session-apps/echo_client.h
1068 session-apps/proxy.h
1071 ##############################################################################
1073 ##############################################################################
1075 list(APPEND VNET_SOURCES
1079 list(APPEND VNET_HEADERS
1083 ##############################################################################
1084 # Linux packet interface
1085 ##############################################################################
1087 list(APPEND VNET_SOURCES
1088 devices/af_packet/af_packet.c
1089 devices/af_packet/device.c
1090 devices/af_packet/node.c
1091 devices/af_packet/cli.c
1092 devices/af_packet/af_packet_api.c
1095 list(APPEND VNET_HEADERS
1096 devices/af_packet/af_packet.h
1099 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1101 ##############################################################################
1103 ##############################################################################
1105 list(APPEND VNET_SOURCES
1106 devices/netmap/netmap.c
1107 devices/netmap/device.c
1108 devices/netmap/node.c
1109 devices/netmap/cli.c
1110 devices/netmap/netmap_api.c
1113 list(APPEND VNET_HEADERS
1114 devices/netmap/netmap.h
1117 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1119 ##############################################################################
1120 # Driver feature graph arc support
1121 ##############################################################################
1123 list(APPEND VNET_SOURCES
1125 feature/feature_api.c
1126 feature/registration.c
1129 list(APPEND VNET_HEADERS
1133 list(APPEND VNET_API_FILES feature/feature.api)
1135 ##############################################################################
1136 # Unix kernel related
1137 ##############################################################################
1139 # FIXME: unix/hgshm.c
1141 list(APPEND VNET_SOURCES
1149 list(APPEND VNET_HEADERS
1155 list(APPEND VNET_API_FILES unix/tap.api)
1157 ##############################################################################
1159 ##############################################################################
1161 list(APPEND VNET_SOURCES
1174 fib/fib_entry_src_rr.c
1175 fib/fib_entry_src_interface.c
1176 fib/fib_entry_src_interpose.c
1177 fib/fib_entry_src_default_route.c
1178 fib/fib_entry_src_special.c
1179 fib/fib_entry_src_api.c
1180 fib/fib_entry_src_adj.c
1181 fib/fib_entry_src_mpls.c
1182 fib/fib_entry_src_lisp.c
1183 fib/fib_entry_cover.c
1184 fib/fib_entry_delegate.c
1189 fib/fib_attached_export.c
1194 list(APPEND VNET_HEADERS
1204 fib/fib_entry_delegate.h
1207 ##############################################################################
1209 ##############################################################################
1211 list(APPEND VNET_SOURCES
1224 list(APPEND VNET_HEADERS
1233 ##############################################################################
1234 # Data-Plane Objects
1235 ##############################################################################
1237 list(APPEND VNET_SOURCES
1245 dpo/load_balance_map.c
1249 dpo/interface_rx_dpo.c
1250 dpo/interface_tx_dpo.c
1251 dpo/mpls_disposition.c
1252 dpo/mpls_label_dpo.c
1257 list(APPEND VNET_HEADERS
1269 ##############################################################################
1271 ##############################################################################
1273 list(APPEND VNET_SOURCES
1285 list(APPEND VNET_HEADERS
1291 ##############################################################################
1293 ##############################################################################
1295 list(APPEND VNET_SOURCES
1302 list(APPEND VNET_HEADERS
1306 ##############################################################################
1308 ##############################################################################
1310 list(APPEND VNET_SOURCES
1313 qos/qos_egress_map.c
1318 list(APPEND VNET_API_FILES qos/qos.api)
1320 ##############################################################################
1322 ##############################################################################
1324 list(APPEND VNET_SOURCES
1325 bier/bier_bit_string.c
1328 bier/bier_fmask_db.c
1338 bier/bier_imp_node.c
1340 bier/bier_disp_entry.c
1341 bier/bier_disp_lookup_node.c
1342 bier/bier_disp_dispatch_node.c
1343 bier/bier_disp_table.c
1344 bier/bier_bift_table.c
1347 list(APPEND VNET_HEADERS
1354 list(APPEND VNET_API_FILES bier/bier.api)
1356 ##############################################################################
1358 ##############################################################################
1360 add_vpp_library(vnet
1361 SOURCES ${VNET_SOURCES}
1362 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1363 INSTALL_HEADERS ${VNET_HEADERS}
1364 API_FILES ${VNET_API_FILES}
1365 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1369 ##############################################################################
1371 ##############################################################################
1373 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1374 if(VPP_BUILD_SESSION_ECHO_APPS)
1375 add_vpp_executable(tcp_echo
1376 SOURCES ../tests/vnet/session/tcp_echo.c
1377 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1381 add_vpp_executable(udp_echo
1382 SOURCES ../tests/vnet/session/udp_echo.c
1383 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1387 endif(VPP_BUILD_SESSION_ECHO_APPS)
1389 ##############################################################################