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
491 ipsec/ikev2_payload.c
496 list(APPEND VNET_MULTIARCH_SOURCES
503 list(APPEND VNET_API_FILES ipsec/ipsec.api)
505 list(APPEND VNET_SOURCES
509 list(APPEND VNET_HEADERS
517 ##############################################################################
518 # Layer 3 protocol: osi
519 ##############################################################################
520 list(APPEND VNET_SOURCES
526 list(APPEND VNET_HEADERS
530 ##############################################################################
531 # Layer 4 protocol: tcp
532 ##############################################################################
533 list(APPEND VNET_SOURCES
537 tcp/tcp_syn_filter4.c
545 list(APPEND VNET_HEADERS
553 list(APPEND VNET_API_FILES tcp/tcp.api)
555 ##############################################################################
556 # Layer 4 protocol: udp
557 ##############################################################################
558 list(APPEND VNET_SOURCES
569 list(APPEND VNET_HEADERS
575 list(APPEND VNET_API_FILES udp/udp.api)
577 ##############################################################################
578 # Layer 4 protocol: sctp
579 ##############################################################################
580 list(APPEND VNET_SOURCES
589 list(APPEND VNET_HEADERS
596 list(APPEND VNET_API_FILES sctp/sctp.api)
598 ##############################################################################
599 # Tunnel protocol: gre
600 ##############################################################################
601 list(APPEND VNET_SOURCES
609 list(APPEND VNET_HEADERS
615 list(APPEND VNET_API_FILES gre/gre.api)
617 ##############################################################################
618 # Tunnel protocol: ipip
619 ##############################################################################
620 list(APPEND VNET_SOURCES
628 list(APPEND VNET_HEADERS
632 list(APPEND VNET_API_FILES ipip/ipip.api)
634 ##############################################################################
635 # Tunnel protocol: l2tpv3
636 ##############################################################################
637 list(APPEND VNET_SOURCES
645 list(APPEND VNET_HEADERS
650 list(APPEND VNET_API_FILES l2tp/l2tp.api)
652 ##############################################################################
653 # Tunnel protocol: gre+mpls
654 ##############################################################################
655 list(APPEND VNET_SOURCES
667 list(APPEND VNET_HEADERS
675 list(APPEND VNET_API_FILES mpls/mpls.api)
677 ##############################################################################
678 # Tunnel protocol: vxlan-gbp
679 ##############################################################################
680 list(APPEND VNET_SOURCES
683 vxlan-gbp/vxlan_gbp_api.c
684 vxlan-gbp/vxlan_gbp.c
685 vxlan-gbp/vxlan_gbp_packet.c
688 list(APPEND VNET_HEADERS
689 vxlan-gbp/vxlan_gbp.h
690 vxlan-gbp/vxlan_gbp_packet.h
691 vxlan-gbp/vxlan_gbp_error.def
694 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
696 ##############################################################################
697 # Tunnel protocol: vxlan-gpe
698 ##############################################################################
700 list(APPEND VNET_SOURCES
701 vxlan-gpe/vxlan_gpe.c
704 vxlan-gpe/vxlan_gpe_api.c
707 list(APPEND VNET_HEADERS
708 vxlan-gpe/vxlan_gpe.h
709 vxlan-gpe/vxlan_gpe_packet.h
710 vxlan-gpe/vxlan_gpe_error.def
713 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
715 ##############################################################################
716 # Tunnel protocol: ipsec+gre
717 ##############################################################################
718 list(APPEND VNET_SOURCES
719 ipsec-gre/ipsec_gre.c
721 ipsec-gre/interface.c
722 ipsec-gre/ipsec_gre_api.c
725 list(APPEND VNET_HEADERS
726 ipsec-gre/ipsec_gre.h
730 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
732 ##############################################################################
733 # LISP control plane: lisp-cp
734 ##############################################################################
736 list(APPEND VNET_SOURCES
738 lisp-cp/lisp_cp_dpo.c
740 lisp-cp/gid_dictionary.c
741 lisp-cp/lisp_msg_serdes.c
749 list(APPEND VNET_HEADERS
752 lisp-cp/gid_dictionary.h
753 lisp-cp/lisp_cp_messages.h
754 lisp-cp/lisp_msg_serdes.h
758 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
759 list(APPEND VNET_API_FILES lisp-cp/one.api)
761 ##############################################################################
762 # Tunnel protocol: lisp-gpe
763 ##############################################################################
765 list(APPEND VNET_SOURCES
767 lisp-gpe/lisp_gpe_sub_interface.c
768 lisp-gpe/lisp_gpe_adjacency.c
769 lisp-gpe/lisp_gpe_tunnel.c
770 lisp-gpe/lisp_gpe_fwd_entry.c
771 lisp-gpe/lisp_gpe_tenant.c
774 lisp-gpe/lisp_gpe_api.c
777 list(APPEND VNET_HEADERS
779 lisp-gpe/lisp_gpe_fwd_entry.h
780 lisp-gpe/lisp_gpe_tenant.h
781 lisp-gpe/lisp_gpe_packet.h
782 lisp-gpe/lisp_gpe_error.def
785 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
787 ##############################################################################
789 ##############################################################################
790 list(APPEND VNET_SOURCES
792 dhcp/dhcp_client_detect.c
793 dhcp/dhcp6_client_common_dp.c
794 dhcp/dhcp6_pd_client_dp.c
795 dhcp/dhcp6_pd_client_cp.c
796 dhcp/dhcp6_ia_na_client_dp.c
797 dhcp/dhcp6_ia_na_client_cp.c
801 list(APPEND VNET_HEADERS
803 dhcp/dhcp6_client_common_dp.h
804 dhcp/dhcp6_pd_client_dp.h
805 dhcp/dhcp6_ia_na_client_dp.h
808 list(APPEND VNET_API_FILES
810 dhcp/dhcp6_pd_client_cp.api
811 dhcp/dhcp6_ia_na_client_cp.api
814 ##############################################################################
816 ##############################################################################
817 list(APPEND VNET_SOURCES
818 dhcp/dhcp6_proxy_node.c
819 dhcp/dhcp4_proxy_node.c
823 list(APPEND VNET_HEADERS
827 dhcp/dhcp6_proxy_error.def
828 dhcp/dhcp4_proxy_error.def
831 ##############################################################################
832 # ipv6 segment routing
833 ##############################################################################
835 list(APPEND VNET_SOURCES
838 srv6/sr_policy_rewrite.c
843 list(APPEND VNET_HEADERS
848 list(APPEND VNET_API_FILES srv6/sr.api)
850 ##############################################################################
851 # mpls segment routing
852 ##############################################################################
854 list(APPEND VNET_SOURCES
855 srmpls/sr_mpls_policy.c
856 srmpls/sr_mpls_steering.c
860 list(APPEND VNET_HEADERS
864 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
866 ##############################################################################
867 # IPFIX / netflow v10
868 ##############################################################################
869 list(APPEND VNET_SOURCES
870 ipfix-export/flow_report.c
871 ipfix-export/flow_api.c
874 list(APPEND VNET_HEADERS
875 ipfix-export/flow_report.h
876 ipfix-export/ipfix_info_elements.h
877 ipfix-export/ipfix_packet.h
880 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
882 ##############################################################################
883 # IPFIX classify code
884 ##############################################################################
886 list(APPEND VNET_SOURCES
887 ipfix-export/flow_report_classify.c
890 list(APPEND VNET_HEADERS
891 ipfix-export/flow_report_classify.h
894 ##############################################################################
896 ##############################################################################
898 list(APPEND VNET_SOURCES
899 lawful-intercept/lawful_intercept.c
900 lawful-intercept/node.c
903 list(APPEND VNET_HEADERS
904 lawful-intercept/lawful_intercept.h
907 ##############################################################################
908 # SPAN (port mirroring)
909 ##############################################################################
911 list(APPEND VNET_SOURCES
917 list(APPEND VNET_HEADERS
921 list(APPEND VNET_API_FILES span/span.api)
923 ##############################################################################
925 ##############################################################################
926 list(APPEND VNET_SOURCES
932 dns/resolver_process.c
935 list(APPEND VNET_HEADERS
939 list(APPEND VNET_API_FILES dns/dns.api)
941 ##############################################################################
943 ##############################################################################
945 list(APPEND VNET_SOURCES
955 list(APPEND VNET_HEADERS
960 list(APPEND VNET_API_FILES pg/pg.api)
962 ##############################################################################
964 ##############################################################################
966 list(APPEND VNET_SOURCES
967 devices/virtio/device.c
968 devices/virtio/node.c
969 devices/virtio/vhost_user.c
970 devices/virtio/vhost_user_input.c
971 devices/virtio/vhost_user_output.c
972 devices/virtio/vhost_user_api.c
973 devices/virtio/virtio.c
974 devices/virtio/virtio_api.c
979 list(APPEND VNET_HEADERS
981 devices/virtio/virtio.h
982 devices/virtio/vhost_user.h
985 list(APPEND VNET_MULTIARCH_SOURCES
986 devices/virtio/vhost_user_input.c
987 devices/virtio/vhost_user_output.c
990 list(APPEND VNET_API_FILES
991 devices/virtio/vhost_user.api
992 devices/virtio/virtio.api
995 ##############################################################################
996 # tap interface (with virtio backend)
997 ##############################################################################
999 list(APPEND VNET_SOURCES
1002 devices/tap/tapv2_api.c
1005 list(APPEND VNET_HEADERS
1009 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1011 ##############################################################################
1012 # tap interface (with virtio backend)
1013 ##############################################################################
1015 list(APPEND VNET_SOURCES
1016 devices/pipe/pipe_api.c
1020 list(APPEND VNET_HEADERS
1024 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1026 ##############################################################################
1027 # session managmeent
1028 ##############################################################################
1030 list(APPEND VNET_SOURCES
1032 session/session_table.c
1033 session/session_rules_table.c
1034 session/session_lookup.c
1035 session/session_node.c
1037 session/application.c
1038 session/session_cli.c
1039 session/application_interface.c
1040 session/application_namespace.c
1041 session/segment_manager.c
1042 session/session_api.c
1045 list(APPEND VNET_HEADERS
1047 session/session_table.h
1048 session/session_rules_table.h
1049 session/stream_session.h
1050 session/session_lookup.h
1051 session/application.h
1053 session/transport_interface.h
1054 session/application_interface.h
1055 session/application_namespace.h
1056 session/session_debug.h
1057 session/segment_manager.h
1058 session/mma_template.h
1059 session/mma_template.c
1064 list(APPEND VNET_API_FILES session/session.api)
1066 ##############################################################################
1067 # session layer applications
1068 ##############################################################################
1070 list(APPEND VNET_SOURCES
1071 session-apps/echo_client.c
1072 session-apps/echo_server.c
1073 session-apps/http_server.c
1074 session-apps/proxy.c
1077 list(APPEND VNET_HEADERS
1078 session-apps/echo_client.h
1079 session-apps/proxy.h
1082 ##############################################################################
1084 ##############################################################################
1086 list(APPEND VNET_SOURCES
1090 list(APPEND VNET_HEADERS
1094 ##############################################################################
1095 # Linux packet interface
1096 ##############################################################################
1098 list(APPEND VNET_SOURCES
1099 devices/af_packet/af_packet.c
1100 devices/af_packet/device.c
1101 devices/af_packet/node.c
1102 devices/af_packet/cli.c
1103 devices/af_packet/af_packet_api.c
1106 list(APPEND VNET_HEADERS
1107 devices/af_packet/af_packet.h
1110 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1112 ##############################################################################
1114 ##############################################################################
1116 list(APPEND VNET_SOURCES
1117 devices/netmap/netmap.c
1118 devices/netmap/device.c
1119 devices/netmap/node.c
1120 devices/netmap/cli.c
1121 devices/netmap/netmap_api.c
1124 list(APPEND VNET_HEADERS
1125 devices/netmap/netmap.h
1128 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1130 ##############################################################################
1131 # Driver feature graph arc support
1132 ##############################################################################
1134 list(APPEND VNET_SOURCES
1136 feature/feature_api.c
1137 feature/registration.c
1140 list(APPEND VNET_HEADERS
1144 list(APPEND VNET_API_FILES feature/feature.api)
1146 ##############################################################################
1147 # Unix kernel related
1148 ##############################################################################
1150 # FIXME: unix/hgshm.c
1152 list(APPEND VNET_SOURCES
1157 list(APPEND VNET_HEADERS
1161 ##############################################################################
1163 ##############################################################################
1165 list(APPEND VNET_SOURCES
1177 fib/fib_entry_src_rr.c
1178 fib/fib_entry_src_interface.c
1179 fib/fib_entry_src_interpose.c
1180 fib/fib_entry_src_default_route.c
1181 fib/fib_entry_src_special.c
1182 fib/fib_entry_src_api.c
1183 fib/fib_entry_src_adj.c
1184 fib/fib_entry_src_mpls.c
1185 fib/fib_entry_src_lisp.c
1186 fib/fib_entry_cover.c
1187 fib/fib_entry_delegate.c
1192 fib/fib_attached_export.c
1197 list(APPEND VNET_HEADERS
1207 fib/fib_entry_delegate.h
1210 ##############################################################################
1212 ##############################################################################
1214 list(APPEND VNET_SOURCES
1227 list(APPEND VNET_HEADERS
1236 ##############################################################################
1237 # Data-Plane Objects
1238 ##############################################################################
1240 list(APPEND VNET_SOURCES
1248 dpo/load_balance_map.c
1252 dpo/interface_rx_dpo.c
1253 dpo/interface_tx_dpo.c
1254 dpo/mpls_disposition.c
1255 dpo/mpls_label_dpo.c
1260 list(APPEND VNET_HEADERS
1272 ##############################################################################
1274 ##############################################################################
1276 list(APPEND VNET_SOURCES
1285 mfib/mfib_entry_cover.c
1286 mfib/mfib_entry_delegate.c
1287 mfib/mfib_entry_src.c
1288 mfib/mfib_entry_src_rr.c
1292 list(APPEND VNET_HEADERS
1298 ##############################################################################
1300 ##############################################################################
1302 list(APPEND VNET_SOURCES
1309 list(APPEND VNET_HEADERS
1313 ##############################################################################
1315 ##############################################################################
1317 list(APPEND VNET_SOURCES
1320 qos/qos_egress_map.c
1325 list(APPEND VNET_API_FILES qos/qos.api)
1327 ##############################################################################
1329 ##############################################################################
1331 list(APPEND VNET_SOURCES
1332 bier/bier_bit_string.c
1335 bier/bier_fmask_db.c
1344 bier/bier_imp_node.c
1346 bier/bier_disp_entry.c
1347 bier/bier_disp_lookup_node.c
1348 bier/bier_disp_dispatch_node.c
1349 bier/bier_disp_table.c
1350 bier/bier_bift_table.c
1353 list(APPEND VNET_HEADERS
1360 list(APPEND VNET_API_FILES bier/bier.api)
1362 ##############################################################################
1364 ##############################################################################
1366 list (APPEND VNET_SOURCES
1372 list(APPEND VNET_HEADERS
1377 list(APPEND VNET_API_FILES syslog/syslog.api)
1379 ##############################################################################
1381 ##############################################################################
1383 add_vpp_library(vnet
1384 SOURCES ${VNET_SOURCES}
1385 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1386 INSTALL_HEADERS ${VNET_HEADERS}
1387 API_FILES ${VNET_API_FILES}
1388 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1392 ##############################################################################
1394 ##############################################################################
1396 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1397 if(VPP_BUILD_SESSION_ECHO_APPS)
1398 add_vpp_executable(tcp_echo
1399 SOURCES ../tests/vnet/session/tcp_echo.c
1400 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1404 add_vpp_executable(udp_echo
1405 SOURCES ../tests/vnet/session/udp_echo.c
1406 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1410 endif(VPP_BUILD_SESSION_ECHO_APPS)
1412 ##############################################################################