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 ip/ip4_forward.c ip/ip4_input.c)
439 ##############################################################################
441 ##############################################################################
442 list(APPEND VNET_SOURCES
446 list(APPEND VNET_HEADERS
447 ethernet/arp_packet.h
451 ##############################################################################
452 # Bidirectional Forwarding Detection
453 ##############################################################################
455 list(APPEND VNET_HEADERS
462 list(APPEND VNET_SOURCES
471 list(APPEND VNET_API_FILES bfd/bfd.api)
473 ##############################################################################
474 # Layer 3 protocol: IPSec
475 ##############################################################################
476 list(APPEND VNET_SOURCES
485 ipsec/ipsec_spd_policy.c
494 ipsec/ikev2_payload.c
499 list(APPEND VNET_MULTIARCH_SOURCES
509 list(APPEND VNET_API_FILES ipsec/ipsec.api)
511 list(APPEND VNET_SOURCES
515 list(APPEND VNET_HEADERS
523 ##############################################################################
524 # Layer 3 protocol: osi
525 ##############################################################################
526 list(APPEND VNET_SOURCES
532 list(APPEND VNET_HEADERS
536 ##############################################################################
537 # Layer 4 protocol: tcp
538 ##############################################################################
539 list(APPEND VNET_SOURCES
543 tcp/tcp_syn_filter4.c
551 list(APPEND VNET_HEADERS
559 list(APPEND VNET_API_FILES tcp/tcp.api)
561 ##############################################################################
562 # Layer 4 protocol: udp
563 ##############################################################################
564 list(APPEND VNET_SOURCES
575 list(APPEND VNET_HEADERS
581 list(APPEND VNET_API_FILES udp/udp.api)
583 ##############################################################################
584 # Layer 4 protocol: sctp
585 ##############################################################################
586 list(APPEND VNET_SOURCES
595 list(APPEND VNET_HEADERS
602 list(APPEND VNET_API_FILES sctp/sctp.api)
604 ##############################################################################
605 # Tunnel protocol: gre
606 ##############################################################################
607 list(APPEND VNET_SOURCES
615 list(APPEND VNET_HEADERS
621 list(APPEND VNET_API_FILES gre/gre.api)
623 ##############################################################################
624 # Tunnel protocol: ipip
625 ##############################################################################
626 list(APPEND VNET_SOURCES
634 list(APPEND VNET_HEADERS
638 list(APPEND VNET_API_FILES ipip/ipip.api)
640 ##############################################################################
641 # Tunnel protocol: l2tpv3
642 ##############################################################################
643 list(APPEND VNET_SOURCES
651 list(APPEND VNET_HEADERS
656 list(APPEND VNET_API_FILES l2tp/l2tp.api)
658 ##############################################################################
659 # Tunnel protocol: gre+mpls
660 ##############################################################################
661 list(APPEND VNET_SOURCES
673 list(APPEND VNET_HEADERS
681 list(APPEND VNET_API_FILES mpls/mpls.api)
683 ##############################################################################
684 # Tunnel protocol: vxlan-gbp
685 ##############################################################################
686 list(APPEND VNET_SOURCES
689 vxlan-gbp/vxlan_gbp_api.c
690 vxlan-gbp/vxlan_gbp.c
691 vxlan-gbp/vxlan_gbp_packet.c
694 list(APPEND VNET_HEADERS
695 vxlan-gbp/vxlan_gbp.h
696 vxlan-gbp/vxlan_gbp_packet.h
697 vxlan-gbp/vxlan_gbp_error.def
700 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
702 ##############################################################################
703 # Tunnel protocol: vxlan-gpe
704 ##############################################################################
706 list(APPEND VNET_SOURCES
707 vxlan-gpe/vxlan_gpe.c
710 vxlan-gpe/vxlan_gpe_api.c
713 list(APPEND VNET_HEADERS
714 vxlan-gpe/vxlan_gpe.h
715 vxlan-gpe/vxlan_gpe_packet.h
716 vxlan-gpe/vxlan_gpe_error.def
719 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
721 ##############################################################################
722 # Tunnel protocol: ipsec+gre
723 ##############################################################################
724 list(APPEND VNET_SOURCES
725 ipsec-gre/ipsec_gre.c
727 ipsec-gre/interface.c
728 ipsec-gre/ipsec_gre_api.c
731 list(APPEND VNET_HEADERS
732 ipsec-gre/ipsec_gre.h
736 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
738 ##############################################################################
739 # LISP control plane: lisp-cp
740 ##############################################################################
742 list(APPEND VNET_SOURCES
744 lisp-cp/lisp_cp_dpo.c
746 lisp-cp/gid_dictionary.c
747 lisp-cp/lisp_msg_serdes.c
755 list(APPEND VNET_HEADERS
758 lisp-cp/gid_dictionary.h
759 lisp-cp/lisp_cp_messages.h
760 lisp-cp/lisp_msg_serdes.h
764 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
765 list(APPEND VNET_API_FILES lisp-cp/one.api)
767 ##############################################################################
768 # Tunnel protocol: lisp-gpe
769 ##############################################################################
771 list(APPEND VNET_SOURCES
773 lisp-gpe/lisp_gpe_sub_interface.c
774 lisp-gpe/lisp_gpe_adjacency.c
775 lisp-gpe/lisp_gpe_tunnel.c
776 lisp-gpe/lisp_gpe_fwd_entry.c
777 lisp-gpe/lisp_gpe_tenant.c
780 lisp-gpe/lisp_gpe_api.c
783 list(APPEND VNET_HEADERS
785 lisp-gpe/lisp_gpe_fwd_entry.h
786 lisp-gpe/lisp_gpe_tenant.h
787 lisp-gpe/lisp_gpe_packet.h
788 lisp-gpe/lisp_gpe_error.def
791 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
793 ##############################################################################
795 ##############################################################################
796 list(APPEND VNET_SOURCES
798 dhcp/dhcp_client_detect.c
799 dhcp/dhcp6_client_common_dp.c
800 dhcp/dhcp6_pd_client_dp.c
801 dhcp/dhcp6_pd_client_cp.c
802 dhcp/dhcp6_ia_na_client_dp.c
803 dhcp/dhcp6_ia_na_client_cp.c
807 list(APPEND VNET_HEADERS
809 dhcp/dhcp6_client_common_dp.h
810 dhcp/dhcp6_pd_client_dp.h
811 dhcp/dhcp6_ia_na_client_dp.h
814 list(APPEND VNET_API_FILES
816 dhcp/dhcp6_pd_client_cp.api
817 dhcp/dhcp6_ia_na_client_cp.api
820 ##############################################################################
822 ##############################################################################
823 list(APPEND VNET_SOURCES
824 dhcp/dhcp6_proxy_node.c
825 dhcp/dhcp4_proxy_node.c
829 list(APPEND VNET_HEADERS
833 dhcp/dhcp6_proxy_error.def
834 dhcp/dhcp4_proxy_error.def
837 ##############################################################################
838 # ipv6 segment routing
839 ##############################################################################
841 list(APPEND VNET_SOURCES
844 srv6/sr_policy_rewrite.c
849 list(APPEND VNET_HEADERS
854 list(APPEND VNET_API_FILES srv6/sr.api)
856 ##############################################################################
857 # mpls segment routing
858 ##############################################################################
860 list(APPEND VNET_SOURCES
861 srmpls/sr_mpls_policy.c
862 srmpls/sr_mpls_steering.c
866 list(APPEND VNET_HEADERS
870 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
872 ##############################################################################
873 # IPFIX / netflow v10
874 ##############################################################################
875 list(APPEND VNET_SOURCES
876 ipfix-export/flow_report.c
877 ipfix-export/flow_api.c
880 list(APPEND VNET_HEADERS
881 ipfix-export/flow_report.h
882 ipfix-export/ipfix_info_elements.h
883 ipfix-export/ipfix_packet.h
886 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
888 ##############################################################################
889 # IPFIX classify code
890 ##############################################################################
892 list(APPEND VNET_SOURCES
893 ipfix-export/flow_report_classify.c
896 list(APPEND VNET_HEADERS
897 ipfix-export/flow_report_classify.h
900 ##############################################################################
902 ##############################################################################
904 list(APPEND VNET_SOURCES
905 lawful-intercept/lawful_intercept.c
906 lawful-intercept/node.c
909 list(APPEND VNET_HEADERS
910 lawful-intercept/lawful_intercept.h
913 ##############################################################################
914 # SPAN (port mirroring)
915 ##############################################################################
917 list(APPEND VNET_SOURCES
923 list(APPEND VNET_HEADERS
927 list(APPEND VNET_API_FILES span/span.api)
929 ##############################################################################
931 ##############################################################################
932 list(APPEND VNET_SOURCES
938 dns/resolver_process.c
941 list(APPEND VNET_HEADERS
945 list(APPEND VNET_API_FILES dns/dns.api)
947 ##############################################################################
949 ##############################################################################
951 list(APPEND VNET_SOURCES
961 list(APPEND VNET_HEADERS
966 list(APPEND VNET_API_FILES pg/pg.api)
968 ##############################################################################
970 ##############################################################################
972 list(APPEND VNET_SOURCES
973 devices/virtio/device.c
974 devices/virtio/node.c
975 devices/virtio/vhost_user.c
976 devices/virtio/vhost_user_input.c
977 devices/virtio/vhost_user_output.c
978 devices/virtio/vhost_user_api.c
979 devices/virtio/virtio.c
980 devices/virtio/virtio_api.c
985 list(APPEND VNET_HEADERS
987 devices/virtio/virtio.h
988 devices/virtio/vhost_user.h
991 list(APPEND VNET_MULTIARCH_SOURCES
992 devices/virtio/vhost_user_input.c
993 devices/virtio/vhost_user_output.c
996 list(APPEND VNET_API_FILES
997 devices/virtio/vhost_user.api
998 devices/virtio/virtio.api
1001 ##############################################################################
1002 # tap interface (with virtio backend)
1003 ##############################################################################
1005 list(APPEND VNET_SOURCES
1008 devices/tap/tapv2_api.c
1011 list(APPEND VNET_HEADERS
1015 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1017 ##############################################################################
1018 # tap interface (with virtio backend)
1019 ##############################################################################
1021 list(APPEND VNET_SOURCES
1022 devices/pipe/pipe_api.c
1026 list(APPEND VNET_HEADERS
1030 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1032 ##############################################################################
1033 # session managmeent
1034 ##############################################################################
1036 list(APPEND VNET_SOURCES
1038 session/session_table.c
1039 session/session_rules_table.c
1040 session/session_lookup.c
1041 session/session_node.c
1043 session/application.c
1044 session/application_worker.c
1045 session/session_cli.c
1046 session/application_interface.c
1047 session/application_namespace.c
1048 session/segment_manager.c
1049 session/session_api.c
1052 list(APPEND VNET_HEADERS
1054 session/session_table.h
1055 session/session_rules_table.h
1056 session/session_types.h
1057 session/session_lookup.h
1058 session/application.h
1060 session/transport_types.h
1061 session/application_interface.h
1062 session/application_namespace.h
1063 session/session_debug.h
1064 session/segment_manager.h
1065 session/mma_template.h
1066 session/mma_template.c
1071 list(APPEND VNET_API_FILES session/session.api)
1073 ##############################################################################
1074 # session layer applications
1075 ##############################################################################
1077 list(APPEND VNET_SOURCES
1078 session-apps/echo_client.c
1079 session-apps/echo_server.c
1080 session-apps/http_server.c
1081 session-apps/proxy.c
1084 list(APPEND VNET_HEADERS
1085 session-apps/echo_client.h
1086 session-apps/proxy.h
1089 ##############################################################################
1091 ##############################################################################
1093 list(APPEND VNET_SOURCES
1097 list(APPEND VNET_HEADERS
1102 ##############################################################################
1103 # Linux packet interface
1104 ##############################################################################
1106 list(APPEND VNET_SOURCES
1107 devices/af_packet/af_packet.c
1108 devices/af_packet/device.c
1109 devices/af_packet/node.c
1110 devices/af_packet/cli.c
1111 devices/af_packet/af_packet_api.c
1114 list(APPEND VNET_HEADERS
1115 devices/af_packet/af_packet.h
1118 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1120 ##############################################################################
1122 ##############################################################################
1124 list(APPEND VNET_SOURCES
1125 devices/netmap/netmap.c
1126 devices/netmap/device.c
1127 devices/netmap/node.c
1128 devices/netmap/cli.c
1129 devices/netmap/netmap_api.c
1132 list(APPEND VNET_HEADERS
1133 devices/netmap/netmap.h
1136 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1138 ##############################################################################
1139 # Driver feature graph arc support
1140 ##############################################################################
1142 list(APPEND VNET_SOURCES
1144 feature/feature_api.c
1145 feature/registration.c
1148 list(APPEND VNET_HEADERS
1152 list(APPEND VNET_API_FILES feature/feature.api)
1154 ##############################################################################
1155 # Unix kernel related
1156 ##############################################################################
1158 # FIXME: unix/hgshm.c
1160 list(APPEND VNET_SOURCES
1165 list(APPEND VNET_HEADERS
1169 ##############################################################################
1171 ##############################################################################
1173 list(APPEND VNET_SOURCES
1185 fib/fib_entry_src_rr.c
1186 fib/fib_entry_src_interface.c
1187 fib/fib_entry_src_interpose.c
1188 fib/fib_entry_src_default_route.c
1189 fib/fib_entry_src_special.c
1190 fib/fib_entry_src_api.c
1191 fib/fib_entry_src_adj.c
1192 fib/fib_entry_src_mpls.c
1193 fib/fib_entry_src_lisp.c
1194 fib/fib_entry_cover.c
1195 fib/fib_entry_delegate.c
1200 fib/fib_attached_export.c
1205 list(APPEND VNET_HEADERS
1215 fib/fib_entry_delegate.h
1218 ##############################################################################
1220 ##############################################################################
1222 list(APPEND VNET_SOURCES
1235 list(APPEND VNET_HEADERS
1244 ##############################################################################
1245 # Data-Plane Objects
1246 ##############################################################################
1248 list(APPEND VNET_SOURCES
1256 dpo/load_balance_map.c
1260 dpo/interface_rx_dpo.c
1261 dpo/interface_tx_dpo.c
1262 dpo/mpls_disposition.c
1263 dpo/mpls_label_dpo.c
1268 list(APPEND VNET_HEADERS
1280 ##############################################################################
1282 ##############################################################################
1284 list(APPEND VNET_SOURCES
1293 mfib/mfib_entry_cover.c
1294 mfib/mfib_entry_delegate.c
1295 mfib/mfib_entry_src.c
1296 mfib/mfib_entry_src_rr.c
1300 list(APPEND VNET_HEADERS
1306 ##############################################################################
1308 ##############################################################################
1310 list(APPEND VNET_SOURCES
1317 list(APPEND VNET_HEADERS
1321 ##############################################################################
1323 ##############################################################################
1325 list(APPEND VNET_SOURCES
1328 qos/qos_egress_map.c
1333 list(APPEND VNET_API_FILES qos/qos.api)
1335 ##############################################################################
1337 ##############################################################################
1339 list(APPEND VNET_SOURCES
1340 bier/bier_bit_string.c
1343 bier/bier_fmask_db.c
1352 bier/bier_imp_node.c
1354 bier/bier_disp_entry.c
1355 bier/bier_disp_lookup_node.c
1356 bier/bier_disp_dispatch_node.c
1357 bier/bier_disp_table.c
1358 bier/bier_bift_table.c
1361 list(APPEND VNET_HEADERS
1368 list(APPEND VNET_API_FILES bier/bier.api)
1370 ##############################################################################
1372 ##############################################################################
1374 list (APPEND VNET_SOURCES
1380 list(APPEND VNET_HEADERS
1385 list(APPEND VNET_API_FILES syslog/syslog.api)
1387 ##############################################################################
1389 ##############################################################################
1391 add_vpp_library(vnet
1392 SOURCES ${VNET_SOURCES}
1393 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1394 INSTALL_HEADERS ${VNET_HEADERS}
1395 API_FILES ${VNET_API_FILES}
1396 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1400 ##############################################################################
1402 ##############################################################################
1404 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1405 if(VPP_BUILD_SESSION_ECHO_APPS)
1406 add_vpp_executable(tcp_echo
1407 SOURCES ../tests/vnet/session/tcp_echo.c
1408 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1412 add_vpp_executable(udp_echo
1413 SOURCES ../tests/vnet/session/udp_echo.c
1414 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1418 endif(VPP_BUILD_SESSION_ECHO_APPS)
1420 ##############################################################################