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
682 vxlan-gbp/vxlan_gbp_packet.c
685 list(APPEND VNET_HEADERS
686 vxlan-gbp/vxlan_gbp.h
687 vxlan-gbp/vxlan_gbp_packet.h
688 vxlan-gbp/vxlan_gbp_error.def
691 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
693 ##############################################################################
694 # Tunnel protocol: vxlan-gpe
695 ##############################################################################
697 list(APPEND VNET_SOURCES
698 vxlan-gpe/vxlan_gpe.c
701 vxlan-gpe/vxlan_gpe_api.c
704 list(APPEND VNET_HEADERS
705 vxlan-gpe/vxlan_gpe.h
706 vxlan-gpe/vxlan_gpe_packet.h
707 vxlan-gpe/vxlan_gpe_error.def
710 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
712 ##############################################################################
713 # Tunnel protocol: ipsec+gre
714 ##############################################################################
715 list(APPEND VNET_SOURCES
716 ipsec-gre/ipsec_gre.c
718 ipsec-gre/interface.c
719 ipsec-gre/ipsec_gre_api.c
722 list(APPEND VNET_HEADERS
723 ipsec-gre/ipsec_gre.h
727 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
729 ##############################################################################
730 # LISP control plane: lisp-cp
731 ##############################################################################
733 list(APPEND VNET_SOURCES
735 lisp-cp/lisp_cp_dpo.c
737 lisp-cp/gid_dictionary.c
738 lisp-cp/lisp_msg_serdes.c
746 list(APPEND VNET_HEADERS
749 lisp-cp/gid_dictionary.h
750 lisp-cp/lisp_cp_messages.h
751 lisp-cp/lisp_msg_serdes.h
755 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
756 list(APPEND VNET_API_FILES lisp-cp/one.api)
758 ##############################################################################
759 # Tunnel protocol: lisp-gpe
760 ##############################################################################
762 list(APPEND VNET_SOURCES
764 lisp-gpe/lisp_gpe_sub_interface.c
765 lisp-gpe/lisp_gpe_adjacency.c
766 lisp-gpe/lisp_gpe_tunnel.c
767 lisp-gpe/lisp_gpe_fwd_entry.c
768 lisp-gpe/lisp_gpe_tenant.c
771 lisp-gpe/lisp_gpe_api.c
774 list(APPEND VNET_HEADERS
776 lisp-gpe/lisp_gpe_fwd_entry.h
777 lisp-gpe/lisp_gpe_tenant.h
778 lisp-gpe/lisp_gpe_packet.h
779 lisp-gpe/lisp_gpe_error.def
782 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
784 ##############################################################################
786 ##############################################################################
787 list(APPEND VNET_SOURCES
789 dhcp/dhcp_client_detect.c
790 dhcp/dhcp6_client_common_dp.c
791 dhcp/dhcp6_pd_client_dp.c
792 dhcp/dhcp6_pd_client_cp.c
793 dhcp/dhcp6_ia_na_client_dp.c
794 dhcp/dhcp6_ia_na_client_cp.c
798 list(APPEND VNET_HEADERS
800 dhcp/dhcp6_client_common_dp.h
801 dhcp/dhcp6_pd_client_dp.h
802 dhcp/dhcp6_ia_na_client_dp.h
805 list(APPEND VNET_API_FILES
807 dhcp/dhcp6_pd_client_cp.api
808 dhcp/dhcp6_ia_na_client_cp.api
811 ##############################################################################
813 ##############################################################################
814 list(APPEND VNET_SOURCES
815 dhcp/dhcp6_proxy_node.c
816 dhcp/dhcp4_proxy_node.c
820 list(APPEND VNET_HEADERS
824 dhcp/dhcp6_proxy_error.def
825 dhcp/dhcp4_proxy_error.def
828 ##############################################################################
829 # ipv6 segment routing
830 ##############################################################################
832 list(APPEND VNET_SOURCES
835 srv6/sr_policy_rewrite.c
840 list(APPEND VNET_HEADERS
845 list(APPEND VNET_API_FILES srv6/sr.api)
847 ##############################################################################
848 # mpls segment routing
849 ##############################################################################
851 list(APPEND VNET_SOURCES
852 srmpls/sr_mpls_policy.c
853 srmpls/sr_mpls_steering.c
857 list(APPEND VNET_HEADERS
861 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
863 ##############################################################################
864 # IPFIX / netflow v10
865 ##############################################################################
866 list(APPEND VNET_SOURCES
867 ipfix-export/flow_report.c
868 ipfix-export/flow_api.c
871 list(APPEND VNET_HEADERS
872 ipfix-export/flow_report.h
873 ipfix-export/ipfix_info_elements.h
874 ipfix-export/ipfix_packet.h
877 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
879 ##############################################################################
880 # IPFIX classify code
881 ##############################################################################
883 list(APPEND VNET_SOURCES
884 ipfix-export/flow_report_classify.c
887 list(APPEND VNET_HEADERS
888 ipfix-export/flow_report_classify.h
891 ##############################################################################
893 ##############################################################################
895 list(APPEND VNET_SOURCES
896 lawful-intercept/lawful_intercept.c
897 lawful-intercept/node.c
900 list(APPEND VNET_HEADERS
901 lawful-intercept/lawful_intercept.h
904 ##############################################################################
905 # SPAN (port mirroring)
906 ##############################################################################
908 list(APPEND VNET_SOURCES
914 list(APPEND VNET_HEADERS
918 list(APPEND VNET_API_FILES span/span.api)
920 ##############################################################################
922 ##############################################################################
923 list(APPEND VNET_SOURCES
929 dns/resolver_process.c
932 list(APPEND VNET_HEADERS
936 list(APPEND VNET_API_FILES dns/dns.api)
938 ##############################################################################
940 ##############################################################################
942 list(APPEND VNET_SOURCES
952 list(APPEND VNET_HEADERS
957 list(APPEND VNET_API_FILES pg/pg.api)
959 ##############################################################################
961 ##############################################################################
963 list(APPEND VNET_SOURCES
964 devices/virtio/device.c
965 devices/virtio/node.c
966 devices/virtio/vhost_user.c
967 devices/virtio/vhost_user_input.c
968 devices/virtio/vhost_user_output.c
969 devices/virtio/vhost_user_api.c
970 devices/virtio/virtio.c
973 list(APPEND VNET_HEADERS
974 devices/virtio/virtio.h
975 devices/virtio/vhost_user.h
978 list(APPEND VNET_MULTIARCH_SOURCES
979 devices/virtio/vhost_user_input.c
980 devices/virtio/vhost_user_output.c
983 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
985 ##############################################################################
986 # tap interface (with virtio backend)
987 ##############################################################################
989 list(APPEND VNET_SOURCES
992 devices/tap/tapv2_api.c
995 list(APPEND VNET_HEADERS
999 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1001 ##############################################################################
1002 # tap interface (with virtio backend)
1003 ##############################################################################
1005 list(APPEND VNET_SOURCES
1006 devices/pipe/pipe_api.c
1010 list(APPEND VNET_HEADERS
1014 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1016 ##############################################################################
1017 # session managmeent
1018 ##############################################################################
1020 list(APPEND VNET_SOURCES
1022 session/session_table.c
1023 session/session_rules_table.c
1024 session/session_lookup.c
1025 session/session_node.c
1027 session/application.c
1028 session/session_cli.c
1029 session/application_interface.c
1030 session/application_namespace.c
1031 session/segment_manager.c
1032 session/session_api.c
1035 list(APPEND VNET_HEADERS
1037 session/session_table.h
1038 session/session_rules_table.h
1039 session/stream_session.h
1040 session/session_lookup.h
1041 session/application.h
1043 session/transport_interface.h
1044 session/application_interface.h
1045 session/application_namespace.h
1046 session/session_debug.h
1047 session/segment_manager.h
1048 session/mma_template.h
1049 session/mma_template.c
1054 list(APPEND VNET_API_FILES session/session.api)
1056 ##############################################################################
1057 # session layer applications
1058 ##############################################################################
1060 list(APPEND VNET_SOURCES
1061 session-apps/echo_client.c
1062 session-apps/echo_server.c
1063 session-apps/http_server.c
1064 session-apps/proxy.c
1067 list(APPEND VNET_HEADERS
1068 session-apps/echo_client.h
1069 session-apps/proxy.h
1072 ##############################################################################
1074 ##############################################################################
1076 list(APPEND VNET_SOURCES
1080 list(APPEND VNET_HEADERS
1084 ##############################################################################
1085 # Linux packet interface
1086 ##############################################################################
1088 list(APPEND VNET_SOURCES
1089 devices/af_packet/af_packet.c
1090 devices/af_packet/device.c
1091 devices/af_packet/node.c
1092 devices/af_packet/cli.c
1093 devices/af_packet/af_packet_api.c
1096 list(APPEND VNET_HEADERS
1097 devices/af_packet/af_packet.h
1100 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1102 ##############################################################################
1104 ##############################################################################
1106 list(APPEND VNET_SOURCES
1107 devices/netmap/netmap.c
1108 devices/netmap/device.c
1109 devices/netmap/node.c
1110 devices/netmap/cli.c
1111 devices/netmap/netmap_api.c
1114 list(APPEND VNET_HEADERS
1115 devices/netmap/netmap.h
1118 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1120 ##############################################################################
1121 # Driver feature graph arc support
1122 ##############################################################################
1124 list(APPEND VNET_SOURCES
1126 feature/feature_api.c
1127 feature/registration.c
1130 list(APPEND VNET_HEADERS
1134 list(APPEND VNET_API_FILES feature/feature.api)
1136 ##############################################################################
1137 # Unix kernel related
1138 ##############################################################################
1140 # FIXME: unix/hgshm.c
1142 list(APPEND VNET_SOURCES
1150 list(APPEND VNET_HEADERS
1156 list(APPEND VNET_API_FILES unix/tap.api)
1158 ##############################################################################
1160 ##############################################################################
1162 list(APPEND VNET_SOURCES
1175 fib/fib_entry_src_rr.c
1176 fib/fib_entry_src_interface.c
1177 fib/fib_entry_src_interpose.c
1178 fib/fib_entry_src_default_route.c
1179 fib/fib_entry_src_special.c
1180 fib/fib_entry_src_api.c
1181 fib/fib_entry_src_adj.c
1182 fib/fib_entry_src_mpls.c
1183 fib/fib_entry_src_lisp.c
1184 fib/fib_entry_cover.c
1185 fib/fib_entry_delegate.c
1190 fib/fib_attached_export.c
1195 list(APPEND VNET_HEADERS
1205 fib/fib_entry_delegate.h
1208 ##############################################################################
1210 ##############################################################################
1212 list(APPEND VNET_SOURCES
1225 list(APPEND VNET_HEADERS
1234 ##############################################################################
1235 # Data-Plane Objects
1236 ##############################################################################
1238 list(APPEND VNET_SOURCES
1246 dpo/load_balance_map.c
1250 dpo/interface_rx_dpo.c
1251 dpo/interface_tx_dpo.c
1252 dpo/mpls_disposition.c
1253 dpo/mpls_label_dpo.c
1258 list(APPEND VNET_HEADERS
1270 ##############################################################################
1272 ##############################################################################
1274 list(APPEND VNET_SOURCES
1286 list(APPEND VNET_HEADERS
1292 ##############################################################################
1294 ##############################################################################
1296 list(APPEND VNET_SOURCES
1303 list(APPEND VNET_HEADERS
1307 ##############################################################################
1309 ##############################################################################
1311 list(APPEND VNET_SOURCES
1314 qos/qos_egress_map.c
1319 list(APPEND VNET_API_FILES qos/qos.api)
1321 ##############################################################################
1323 ##############################################################################
1325 list(APPEND VNET_SOURCES
1326 bier/bier_bit_string.c
1329 bier/bier_fmask_db.c
1339 bier/bier_imp_node.c
1341 bier/bier_disp_entry.c
1342 bier/bier_disp_lookup_node.c
1343 bier/bier_disp_dispatch_node.c
1344 bier/bier_disp_table.c
1345 bier/bier_bift_table.c
1348 list(APPEND VNET_HEADERS
1355 list(APPEND VNET_API_FILES bier/bier.api)
1357 ##############################################################################
1359 ##############################################################################
1361 add_vpp_library(vnet
1362 SOURCES ${VNET_SOURCES}
1363 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1364 INSTALL_HEADERS ${VNET_HEADERS}
1365 API_FILES ${VNET_API_FILES}
1366 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1370 ##############################################################################
1372 ##############################################################################
1374 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1375 if(VPP_BUILD_SESSION_ECHO_APPS)
1376 add_vpp_executable(tcp_echo
1377 SOURCES ../tests/vnet/session/tcp_echo.c
1378 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1382 add_vpp_executable(udp_echo
1383 SOURCES ../tests/vnet/session/udp_echo.c
1384 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1388 endif(VPP_BUILD_SESSION_ECHO_APPS)
1390 ##############################################################################