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
506 list(APPEND VNET_API_FILES ipsec/ipsec.api)
508 list(APPEND VNET_SOURCES
512 list(APPEND VNET_HEADERS
520 ##############################################################################
521 # Layer 3 protocol: osi
522 ##############################################################################
523 list(APPEND VNET_SOURCES
529 list(APPEND VNET_HEADERS
533 ##############################################################################
534 # Layer 4 protocol: tcp
535 ##############################################################################
536 list(APPEND VNET_SOURCES
540 tcp/tcp_syn_filter4.c
548 list(APPEND VNET_HEADERS
556 list(APPEND VNET_API_FILES tcp/tcp.api)
558 ##############################################################################
559 # Layer 4 protocol: udp
560 ##############################################################################
561 list(APPEND VNET_SOURCES
572 list(APPEND VNET_HEADERS
578 list(APPEND VNET_API_FILES udp/udp.api)
580 ##############################################################################
581 # Layer 4 protocol: sctp
582 ##############################################################################
583 list(APPEND VNET_SOURCES
592 list(APPEND VNET_HEADERS
599 list(APPEND VNET_API_FILES sctp/sctp.api)
601 ##############################################################################
602 # Tunnel protocol: gre
603 ##############################################################################
604 list(APPEND VNET_SOURCES
612 list(APPEND VNET_HEADERS
618 list(APPEND VNET_API_FILES gre/gre.api)
620 ##############################################################################
621 # Tunnel protocol: ipip
622 ##############################################################################
623 list(APPEND VNET_SOURCES
631 list(APPEND VNET_HEADERS
635 list(APPEND VNET_API_FILES ipip/ipip.api)
637 ##############################################################################
638 # Tunnel protocol: l2tpv3
639 ##############################################################################
640 list(APPEND VNET_SOURCES
648 list(APPEND VNET_HEADERS
653 list(APPEND VNET_API_FILES l2tp/l2tp.api)
655 ##############################################################################
656 # Tunnel protocol: gre+mpls
657 ##############################################################################
658 list(APPEND VNET_SOURCES
670 list(APPEND VNET_HEADERS
678 list(APPEND VNET_API_FILES mpls/mpls.api)
680 ##############################################################################
681 # Tunnel protocol: vxlan-gbp
682 ##############################################################################
683 list(APPEND VNET_SOURCES
686 vxlan-gbp/vxlan_gbp_api.c
687 vxlan-gbp/vxlan_gbp.c
688 vxlan-gbp/vxlan_gbp_packet.c
691 list(APPEND VNET_HEADERS
692 vxlan-gbp/vxlan_gbp.h
693 vxlan-gbp/vxlan_gbp_packet.h
694 vxlan-gbp/vxlan_gbp_error.def
697 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
699 ##############################################################################
700 # Tunnel protocol: vxlan-gpe
701 ##############################################################################
703 list(APPEND VNET_SOURCES
704 vxlan-gpe/vxlan_gpe.c
707 vxlan-gpe/vxlan_gpe_api.c
710 list(APPEND VNET_HEADERS
711 vxlan-gpe/vxlan_gpe.h
712 vxlan-gpe/vxlan_gpe_packet.h
713 vxlan-gpe/vxlan_gpe_error.def
716 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
718 ##############################################################################
719 # Tunnel protocol: ipsec+gre
720 ##############################################################################
721 list(APPEND VNET_SOURCES
722 ipsec-gre/ipsec_gre.c
724 ipsec-gre/interface.c
725 ipsec-gre/ipsec_gre_api.c
728 list(APPEND VNET_HEADERS
729 ipsec-gre/ipsec_gre.h
733 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
735 ##############################################################################
736 # LISP control plane: lisp-cp
737 ##############################################################################
739 list(APPEND VNET_SOURCES
741 lisp-cp/lisp_cp_dpo.c
743 lisp-cp/gid_dictionary.c
744 lisp-cp/lisp_msg_serdes.c
752 list(APPEND VNET_HEADERS
755 lisp-cp/gid_dictionary.h
756 lisp-cp/lisp_cp_messages.h
757 lisp-cp/lisp_msg_serdes.h
761 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
762 list(APPEND VNET_API_FILES lisp-cp/one.api)
764 ##############################################################################
765 # Tunnel protocol: lisp-gpe
766 ##############################################################################
768 list(APPEND VNET_SOURCES
770 lisp-gpe/lisp_gpe_sub_interface.c
771 lisp-gpe/lisp_gpe_adjacency.c
772 lisp-gpe/lisp_gpe_tunnel.c
773 lisp-gpe/lisp_gpe_fwd_entry.c
774 lisp-gpe/lisp_gpe_tenant.c
777 lisp-gpe/lisp_gpe_api.c
780 list(APPEND VNET_HEADERS
782 lisp-gpe/lisp_gpe_fwd_entry.h
783 lisp-gpe/lisp_gpe_tenant.h
784 lisp-gpe/lisp_gpe_packet.h
785 lisp-gpe/lisp_gpe_error.def
788 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
790 ##############################################################################
792 ##############################################################################
793 list(APPEND VNET_SOURCES
795 dhcp/dhcp_client_detect.c
796 dhcp/dhcp6_client_common_dp.c
797 dhcp/dhcp6_pd_client_dp.c
798 dhcp/dhcp6_pd_client_cp.c
799 dhcp/dhcp6_ia_na_client_dp.c
800 dhcp/dhcp6_ia_na_client_cp.c
804 list(APPEND VNET_HEADERS
806 dhcp/dhcp6_client_common_dp.h
807 dhcp/dhcp6_pd_client_dp.h
808 dhcp/dhcp6_ia_na_client_dp.h
811 list(APPEND VNET_API_FILES
813 dhcp/dhcp6_pd_client_cp.api
814 dhcp/dhcp6_ia_na_client_cp.api
817 ##############################################################################
819 ##############################################################################
820 list(APPEND VNET_SOURCES
821 dhcp/dhcp6_proxy_node.c
822 dhcp/dhcp4_proxy_node.c
826 list(APPEND VNET_HEADERS
830 dhcp/dhcp6_proxy_error.def
831 dhcp/dhcp4_proxy_error.def
834 ##############################################################################
835 # ipv6 segment routing
836 ##############################################################################
838 list(APPEND VNET_SOURCES
841 srv6/sr_policy_rewrite.c
846 list(APPEND VNET_HEADERS
851 list(APPEND VNET_API_FILES srv6/sr.api)
853 ##############################################################################
854 # mpls segment routing
855 ##############################################################################
857 list(APPEND VNET_SOURCES
858 srmpls/sr_mpls_policy.c
859 srmpls/sr_mpls_steering.c
863 list(APPEND VNET_HEADERS
867 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
869 ##############################################################################
870 # IPFIX / netflow v10
871 ##############################################################################
872 list(APPEND VNET_SOURCES
873 ipfix-export/flow_report.c
874 ipfix-export/flow_api.c
877 list(APPEND VNET_HEADERS
878 ipfix-export/flow_report.h
879 ipfix-export/ipfix_info_elements.h
880 ipfix-export/ipfix_packet.h
883 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
885 ##############################################################################
886 # IPFIX classify code
887 ##############################################################################
889 list(APPEND VNET_SOURCES
890 ipfix-export/flow_report_classify.c
893 list(APPEND VNET_HEADERS
894 ipfix-export/flow_report_classify.h
897 ##############################################################################
899 ##############################################################################
901 list(APPEND VNET_SOURCES
902 lawful-intercept/lawful_intercept.c
903 lawful-intercept/node.c
906 list(APPEND VNET_HEADERS
907 lawful-intercept/lawful_intercept.h
910 ##############################################################################
911 # SPAN (port mirroring)
912 ##############################################################################
914 list(APPEND VNET_SOURCES
920 list(APPEND VNET_HEADERS
924 list(APPEND VNET_API_FILES span/span.api)
926 ##############################################################################
928 ##############################################################################
929 list(APPEND VNET_SOURCES
935 dns/resolver_process.c
938 list(APPEND VNET_HEADERS
942 list(APPEND VNET_API_FILES dns/dns.api)
944 ##############################################################################
946 ##############################################################################
948 list(APPEND VNET_SOURCES
958 list(APPEND VNET_HEADERS
963 list(APPEND VNET_API_FILES pg/pg.api)
965 ##############################################################################
967 ##############################################################################
969 list(APPEND VNET_SOURCES
970 devices/virtio/device.c
971 devices/virtio/node.c
972 devices/virtio/vhost_user.c
973 devices/virtio/vhost_user_input.c
974 devices/virtio/vhost_user_output.c
975 devices/virtio/vhost_user_api.c
976 devices/virtio/virtio.c
977 devices/virtio/virtio_api.c
982 list(APPEND VNET_HEADERS
984 devices/virtio/virtio.h
985 devices/virtio/vhost_user.h
988 list(APPEND VNET_MULTIARCH_SOURCES
989 devices/virtio/vhost_user_input.c
990 devices/virtio/vhost_user_output.c
993 list(APPEND VNET_API_FILES
994 devices/virtio/vhost_user.api
995 devices/virtio/virtio.api
998 ##############################################################################
999 # tap interface (with virtio backend)
1000 ##############################################################################
1002 list(APPEND VNET_SOURCES
1005 devices/tap/tapv2_api.c
1008 list(APPEND VNET_HEADERS
1012 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1014 ##############################################################################
1015 # tap interface (with virtio backend)
1016 ##############################################################################
1018 list(APPEND VNET_SOURCES
1019 devices/pipe/pipe_api.c
1023 list(APPEND VNET_HEADERS
1027 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1029 ##############################################################################
1030 # session managmeent
1031 ##############################################################################
1033 list(APPEND VNET_SOURCES
1035 session/session_table.c
1036 session/session_rules_table.c
1037 session/session_lookup.c
1038 session/session_node.c
1040 session/application.c
1041 session/session_cli.c
1042 session/application_interface.c
1043 session/application_namespace.c
1044 session/segment_manager.c
1045 session/session_api.c
1048 list(APPEND VNET_HEADERS
1050 session/session_table.h
1051 session/session_rules_table.h
1052 session/stream_session.h
1053 session/session_lookup.h
1054 session/application.h
1056 session/transport_interface.h
1057 session/application_interface.h
1058 session/application_namespace.h
1059 session/session_debug.h
1060 session/segment_manager.h
1061 session/mma_template.h
1062 session/mma_template.c
1067 list(APPEND VNET_API_FILES session/session.api)
1069 ##############################################################################
1070 # session layer applications
1071 ##############################################################################
1073 list(APPEND VNET_SOURCES
1074 session-apps/echo_client.c
1075 session-apps/echo_server.c
1076 session-apps/http_server.c
1077 session-apps/proxy.c
1080 list(APPEND VNET_HEADERS
1081 session-apps/echo_client.h
1082 session-apps/proxy.h
1085 ##############################################################################
1087 ##############################################################################
1089 list(APPEND VNET_SOURCES
1093 list(APPEND VNET_HEADERS
1097 ##############################################################################
1098 # Linux packet interface
1099 ##############################################################################
1101 list(APPEND VNET_SOURCES
1102 devices/af_packet/af_packet.c
1103 devices/af_packet/device.c
1104 devices/af_packet/node.c
1105 devices/af_packet/cli.c
1106 devices/af_packet/af_packet_api.c
1109 list(APPEND VNET_HEADERS
1110 devices/af_packet/af_packet.h
1113 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1115 ##############################################################################
1117 ##############################################################################
1119 list(APPEND VNET_SOURCES
1120 devices/netmap/netmap.c
1121 devices/netmap/device.c
1122 devices/netmap/node.c
1123 devices/netmap/cli.c
1124 devices/netmap/netmap_api.c
1127 list(APPEND VNET_HEADERS
1128 devices/netmap/netmap.h
1131 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1133 ##############################################################################
1134 # Driver feature graph arc support
1135 ##############################################################################
1137 list(APPEND VNET_SOURCES
1139 feature/feature_api.c
1140 feature/registration.c
1143 list(APPEND VNET_HEADERS
1147 list(APPEND VNET_API_FILES feature/feature.api)
1149 ##############################################################################
1150 # Unix kernel related
1151 ##############################################################################
1153 # FIXME: unix/hgshm.c
1155 list(APPEND VNET_SOURCES
1160 list(APPEND VNET_HEADERS
1164 ##############################################################################
1166 ##############################################################################
1168 list(APPEND VNET_SOURCES
1180 fib/fib_entry_src_rr.c
1181 fib/fib_entry_src_interface.c
1182 fib/fib_entry_src_interpose.c
1183 fib/fib_entry_src_default_route.c
1184 fib/fib_entry_src_special.c
1185 fib/fib_entry_src_api.c
1186 fib/fib_entry_src_adj.c
1187 fib/fib_entry_src_mpls.c
1188 fib/fib_entry_src_lisp.c
1189 fib/fib_entry_cover.c
1190 fib/fib_entry_delegate.c
1195 fib/fib_attached_export.c
1200 list(APPEND VNET_HEADERS
1210 fib/fib_entry_delegate.h
1213 ##############################################################################
1215 ##############################################################################
1217 list(APPEND VNET_SOURCES
1230 list(APPEND VNET_HEADERS
1239 ##############################################################################
1240 # Data-Plane Objects
1241 ##############################################################################
1243 list(APPEND VNET_SOURCES
1251 dpo/load_balance_map.c
1255 dpo/interface_rx_dpo.c
1256 dpo/interface_tx_dpo.c
1257 dpo/mpls_disposition.c
1258 dpo/mpls_label_dpo.c
1263 list(APPEND VNET_HEADERS
1275 ##############################################################################
1277 ##############################################################################
1279 list(APPEND VNET_SOURCES
1288 mfib/mfib_entry_cover.c
1289 mfib/mfib_entry_delegate.c
1290 mfib/mfib_entry_src.c
1291 mfib/mfib_entry_src_rr.c
1295 list(APPEND VNET_HEADERS
1301 ##############################################################################
1303 ##############################################################################
1305 list(APPEND VNET_SOURCES
1312 list(APPEND VNET_HEADERS
1316 ##############################################################################
1318 ##############################################################################
1320 list(APPEND VNET_SOURCES
1323 qos/qos_egress_map.c
1328 list(APPEND VNET_API_FILES qos/qos.api)
1330 ##############################################################################
1332 ##############################################################################
1334 list(APPEND VNET_SOURCES
1335 bier/bier_bit_string.c
1338 bier/bier_fmask_db.c
1347 bier/bier_imp_node.c
1349 bier/bier_disp_entry.c
1350 bier/bier_disp_lookup_node.c
1351 bier/bier_disp_dispatch_node.c
1352 bier/bier_disp_table.c
1353 bier/bier_bift_table.c
1356 list(APPEND VNET_HEADERS
1363 list(APPEND VNET_API_FILES bier/bier.api)
1365 ##############################################################################
1367 ##############################################################################
1369 list (APPEND VNET_SOURCES
1375 list(APPEND VNET_HEADERS
1380 list(APPEND VNET_API_FILES syslog/syslog.api)
1382 ##############################################################################
1384 ##############################################################################
1386 add_vpp_library(vnet
1387 SOURCES ${VNET_SOURCES}
1388 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1389 INSTALL_HEADERS ${VNET_HEADERS}
1390 API_FILES ${VNET_API_FILES}
1391 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1395 ##############################################################################
1397 ##############################################################################
1399 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1400 if(VPP_BUILD_SESSION_ECHO_APPS)
1401 add_vpp_executable(tcp_echo
1402 SOURCES ../tests/vnet/session/tcp_echo.c
1403 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1407 add_vpp_executable(udp_echo
1408 SOURCES ../tests/vnet/session/udp_echo.c
1409 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1413 endif(VPP_BUILD_SESSION_ECHO_APPS)
1415 ##############################################################################