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_MULTIARCH_SOURCES
296 list(APPEND VNET_HEADERS
298 geneve/geneve_packet.h
299 geneve/geneve_error.def
302 list(APPEND VNET_API_FILES geneve/geneve.api)
304 ##############################################################################
306 ##############################################################################
307 list(APPEND VNET_SOURCES
314 list(APPEND VNET_HEADERS
318 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
319 list(APPEND VNET_API_FILES bonding/bond.api)
321 ##############################################################################
323 ##############################################################################
324 list(APPEND VNET_SOURCES
332 list(APPEND VNET_HEADERS
337 list(APPEND VNET_API_FILES lldp/lldp.api)
339 ##############################################################################
340 # Layer 2/3 "classify"
341 ##############################################################################
342 list(APPEND VNET_SOURCES
343 classify/vnet_classify.c
344 classify/ip_classify.c
345 classify/in_out_acl.c
346 classify/policer_classify.c
347 classify/flow_classify.c
348 classify/flow_classify_node.c
349 classify/vnet_classify.h
350 classify/classify_api.c
353 list(APPEND VNET_HEADERS
354 classify/vnet_classify.h
355 classify/in_out_acl.h
356 classify/policer_classify.h
357 classify/flow_classify.h
360 list(APPEND VNET_API_FILES classify/classify.api)
362 ##############################################################################
363 # Layer 3 protocols go here
364 ##############################################################################
366 ##############################################################################
367 # Layer 3 protocol: IP v4/v6
368 ##############################################################################
369 list(APPEND VNET_SOURCES
382 ip/ip4_source_and_port_range_check.c
383 ip/ip4_source_check.c
409 list(APPEND VNET_HEADERS
422 ip/ip6_hop_by_hop_packet.h
427 ip/ip_source_and_port_range_check.h
436 list(APPEND VNET_API_FILES
442 list(APPEND VNET_MULTIARCH_SOURCES
448 ##############################################################################
450 ##############################################################################
451 list(APPEND VNET_SOURCES
455 list(APPEND VNET_HEADERS
456 ethernet/arp_packet.h
460 ##############################################################################
461 # Bidirectional Forwarding Detection
462 ##############################################################################
464 list(APPEND VNET_HEADERS
471 list(APPEND VNET_SOURCES
480 list(APPEND VNET_API_FILES bfd/bfd.api)
482 ##############################################################################
483 # Layer 3 protocol: IPSec
484 ##############################################################################
485 list(APPEND VNET_SOURCES
494 ipsec/ipsec_spd_policy.c
503 list(APPEND VNET_MULTIARCH_SOURCES
513 list(APPEND VNET_API_FILES ipsec/ipsec.api)
515 list(APPEND VNET_SOURCES
519 list(APPEND VNET_HEADERS
522 ipsec/ipsec_spd_policy.h
529 ##############################################################################
530 # Layer 3 protocol: osi
531 ##############################################################################
532 list(APPEND VNET_SOURCES
538 list(APPEND VNET_HEADERS
542 ##############################################################################
543 # Layer 4 protocol: tcp
544 ##############################################################################
545 list(APPEND VNET_SOURCES
549 tcp/tcp_syn_filter4.c
557 list(APPEND VNET_HEADERS
565 list(APPEND VNET_API_FILES tcp/tcp.api)
567 ##############################################################################
568 # Layer 4 protocol: udp
569 ##############################################################################
570 list(APPEND VNET_SOURCES
581 list(APPEND VNET_HEADERS
587 list(APPEND VNET_API_FILES udp/udp.api)
589 ##############################################################################
590 # Layer 4 protocol: sctp
591 ##############################################################################
592 list(APPEND VNET_SOURCES
598 sctp/sctp_output_node.c
602 list(APPEND VNET_MULTIARCH_SOURCES
603 sctp/sctp_output_node.c
607 list(APPEND VNET_HEADERS
614 list(APPEND VNET_API_FILES sctp/sctp.api)
616 ##############################################################################
617 # Tunnel protocol: gre
618 ##############################################################################
619 list(APPEND VNET_SOURCES
627 list(APPEND VNET_MULTIARCH_SOURCES
632 list(APPEND VNET_HEADERS
638 list(APPEND VNET_API_FILES gre/gre.api)
640 ##############################################################################
641 # Tunnel protocol: ipip
642 ##############################################################################
643 list(APPEND VNET_SOURCES
651 list(APPEND VNET_MULTIARCH_SOURCES
655 list(APPEND VNET_HEADERS
659 list(APPEND VNET_API_FILES ipip/ipip.api)
661 ##############################################################################
662 # Tunnel protocol: l2tpv3
663 ##############################################################################
664 list(APPEND VNET_SOURCES
672 list(APPEND VNET_HEADERS
677 list(APPEND VNET_API_FILES l2tp/l2tp.api)
679 ##############################################################################
680 # Tunnel protocol: gre+mpls
681 ##############################################################################
682 list(APPEND VNET_SOURCES
694 list(APPEND VNET_MULTIARCH_SOURCES
701 list(APPEND VNET_HEADERS
709 list(APPEND VNET_API_FILES mpls/mpls.api)
711 ##############################################################################
712 # Tunnel protocol: vxlan-gbp
713 ##############################################################################
714 list(APPEND VNET_SOURCES
717 vxlan-gbp/vxlan_gbp_api.c
718 vxlan-gbp/vxlan_gbp.c
719 vxlan-gbp/vxlan_gbp_packet.c
722 list(APPEND VNET_HEADERS
723 vxlan-gbp/vxlan_gbp.h
724 vxlan-gbp/vxlan_gbp_packet.h
725 vxlan-gbp/vxlan_gbp_error.def
728 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
730 ##############################################################################
731 # Tunnel protocol: vxlan-gpe
732 ##############################################################################
734 list(APPEND VNET_SOURCES
735 vxlan-gpe/vxlan_gpe.c
738 vxlan-gpe/vxlan_gpe_api.c
741 list(APPEND VNET_HEADERS
742 vxlan-gpe/vxlan_gpe.h
743 vxlan-gpe/vxlan_gpe_packet.h
744 vxlan-gpe/vxlan_gpe_error.def
747 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
749 ##############################################################################
750 # Tunnel protocol: ipsec+gre
751 ##############################################################################
752 list(APPEND VNET_SOURCES
753 ipsec-gre/ipsec_gre.c
755 ipsec-gre/interface.c
756 ipsec-gre/ipsec_gre_api.c
759 list(APPEND VNET_HEADERS
760 ipsec-gre/ipsec_gre.h
764 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
766 ##############################################################################
767 # LISP control plane: lisp-cp
768 ##############################################################################
770 list(APPEND VNET_SOURCES
772 lisp-cp/lisp_cp_dpo.c
774 lisp-cp/gid_dictionary.c
775 lisp-cp/lisp_msg_serdes.c
783 list(APPEND VNET_HEADERS
786 lisp-cp/gid_dictionary.h
787 lisp-cp/lisp_cp_messages.h
788 lisp-cp/lisp_msg_serdes.h
792 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
793 list(APPEND VNET_API_FILES lisp-cp/one.api)
795 ##############################################################################
796 # Tunnel protocol: lisp-gpe
797 ##############################################################################
799 list(APPEND VNET_SOURCES
801 lisp-gpe/lisp_gpe_sub_interface.c
802 lisp-gpe/lisp_gpe_adjacency.c
803 lisp-gpe/lisp_gpe_tunnel.c
804 lisp-gpe/lisp_gpe_fwd_entry.c
805 lisp-gpe/lisp_gpe_tenant.c
808 lisp-gpe/lisp_gpe_api.c
811 list(APPEND VNET_HEADERS
813 lisp-gpe/lisp_gpe_fwd_entry.h
814 lisp-gpe/lisp_gpe_tenant.h
815 lisp-gpe/lisp_gpe_packet.h
816 lisp-gpe/lisp_gpe_error.def
819 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
821 ##############################################################################
823 ##############################################################################
824 list(APPEND VNET_SOURCES
826 dhcp/dhcp_client_detect.c
827 dhcp/dhcp6_client_common_dp.c
828 dhcp/dhcp6_pd_client_dp.c
829 dhcp/dhcp6_pd_client_cp.c
830 dhcp/dhcp6_ia_na_client_dp.c
831 dhcp/dhcp6_ia_na_client_cp.c
835 list(APPEND VNET_HEADERS
837 dhcp/dhcp6_client_common_dp.h
838 dhcp/dhcp6_pd_client_dp.h
839 dhcp/dhcp6_ia_na_client_dp.h
842 list(APPEND VNET_API_FILES
844 dhcp/dhcp6_pd_client_cp.api
845 dhcp/dhcp6_ia_na_client_cp.api
848 ##############################################################################
850 ##############################################################################
851 list(APPEND VNET_SOURCES
852 dhcp/dhcp6_proxy_node.c
853 dhcp/dhcp4_proxy_node.c
857 list(APPEND VNET_HEADERS
861 dhcp/dhcp6_proxy_error.def
862 dhcp/dhcp4_proxy_error.def
865 ##############################################################################
866 # ipv6 segment routing
867 ##############################################################################
869 list(APPEND VNET_SOURCES
872 srv6/sr_policy_rewrite.c
877 list(APPEND VNET_HEADERS
882 list(APPEND VNET_API_FILES srv6/sr.api)
884 ##############################################################################
885 # mpls segment routing
886 ##############################################################################
888 list(APPEND VNET_SOURCES
889 srmpls/sr_mpls_policy.c
890 srmpls/sr_mpls_steering.c
894 list(APPEND VNET_HEADERS
898 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
900 ##############################################################################
901 # IPFIX / netflow v10
902 ##############################################################################
903 list(APPEND VNET_SOURCES
904 ipfix-export/flow_report.c
905 ipfix-export/flow_api.c
908 list(APPEND VNET_HEADERS
909 ipfix-export/flow_report.h
910 ipfix-export/ipfix_info_elements.h
911 ipfix-export/ipfix_packet.h
914 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
916 ##############################################################################
917 # IPFIX classify code
918 ##############################################################################
920 list(APPEND VNET_SOURCES
921 ipfix-export/flow_report_classify.c
924 list(APPEND VNET_HEADERS
925 ipfix-export/flow_report_classify.h
928 ##############################################################################
930 ##############################################################################
932 list(APPEND VNET_SOURCES
933 lawful-intercept/lawful_intercept.c
934 lawful-intercept/node.c
937 list(APPEND VNET_HEADERS
938 lawful-intercept/lawful_intercept.h
941 ##############################################################################
942 # SPAN (port mirroring)
943 ##############################################################################
945 list(APPEND VNET_SOURCES
951 list(APPEND VNET_HEADERS
955 list(APPEND VNET_API_FILES span/span.api)
957 ##############################################################################
959 ##############################################################################
960 list(APPEND VNET_SOURCES
966 dns/resolver_process.c
969 list(APPEND VNET_HEADERS
973 list(APPEND VNET_API_FILES dns/dns.api)
975 ##############################################################################
977 ##############################################################################
979 list(APPEND VNET_SOURCES
989 list(APPEND VNET_HEADERS
994 list(APPEND VNET_API_FILES pg/pg.api)
996 ##############################################################################
998 ##############################################################################
1000 list(APPEND VNET_SOURCES
1001 devices/virtio/device.c
1002 devices/virtio/node.c
1003 devices/virtio/vhost_user.c
1004 devices/virtio/vhost_user_input.c
1005 devices/virtio/vhost_user_output.c
1006 devices/virtio/vhost_user_api.c
1007 devices/virtio/virtio.c
1008 devices/virtio/virtio_api.c
1009 devices/virtio/cli.c
1010 devices/virtio/pci.c
1013 list(APPEND VNET_HEADERS
1014 devices/virtio/pci.h
1015 devices/virtio/virtio.h
1016 devices/virtio/vhost_user.h
1019 list(APPEND VNET_MULTIARCH_SOURCES
1020 devices/virtio/vhost_user_input.c
1021 devices/virtio/vhost_user_output.c
1022 devices/netmap/node.c
1023 devices/virtio/node.c
1024 devices/af_packet/node.c
1027 list(APPEND VNET_API_FILES
1028 devices/virtio/vhost_user.api
1029 devices/virtio/virtio.api
1032 ##############################################################################
1033 # tap interface (with virtio backend)
1034 ##############################################################################
1036 list(APPEND VNET_SOURCES
1039 devices/tap/tapv2_api.c
1042 list(APPEND VNET_HEADERS
1046 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1048 ##############################################################################
1049 # tap interface (with virtio backend)
1050 ##############################################################################
1052 list(APPEND VNET_SOURCES
1053 devices/pipe/pipe_api.c
1057 list(APPEND VNET_HEADERS
1061 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1063 ##############################################################################
1064 # session managmeent
1065 ##############################################################################
1067 list(APPEND VNET_SOURCES
1069 session/session_table.c
1070 session/session_rules_table.c
1071 session/session_lookup.c
1072 session/session_node.c
1074 session/application.c
1075 session/application_worker.c
1076 session/session_cli.c
1077 session/application_interface.c
1078 session/application_local.c
1079 session/application_namespace.c
1080 session/segment_manager.c
1081 session/session_api.c
1084 list(APPEND VNET_HEADERS
1086 session/session_table.h
1087 session/session_rules_table.h
1088 session/session_types.h
1089 session/session_lookup.h
1090 session/application.h
1092 session/transport_types.h
1093 session/application_interface.h
1094 session/application_local.h
1095 session/application_namespace.h
1096 session/session_debug.h
1097 session/segment_manager.h
1098 session/mma_template.h
1099 session/mma_template.c
1104 list(APPEND VNET_API_FILES session/session.api)
1106 ##############################################################################
1107 # session layer applications
1108 ##############################################################################
1110 list(APPEND VNET_SOURCES
1111 session-apps/echo_client.c
1112 session-apps/echo_server.c
1113 session-apps/http_server.c
1114 session-apps/proxy.c
1117 list(APPEND VNET_HEADERS
1118 session-apps/echo_client.h
1119 session-apps/proxy.h
1122 ##############################################################################
1124 ##############################################################################
1126 list(APPEND VNET_SOURCES
1130 list(APPEND VNET_HEADERS
1135 ##############################################################################
1136 # Linux packet interface
1137 ##############################################################################
1139 list(APPEND VNET_SOURCES
1140 devices/af_packet/af_packet.c
1141 devices/af_packet/device.c
1142 devices/af_packet/node.c
1143 devices/af_packet/cli.c
1144 devices/af_packet/af_packet_api.c
1147 list(APPEND VNET_HEADERS
1148 devices/af_packet/af_packet.h
1151 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1153 ##############################################################################
1155 ##############################################################################
1157 list(APPEND VNET_SOURCES
1158 devices/netmap/netmap.c
1159 devices/netmap/device.c
1160 devices/netmap/node.c
1161 devices/netmap/cli.c
1162 devices/netmap/netmap_api.c
1165 list(APPEND VNET_HEADERS
1166 devices/netmap/netmap.h
1169 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1171 ##############################################################################
1172 # Driver feature graph arc support
1173 ##############################################################################
1175 list(APPEND VNET_SOURCES
1177 feature/feature_api.c
1178 feature/registration.c
1181 list(APPEND VNET_HEADERS
1185 list(APPEND VNET_API_FILES feature/feature.api)
1187 ##############################################################################
1188 # Unix kernel related
1189 ##############################################################################
1191 # FIXME: unix/hgshm.c
1193 list(APPEND VNET_SOURCES
1198 list(APPEND VNET_HEADERS
1202 ##############################################################################
1204 ##############################################################################
1206 list(APPEND VNET_SOURCES
1218 fib/fib_entry_src_rr.c
1219 fib/fib_entry_src_interface.c
1220 fib/fib_entry_src_interpose.c
1221 fib/fib_entry_src_default_route.c
1222 fib/fib_entry_src_special.c
1223 fib/fib_entry_src_api.c
1224 fib/fib_entry_src_adj.c
1225 fib/fib_entry_src_mpls.c
1226 fib/fib_entry_src_lisp.c
1227 fib/fib_entry_cover.c
1228 fib/fib_entry_delegate.c
1233 fib/fib_attached_export.c
1238 list(APPEND VNET_HEADERS
1248 fib/fib_entry_delegate.h
1251 ##############################################################################
1253 ##############################################################################
1255 list(APPEND VNET_SOURCES
1268 list(APPEND VNET_MULTIARCH_SOURCES
1273 list(APPEND VNET_HEADERS
1282 ##############################################################################
1283 # Data-Plane Objects
1284 ##############################################################################
1286 list(APPEND VNET_SOURCES
1294 dpo/load_balance_map.c
1298 dpo/interface_rx_dpo.c
1299 dpo/interface_tx_dpo.c
1300 dpo/mpls_disposition.c
1301 dpo/mpls_label_dpo.c
1306 list(APPEND VNET_HEADERS
1318 ##############################################################################
1320 ##############################################################################
1322 list(APPEND VNET_SOURCES
1331 mfib/mfib_entry_cover.c
1332 mfib/mfib_entry_delegate.c
1333 mfib/mfib_entry_src.c
1334 mfib/mfib_entry_src_rr.c
1338 list(APPEND VNET_HEADERS
1344 ##############################################################################
1346 ##############################################################################
1348 list(APPEND VNET_SOURCES
1355 list(APPEND VNET_HEADERS
1359 ##############################################################################
1361 ##############################################################################
1363 list(APPEND VNET_SOURCES
1366 qos/qos_egress_map.c
1368 qos/qos_record_node.c
1373 list(APPEND VNET_MULTIARCH_SOURCES
1374 qos/qos_record_node.c
1378 list(APPEND VNET_API_FILES qos/qos.api)
1380 ##############################################################################
1382 ##############################################################################
1384 list(APPEND VNET_SOURCES
1385 bier/bier_bit_string.c
1388 bier/bier_fmask_db.c
1397 bier/bier_imp_node.c
1399 bier/bier_disp_entry.c
1400 bier/bier_disp_lookup_node.c
1401 bier/bier_disp_dispatch_node.c
1402 bier/bier_disp_table.c
1403 bier/bier_bift_table.c
1406 list(APPEND VNET_MULTIARCH_SOURCES
1407 bier/bier_disp_dispatch_node.c
1408 bier/bier_disp_lookup_node.c
1409 bier/bier_imp_node.c
1412 list(APPEND VNET_HEADERS
1419 list(APPEND VNET_API_FILES bier/bier.api)
1421 ##############################################################################
1423 ##############################################################################
1425 list (APPEND VNET_SOURCES
1431 list(APPEND VNET_HEADERS
1436 list(APPEND VNET_API_FILES syslog/syslog.api)
1438 ##############################################################################
1440 ##############################################################################
1442 add_vpp_library(vnet
1443 SOURCES ${VNET_SOURCES}
1444 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1445 INSTALL_HEADERS ${VNET_HEADERS}
1446 API_FILES ${VNET_API_FILES}
1447 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1451 ##############################################################################
1453 ##############################################################################
1455 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1456 if(VPP_BUILD_SESSION_ECHO_APPS)
1457 add_vpp_executable(tcp_echo
1458 SOURCES ../tests/vnet/session/tcp_echo.c
1459 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1463 add_vpp_executable(udp_echo
1464 SOURCES ../tests/vnet/session/udp_echo.c
1465 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1469 endif(VPP_BUILD_SESSION_ECHO_APPS)
1471 ##############################################################################