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
128 ethernet/mac_address.h
132 ethernet/p2p_ethernet.h
135 list(APPEND VNET_API_FILES ethernet/p2p_ethernet.api)
137 ##############################################################################
138 # Layer 2 protocol: Ethernet bridging
139 ##############################################################################
140 list(APPEND VNET_SOURCES
145 l2/l2_input_classify.c
146 l2/l2_output_classify.c
156 l2/l2_in_out_feat_arc.c
164 list(APPEND VNET_MULTIARCH_SOURCES
171 list(APPEND VNET_HEADERS
188 list(APPEND VNET_API_FILES l2/l2.api)
190 ##############################################################################
191 # Layer 2 protocol: SRP
192 ##############################################################################
193 list(APPEND VNET_SOURCES
200 list(APPEND VNET_HEADERS
205 ##############################################################################
206 # Layer 2 protocol: PPP
207 ##############################################################################
208 list(APPEND VNET_SOURCES
214 list(APPEND VNET_HEADERS
220 ##############################################################################
221 # Layer 2 protocol: HDLC
222 ##############################################################################
223 list(APPEND VNET_SOURCES
229 list(APPEND VNET_HEADERS
235 ##############################################################################
236 # Layer 2 protocol: LLC
237 ##############################################################################
238 list(APPEND VNET_SOURCES
244 list(APPEND VNET_HEADERS
248 ##############################################################################
249 # Layer 2 protocol: SNAP
250 ##############################################################################
251 list(APPEND VNET_SOURCES
257 list(APPEND VNET_HEADERS
261 ##############################################################################
263 ##############################################################################
264 list(APPEND VNET_SOURCES
271 list(APPEND VNET_MULTIARCH_SOURCES
275 list(APPEND VNET_HEADERS
278 vxlan/vxlan_error.def
281 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
283 list(APPEND VNET_API_FILES vxlan/vxlan.api)
285 ##############################################################################
287 ##############################################################################
288 list(APPEND VNET_SOURCES
295 list(APPEND VNET_MULTIARCH_SOURCES
300 list(APPEND VNET_HEADERS
302 geneve/geneve_packet.h
303 geneve/geneve_error.def
306 list(APPEND VNET_API_FILES geneve/geneve.api)
308 ##############################################################################
310 ##############################################################################
311 list(APPEND VNET_SOURCES
318 list(APPEND VNET_HEADERS
322 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
323 list(APPEND VNET_API_FILES bonding/bond.api)
325 ##############################################################################
327 ##############################################################################
328 list(APPEND VNET_SOURCES
336 list(APPEND VNET_HEADERS
341 list(APPEND VNET_API_FILES lldp/lldp.api)
343 ##############################################################################
344 # Layer 2/3 "classify"
345 ##############################################################################
346 list(APPEND VNET_SOURCES
347 classify/vnet_classify.c
348 classify/ip_classify.c
349 classify/in_out_acl.c
350 classify/policer_classify.c
351 classify/flow_classify.c
352 classify/flow_classify_node.c
353 classify/vnet_classify.h
354 classify/classify_api.c
357 list(APPEND VNET_HEADERS
358 classify/vnet_classify.h
359 classify/in_out_acl.h
360 classify/policer_classify.h
361 classify/flow_classify.h
364 list(APPEND VNET_API_FILES classify/classify.api)
366 ##############################################################################
367 # Layer 3 protocols go here
368 ##############################################################################
370 ##############################################################################
371 # Layer 3 protocol: IP v4/v6
372 ##############################################################################
373 list(APPEND VNET_SOURCES
386 ip/ip4_source_and_port_range_check.c
387 ip/ip4_source_check.c
413 list(APPEND VNET_HEADERS
426 ip/ip6_hop_by_hop_packet.h
431 ip/ip_source_and_port_range_check.h
440 list(APPEND VNET_API_FILES
446 list(APPEND VNET_MULTIARCH_SOURCES
452 ##############################################################################
454 ##############################################################################
455 list(APPEND VNET_SOURCES
459 list(APPEND VNET_HEADERS
460 ethernet/arp_packet.h
464 ##############################################################################
465 # Bidirectional Forwarding Detection
466 ##############################################################################
468 list(APPEND VNET_HEADERS
475 list(APPEND VNET_SOURCES
484 list(APPEND VNET_API_FILES bfd/bfd.api)
486 ##############################################################################
487 # Layer 3 protocol: IPSec
488 ##############################################################################
489 list(APPEND VNET_SOURCES
498 ipsec/ipsec_spd_policy.c
507 list(APPEND VNET_MULTIARCH_SOURCES
517 list(APPEND VNET_API_FILES ipsec/ipsec.api)
519 list(APPEND VNET_SOURCES
523 list(APPEND VNET_HEADERS
526 ipsec/ipsec_spd_policy.h
533 ##############################################################################
534 # Layer 3 protocol: osi
535 ##############################################################################
536 list(APPEND VNET_SOURCES
542 list(APPEND VNET_HEADERS
546 ##############################################################################
547 # Layer 4 protocol: tcp
548 ##############################################################################
549 list(APPEND VNET_SOURCES
553 tcp/tcp_syn_filter4.c
561 list(APPEND VNET_HEADERS
569 list(APPEND VNET_API_FILES tcp/tcp.api)
571 ##############################################################################
572 # Layer 4 protocol: udp
573 ##############################################################################
574 list(APPEND VNET_SOURCES
585 list(APPEND VNET_HEADERS
591 list(APPEND VNET_API_FILES udp/udp.api)
593 ##############################################################################
594 # Layer 4 protocol: sctp
595 ##############################################################################
596 list(APPEND VNET_SOURCES
602 sctp/sctp_output_node.c
606 list(APPEND VNET_MULTIARCH_SOURCES
607 sctp/sctp_output_node.c
611 list(APPEND VNET_HEADERS
618 list(APPEND VNET_API_FILES sctp/sctp.api)
620 ##############################################################################
621 # Tunnel protocol: gre
622 ##############################################################################
623 list(APPEND VNET_SOURCES
631 list(APPEND VNET_MULTIARCH_SOURCES
636 list(APPEND VNET_HEADERS
642 list(APPEND VNET_API_FILES gre/gre.api)
644 ##############################################################################
645 # Tunnel protocol: ipip
646 ##############################################################################
647 list(APPEND VNET_SOURCES
655 list(APPEND VNET_MULTIARCH_SOURCES
659 list(APPEND VNET_HEADERS
663 list(APPEND VNET_API_FILES ipip/ipip.api)
665 ##############################################################################
666 # Tunnel protocol: l2tpv3
667 ##############################################################################
668 list(APPEND VNET_SOURCES
676 list(APPEND VNET_HEADERS
681 list(APPEND VNET_API_FILES l2tp/l2tp.api)
683 ##############################################################################
684 # Tunnel protocol: gre+mpls
685 ##############################################################################
686 list(APPEND VNET_SOURCES
698 list(APPEND VNET_MULTIARCH_SOURCES
705 list(APPEND VNET_HEADERS
713 list(APPEND VNET_API_FILES mpls/mpls.api)
715 ##############################################################################
716 # Tunnel protocol: vxlan-gbp
717 ##############################################################################
718 list(APPEND VNET_SOURCES
721 vxlan-gbp/vxlan_gbp_api.c
722 vxlan-gbp/vxlan_gbp.c
723 vxlan-gbp/vxlan_gbp_packet.c
726 list (APPEND VNET_MULTIARCH_SOURCES
731 list(APPEND VNET_HEADERS
732 vxlan-gbp/vxlan_gbp.h
733 vxlan-gbp/vxlan_gbp_packet.h
734 vxlan-gbp/vxlan_gbp_error.def
737 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
739 ##############################################################################
740 # Tunnel protocol: vxlan-gpe
741 ##############################################################################
743 list(APPEND VNET_SOURCES
744 vxlan-gpe/vxlan_gpe.c
747 vxlan-gpe/vxlan_gpe_api.c
750 list (APPEND VNET_MULTIARCH_SOURCES
754 list(APPEND VNET_HEADERS
755 vxlan-gpe/vxlan_gpe.h
756 vxlan-gpe/vxlan_gpe_packet.h
757 vxlan-gpe/vxlan_gpe_error.def
760 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
762 ##############################################################################
763 # Tunnel protocol: ipsec+gre
764 ##############################################################################
765 list(APPEND VNET_SOURCES
766 ipsec-gre/ipsec_gre.c
768 ipsec-gre/interface.c
769 ipsec-gre/ipsec_gre_api.c
772 list(APPEND VNET_HEADERS
773 ipsec-gre/ipsec_gre.h
777 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
779 ##############################################################################
780 # LISP control plane: lisp-cp
781 ##############################################################################
783 list(APPEND VNET_SOURCES
785 lisp-cp/lisp_cp_dpo.c
787 lisp-cp/gid_dictionary.c
788 lisp-cp/lisp_msg_serdes.c
796 list(APPEND VNET_HEADERS
799 lisp-cp/gid_dictionary.h
800 lisp-cp/lisp_cp_messages.h
801 lisp-cp/lisp_msg_serdes.h
805 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
806 list(APPEND VNET_API_FILES lisp-cp/one.api)
808 ##############################################################################
809 # Tunnel protocol: lisp-gpe
810 ##############################################################################
812 list(APPEND VNET_SOURCES
814 lisp-gpe/lisp_gpe_sub_interface.c
815 lisp-gpe/lisp_gpe_adjacency.c
816 lisp-gpe/lisp_gpe_tunnel.c
817 lisp-gpe/lisp_gpe_fwd_entry.c
818 lisp-gpe/lisp_gpe_tenant.c
821 lisp-gpe/lisp_gpe_api.c
824 list(APPEND VNET_HEADERS
826 lisp-gpe/lisp_gpe_fwd_entry.h
827 lisp-gpe/lisp_gpe_tenant.h
828 lisp-gpe/lisp_gpe_packet.h
829 lisp-gpe/lisp_gpe_error.def
832 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
834 ##############################################################################
836 ##############################################################################
837 list(APPEND VNET_SOURCES
839 dhcp/dhcp_client_detect.c
840 dhcp/dhcp6_client_common_dp.c
841 dhcp/dhcp6_pd_client_dp.c
842 dhcp/dhcp6_pd_client_cp.c
843 dhcp/dhcp6_ia_na_client_dp.c
844 dhcp/dhcp6_ia_na_client_cp.c
848 list(APPEND VNET_HEADERS
850 dhcp/dhcp6_client_common_dp.h
851 dhcp/dhcp6_pd_client_dp.h
852 dhcp/dhcp6_ia_na_client_dp.h
855 list(APPEND VNET_API_FILES
857 dhcp/dhcp6_pd_client_cp.api
858 dhcp/dhcp6_ia_na_client_cp.api
861 ##############################################################################
863 ##############################################################################
864 list(APPEND VNET_SOURCES
865 dhcp/dhcp6_proxy_node.c
866 dhcp/dhcp4_proxy_node.c
870 list(APPEND VNET_HEADERS
874 dhcp/dhcp6_proxy_error.def
875 dhcp/dhcp4_proxy_error.def
878 ##############################################################################
879 # ipv6 segment routing
880 ##############################################################################
882 list(APPEND VNET_SOURCES
885 srv6/sr_policy_rewrite.c
890 list(APPEND VNET_HEADERS
895 list(APPEND VNET_API_FILES srv6/sr.api)
897 ##############################################################################
898 # mpls segment routing
899 ##############################################################################
901 list(APPEND VNET_SOURCES
902 srmpls/sr_mpls_policy.c
903 srmpls/sr_mpls_steering.c
907 list(APPEND VNET_HEADERS
911 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
913 ##############################################################################
914 # IPFIX / netflow v10
915 ##############################################################################
916 list(APPEND VNET_SOURCES
917 ipfix-export/flow_report.c
918 ipfix-export/flow_api.c
921 list(APPEND VNET_HEADERS
922 ipfix-export/flow_report.h
923 ipfix-export/ipfix_info_elements.h
924 ipfix-export/ipfix_packet.h
927 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
929 ##############################################################################
930 # IPFIX classify code
931 ##############################################################################
933 list(APPEND VNET_SOURCES
934 ipfix-export/flow_report_classify.c
937 list(APPEND VNET_HEADERS
938 ipfix-export/flow_report_classify.h
941 ##############################################################################
943 ##############################################################################
945 list(APPEND VNET_SOURCES
946 lawful-intercept/lawful_intercept.c
947 lawful-intercept/node.c
950 list(APPEND VNET_HEADERS
951 lawful-intercept/lawful_intercept.h
954 ##############################################################################
955 # SPAN (port mirroring)
956 ##############################################################################
958 list(APPEND VNET_SOURCES
964 list(APPEND VNET_MULTIARCH_SOURCES
968 list(APPEND VNET_HEADERS
972 list(APPEND VNET_API_FILES span/span.api)
974 ##############################################################################
976 ##############################################################################
977 list(APPEND VNET_SOURCES
983 dns/resolver_process.c
986 list(APPEND VNET_HEADERS
990 list(APPEND VNET_API_FILES dns/dns.api)
992 ##############################################################################
994 ##############################################################################
996 list(APPEND VNET_SOURCES
1006 list(APPEND VNET_HEADERS
1011 list(APPEND VNET_API_FILES pg/pg.api)
1013 ##############################################################################
1015 ##############################################################################
1017 list(APPEND VNET_SOURCES
1018 devices/virtio/device.c
1019 devices/virtio/node.c
1020 devices/virtio/vhost_user.c
1021 devices/virtio/vhost_user_input.c
1022 devices/virtio/vhost_user_output.c
1023 devices/virtio/vhost_user_api.c
1024 devices/virtio/virtio.c
1025 devices/virtio/virtio_api.c
1026 devices/virtio/cli.c
1027 devices/virtio/pci.c
1030 list(APPEND VNET_HEADERS
1031 devices/virtio/pci.h
1032 devices/virtio/virtio.h
1033 devices/virtio/vhost_user.h
1036 list(APPEND VNET_MULTIARCH_SOURCES
1037 devices/virtio/vhost_user_input.c
1038 devices/virtio/vhost_user_output.c
1039 devices/netmap/node.c
1040 devices/virtio/node.c
1041 devices/af_packet/node.c
1044 list(APPEND VNET_API_FILES
1045 devices/virtio/vhost_user.api
1046 devices/virtio/virtio.api
1049 ##############################################################################
1050 # tap interface (with virtio backend)
1051 ##############################################################################
1053 list(APPEND VNET_SOURCES
1056 devices/tap/tapv2_api.c
1059 list(APPEND VNET_HEADERS
1063 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1065 ##############################################################################
1066 # tap interface (with virtio backend)
1067 ##############################################################################
1069 list(APPEND VNET_SOURCES
1070 devices/pipe/pipe_api.c
1074 list(APPEND VNET_HEADERS
1078 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1080 ##############################################################################
1081 # session managmeent
1082 ##############################################################################
1084 list(APPEND VNET_SOURCES
1086 session/session_table.c
1087 session/session_rules_table.c
1088 session/session_lookup.c
1089 session/session_node.c
1091 session/application.c
1092 session/application_worker.c
1093 session/session_cli.c
1094 session/application_interface.c
1095 session/application_local.c
1096 session/application_namespace.c
1097 session/segment_manager.c
1098 session/session_api.c
1101 list(APPEND VNET_HEADERS
1103 session/session_table.h
1104 session/session_rules_table.h
1105 session/session_types.h
1106 session/session_lookup.h
1107 session/application.h
1109 session/transport_types.h
1110 session/application_interface.h
1111 session/application_local.h
1112 session/application_namespace.h
1113 session/session_debug.h
1114 session/segment_manager.h
1115 session/mma_template.h
1116 session/mma_template.c
1121 list(APPEND VNET_API_FILES session/session.api)
1123 ##############################################################################
1124 # session layer applications
1125 ##############################################################################
1127 list(APPEND VNET_SOURCES
1128 session-apps/echo_client.c
1129 session-apps/echo_server.c
1130 session-apps/http_server.c
1131 session-apps/proxy.c
1134 list(APPEND VNET_HEADERS
1135 session-apps/echo_client.h
1136 session-apps/proxy.h
1139 ##############################################################################
1141 ##############################################################################
1143 list(APPEND VNET_SOURCES
1147 list(APPEND VNET_HEADERS
1152 ##############################################################################
1153 # Linux packet interface
1154 ##############################################################################
1156 list(APPEND VNET_SOURCES
1157 devices/af_packet/af_packet.c
1158 devices/af_packet/device.c
1159 devices/af_packet/node.c
1160 devices/af_packet/cli.c
1161 devices/af_packet/af_packet_api.c
1164 list(APPEND VNET_HEADERS
1165 devices/af_packet/af_packet.h
1168 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1170 ##############################################################################
1172 ##############################################################################
1174 list(APPEND VNET_SOURCES
1175 devices/netmap/netmap.c
1176 devices/netmap/device.c
1177 devices/netmap/node.c
1178 devices/netmap/cli.c
1179 devices/netmap/netmap_api.c
1182 list(APPEND VNET_HEADERS
1183 devices/netmap/netmap.h
1186 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1188 ##############################################################################
1189 # Driver feature graph arc support
1190 ##############################################################################
1192 list(APPEND VNET_SOURCES
1194 feature/feature_api.c
1195 feature/registration.c
1198 list(APPEND VNET_HEADERS
1202 list(APPEND VNET_API_FILES feature/feature.api)
1204 ##############################################################################
1205 # Unix kernel related
1206 ##############################################################################
1208 # FIXME: unix/hgshm.c
1210 list(APPEND VNET_SOURCES
1215 list(APPEND VNET_HEADERS
1219 ##############################################################################
1221 ##############################################################################
1223 list(APPEND VNET_SOURCES
1235 fib/fib_entry_src_rr.c
1236 fib/fib_entry_src_interface.c
1237 fib/fib_entry_src_interpose.c
1238 fib/fib_entry_src_default_route.c
1239 fib/fib_entry_src_special.c
1240 fib/fib_entry_src_api.c
1241 fib/fib_entry_src_adj.c
1242 fib/fib_entry_src_mpls.c
1243 fib/fib_entry_src_lisp.c
1244 fib/fib_entry_cover.c
1245 fib/fib_entry_delegate.c
1250 fib/fib_attached_export.c
1255 list(APPEND VNET_HEADERS
1265 fib/fib_entry_delegate.h
1268 ##############################################################################
1270 ##############################################################################
1272 list(APPEND VNET_SOURCES
1285 list(APPEND VNET_MULTIARCH_SOURCES
1290 list(APPEND VNET_HEADERS
1299 ##############################################################################
1300 # Data-Plane Objects
1301 ##############################################################################
1303 list(APPEND VNET_SOURCES
1311 dpo/load_balance_map.c
1315 dpo/interface_rx_dpo.c
1316 dpo/interface_tx_dpo.c
1317 dpo/mpls_disposition.c
1318 dpo/mpls_label_dpo.c
1323 list(APPEND VNET_HEADERS
1335 ##############################################################################
1337 ##############################################################################
1339 list(APPEND VNET_SOURCES
1348 mfib/mfib_entry_cover.c
1349 mfib/mfib_entry_delegate.c
1350 mfib/mfib_entry_src.c
1351 mfib/mfib_entry_src_rr.c
1355 list(APPEND VNET_HEADERS
1361 ##############################################################################
1363 ##############################################################################
1365 list(APPEND VNET_SOURCES
1372 list(APPEND VNET_HEADERS
1376 ##############################################################################
1378 ##############################################################################
1380 list(APPEND VNET_SOURCES
1383 qos/qos_egress_map.c
1385 qos/qos_record_node.c
1390 list(APPEND VNET_MULTIARCH_SOURCES
1391 qos/qos_record_node.c
1395 list(APPEND VNET_API_FILES qos/qos.api)
1397 ##############################################################################
1399 ##############################################################################
1401 list(APPEND VNET_SOURCES
1402 bier/bier_bit_string.c
1405 bier/bier_fmask_db.c
1414 bier/bier_imp_node.c
1416 bier/bier_disp_entry.c
1417 bier/bier_disp_lookup_node.c
1418 bier/bier_disp_dispatch_node.c
1419 bier/bier_disp_table.c
1420 bier/bier_bift_table.c
1423 list(APPEND VNET_MULTIARCH_SOURCES
1424 bier/bier_disp_dispatch_node.c
1425 bier/bier_disp_lookup_node.c
1426 bier/bier_imp_node.c
1429 list(APPEND VNET_HEADERS
1436 list(APPEND VNET_API_FILES bier/bier.api)
1438 ##############################################################################
1440 ##############################################################################
1442 list (APPEND VNET_SOURCES
1448 list(APPEND VNET_HEADERS
1453 list(APPEND VNET_API_FILES syslog/syslog.api)
1455 ##############################################################################
1457 ##############################################################################
1459 add_vpp_library(vnet
1460 SOURCES ${VNET_SOURCES}
1461 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1462 INSTALL_HEADERS ${VNET_HEADERS}
1463 API_FILES ${VNET_API_FILES}
1464 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1468 ##############################################################################
1470 ##############################################################################
1472 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1473 if(VPP_BUILD_SESSION_ECHO_APPS)
1474 add_vpp_executable(tcp_echo
1475 SOURCES ../tests/vnet/session/tcp_echo.c
1476 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1480 add_vpp_executable(udp_echo
1481 SOURCES ../tests/vnet/session/udp_echo.c
1482 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1486 endif(VPP_BUILD_SESSION_ECHO_APPS)
1488 ##############################################################################