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 l2/l2_output.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
161 list(APPEND VNET_HEADERS
178 list(APPEND VNET_API_FILES l2/l2.api)
180 ##############################################################################
181 # Layer 2 protocol: SRP
182 ##############################################################################
183 list(APPEND VNET_SOURCES
190 list(APPEND VNET_HEADERS
195 ##############################################################################
196 # Layer 2 protocol: PPP
197 ##############################################################################
198 list(APPEND VNET_SOURCES
204 list(APPEND VNET_HEADERS
210 ##############################################################################
211 # Layer 2 protocol: HDLC
212 ##############################################################################
213 list(APPEND VNET_SOURCES
219 list(APPEND VNET_HEADERS
225 ##############################################################################
226 # Layer 2 protocol: LLC
227 ##############################################################################
228 list(APPEND VNET_SOURCES
234 list(APPEND VNET_HEADERS
238 ##############################################################################
239 # Layer 2 protocol: SNAP
240 ##############################################################################
241 list(APPEND VNET_SOURCES
247 list(APPEND VNET_HEADERS
251 ##############################################################################
253 ##############################################################################
254 list(APPEND VNET_SOURCES
261 list(APPEND VNET_HEADERS
264 vxlan/vxlan_error.def
267 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
269 list(APPEND VNET_API_FILES vxlan/vxlan.api)
271 ##############################################################################
273 ##############################################################################
274 list(APPEND VNET_SOURCES
281 list(APPEND VNET_HEADERS
283 geneve/geneve_packet.h
284 geneve/geneve_error.def
287 list(APPEND VNET_API_FILES geneve/geneve.api)
289 ##############################################################################
291 ##############################################################################
292 list(APPEND VNET_SOURCES
299 list(APPEND VNET_HEADERS
303 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c)
304 list(APPEND VNET_API_FILES bonding/bond.api)
306 ##############################################################################
308 ##############################################################################
309 list(APPEND VNET_SOURCES
317 list(APPEND VNET_HEADERS
322 list(APPEND VNET_API_FILES lldp/lldp.api)
324 ##############################################################################
325 # Layer 2/3 "classify"
326 ##############################################################################
327 list(APPEND VNET_SOURCES
328 classify/vnet_classify.c
329 classify/ip_classify.c
330 classify/in_out_acl.c
331 classify/policer_classify.c
332 classify/flow_classify.c
333 classify/flow_classify_node.c
334 classify/vnet_classify.h
335 classify/classify_api.c
338 list(APPEND VNET_HEADERS
339 classify/vnet_classify.h
340 classify/in_out_acl.h
341 classify/policer_classify.h
342 classify/flow_classify.h
345 list(APPEND VNET_API_FILES classify/classify.api)
347 ##############################################################################
348 # Layer 3 protocols go here
349 ##############################################################################
351 ##############################################################################
352 # Layer 3 protocol: IP v4/v6
353 ##############################################################################
354 list(APPEND VNET_SOURCES
367 ip/ip4_source_and_port_range_check.c
368 ip/ip4_source_check.c
394 list(APPEND VNET_HEADERS
407 ip/ip6_hop_by_hop_packet.h
412 ip/ip_source_and_port_range_check.h
421 list(APPEND VNET_API_FILES
427 list(APPEND VNET_MULTIARCH_SOURCES ip/ip4_forward.c ip/ip4_input.c)
429 ##############################################################################
431 ##############################################################################
432 list(APPEND VNET_SOURCES
436 list(APPEND VNET_HEADERS
437 ethernet/arp_packet.h
441 ##############################################################################
442 # Bidirectional Forwarding Detection
443 ##############################################################################
445 list(APPEND VNET_HEADERS
452 list(APPEND VNET_SOURCES
461 list(APPEND VNET_API_FILES bfd/bfd.api)
463 ##############################################################################
464 # Layer 3 protocol: IPSec
465 ##############################################################################
466 list(APPEND VNET_SOURCES
481 ipsec/ikev2_payload.c
486 list(APPEND VNET_API_FILES ipsec/ipsec.api)
488 list(APPEND VNET_SOURCES
492 list(APPEND VNET_HEADERS
500 ##############################################################################
501 # Layer 3 protocol: osi
502 ##############################################################################
503 list(APPEND VNET_SOURCES
509 list(APPEND VNET_HEADERS
513 ##############################################################################
514 # Layer 4 protocol: tcp
515 ##############################################################################
516 list(APPEND VNET_SOURCES
520 tcp/tcp_syn_filter4.c
527 list(APPEND VNET_HEADERS
535 list(APPEND VNET_API_FILES tcp/tcp.api)
537 ##############################################################################
538 # Layer 4 protocol: udp
539 ##############################################################################
540 list(APPEND VNET_SOURCES
551 list(APPEND VNET_HEADERS
557 list(APPEND VNET_API_FILES udp/udp.api)
559 ##############################################################################
560 # Layer 4 protocol: sctp
561 ##############################################################################
562 list(APPEND VNET_SOURCES
571 list(APPEND VNET_HEADERS
578 list(APPEND VNET_API_FILES sctp/sctp.api)
580 ##############################################################################
581 # Tunnel protocol: gre
582 ##############################################################################
583 list(APPEND VNET_SOURCES
591 list(APPEND VNET_HEADERS
597 list(APPEND VNET_API_FILES gre/gre.api)
599 ##############################################################################
600 # Tunnel protocol: ipip
601 ##############################################################################
602 list(APPEND VNET_SOURCES
610 list(APPEND VNET_HEADERS
614 list(APPEND VNET_API_FILES ipip/ipip.api)
616 ##############################################################################
617 # Tunnel protocol: l2tpv3
618 ##############################################################################
619 list(APPEND VNET_SOURCES
627 list(APPEND VNET_HEADERS
632 list(APPEND VNET_API_FILES l2tp/l2tp.api)
634 ##############################################################################
635 # Tunnel protocol: gre+mpls
636 ##############################################################################
637 list(APPEND VNET_SOURCES
649 list(APPEND VNET_HEADERS
657 list(APPEND VNET_API_FILES mpls/mpls.api)
659 ##############################################################################
660 # Tunnel protocol: vxlan-gbp
661 ##############################################################################
662 list(APPEND VNET_SOURCES
665 vxlan-gbp/vxlan_gbp_api.c
666 vxlan-gbp/vxlan_gbp.c
669 list(APPEND VNET_HEADERS
670 vxlan-gbp/vxlan_gbp.h
671 vxlan-gbp/vxlan_gbp_packet.h
672 vxlan-gbp/vxlan_gbp_error.def
675 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
677 ##############################################################################
678 # Tunnel protocol: vxlan-gpe
679 ##############################################################################
681 list(APPEND VNET_SOURCES
682 vxlan-gpe/vxlan_gpe.c
685 vxlan-gpe/vxlan_gpe_api.c
688 list(APPEND VNET_HEADERS
689 vxlan-gpe/vxlan_gpe.h
690 vxlan-gpe/vxlan_gpe_packet.h
691 vxlan-gpe/vxlan_gpe_error.def
694 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
696 ##############################################################################
697 # Tunnel protocol: ipsec+gre
698 ##############################################################################
699 list(APPEND VNET_SOURCES
700 ipsec-gre/ipsec_gre.c
702 ipsec-gre/interface.c
703 ipsec-gre/ipsec_gre_api.c
706 list(APPEND VNET_HEADERS
707 ipsec-gre/ipsec_gre.h
711 list(APPEND VNET_API_FILES ipsec-gre/ipsec_gre.api)
713 ##############################################################################
714 # LISP control plane: lisp-cp
715 ##############################################################################
717 list(APPEND VNET_SOURCES
719 lisp-cp/lisp_cp_dpo.c
721 lisp-cp/gid_dictionary.c
722 lisp-cp/lisp_msg_serdes.c
730 list(APPEND VNET_HEADERS
733 lisp-cp/gid_dictionary.h
734 lisp-cp/lisp_cp_messages.h
735 lisp-cp/lisp_msg_serdes.h
739 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
740 list(APPEND VNET_API_FILES lisp-cp/one.api)
742 ##############################################################################
743 # Tunnel protocol: lisp-gpe
744 ##############################################################################
746 list(APPEND VNET_SOURCES
748 lisp-gpe/lisp_gpe_sub_interface.c
749 lisp-gpe/lisp_gpe_adjacency.c
750 lisp-gpe/lisp_gpe_tunnel.c
751 lisp-gpe/lisp_gpe_fwd_entry.c
752 lisp-gpe/lisp_gpe_tenant.c
755 lisp-gpe/lisp_gpe_api.c
758 list(APPEND VNET_HEADERS
760 lisp-gpe/lisp_gpe_fwd_entry.h
761 lisp-gpe/lisp_gpe_tenant.h
762 lisp-gpe/lisp_gpe_packet.h
763 lisp-gpe/lisp_gpe_error.def
766 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
768 ##############################################################################
770 ##############################################################################
771 list(APPEND VNET_SOURCES
773 dhcp/dhcp_client_detect.c
774 dhcp/dhcp6_client_common_dp.c
775 dhcp/dhcp6_pd_client_dp.c
776 dhcp/dhcp6_pd_client_cp.c
777 dhcp/dhcp6_ia_na_client_dp.c
778 dhcp/dhcp6_ia_na_client_cp.c
782 list(APPEND VNET_HEADERS
784 dhcp/dhcp6_client_common_dp.h
785 dhcp/dhcp6_pd_client_dp.h
786 dhcp/dhcp6_ia_na_client_dp.h
789 list(APPEND VNET_API_FILES
791 dhcp/dhcp6_pd_client_cp.api
792 dhcp/dhcp6_ia_na_client_cp.api
795 ##############################################################################
797 ##############################################################################
798 list(APPEND VNET_SOURCES
799 dhcp/dhcp6_proxy_node.c
800 dhcp/dhcp4_proxy_node.c
804 list(APPEND VNET_HEADERS
808 dhcp/dhcp6_proxy_error.def
809 dhcp/dhcp4_proxy_error.def
812 ##############################################################################
813 # ipv6 segment routing
814 ##############################################################################
816 list(APPEND VNET_SOURCES
819 srv6/sr_policy_rewrite.c
824 list(APPEND VNET_HEADERS
829 list(APPEND VNET_API_FILES srv6/sr.api)
831 ##############################################################################
832 # mpls segment routing
833 ##############################################################################
835 list(APPEND VNET_SOURCES
836 srmpls/sr_mpls_policy.c
837 srmpls/sr_mpls_steering.c
841 list(APPEND VNET_HEADERS
845 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
847 ##############################################################################
848 # IPFIX / netflow v10
849 ##############################################################################
850 list(APPEND VNET_SOURCES
851 ipfix-export/flow_report.c
852 ipfix-export/flow_api.c
855 list(APPEND VNET_HEADERS
856 ipfix-export/flow_report.h
857 ipfix-export/ipfix_info_elements.h
858 ipfix-export/ipfix_packet.h
861 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
863 ##############################################################################
864 # IPFIX classify code
865 ##############################################################################
867 list(APPEND VNET_SOURCES
868 ipfix-export/flow_report_classify.c
871 list(APPEND VNET_HEADERS
872 ipfix-export/flow_report_classify.h
875 ##############################################################################
877 ##############################################################################
879 list(APPEND VNET_SOURCES
880 lawful-intercept/lawful_intercept.c
881 lawful-intercept/node.c
884 list(APPEND VNET_HEADERS
885 lawful-intercept/lawful_intercept.h
888 ##############################################################################
889 # SPAN (port mirroring)
890 ##############################################################################
892 list(APPEND VNET_SOURCES
898 list(APPEND VNET_HEADERS
902 list(APPEND VNET_API_FILES span/span.api)
904 ##############################################################################
906 ##############################################################################
907 list(APPEND VNET_SOURCES
913 dns/resolver_process.c
916 list(APPEND VNET_HEADERS
920 list(APPEND VNET_API_FILES dns/dns.api)
922 ##############################################################################
924 ##############################################################################
926 list(APPEND VNET_SOURCES
936 list(APPEND VNET_HEADERS
941 list(APPEND VNET_API_FILES pg/pg.api)
943 ##############################################################################
945 ##############################################################################
947 list(APPEND VNET_SOURCES
948 devices/virtio/device.c
949 devices/virtio/node.c
950 devices/virtio/vhost_user.c
951 devices/virtio/vhost_user_input.c
952 devices/virtio/vhost_user_output.c
953 devices/virtio/vhost_user_api.c
954 devices/virtio/virtio.c
957 list(APPEND VNET_HEADERS
958 devices/virtio/virtio.h
959 devices/virtio/vhost_user.h
962 list(APPEND VNET_MULTIARCH_SOURCES
963 devices/virtio/vhost_user_input.c
964 devices/virtio/vhost_user_output.c
967 list(APPEND VNET_API_FILES devices/virtio/vhost_user.api)
969 ##############################################################################
970 # tap interface (with virtio backend)
971 ##############################################################################
973 list(APPEND VNET_SOURCES
976 devices/tap/tapv2_api.c
979 list(APPEND VNET_HEADERS
983 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
985 ##############################################################################
986 # tap interface (with virtio backend)
987 ##############################################################################
989 list(APPEND VNET_SOURCES
990 devices/pipe/pipe_api.c
994 list(APPEND VNET_HEADERS
998 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1000 ##############################################################################
1001 # session managmeent
1002 ##############################################################################
1004 list(APPEND VNET_SOURCES
1006 session/session_table.c
1007 session/session_rules_table.c
1008 session/session_lookup.c
1009 session/session_node.c
1011 session/application.c
1012 session/session_cli.c
1013 session/application_interface.c
1014 session/application_namespace.c
1015 session/segment_manager.c
1016 session/session_test.c
1017 session/session_api.c
1020 list(APPEND VNET_HEADERS
1022 session/session_table.h
1023 session/session_rules_table.h
1024 session/stream_session.h
1025 session/session_lookup.h
1026 session/application.h
1028 session/transport_interface.h
1029 session/application_interface.h
1030 session/application_namespace.h
1031 session/session_debug.h
1032 session/segment_manager.h
1033 session/mma_template.h
1034 session/mma_template.c
1039 list(APPEND VNET_API_FILES session/session.api)
1041 ##############################################################################
1042 # session layer applications
1043 ##############################################################################
1045 list(APPEND VNET_SOURCES
1046 session-apps/echo_client.c
1047 session-apps/echo_server.c
1048 session-apps/http_server.c
1049 session-apps/proxy.c
1052 list(APPEND VNET_HEADERS
1053 session-apps/echo_client.h
1054 session-apps/proxy.h
1057 ##############################################################################
1059 ##############################################################################
1061 list(APPEND VNET_SOURCES
1065 list(APPEND VNET_HEADERS
1069 ##############################################################################
1070 # Linux packet interface
1071 ##############################################################################
1073 list(APPEND VNET_SOURCES
1074 devices/af_packet/af_packet.c
1075 devices/af_packet/device.c
1076 devices/af_packet/node.c
1077 devices/af_packet/cli.c
1078 devices/af_packet/af_packet_api.c
1081 list(APPEND VNET_HEADERS
1082 devices/af_packet/af_packet.h
1085 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1087 ##############################################################################
1089 ##############################################################################
1091 list(APPEND VNET_SOURCES
1092 devices/netmap/netmap.c
1093 devices/netmap/device.c
1094 devices/netmap/node.c
1095 devices/netmap/cli.c
1096 devices/netmap/netmap_api.c
1099 list(APPEND VNET_HEADERS
1100 devices/netmap/netmap.h
1103 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1105 ##############################################################################
1106 # Driver feature graph arc support
1107 ##############################################################################
1109 list(APPEND VNET_SOURCES
1111 feature/feature_api.c
1112 feature/registration.c
1115 list(APPEND VNET_HEADERS
1119 list(APPEND VNET_API_FILES feature/feature.api)
1121 ##############################################################################
1122 # Unix kernel related
1123 ##############################################################################
1125 # FIXME: unix/hgshm.c
1127 list(APPEND VNET_SOURCES
1135 list(APPEND VNET_HEADERS
1141 list(APPEND VNET_API_FILES unix/tap.api)
1143 ##############################################################################
1145 ##############################################################################
1147 list(APPEND VNET_SOURCES
1160 fib/fib_entry_src_rr.c
1161 fib/fib_entry_src_interface.c
1162 fib/fib_entry_src_interpose.c
1163 fib/fib_entry_src_default_route.c
1164 fib/fib_entry_src_special.c
1165 fib/fib_entry_src_api.c
1166 fib/fib_entry_src_adj.c
1167 fib/fib_entry_src_mpls.c
1168 fib/fib_entry_src_lisp.c
1169 fib/fib_entry_cover.c
1170 fib/fib_entry_delegate.c
1175 fib/fib_attached_export.c
1180 list(APPEND VNET_HEADERS
1190 fib/fib_entry_delegate.h
1193 ##############################################################################
1195 ##############################################################################
1197 list(APPEND VNET_SOURCES
1210 list(APPEND VNET_HEADERS
1219 ##############################################################################
1220 # Data-Plane Objects
1221 ##############################################################################
1223 list(APPEND VNET_SOURCES
1231 dpo/load_balance_map.c
1235 dpo/interface_rx_dpo.c
1236 dpo/interface_tx_dpo.c
1237 dpo/mpls_disposition.c
1238 dpo/mpls_label_dpo.c
1243 list(APPEND VNET_HEADERS
1255 ##############################################################################
1257 ##############################################################################
1259 list(APPEND VNET_SOURCES
1271 list(APPEND VNET_HEADERS
1277 ##############################################################################
1279 ##############################################################################
1281 list(APPEND VNET_SOURCES
1288 list(APPEND VNET_HEADERS
1292 ##############################################################################
1294 ##############################################################################
1296 list(APPEND VNET_SOURCES
1299 qos/qos_egress_map.c
1304 list(APPEND VNET_API_FILES qos/qos.api)
1306 ##############################################################################
1308 ##############################################################################
1310 list(APPEND VNET_SOURCES
1311 bier/bier_bit_string.c
1314 bier/bier_fmask_db.c
1324 bier/bier_imp_node.c
1326 bier/bier_disp_entry.c
1327 bier/bier_disp_lookup_node.c
1328 bier/bier_disp_dispatch_node.c
1329 bier/bier_disp_table.c
1330 bier/bier_bift_table.c
1333 list(APPEND VNET_HEADERS
1340 list(APPEND VNET_API_FILES bier/bier.api)
1342 add_vpp_library(vnet
1343 SOURCES ${VNET_SOURCES}
1344 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1345 INSTALL_HEADERS ${VNET_HEADERS}
1346 API_FILES ${VNET_API_FILES}
1347 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}