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_HEADERS
274 vxlan/vxlan_error.def
277 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
279 list(APPEND VNET_API_FILES vxlan/vxlan.api)
281 ##############################################################################
283 ##############################################################################
284 list(APPEND VNET_SOURCES
291 list(APPEND VNET_HEADERS
293 geneve/geneve_packet.h
294 geneve/geneve_error.def
297 list(APPEND VNET_API_FILES geneve/geneve.api)
299 ##############################################################################
301 ##############################################################################
302 list(APPEND VNET_SOURCES
309 list(APPEND VNET_HEADERS
313 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
314 list(APPEND VNET_API_FILES bonding/bond.api)
316 ##############################################################################
318 ##############################################################################
319 list(APPEND VNET_SOURCES
327 list(APPEND VNET_HEADERS
332 list(APPEND VNET_API_FILES lldp/lldp.api)
334 ##############################################################################
335 # Layer 2/3 "classify"
336 ##############################################################################
337 list(APPEND VNET_SOURCES
338 classify/vnet_classify.c
339 classify/ip_classify.c
340 classify/in_out_acl.c
341 classify/policer_classify.c
342 classify/flow_classify.c
343 classify/flow_classify_node.c
344 classify/vnet_classify.h
345 classify/classify_api.c
348 list(APPEND VNET_HEADERS
349 classify/vnet_classify.h
350 classify/in_out_acl.h
351 classify/policer_classify.h
352 classify/flow_classify.h
355 list(APPEND VNET_API_FILES classify/classify.api)
357 ##############################################################################
358 # Layer 3 protocols go here
359 ##############################################################################
361 ##############################################################################
362 # Layer 3 protocol: IP v4/v6
363 ##############################################################################
364 list(APPEND VNET_SOURCES
377 ip/ip4_source_and_port_range_check.c
378 ip/ip4_source_check.c
404 list(APPEND VNET_HEADERS
417 ip/ip6_hop_by_hop_packet.h
422 ip/ip_source_and_port_range_check.h
431 list(APPEND VNET_API_FILES
437 list(APPEND VNET_MULTIARCH_SOURCES
443 ##############################################################################
445 ##############################################################################
446 list(APPEND VNET_SOURCES
450 list(APPEND VNET_HEADERS
451 ethernet/arp_packet.h
455 ##############################################################################
456 # Bidirectional Forwarding Detection
457 ##############################################################################
459 list(APPEND VNET_HEADERS
466 list(APPEND VNET_SOURCES
475 list(APPEND VNET_API_FILES bfd/bfd.api)
477 ##############################################################################
478 # Layer 3 protocol: IPSec
479 ##############################################################################
480 list(APPEND VNET_SOURCES
489 ipsec/ipsec_spd_policy.c
498 list(APPEND VNET_MULTIARCH_SOURCES
508 list(APPEND VNET_API_FILES ipsec/ipsec.api)
510 list(APPEND VNET_SOURCES
514 list(APPEND VNET_HEADERS
517 ipsec/ipsec_spd_policy.h
524 ##############################################################################
525 # Layer 3 protocol: osi
526 ##############################################################################
527 list(APPEND VNET_SOURCES
533 list(APPEND VNET_HEADERS
537 ##############################################################################
538 # Layer 4 protocol: tcp
539 ##############################################################################
540 list(APPEND VNET_SOURCES
544 tcp/tcp_syn_filter4.c
552 list(APPEND VNET_HEADERS
560 list(APPEND VNET_API_FILES tcp/tcp.api)
562 ##############################################################################
563 # Layer 4 protocol: udp
564 ##############################################################################
565 list(APPEND VNET_SOURCES
576 list(APPEND VNET_HEADERS
582 list(APPEND VNET_API_FILES udp/udp.api)
584 ##############################################################################
585 # Layer 4 protocol: sctp
586 ##############################################################################
587 list(APPEND VNET_SOURCES
593 sctp/sctp_output_node.c
597 list(APPEND VNET_MULTIARCH_SOURCES
598 sctp/sctp_output_node.c
602 list(APPEND VNET_HEADERS
609 list(APPEND VNET_API_FILES sctp/sctp.api)
611 ##############################################################################
612 # Tunnel protocol: gre
613 ##############################################################################
614 list(APPEND VNET_SOURCES
622 list(APPEND VNET_MULTIARCH_SOURCES
627 list(APPEND VNET_HEADERS
633 list(APPEND VNET_API_FILES gre/gre.api)
635 ##############################################################################
636 # Tunnel protocol: ipip
637 ##############################################################################
638 list(APPEND VNET_SOURCES
646 list(APPEND VNET_MULTIARCH_SOURCES
650 list(APPEND VNET_HEADERS
654 list(APPEND VNET_API_FILES ipip/ipip.api)
656 ##############################################################################
657 # Tunnel protocol: l2tpv3
658 ##############################################################################
659 list(APPEND VNET_SOURCES
667 list(APPEND VNET_HEADERS
672 list(APPEND VNET_API_FILES l2tp/l2tp.api)
674 ##############################################################################
675 # Tunnel protocol: gre+mpls
676 ##############################################################################
677 list(APPEND VNET_SOURCES
689 list(APPEND VNET_MULTIARCH_SOURCES
696 list(APPEND VNET_HEADERS
704 list(APPEND VNET_API_FILES mpls/mpls.api)
706 ##############################################################################
707 # Tunnel protocol: vxlan-gbp
708 ##############################################################################
709 list(APPEND VNET_SOURCES
712 vxlan-gbp/vxlan_gbp_api.c
713 vxlan-gbp/vxlan_gbp.c
714 vxlan-gbp/vxlan_gbp_packet.c
717 list(APPEND VNET_HEADERS
718 vxlan-gbp/vxlan_gbp.h
719 vxlan-gbp/vxlan_gbp_packet.h
720 vxlan-gbp/vxlan_gbp_error.def
723 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
725 ##############################################################################
726 # Tunnel protocol: vxlan-gpe
727 ##############################################################################
729 list(APPEND VNET_SOURCES
730 vxlan-gpe/vxlan_gpe.c
733 vxlan-gpe/vxlan_gpe_api.c
736 list(APPEND VNET_HEADERS
737 vxlan-gpe/vxlan_gpe.h
738 vxlan-gpe/vxlan_gpe_packet.h
739 vxlan-gpe/vxlan_gpe_error.def
742 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
744 ##############################################################################
745 # Tunnel protocol: ipsec+gre
746 ##############################################################################
747 list(APPEND VNET_SOURCES
748 ipsec-gre/ipsec_gre.c
750 ipsec-gre/interface.c
751 ipsec-gre/ipsec_gre_api.c
754 list(APPEND VNET_HEADERS
755 ipsec-gre/ipsec_gre.h
759 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
761 ##############################################################################
762 # LISP control plane: lisp-cp
763 ##############################################################################
765 list(APPEND VNET_SOURCES
767 lisp-cp/lisp_cp_dpo.c
769 lisp-cp/gid_dictionary.c
770 lisp-cp/lisp_msg_serdes.c
778 list(APPEND VNET_HEADERS
781 lisp-cp/gid_dictionary.h
782 lisp-cp/lisp_cp_messages.h
783 lisp-cp/lisp_msg_serdes.h
787 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
788 list(APPEND VNET_API_FILES lisp-cp/one.api)
790 ##############################################################################
791 # Tunnel protocol: lisp-gpe
792 ##############################################################################
794 list(APPEND VNET_SOURCES
796 lisp-gpe/lisp_gpe_sub_interface.c
797 lisp-gpe/lisp_gpe_adjacency.c
798 lisp-gpe/lisp_gpe_tunnel.c
799 lisp-gpe/lisp_gpe_fwd_entry.c
800 lisp-gpe/lisp_gpe_tenant.c
803 lisp-gpe/lisp_gpe_api.c
806 list(APPEND VNET_HEADERS
808 lisp-gpe/lisp_gpe_fwd_entry.h
809 lisp-gpe/lisp_gpe_tenant.h
810 lisp-gpe/lisp_gpe_packet.h
811 lisp-gpe/lisp_gpe_error.def
814 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
816 ##############################################################################
818 ##############################################################################
819 list(APPEND VNET_SOURCES
821 dhcp/dhcp_client_detect.c
822 dhcp/dhcp6_client_common_dp.c
823 dhcp/dhcp6_pd_client_dp.c
824 dhcp/dhcp6_pd_client_cp.c
825 dhcp/dhcp6_ia_na_client_dp.c
826 dhcp/dhcp6_ia_na_client_cp.c
830 list(APPEND VNET_HEADERS
832 dhcp/dhcp6_client_common_dp.h
833 dhcp/dhcp6_pd_client_dp.h
834 dhcp/dhcp6_ia_na_client_dp.h
837 list(APPEND VNET_API_FILES
839 dhcp/dhcp6_pd_client_cp.api
840 dhcp/dhcp6_ia_na_client_cp.api
843 ##############################################################################
845 ##############################################################################
846 list(APPEND VNET_SOURCES
847 dhcp/dhcp6_proxy_node.c
848 dhcp/dhcp4_proxy_node.c
852 list(APPEND VNET_HEADERS
856 dhcp/dhcp6_proxy_error.def
857 dhcp/dhcp4_proxy_error.def
860 ##############################################################################
861 # ipv6 segment routing
862 ##############################################################################
864 list(APPEND VNET_SOURCES
867 srv6/sr_policy_rewrite.c
872 list(APPEND VNET_HEADERS
877 list(APPEND VNET_API_FILES srv6/sr.api)
879 ##############################################################################
880 # mpls segment routing
881 ##############################################################################
883 list(APPEND VNET_SOURCES
884 srmpls/sr_mpls_policy.c
885 srmpls/sr_mpls_steering.c
889 list(APPEND VNET_HEADERS
893 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
895 ##############################################################################
896 # IPFIX / netflow v10
897 ##############################################################################
898 list(APPEND VNET_SOURCES
899 ipfix-export/flow_report.c
900 ipfix-export/flow_api.c
903 list(APPEND VNET_HEADERS
904 ipfix-export/flow_report.h
905 ipfix-export/ipfix_info_elements.h
906 ipfix-export/ipfix_packet.h
909 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
911 ##############################################################################
912 # IPFIX classify code
913 ##############################################################################
915 list(APPEND VNET_SOURCES
916 ipfix-export/flow_report_classify.c
919 list(APPEND VNET_HEADERS
920 ipfix-export/flow_report_classify.h
923 ##############################################################################
925 ##############################################################################
927 list(APPEND VNET_SOURCES
928 lawful-intercept/lawful_intercept.c
929 lawful-intercept/node.c
932 list(APPEND VNET_HEADERS
933 lawful-intercept/lawful_intercept.h
936 ##############################################################################
937 # SPAN (port mirroring)
938 ##############################################################################
940 list(APPEND VNET_SOURCES
946 list(APPEND VNET_HEADERS
950 list(APPEND VNET_API_FILES span/span.api)
952 ##############################################################################
954 ##############################################################################
955 list(APPEND VNET_SOURCES
961 dns/resolver_process.c
964 list(APPEND VNET_HEADERS
968 list(APPEND VNET_API_FILES dns/dns.api)
970 ##############################################################################
972 ##############################################################################
974 list(APPEND VNET_SOURCES
984 list(APPEND VNET_HEADERS
989 list(APPEND VNET_API_FILES pg/pg.api)
991 ##############################################################################
993 ##############################################################################
995 list(APPEND VNET_SOURCES
996 devices/virtio/device.c
997 devices/virtio/node.c
998 devices/virtio/vhost_user.c
999 devices/virtio/vhost_user_input.c
1000 devices/virtio/vhost_user_output.c
1001 devices/virtio/vhost_user_api.c
1002 devices/virtio/virtio.c
1003 devices/virtio/virtio_api.c
1004 devices/virtio/cli.c
1005 devices/virtio/pci.c
1008 list(APPEND VNET_HEADERS
1009 devices/virtio/pci.h
1010 devices/virtio/virtio.h
1011 devices/virtio/vhost_user.h
1014 list(APPEND VNET_MULTIARCH_SOURCES
1015 devices/virtio/vhost_user_input.c
1016 devices/virtio/vhost_user_output.c
1017 devices/netmap/node.c
1018 devices/virtio/node.c
1019 devices/af_packet/node.c
1022 list(APPEND VNET_API_FILES
1023 devices/virtio/vhost_user.api
1024 devices/virtio/virtio.api
1027 ##############################################################################
1028 # tap interface (with virtio backend)
1029 ##############################################################################
1031 list(APPEND VNET_SOURCES
1034 devices/tap/tapv2_api.c
1037 list(APPEND VNET_HEADERS
1041 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1043 ##############################################################################
1044 # tap interface (with virtio backend)
1045 ##############################################################################
1047 list(APPEND VNET_SOURCES
1048 devices/pipe/pipe_api.c
1052 list(APPEND VNET_HEADERS
1056 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1058 ##############################################################################
1059 # session managmeent
1060 ##############################################################################
1062 list(APPEND VNET_SOURCES
1064 session/session_table.c
1065 session/session_rules_table.c
1066 session/session_lookup.c
1067 session/session_node.c
1069 session/application.c
1070 session/application_worker.c
1071 session/session_cli.c
1072 session/application_interface.c
1073 session/application_local.c
1074 session/application_namespace.c
1075 session/segment_manager.c
1076 session/session_api.c
1079 list(APPEND VNET_HEADERS
1081 session/session_table.h
1082 session/session_rules_table.h
1083 session/session_types.h
1084 session/session_lookup.h
1085 session/application.h
1087 session/transport_types.h
1088 session/application_interface.h
1089 session/application_local.h
1090 session/application_namespace.h
1091 session/session_debug.h
1092 session/segment_manager.h
1093 session/mma_template.h
1094 session/mma_template.c
1099 list(APPEND VNET_API_FILES session/session.api)
1101 ##############################################################################
1102 # session layer applications
1103 ##############################################################################
1105 list(APPEND VNET_SOURCES
1106 session-apps/echo_client.c
1107 session-apps/echo_server.c
1108 session-apps/http_server.c
1109 session-apps/proxy.c
1112 list(APPEND VNET_HEADERS
1113 session-apps/echo_client.h
1114 session-apps/proxy.h
1117 ##############################################################################
1119 ##############################################################################
1121 list(APPEND VNET_SOURCES
1125 list(APPEND VNET_HEADERS
1130 ##############################################################################
1131 # Linux packet interface
1132 ##############################################################################
1134 list(APPEND VNET_SOURCES
1135 devices/af_packet/af_packet.c
1136 devices/af_packet/device.c
1137 devices/af_packet/node.c
1138 devices/af_packet/cli.c
1139 devices/af_packet/af_packet_api.c
1142 list(APPEND VNET_HEADERS
1143 devices/af_packet/af_packet.h
1146 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1148 ##############################################################################
1150 ##############################################################################
1152 list(APPEND VNET_SOURCES
1153 devices/netmap/netmap.c
1154 devices/netmap/device.c
1155 devices/netmap/node.c
1156 devices/netmap/cli.c
1157 devices/netmap/netmap_api.c
1160 list(APPEND VNET_HEADERS
1161 devices/netmap/netmap.h
1164 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1166 ##############################################################################
1167 # Driver feature graph arc support
1168 ##############################################################################
1170 list(APPEND VNET_SOURCES
1172 feature/feature_api.c
1173 feature/registration.c
1176 list(APPEND VNET_HEADERS
1180 list(APPEND VNET_API_FILES feature/feature.api)
1182 ##############################################################################
1183 # Unix kernel related
1184 ##############################################################################
1186 # FIXME: unix/hgshm.c
1188 list(APPEND VNET_SOURCES
1193 list(APPEND VNET_HEADERS
1197 ##############################################################################
1199 ##############################################################################
1201 list(APPEND VNET_SOURCES
1213 fib/fib_entry_src_rr.c
1214 fib/fib_entry_src_interface.c
1215 fib/fib_entry_src_interpose.c
1216 fib/fib_entry_src_default_route.c
1217 fib/fib_entry_src_special.c
1218 fib/fib_entry_src_api.c
1219 fib/fib_entry_src_adj.c
1220 fib/fib_entry_src_mpls.c
1221 fib/fib_entry_src_lisp.c
1222 fib/fib_entry_cover.c
1223 fib/fib_entry_delegate.c
1228 fib/fib_attached_export.c
1233 list(APPEND VNET_HEADERS
1243 fib/fib_entry_delegate.h
1246 ##############################################################################
1248 ##############################################################################
1250 list(APPEND VNET_SOURCES
1263 list(APPEND VNET_MULTIARCH_SOURCES
1268 list(APPEND VNET_HEADERS
1277 ##############################################################################
1278 # Data-Plane Objects
1279 ##############################################################################
1281 list(APPEND VNET_SOURCES
1289 dpo/load_balance_map.c
1293 dpo/interface_rx_dpo.c
1294 dpo/interface_tx_dpo.c
1295 dpo/mpls_disposition.c
1296 dpo/mpls_label_dpo.c
1301 list(APPEND VNET_HEADERS
1313 ##############################################################################
1315 ##############################################################################
1317 list(APPEND VNET_SOURCES
1326 mfib/mfib_entry_cover.c
1327 mfib/mfib_entry_delegate.c
1328 mfib/mfib_entry_src.c
1329 mfib/mfib_entry_src_rr.c
1333 list(APPEND VNET_HEADERS
1339 ##############################################################################
1341 ##############################################################################
1343 list(APPEND VNET_SOURCES
1350 list(APPEND VNET_HEADERS
1354 ##############################################################################
1356 ##############################################################################
1358 list(APPEND VNET_SOURCES
1361 qos/qos_egress_map.c
1363 qos/qos_record_node.c
1368 list(APPEND VNET_MULTIARCH_SOURCES
1369 qos/qos_record_node.c
1373 list(APPEND VNET_API_FILES qos/qos.api)
1375 ##############################################################################
1377 ##############################################################################
1379 list(APPEND VNET_SOURCES
1380 bier/bier_bit_string.c
1383 bier/bier_fmask_db.c
1392 bier/bier_imp_node.c
1394 bier/bier_disp_entry.c
1395 bier/bier_disp_lookup_node.c
1396 bier/bier_disp_dispatch_node.c
1397 bier/bier_disp_table.c
1398 bier/bier_bift_table.c
1401 list(APPEND VNET_MULTIARCH_SOURCES
1402 bier/bier_disp_dispatch_node.c
1403 bier/bier_disp_lookup_node.c
1404 bier/bier_imp_node.c
1407 list(APPEND VNET_HEADERS
1414 list(APPEND VNET_API_FILES bier/bier.api)
1416 ##############################################################################
1418 ##############################################################################
1420 list (APPEND VNET_SOURCES
1426 list(APPEND VNET_HEADERS
1431 list(APPEND VNET_API_FILES syslog/syslog.api)
1433 ##############################################################################
1435 ##############################################################################
1437 add_vpp_library(vnet
1438 SOURCES ${VNET_SOURCES}
1439 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1440 INSTALL_HEADERS ${VNET_HEADERS}
1441 API_FILES ${VNET_API_FILES}
1442 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1446 ##############################################################################
1448 ##############################################################################
1450 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1451 if(VPP_BUILD_SESSION_ECHO_APPS)
1452 add_vpp_executable(tcp_echo
1453 SOURCES ../tests/vnet/session/tcp_echo.c
1454 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1458 add_vpp_executable(udp_echo
1459 SOURCES ../tests/vnet/session/udp_echo.c
1460 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1464 endif(VPP_BUILD_SESSION_ECHO_APPS)
1466 ##############################################################################