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
162 list(APPEND VNET_MULTIARCH_SOURCES
168 list(APPEND VNET_HEADERS
185 list(APPEND VNET_API_FILES l2/l2.api)
187 ##############################################################################
188 # Layer 2 protocol: SRP
189 ##############################################################################
190 list(APPEND VNET_SOURCES
197 list(APPEND VNET_HEADERS
202 ##############################################################################
203 # Layer 2 protocol: PPP
204 ##############################################################################
205 list(APPEND VNET_SOURCES
211 list(APPEND VNET_HEADERS
217 ##############################################################################
218 # Layer 2 protocol: HDLC
219 ##############################################################################
220 list(APPEND VNET_SOURCES
226 list(APPEND VNET_HEADERS
232 ##############################################################################
233 # Layer 2 protocol: LLC
234 ##############################################################################
235 list(APPEND VNET_SOURCES
241 list(APPEND VNET_HEADERS
245 ##############################################################################
246 # Layer 2 protocol: SNAP
247 ##############################################################################
248 list(APPEND VNET_SOURCES
254 list(APPEND VNET_HEADERS
258 ##############################################################################
260 ##############################################################################
261 list(APPEND VNET_SOURCES
268 list(APPEND VNET_HEADERS
271 vxlan/vxlan_error.def
274 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
276 list(APPEND VNET_API_FILES vxlan/vxlan.api)
278 ##############################################################################
280 ##############################################################################
281 list(APPEND VNET_SOURCES
288 list(APPEND VNET_HEADERS
290 geneve/geneve_packet.h
291 geneve/geneve_error.def
294 list(APPEND VNET_API_FILES geneve/geneve.api)
296 ##############################################################################
298 ##############################################################################
299 list(APPEND VNET_SOURCES
306 list(APPEND VNET_HEADERS
310 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
311 list(APPEND VNET_API_FILES bonding/bond.api)
313 ##############################################################################
315 ##############################################################################
316 list(APPEND VNET_SOURCES
324 list(APPEND VNET_HEADERS
329 list(APPEND VNET_API_FILES lldp/lldp.api)
331 ##############################################################################
332 # Layer 2/3 "classify"
333 ##############################################################################
334 list(APPEND VNET_SOURCES
335 classify/vnet_classify.c
336 classify/ip_classify.c
337 classify/in_out_acl.c
338 classify/policer_classify.c
339 classify/flow_classify.c
340 classify/flow_classify_node.c
341 classify/vnet_classify.h
342 classify/classify_api.c
345 list(APPEND VNET_HEADERS
346 classify/vnet_classify.h
347 classify/in_out_acl.h
348 classify/policer_classify.h
349 classify/flow_classify.h
352 list(APPEND VNET_API_FILES classify/classify.api)
354 ##############################################################################
355 # Layer 3 protocols go here
356 ##############################################################################
358 ##############################################################################
359 # Layer 3 protocol: IP v4/v6
360 ##############################################################################
361 list(APPEND VNET_SOURCES
374 ip/ip4_source_and_port_range_check.c
375 ip/ip4_source_check.c
401 list(APPEND VNET_HEADERS
414 ip/ip6_hop_by_hop_packet.h
419 ip/ip_source_and_port_range_check.h
428 list(APPEND VNET_API_FILES
434 list(APPEND VNET_MULTIARCH_SOURCES ip/ip4_forward.c ip/ip4_input.c)
436 ##############################################################################
438 ##############################################################################
439 list(APPEND VNET_SOURCES
443 list(APPEND VNET_HEADERS
444 ethernet/arp_packet.h
448 ##############################################################################
449 # Bidirectional Forwarding Detection
450 ##############################################################################
452 list(APPEND VNET_HEADERS
459 list(APPEND VNET_SOURCES
468 list(APPEND VNET_API_FILES bfd/bfd.api)
470 ##############################################################################
471 # Layer 3 protocol: IPSec
472 ##############################################################################
473 list(APPEND VNET_SOURCES
488 ipsec/ikev2_payload.c
493 list(APPEND VNET_API_FILES ipsec/ipsec.api)
495 list(APPEND VNET_SOURCES
499 list(APPEND VNET_HEADERS
507 ##############################################################################
508 # Layer 3 protocol: osi
509 ##############################################################################
510 list(APPEND VNET_SOURCES
516 list(APPEND VNET_HEADERS
520 ##############################################################################
521 # Layer 4 protocol: tcp
522 ##############################################################################
523 list(APPEND VNET_SOURCES
527 tcp/tcp_syn_filter4.c
534 list(APPEND VNET_HEADERS
542 list(APPEND VNET_API_FILES tcp/tcp.api)
544 ##############################################################################
545 # Layer 4 protocol: udp
546 ##############################################################################
547 list(APPEND VNET_SOURCES
558 list(APPEND VNET_HEADERS
564 list(APPEND VNET_API_FILES udp/udp.api)
566 ##############################################################################
567 # Layer 4 protocol: sctp
568 ##############################################################################
569 list(APPEND VNET_SOURCES
578 list(APPEND VNET_HEADERS
585 list(APPEND VNET_API_FILES sctp/sctp.api)
587 ##############################################################################
588 # Tunnel protocol: gre
589 ##############################################################################
590 list(APPEND VNET_SOURCES
598 list(APPEND VNET_HEADERS
604 list(APPEND VNET_API_FILES gre/gre.api)
606 ##############################################################################
607 # Tunnel protocol: ipip
608 ##############################################################################
609 list(APPEND VNET_SOURCES
617 list(APPEND VNET_HEADERS
621 list(APPEND VNET_API_FILES ipip/ipip.api)
623 ##############################################################################
624 # Tunnel protocol: l2tpv3
625 ##############################################################################
626 list(APPEND VNET_SOURCES
634 list(APPEND VNET_HEADERS
639 list(APPEND VNET_API_FILES l2tp/l2tp.api)
641 ##############################################################################
642 # Tunnel protocol: gre+mpls
643 ##############################################################################
644 list(APPEND VNET_SOURCES
656 list(APPEND VNET_HEADERS
664 list(APPEND VNET_API_FILES mpls/mpls.api)
666 ##############################################################################
667 # Tunnel protocol: vxlan-gbp
668 ##############################################################################
669 list(APPEND VNET_SOURCES
672 vxlan-gbp/vxlan_gbp_api.c
673 vxlan-gbp/vxlan_gbp.c
676 list(APPEND VNET_HEADERS
677 vxlan-gbp/vxlan_gbp.h
678 vxlan-gbp/vxlan_gbp_packet.h
679 vxlan-gbp/vxlan_gbp_error.def
682 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
684 ##############################################################################
685 # Tunnel protocol: vxlan-gpe
686 ##############################################################################
688 list(APPEND VNET_SOURCES
689 vxlan-gpe/vxlan_gpe.c
692 vxlan-gpe/vxlan_gpe_api.c
695 list(APPEND VNET_HEADERS
696 vxlan-gpe/vxlan_gpe.h
697 vxlan-gpe/vxlan_gpe_packet.h
698 vxlan-gpe/vxlan_gpe_error.def
701 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
703 ##############################################################################
704 # Tunnel protocol: ipsec+gre
705 ##############################################################################
706 list(APPEND VNET_SOURCES
707 ipsec-gre/ipsec_gre.c
709 ipsec-gre/interface.c
710 ipsec-gre/ipsec_gre_api.c
713 list(APPEND VNET_HEADERS
714 ipsec-gre/ipsec_gre.h
718 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
720 ##############################################################################
721 # LISP control plane: lisp-cp
722 ##############################################################################
724 list(APPEND VNET_SOURCES
726 lisp-cp/lisp_cp_dpo.c
728 lisp-cp/gid_dictionary.c
729 lisp-cp/lisp_msg_serdes.c
737 list(APPEND VNET_HEADERS
740 lisp-cp/gid_dictionary.h
741 lisp-cp/lisp_cp_messages.h
742 lisp-cp/lisp_msg_serdes.h
746 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
747 list(APPEND VNET_API_FILES lisp-cp/one.api)
749 ##############################################################################
750 # Tunnel protocol: lisp-gpe
751 ##############################################################################
753 list(APPEND VNET_SOURCES
755 lisp-gpe/lisp_gpe_sub_interface.c
756 lisp-gpe/lisp_gpe_adjacency.c
757 lisp-gpe/lisp_gpe_tunnel.c
758 lisp-gpe/lisp_gpe_fwd_entry.c
759 lisp-gpe/lisp_gpe_tenant.c
762 lisp-gpe/lisp_gpe_api.c
765 list(APPEND VNET_HEADERS
767 lisp-gpe/lisp_gpe_fwd_entry.h
768 lisp-gpe/lisp_gpe_tenant.h
769 lisp-gpe/lisp_gpe_packet.h
770 lisp-gpe/lisp_gpe_error.def
773 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
775 ##############################################################################
777 ##############################################################################
778 list(APPEND VNET_SOURCES
780 dhcp/dhcp_client_detect.c
781 dhcp/dhcp6_client_common_dp.c
782 dhcp/dhcp6_pd_client_dp.c
783 dhcp/dhcp6_pd_client_cp.c
784 dhcp/dhcp6_ia_na_client_dp.c
785 dhcp/dhcp6_ia_na_client_cp.c
789 list(APPEND VNET_HEADERS
791 dhcp/dhcp6_client_common_dp.h
792 dhcp/dhcp6_pd_client_dp.h
793 dhcp/dhcp6_ia_na_client_dp.h
796 list(APPEND VNET_API_FILES
798 dhcp/dhcp6_pd_client_cp.api
799 dhcp/dhcp6_ia_na_client_cp.api
802 ##############################################################################
804 ##############################################################################
805 list(APPEND VNET_SOURCES
806 dhcp/dhcp6_proxy_node.c
807 dhcp/dhcp4_proxy_node.c
811 list(APPEND VNET_HEADERS
815 dhcp/dhcp6_proxy_error.def
816 dhcp/dhcp4_proxy_error.def
819 ##############################################################################
820 # ipv6 segment routing
821 ##############################################################################
823 list(APPEND VNET_SOURCES
826 srv6/sr_policy_rewrite.c
831 list(APPEND VNET_HEADERS
836 list(APPEND VNET_API_FILES srv6/sr.api)
838 ##############################################################################
839 # mpls segment routing
840 ##############################################################################
842 list(APPEND VNET_SOURCES
843 srmpls/sr_mpls_policy.c
844 srmpls/sr_mpls_steering.c
848 list(APPEND VNET_HEADERS
852 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
854 ##############################################################################
855 # IPFIX / netflow v10
856 ##############################################################################
857 list(APPEND VNET_SOURCES
858 ipfix-export/flow_report.c
859 ipfix-export/flow_api.c
862 list(APPEND VNET_HEADERS
863 ipfix-export/flow_report.h
864 ipfix-export/ipfix_info_elements.h
865 ipfix-export/ipfix_packet.h
868 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
870 ##############################################################################
871 # IPFIX classify code
872 ##############################################################################
874 list(APPEND VNET_SOURCES
875 ipfix-export/flow_report_classify.c
878 list(APPEND VNET_HEADERS
879 ipfix-export/flow_report_classify.h
882 ##############################################################################
884 ##############################################################################
886 list(APPEND VNET_SOURCES
887 lawful-intercept/lawful_intercept.c
888 lawful-intercept/node.c
891 list(APPEND VNET_HEADERS
892 lawful-intercept/lawful_intercept.h
895 ##############################################################################
896 # SPAN (port mirroring)
897 ##############################################################################
899 list(APPEND VNET_SOURCES
905 list(APPEND VNET_HEADERS
909 list(APPEND VNET_API_FILES span/span.api)
911 ##############################################################################
913 ##############################################################################
914 list(APPEND VNET_SOURCES
920 dns/resolver_process.c
923 list(APPEND VNET_HEADERS
927 list(APPEND VNET_API_FILES dns/dns.api)
929 ##############################################################################
931 ##############################################################################
933 list(APPEND VNET_SOURCES
943 list(APPEND VNET_HEADERS
948 list(APPEND VNET_API_FILES pg/pg.api)
950 ##############################################################################
952 ##############################################################################
954 list(APPEND VNET_SOURCES
955 devices/virtio/device.c
956 devices/virtio/node.c
957 devices/virtio/vhost_user.c
958 devices/virtio/vhost_user_input.c
959 devices/virtio/vhost_user_output.c
960 devices/virtio/vhost_user_api.c
961 devices/virtio/virtio.c
964 list(APPEND VNET_HEADERS
965 devices/virtio/virtio.h
966 devices/virtio/vhost_user.h
969 list(APPEND VNET_MULTIARCH_SOURCES
970 devices/virtio/vhost_user_input.c
971 devices/virtio/vhost_user_output.c
974 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
976 ##############################################################################
977 # tap interface (with virtio backend)
978 ##############################################################################
980 list(APPEND VNET_SOURCES
983 devices/tap/tapv2_api.c
986 list(APPEND VNET_HEADERS
990 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
992 ##############################################################################
993 # tap interface (with virtio backend)
994 ##############################################################################
996 list(APPEND VNET_SOURCES
997 devices/pipe/pipe_api.c
1001 list(APPEND VNET_HEADERS
1005 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1007 ##############################################################################
1008 # session managmeent
1009 ##############################################################################
1011 list(APPEND VNET_SOURCES
1013 session/session_table.c
1014 session/session_rules_table.c
1015 session/session_lookup.c
1016 session/session_node.c
1018 session/application.c
1019 session/session_cli.c
1020 session/application_interface.c
1021 session/application_namespace.c
1022 session/segment_manager.c
1023 session/session_test.c
1024 session/session_api.c
1027 list(APPEND VNET_HEADERS
1029 session/session_table.h
1030 session/session_rules_table.h
1031 session/stream_session.h
1032 session/session_lookup.h
1033 session/application.h
1035 session/transport_interface.h
1036 session/application_interface.h
1037 session/application_namespace.h
1038 session/session_debug.h
1039 session/segment_manager.h
1040 session/mma_template.h
1041 session/mma_template.c
1046 list(APPEND VNET_API_FILES session/session.api)
1048 ##############################################################################
1049 # session layer applications
1050 ##############################################################################
1052 list(APPEND VNET_SOURCES
1053 session-apps/echo_client.c
1054 session-apps/echo_server.c
1055 session-apps/http_server.c
1056 session-apps/proxy.c
1059 list(APPEND VNET_HEADERS
1060 session-apps/echo_client.h
1061 session-apps/proxy.h
1064 ##############################################################################
1066 ##############################################################################
1068 list(APPEND VNET_SOURCES
1072 list(APPEND VNET_HEADERS
1076 ##############################################################################
1077 # Linux packet interface
1078 ##############################################################################
1080 list(APPEND VNET_SOURCES
1081 devices/af_packet/af_packet.c
1082 devices/af_packet/device.c
1083 devices/af_packet/node.c
1084 devices/af_packet/cli.c
1085 devices/af_packet/af_packet_api.c
1088 list(APPEND VNET_HEADERS
1089 devices/af_packet/af_packet.h
1092 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1094 ##############################################################################
1096 ##############################################################################
1098 list(APPEND VNET_SOURCES
1099 devices/netmap/netmap.c
1100 devices/netmap/device.c
1101 devices/netmap/node.c
1102 devices/netmap/cli.c
1103 devices/netmap/netmap_api.c
1106 list(APPEND VNET_HEADERS
1107 devices/netmap/netmap.h
1110 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1112 ##############################################################################
1113 # Driver feature graph arc support
1114 ##############################################################################
1116 list(APPEND VNET_SOURCES
1118 feature/feature_api.c
1119 feature/registration.c
1122 list(APPEND VNET_HEADERS
1126 list(APPEND VNET_API_FILES feature/feature.api)
1128 ##############################################################################
1129 # Unix kernel related
1130 ##############################################################################
1132 # FIXME: unix/hgshm.c
1134 list(APPEND VNET_SOURCES
1142 list(APPEND VNET_HEADERS
1148 list(APPEND VNET_API_FILES unix/tap.api)
1150 ##############################################################################
1152 ##############################################################################
1154 list(APPEND VNET_SOURCES
1167 fib/fib_entry_src_rr.c
1168 fib/fib_entry_src_interface.c
1169 fib/fib_entry_src_interpose.c
1170 fib/fib_entry_src_default_route.c
1171 fib/fib_entry_src_special.c
1172 fib/fib_entry_src_api.c
1173 fib/fib_entry_src_adj.c
1174 fib/fib_entry_src_mpls.c
1175 fib/fib_entry_src_lisp.c
1176 fib/fib_entry_cover.c
1177 fib/fib_entry_delegate.c
1182 fib/fib_attached_export.c
1187 list(APPEND VNET_HEADERS
1197 fib/fib_entry_delegate.h
1200 ##############################################################################
1202 ##############################################################################
1204 list(APPEND VNET_SOURCES
1217 list(APPEND VNET_HEADERS
1226 ##############################################################################
1227 # Data-Plane Objects
1228 ##############################################################################
1230 list(APPEND VNET_SOURCES
1238 dpo/load_balance_map.c
1242 dpo/interface_rx_dpo.c
1243 dpo/interface_tx_dpo.c
1244 dpo/mpls_disposition.c
1245 dpo/mpls_label_dpo.c
1250 list(APPEND VNET_HEADERS
1262 ##############################################################################
1264 ##############################################################################
1266 list(APPEND VNET_SOURCES
1278 list(APPEND VNET_HEADERS
1284 ##############################################################################
1286 ##############################################################################
1288 list(APPEND VNET_SOURCES
1295 list(APPEND VNET_HEADERS
1299 ##############################################################################
1301 ##############################################################################
1303 list(APPEND VNET_SOURCES
1306 qos/qos_egress_map.c
1311 list(APPEND VNET_API_FILES qos/qos.api)
1313 ##############################################################################
1315 ##############################################################################
1317 list(APPEND VNET_SOURCES
1318 bier/bier_bit_string.c
1321 bier/bier_fmask_db.c
1331 bier/bier_imp_node.c
1333 bier/bier_disp_entry.c
1334 bier/bier_disp_lookup_node.c
1335 bier/bier_disp_dispatch_node.c
1336 bier/bier_disp_table.c
1337 bier/bier_bift_table.c
1340 list(APPEND VNET_HEADERS
1347 list(APPEND VNET_API_FILES bier/bier.api)
1349 ##############################################################################
1351 ##############################################################################
1353 add_vpp_library(vnet
1354 SOURCES ${VNET_SOURCES}
1355 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1356 INSTALL_HEADERS ${VNET_HEADERS}
1357 API_FILES ${VNET_API_FILES}
1358 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1362 ##############################################################################
1364 ##############################################################################
1366 option(VPP_BUILD_SESSION_ECHO_APPS "Build session echo apps." ON)
1367 if(VPP_BUILD_SESSION_ECHO_APPS)
1368 add_vpp_executable(tcp_echo
1369 SOURCES ../tests/vnet/session/tcp_echo.c
1370 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1374 add_vpp_executable(udp_echo
1375 SOURCES ../tests/vnet/session/udp_echo.c
1376 LINK_LIBRARIES vlibmemoryclient svm vppinfra pthread m rt
1380 endif(VPP_BUILD_SESSION_ECHO_APPS)
1382 ##############################################################################