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
170 list(APPEND VNET_HEADERS
187 list(APPEND VNET_API_FILES l2/l2.api)
189 ##############################################################################
190 # Layer 2 protocol: SRP
191 ##############################################################################
192 list(APPEND VNET_SOURCES
199 list(APPEND VNET_HEADERS
204 ##############################################################################
205 # Layer 2 protocol: PPP
206 ##############################################################################
207 list(APPEND VNET_SOURCES
213 list(APPEND VNET_HEADERS
219 ##############################################################################
220 # Layer 2 protocol: HDLC
221 ##############################################################################
222 list(APPEND VNET_SOURCES
228 list(APPEND VNET_HEADERS
234 ##############################################################################
235 # Layer 2 protocol: LLC
236 ##############################################################################
237 list(APPEND VNET_SOURCES
243 list(APPEND VNET_HEADERS
247 ##############################################################################
248 # Layer 2 protocol: SNAP
249 ##############################################################################
250 list(APPEND VNET_SOURCES
256 list(APPEND VNET_HEADERS
260 ##############################################################################
262 ##############################################################################
263 list(APPEND VNET_SOURCES
270 list(APPEND VNET_HEADERS
273 vxlan/vxlan_error.def
276 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
278 list(APPEND VNET_API_FILES vxlan/vxlan.api)
280 ##############################################################################
282 ##############################################################################
283 list(APPEND VNET_SOURCES
290 list(APPEND VNET_HEADERS
292 geneve/geneve_packet.h
293 geneve/geneve_error.def
296 list(APPEND VNET_API_FILES geneve/geneve.api)
298 ##############################################################################
300 ##############################################################################
301 list(APPEND VNET_SOURCES
308 list(APPEND VNET_HEADERS
312 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
313 list(APPEND VNET_API_FILES bonding/bond.api)
315 ##############################################################################
317 ##############################################################################
318 list(APPEND VNET_SOURCES
326 list(APPEND VNET_HEADERS
331 list(APPEND VNET_API_FILES lldp/lldp.api)
333 ##############################################################################
334 # Layer 2/3 "classify"
335 ##############################################################################
336 list(APPEND VNET_SOURCES
337 classify/vnet_classify.c
338 classify/ip_classify.c
339 classify/in_out_acl.c
340 classify/policer_classify.c
341 classify/flow_classify.c
342 classify/flow_classify_node.c
343 classify/vnet_classify.h
344 classify/classify_api.c
347 list(APPEND VNET_HEADERS
348 classify/vnet_classify.h
349 classify/in_out_acl.h
350 classify/policer_classify.h
351 classify/flow_classify.h
354 list(APPEND VNET_API_FILES classify/classify.api)
356 ##############################################################################
357 # Layer 3 protocols go here
358 ##############################################################################
360 ##############################################################################
361 # Layer 3 protocol: IP v4/v6
362 ##############################################################################
363 list(APPEND VNET_SOURCES
376 ip/ip4_source_and_port_range_check.c
377 ip/ip4_source_check.c
403 list(APPEND VNET_HEADERS
416 ip/ip6_hop_by_hop_packet.h
421 ip/ip_source_and_port_range_check.h
430 list(APPEND VNET_API_FILES
436 list(APPEND VNET_MULTIARCH_SOURCES ip/ip4_forward.c ip/ip4_input.c)
438 ##############################################################################
440 ##############################################################################
441 list(APPEND VNET_SOURCES
445 list(APPEND VNET_HEADERS
446 ethernet/arp_packet.h
450 ##############################################################################
451 # Bidirectional Forwarding Detection
452 ##############################################################################
454 list(APPEND VNET_HEADERS
461 list(APPEND VNET_SOURCES
470 list(APPEND VNET_API_FILES bfd/bfd.api)
472 ##############################################################################
473 # Layer 3 protocol: IPSec
474 ##############################################################################
475 list(APPEND VNET_SOURCES
490 ipsec/ikev2_payload.c
495 list(APPEND VNET_MULTIARCH_SOURCES
502 list(APPEND VNET_API_FILES ipsec/ipsec.api)
504 list(APPEND VNET_SOURCES
508 list(APPEND VNET_HEADERS
516 ##############################################################################
517 # Layer 3 protocol: osi
518 ##############################################################################
519 list(APPEND VNET_SOURCES
525 list(APPEND VNET_HEADERS
529 ##############################################################################
530 # Layer 4 protocol: tcp
531 ##############################################################################
532 list(APPEND VNET_SOURCES
536 tcp/tcp_syn_filter4.c
543 list(APPEND VNET_HEADERS
551 list(APPEND VNET_API_FILES tcp/tcp.api)
553 ##############################################################################
554 # Layer 4 protocol: udp
555 ##############################################################################
556 list(APPEND VNET_SOURCES
567 list(APPEND VNET_HEADERS
573 list(APPEND VNET_API_FILES udp/udp.api)
575 ##############################################################################
576 # Layer 4 protocol: sctp
577 ##############################################################################
578 list(APPEND VNET_SOURCES
587 list(APPEND VNET_HEADERS
594 list(APPEND VNET_API_FILES sctp/sctp.api)
596 ##############################################################################
597 # Tunnel protocol: gre
598 ##############################################################################
599 list(APPEND VNET_SOURCES
607 list(APPEND VNET_HEADERS
613 list(APPEND VNET_API_FILES gre/gre.api)
615 ##############################################################################
616 # Tunnel protocol: ipip
617 ##############################################################################
618 list(APPEND VNET_SOURCES
626 list(APPEND VNET_HEADERS
630 list(APPEND VNET_API_FILES ipip/ipip.api)
632 ##############################################################################
633 # Tunnel protocol: l2tpv3
634 ##############################################################################
635 list(APPEND VNET_SOURCES
643 list(APPEND VNET_HEADERS
648 list(APPEND VNET_API_FILES l2tp/l2tp.api)
650 ##############################################################################
651 # Tunnel protocol: gre+mpls
652 ##############################################################################
653 list(APPEND VNET_SOURCES
665 list(APPEND VNET_HEADERS
673 list(APPEND VNET_API_FILES mpls/mpls.api)
675 ##############################################################################
676 # Tunnel protocol: vxlan-gbp
677 ##############################################################################
678 list(APPEND VNET_SOURCES
681 vxlan-gbp/vxlan_gbp_api.c
682 vxlan-gbp/vxlan_gbp.c
683 vxlan-gbp/vxlan_gbp_packet.c
686 list(APPEND VNET_HEADERS
687 vxlan-gbp/vxlan_gbp.h
688 vxlan-gbp/vxlan_gbp_packet.h
689 vxlan-gbp/vxlan_gbp_error.def
692 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
694 ##############################################################################
695 # Tunnel protocol: vxlan-gpe
696 ##############################################################################
698 list(APPEND VNET_SOURCES
699 vxlan-gpe/vxlan_gpe.c
702 vxlan-gpe/vxlan_gpe_api.c
705 list(APPEND VNET_HEADERS
706 vxlan-gpe/vxlan_gpe.h
707 vxlan-gpe/vxlan_gpe_packet.h
708 vxlan-gpe/vxlan_gpe_error.def
711 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
713 ##############################################################################
714 # Tunnel protocol: ipsec+gre
715 ##############################################################################
716 list(APPEND VNET_SOURCES
717 ipsec-gre/ipsec_gre.c
719 ipsec-gre/interface.c
720 ipsec-gre/ipsec_gre_api.c
723 list(APPEND VNET_HEADERS
724 ipsec-gre/ipsec_gre.h
728 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
730 ##############################################################################
731 # LISP control plane: lisp-cp
732 ##############################################################################
734 list(APPEND VNET_SOURCES
736 lisp-cp/lisp_cp_dpo.c
738 lisp-cp/gid_dictionary.c
739 lisp-cp/lisp_msg_serdes.c
747 list(APPEND VNET_HEADERS
750 lisp-cp/gid_dictionary.h
751 lisp-cp/lisp_cp_messages.h
752 lisp-cp/lisp_msg_serdes.h
756 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
757 list(APPEND VNET_API_FILES lisp-cp/one.api)
759 ##############################################################################
760 # Tunnel protocol: lisp-gpe
761 ##############################################################################
763 list(APPEND VNET_SOURCES
765 lisp-gpe/lisp_gpe_sub_interface.c
766 lisp-gpe/lisp_gpe_adjacency.c
767 lisp-gpe/lisp_gpe_tunnel.c
768 lisp-gpe/lisp_gpe_fwd_entry.c
769 lisp-gpe/lisp_gpe_tenant.c
772 lisp-gpe/lisp_gpe_api.c
775 list(APPEND VNET_HEADERS
777 lisp-gpe/lisp_gpe_fwd_entry.h
778 lisp-gpe/lisp_gpe_tenant.h
779 lisp-gpe/lisp_gpe_packet.h
780 lisp-gpe/lisp_gpe_error.def
783 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
785 ##############################################################################
787 ##############################################################################
788 list(APPEND VNET_SOURCES
790 dhcp/dhcp_client_detect.c
791 dhcp/dhcp6_client_common_dp.c
792 dhcp/dhcp6_pd_client_dp.c
793 dhcp/dhcp6_pd_client_cp.c
794 dhcp/dhcp6_ia_na_client_dp.c
795 dhcp/dhcp6_ia_na_client_cp.c
799 list(APPEND VNET_HEADERS
801 dhcp/dhcp6_client_common_dp.h
802 dhcp/dhcp6_pd_client_dp.h
803 dhcp/dhcp6_ia_na_client_dp.h
806 list(APPEND VNET_API_FILES
808 dhcp/dhcp6_pd_client_cp.api
809 dhcp/dhcp6_ia_na_client_cp.api
812 ##############################################################################
814 ##############################################################################
815 list(APPEND VNET_SOURCES
816 dhcp/dhcp6_proxy_node.c
817 dhcp/dhcp4_proxy_node.c
821 list(APPEND VNET_HEADERS
825 dhcp/dhcp6_proxy_error.def
826 dhcp/dhcp4_proxy_error.def
829 ##############################################################################
830 # ipv6 segment routing
831 ##############################################################################
833 list(APPEND VNET_SOURCES
836 srv6/sr_policy_rewrite.c
841 list(APPEND VNET_HEADERS
846 list(APPEND VNET_API_FILES srv6/sr.api)
848 ##############################################################################
849 # mpls segment routing
850 ##############################################################################
852 list(APPEND VNET_SOURCES
853 srmpls/sr_mpls_policy.c
854 srmpls/sr_mpls_steering.c
858 list(APPEND VNET_HEADERS
862 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
864 ##############################################################################
865 # IPFIX / netflow v10
866 ##############################################################################
867 list(APPEND VNET_SOURCES
868 ipfix-export/flow_report.c
869 ipfix-export/flow_api.c
872 list(APPEND VNET_HEADERS
873 ipfix-export/flow_report.h
874 ipfix-export/ipfix_info_elements.h
875 ipfix-export/ipfix_packet.h
878 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
880 ##############################################################################
881 # IPFIX classify code
882 ##############################################################################
884 list(APPEND VNET_SOURCES
885 ipfix-export/flow_report_classify.c
888 list(APPEND VNET_HEADERS
889 ipfix-export/flow_report_classify.h
892 ##############################################################################
894 ##############################################################################
896 list(APPEND VNET_SOURCES
897 lawful-intercept/lawful_intercept.c
898 lawful-intercept/node.c
901 list(APPEND VNET_HEADERS
902 lawful-intercept/lawful_intercept.h
905 ##############################################################################
906 # SPAN (port mirroring)
907 ##############################################################################
909 list(APPEND VNET_SOURCES
915 list(APPEND VNET_HEADERS
919 list(APPEND VNET_API_FILES span/span.api)
921 ##############################################################################
923 ##############################################################################
924 list(APPEND VNET_SOURCES
930 dns/resolver_process.c
933 list(APPEND VNET_HEADERS
937 list(APPEND VNET_API_FILES dns/dns.api)
939 ##############################################################################
941 ##############################################################################
943 list(APPEND VNET_SOURCES
953 list(APPEND VNET_HEADERS
958 list(APPEND VNET_API_FILES pg/pg.api)
960 ##############################################################################
962 ##############################################################################
964 list(APPEND VNET_SOURCES
965 devices/virtio/device.c
966 devices/virtio/node.c
967 devices/virtio/vhost_user.c
968 devices/virtio/vhost_user_input.c
969 devices/virtio/vhost_user_output.c
970 devices/virtio/vhost_user_api.c
971 devices/virtio/virtio.c
974 list(APPEND VNET_HEADERS
975 devices/virtio/virtio.h
976 devices/virtio/vhost_user.h
979 list(APPEND VNET_MULTIARCH_SOURCES
980 devices/virtio/vhost_user_input.c
981 devices/virtio/vhost_user_output.c
984 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
986 ##############################################################################
987 # tap interface (with virtio backend)
988 ##############################################################################
990 list(APPEND VNET_SOURCES
993 devices/tap/tapv2_api.c
996 list(APPEND VNET_HEADERS
1000 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1002 ##############################################################################
1003 # tap interface (with virtio backend)
1004 ##############################################################################
1006 list(APPEND VNET_SOURCES
1007 devices/pipe/pipe_api.c
1011 list(APPEND VNET_HEADERS
1015 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1017 ##############################################################################
1018 # session managmeent
1019 ##############################################################################
1021 list(APPEND VNET_SOURCES
1023 session/session_table.c
1024 session/session_rules_table.c
1025 session/session_lookup.c
1026 session/session_node.c
1028 session/application.c
1029 session/session_cli.c
1030 session/application_interface.c
1031 session/application_namespace.c
1032 session/segment_manager.c
1033 session/session_api.c
1036 list(APPEND VNET_HEADERS
1038 session/session_table.h
1039 session/session_rules_table.h
1040 session/stream_session.h
1041 session/session_lookup.h
1042 session/application.h
1044 session/transport_interface.h
1045 session/application_interface.h
1046 session/application_namespace.h
1047 session/session_debug.h
1048 session/segment_manager.h
1049 session/mma_template.h
1050 session/mma_template.c
1055 list(APPEND VNET_API_FILES session/session.api)
1057 ##############################################################################
1058 # session layer applications
1059 ##############################################################################
1061 list(APPEND VNET_SOURCES
1062 session-apps/echo_client.c
1063 session-apps/echo_server.c
1064 session-apps/http_server.c
1065 session-apps/proxy.c
1068 list(APPEND VNET_HEADERS
1069 session-apps/echo_client.h
1070 session-apps/proxy.h
1073 ##############################################################################
1075 ##############################################################################
1077 list(APPEND VNET_SOURCES
1081 list(APPEND VNET_HEADERS
1085 ##############################################################################
1086 # Linux packet interface
1087 ##############################################################################
1089 list(APPEND VNET_SOURCES
1090 devices/af_packet/af_packet.c
1091 devices/af_packet/device.c
1092 devices/af_packet/node.c
1093 devices/af_packet/cli.c
1094 devices/af_packet/af_packet_api.c
1097 list(APPEND VNET_HEADERS
1098 devices/af_packet/af_packet.h
1101 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1103 ##############################################################################
1105 ##############################################################################
1107 list(APPEND VNET_SOURCES
1108 devices/netmap/netmap.c
1109 devices/netmap/device.c
1110 devices/netmap/node.c
1111 devices/netmap/cli.c
1112 devices/netmap/netmap_api.c
1115 list(APPEND VNET_HEADERS
1116 devices/netmap/netmap.h
1119 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1121 ##############################################################################
1122 # Driver feature graph arc support
1123 ##############################################################################
1125 list(APPEND VNET_SOURCES
1127 feature/feature_api.c
1128 feature/registration.c
1131 list(APPEND VNET_HEADERS
1135 list(APPEND VNET_API_FILES feature/feature.api)
1137 ##############################################################################
1138 # Unix kernel related
1139 ##############################################################################
1141 # FIXME: unix/hgshm.c
1143 list(APPEND VNET_SOURCES
1151 list(APPEND VNET_HEADERS
1157 list(APPEND VNET_API_FILES unix/tap.api)
1159 ##############################################################################
1161 ##############################################################################
1163 list(APPEND VNET_SOURCES
1176 fib/fib_entry_src_rr.c
1177 fib/fib_entry_src_interface.c
1178 fib/fib_entry_src_interpose.c
1179 fib/fib_entry_src_default_route.c
1180 fib/fib_entry_src_special.c
1181 fib/fib_entry_src_api.c
1182 fib/fib_entry_src_adj.c
1183 fib/fib_entry_src_mpls.c
1184 fib/fib_entry_src_lisp.c
1185 fib/fib_entry_cover.c
1186 fib/fib_entry_delegate.c
1191 fib/fib_attached_export.c
1196 list(APPEND VNET_HEADERS
1206 fib/fib_entry_delegate.h
1209 ##############################################################################
1211 ##############################################################################
1213 list(APPEND VNET_SOURCES
1226 list(APPEND VNET_HEADERS
1235 ##############################################################################
1236 # Data-Plane Objects
1237 ##############################################################################
1239 list(APPEND VNET_SOURCES
1247 dpo/load_balance_map.c
1251 dpo/interface_rx_dpo.c
1252 dpo/interface_tx_dpo.c
1253 dpo/mpls_disposition.c
1254 dpo/mpls_label_dpo.c
1259 list(APPEND VNET_HEADERS
1271 ##############################################################################
1273 ##############################################################################
1275 list(APPEND VNET_SOURCES
1287 list(APPEND VNET_HEADERS
1293 ##############################################################################
1295 ##############################################################################
1297 list(APPEND VNET_SOURCES
1304 list(APPEND VNET_HEADERS
1308 ##############################################################################
1310 ##############################################################################
1312 list(APPEND VNET_SOURCES
1315 qos/qos_egress_map.c
1320 list(APPEND VNET_API_FILES qos/qos.api)
1322 ##############################################################################
1324 ##############################################################################
1326 list(APPEND VNET_SOURCES
1327 bier/bier_bit_string.c
1330 bier/bier_fmask_db.c
1340 bier/bier_imp_node.c
1342 bier/bier_disp_entry.c
1343 bier/bier_disp_lookup_node.c
1344 bier/bier_disp_dispatch_node.c
1345 bier/bier_disp_table.c
1346 bier/bier_bift_table.c
1349 list(APPEND VNET_HEADERS
1356 list(APPEND VNET_API_FILES bier/bier.api)
1358 ##############################################################################
1360 ##############################################################################
1362 add_vpp_library(vnet
1363 SOURCES ${VNET_SOURCES}
1364 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1365 INSTALL_HEADERS ${VNET_HEADERS}
1366 API_FILES ${VNET_API_FILES}
1367 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1371 ##############################################################################
1373 ##############################################################################
1375 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1376 if(VPP_BUILD_SESSION_ECHO_APPS)
1377 add_vpp_executable(tcp_echo
1378 SOURCES ../tests/vnet/session/tcp_echo.c
1379 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1383 add_vpp_executable(udp_echo
1384 SOURCES ../tests/vnet/session/udp_echo.c
1385 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1389 endif(VPP_BUILD_SESSION_ECHO_APPS)
1391 ##############################################################################