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_MULTIARCH_SOURCES
48 list(APPEND VNET_HEADERS
72 list(APPEND VNET_API_FILES
77 ##############################################################################
79 ##############################################################################
80 list(APPEND VNET_SOURCES
87 list(APPEND VNET_MULTIARCH_SOURCES
91 list(APPEND VNET_HEADERS
97 list(APPEND VNET_API_FILES policer/policer.api)
99 ##############################################################################
101 ##############################################################################
102 list(APPEND VNET_SOURCES
110 list(APPEND VNET_MULTIARCH_SOURCES
116 list(APPEND VNET_HEADERS
120 list(APPEND VNET_API_FILES cop/cop.api)
122 ##############################################################################
123 # Layer 2 protocols go here
124 ##############################################################################
126 ##############################################################################
127 # Layer 2 protocol: Ethernet
128 ##############################################################################
129 list(APPEND VNET_SOURCES
130 ethernet/ethernet_types_api.c
134 ethernet/mac_address.c
138 ethernet/p2p_ethernet.c
139 ethernet/p2p_ethernet_input.c
140 ethernet/p2p_ethernet_api.c
143 list(APPEND VNET_MULTIARCH_SOURCES
145 ethernet/p2p_ethernet_input.c
148 list(APPEND VNET_HEADERS
151 ethernet/mac_address.h
155 ethernet/p2p_ethernet.h
158 list(APPEND VNET_API_FILES ethernet/p2p_ethernet.api)
160 ##############################################################################
161 # Layer 2 protocol: Ethernet bridging
162 ##############################################################################
163 list(APPEND VNET_SOURCES
169 l2/l2_input_classify.c
170 l2/l2_output_classify.c
180 l2/l2_in_out_feat_arc.c
188 list(APPEND VNET_MULTIARCH_SOURCES
194 l2/l2_in_out_feat_arc.c
195 l2/l2_input_classify.c
197 l2/l2_output_classify.c
207 list(APPEND VNET_HEADERS
224 list(APPEND VNET_API_FILES l2/l2.api)
226 ##############################################################################
227 # Layer 2 protocol: SRP
228 ##############################################################################
229 list(APPEND VNET_SOURCES
236 list(APPEND VNET_HEADERS
241 ##############################################################################
242 # Layer 2 protocol: PPP
243 ##############################################################################
244 list(APPEND VNET_SOURCES
250 list(APPEND VNET_HEADERS
256 ##############################################################################
257 # Layer 2 protocol: HDLC
258 ##############################################################################
259 list(APPEND VNET_SOURCES
265 list(APPEND VNET_HEADERS
271 ##############################################################################
272 # Layer 2 protocol: LLC
273 ##############################################################################
274 list(APPEND VNET_SOURCES
280 list(APPEND VNET_HEADERS
284 ##############################################################################
285 # Layer 2 protocol: SNAP
286 ##############################################################################
287 list(APPEND VNET_SOURCES
293 list(APPEND VNET_HEADERS
297 ##############################################################################
299 ##############################################################################
300 list(APPEND VNET_SOURCES
307 list(APPEND VNET_MULTIARCH_SOURCES
311 list(APPEND VNET_HEADERS
314 vxlan/vxlan_error.def
317 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
319 list(APPEND VNET_API_FILES vxlan/vxlan.api)
321 ##############################################################################
323 ##############################################################################
324 list(APPEND VNET_SOURCES
331 list(APPEND VNET_MULTIARCH_SOURCES
336 list(APPEND VNET_HEADERS
338 geneve/geneve_packet.h
339 geneve/geneve_error.def
342 list(APPEND VNET_API_FILES geneve/geneve.api)
344 ##############################################################################
346 ##############################################################################
347 list(APPEND VNET_SOURCES
354 list(APPEND VNET_HEADERS
358 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
359 list(APPEND VNET_API_FILES bonding/bond.api)
361 ##############################################################################
363 ##############################################################################
364 list(APPEND VNET_SOURCES
372 list(APPEND VNET_HEADERS
377 list(APPEND VNET_API_FILES lldp/lldp.api)
379 ##############################################################################
380 # Layer 2/3 "classify"
381 ##############################################################################
382 list(APPEND VNET_SOURCES
383 classify/vnet_classify.c
384 classify/ip_classify.c
385 classify/in_out_acl.c
386 classify/policer_classify.c
387 classify/flow_classify.c
388 classify/flow_classify_node.c
389 classify/vnet_classify.h
390 classify/classify_api.c
393 list(APPEND VNET_MULTIARCH_SOURCES
394 classify/ip_classify.c
395 classify/flow_classify_node.c
398 list(APPEND VNET_HEADERS
399 classify/vnet_classify.h
400 classify/in_out_acl.h
401 classify/policer_classify.h
402 classify/flow_classify.h
405 list(APPEND VNET_API_FILES classify/classify.api)
407 ##############################################################################
408 # Layer 3 protocols go here
409 ##############################################################################
411 ##############################################################################
412 # Layer 3 protocol: IP v4/v6
413 ##############################################################################
414 list(APPEND VNET_SOURCES
427 ip/ip4_source_and_port_range_check.c
428 ip/ip4_source_check.c
456 list(APPEND VNET_MULTIARCH_SOURCES
457 ip/ip4_source_check.c
468 list(APPEND VNET_HEADERS
481 ip/ip6_hop_by_hop_packet.h
486 ip/ip_source_and_port_range_check.h
495 list(APPEND VNET_API_FILES
501 list(APPEND VNET_MULTIARCH_SOURCES
507 ##############################################################################
509 ##############################################################################
510 list(APPEND VNET_SOURCES
514 list(APPEND VNET_HEADERS
515 ethernet/arp_packet.h
519 ##############################################################################
520 # Bidirectional Forwarding Detection
521 ##############################################################################
523 list(APPEND VNET_HEADERS
530 list(APPEND VNET_SOURCES
539 list(APPEND VNET_API_FILES bfd/bfd.api)
541 ##############################################################################
543 ##############################################################################
545 list(APPEND VNET_SOURCES
551 list(APPEND VNET_HEADERS
555 ##############################################################################
556 # Layer 3 protocol: IPSec
557 ##############################################################################
558 list(APPEND VNET_SOURCES
568 ipsec/ipsec_spd_policy.c
579 list(APPEND VNET_MULTIARCH_SOURCES
590 list(APPEND VNET_API_FILES ipsec/ipsec.api)
592 list(APPEND VNET_SOURCES
596 list(APPEND VNET_HEADERS
599 ipsec/ipsec_spd_policy.h
607 ##############################################################################
608 # Layer 3 protocol: osi
609 ##############################################################################
610 list(APPEND VNET_SOURCES
616 list(APPEND VNET_HEADERS
620 ##############################################################################
621 # Layer 4 protocol: tcp
622 ##############################################################################
623 list(APPEND VNET_SOURCES
627 tcp/tcp_syn_filter4.c
636 list(APPEND VNET_MULTIARCH_SOURCES
639 tcp/tcp_syn_filter4.c
642 list(APPEND VNET_HEADERS
650 list(APPEND VNET_API_FILES tcp/tcp.api)
652 ##############################################################################
653 # Layer 4 protocol: udp
654 ##############################################################################
655 list(APPEND VNET_SOURCES
666 list(APPEND VNET_MULTIARCH_SOURCES
671 list(APPEND VNET_HEADERS
677 list(APPEND VNET_API_FILES udp/udp.api)
679 ##############################################################################
680 # Tunnel protocol: gre
681 ##############################################################################
682 list(APPEND VNET_SOURCES
690 list(APPEND VNET_MULTIARCH_SOURCES
695 list(APPEND VNET_HEADERS
701 list(APPEND VNET_API_FILES gre/gre.api)
703 ##############################################################################
704 # Tunnel protocol: ipip
705 ##############################################################################
706 list(APPEND VNET_SOURCES
714 list(APPEND VNET_MULTIARCH_SOURCES
718 list(APPEND VNET_HEADERS
722 list(APPEND VNET_API_FILES ipip/ipip.api)
724 ##############################################################################
725 # Tunnel protocol: l2tpv3
726 ##############################################################################
727 list(APPEND VNET_SOURCES
735 list(APPEND VNET_MULTIARCH_SOURCES
740 list(APPEND VNET_HEADERS
745 list(APPEND VNET_API_FILES l2tp/l2tp.api)
747 ##############################################################################
748 # Tunnel protocol: gre+mpls
749 ##############################################################################
750 list(APPEND VNET_SOURCES
762 list(APPEND VNET_MULTIARCH_SOURCES
769 list(APPEND VNET_HEADERS
777 list(APPEND VNET_API_FILES mpls/mpls.api)
779 ##############################################################################
780 # Tunnel protocol: vxlan-gbp
781 ##############################################################################
782 list(APPEND VNET_SOURCES
785 vxlan-gbp/vxlan_gbp_api.c
786 vxlan-gbp/vxlan_gbp.c
787 vxlan-gbp/vxlan_gbp_packet.c
790 list (APPEND VNET_MULTIARCH_SOURCES
795 list(APPEND VNET_HEADERS
796 vxlan-gbp/vxlan_gbp.h
797 vxlan-gbp/vxlan_gbp_packet.h
798 vxlan-gbp/vxlan_gbp_error.def
801 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
803 ##############################################################################
804 # Tunnel protocol: vxlan-gpe
805 ##############################################################################
807 list(APPEND VNET_SOURCES
808 vxlan-gpe/vxlan_gpe.c
811 vxlan-gpe/vxlan_gpe_api.c
814 list (APPEND VNET_MULTIARCH_SOURCES
818 list(APPEND VNET_HEADERS
819 vxlan-gpe/vxlan_gpe.h
820 vxlan-gpe/vxlan_gpe_packet.h
821 vxlan-gpe/vxlan_gpe_error.def
824 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
826 ##############################################################################
827 # LISP control plane: lisp-cp
828 ##############################################################################
830 list(APPEND VNET_SOURCES
832 lisp-cp/lisp_cp_dpo.c
834 lisp-cp/gid_dictionary.c
835 lisp-cp/lisp_msg_serdes.c
843 list(APPEND VNET_HEADERS
846 lisp-cp/gid_dictionary.h
847 lisp-cp/lisp_cp_messages.h
848 lisp-cp/lisp_msg_serdes.h
852 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
853 list(APPEND VNET_API_FILES lisp-cp/one.api)
855 ##############################################################################
856 # Tunnel protocol: lisp-gpe
857 ##############################################################################
859 list(APPEND VNET_SOURCES
861 lisp-gpe/lisp_gpe_sub_interface.c
862 lisp-gpe/lisp_gpe_adjacency.c
863 lisp-gpe/lisp_gpe_tunnel.c
864 lisp-gpe/lisp_gpe_fwd_entry.c
865 lisp-gpe/lisp_gpe_tenant.c
868 lisp-gpe/lisp_gpe_api.c
871 list(APPEND VNET_HEADERS
873 lisp-gpe/lisp_gpe_fwd_entry.h
874 lisp-gpe/lisp_gpe_tenant.h
875 lisp-gpe/lisp_gpe_packet.h
876 lisp-gpe/lisp_gpe_error.def
879 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
881 ##############################################################################
883 ##############################################################################
884 list(APPEND VNET_SOURCES
886 dhcp/dhcp_client_detect.c
887 dhcp/dhcp6_client_common_dp.c
888 dhcp/dhcp6_pd_client_dp.c
889 dhcp/dhcp6_pd_client_cp.c
890 dhcp/dhcp6_ia_na_client_dp.c
891 dhcp/dhcp6_ia_na_client_cp.c
895 list(APPEND VNET_MULTIARCH_SOURCES
896 dhcp/dhcp_client_detect.c
899 list(APPEND VNET_HEADERS
901 dhcp/dhcp6_client_common_dp.h
902 dhcp/dhcp6_pd_client_dp.h
903 dhcp/dhcp6_ia_na_client_dp.h
906 list(APPEND VNET_API_FILES
908 dhcp/dhcp6_pd_client_cp.api
909 dhcp/dhcp6_ia_na_client_cp.api
912 ##############################################################################
914 ##############################################################################
915 list(APPEND VNET_SOURCES
916 dhcp/dhcp6_proxy_node.c
917 dhcp/dhcp4_proxy_node.c
921 list(APPEND VNET_HEADERS
925 dhcp/dhcp6_proxy_error.def
926 dhcp/dhcp4_proxy_error.def
929 ##############################################################################
930 # ipv6 segment routing
931 ##############################################################################
933 list(APPEND VNET_SOURCES
936 srv6/sr_policy_rewrite.c
941 list(APPEND VNET_HEADERS
946 list(APPEND VNET_API_FILES srv6/sr.api)
948 ##############################################################################
949 # mpls segment routing
950 ##############################################################################
952 list(APPEND VNET_SOURCES
953 srmpls/sr_mpls_policy.c
954 srmpls/sr_mpls_steering.c
958 list(APPEND VNET_HEADERS
962 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
964 ##############################################################################
965 # IPFIX / netflow v10
966 ##############################################################################
967 list(APPEND VNET_SOURCES
968 ipfix-export/flow_report.c
969 ipfix-export/flow_api.c
972 list(APPEND VNET_HEADERS
973 ipfix-export/flow_report.h
974 ipfix-export/ipfix_info_elements.h
975 ipfix-export/ipfix_packet.h
978 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
980 ##############################################################################
981 # IPFIX classify code
982 ##############################################################################
984 list(APPEND VNET_SOURCES
985 ipfix-export/flow_report_classify.c
988 list(APPEND VNET_HEADERS
989 ipfix-export/flow_report_classify.h
992 ##############################################################################
994 ##############################################################################
996 list(APPEND VNET_SOURCES
997 lawful-intercept/lawful_intercept.c
998 lawful-intercept/node.c
1001 list(APPEND VNET_MULTIARCH_SOURCES
1002 lawful-intercept/node.c
1005 list(APPEND VNET_HEADERS
1006 lawful-intercept/lawful_intercept.h
1009 ##############################################################################
1010 # SPAN (port mirroring)
1011 ##############################################################################
1013 list(APPEND VNET_SOURCES
1019 list(APPEND VNET_MULTIARCH_SOURCES
1023 list(APPEND VNET_HEADERS
1027 list(APPEND VNET_API_FILES span/span.api)
1029 ##############################################################################
1031 ##############################################################################
1032 list(APPEND VNET_SOURCES
1038 dns/resolver_process.c
1041 list(APPEND VNET_HEADERS
1045 list(APPEND VNET_API_FILES dns/dns.api)
1047 ##############################################################################
1049 ##############################################################################
1051 list(APPEND VNET_SOURCES
1061 list(APPEND VNET_HEADERS
1066 list(APPEND VNET_API_FILES pg/pg.api)
1068 ##############################################################################
1070 ##############################################################################
1072 list(APPEND VNET_SOURCES
1073 devices/virtio/device.c
1074 devices/virtio/node.c
1075 devices/virtio/vhost_user.c
1076 devices/virtio/vhost_user_input.c
1077 devices/virtio/vhost_user_output.c
1078 devices/virtio/vhost_user_api.c
1079 devices/virtio/virtio.c
1080 devices/virtio/virtio_api.c
1081 devices/virtio/cli.c
1082 devices/virtio/pci.c
1085 list(APPEND VNET_HEADERS
1086 devices/virtio/pci.h
1087 devices/virtio/virtio.h
1088 devices/virtio/vhost_user.h
1091 list(APPEND VNET_MULTIARCH_SOURCES
1092 devices/virtio/vhost_user_input.c
1093 devices/virtio/vhost_user_output.c
1094 devices/netmap/node.c
1095 devices/virtio/node.c
1096 devices/af_packet/node.c
1097 devices/virtio/device.c
1100 list(APPEND VNET_API_FILES
1101 devices/virtio/vhost_user.api
1102 devices/virtio/virtio.api
1105 ##############################################################################
1106 # tap interface (with virtio backend)
1107 ##############################################################################
1109 list(APPEND VNET_SOURCES
1112 devices/tap/tapv2_api.c
1115 list(APPEND VNET_HEADERS
1119 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1121 ##############################################################################
1122 # tap interface (with virtio backend)
1123 ##############################################################################
1125 list(APPEND VNET_SOURCES
1126 devices/pipe/pipe_api.c
1130 list(APPEND VNET_HEADERS
1134 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1136 ##############################################################################
1137 # session managmeent
1138 ##############################################################################
1140 list(APPEND VNET_SOURCES
1142 session/session_table.c
1143 session/session_rules_table.c
1144 session/session_lookup.c
1145 session/session_node.c
1147 session/application.c
1148 session/application_worker.c
1149 session/session_cli.c
1150 session/application_interface.c
1151 session/application_local.c
1152 session/application_namespace.c
1153 session/segment_manager.c
1154 session/session_api.c
1157 list(APPEND VNET_HEADERS
1159 session/session_table.h
1160 session/session_rules_table.h
1161 session/session_types.h
1162 session/session_lookup.h
1163 session/application.h
1165 session/transport_types.h
1166 session/application_interface.h
1167 session/application_local.h
1168 session/application_namespace.h
1169 session/session_debug.h
1170 session/segment_manager.h
1171 session/mma_template.h
1172 session/mma_template.c
1177 list(APPEND VNET_API_FILES session/session.api)
1179 ##############################################################################
1181 ##############################################################################
1183 list(APPEND VNET_SOURCES
1187 list(APPEND VNET_HEADERS
1192 ##############################################################################
1193 # Linux packet interface
1194 ##############################################################################
1196 list(APPEND VNET_SOURCES
1197 devices/af_packet/af_packet.c
1198 devices/af_packet/device.c
1199 devices/af_packet/node.c
1200 devices/af_packet/cli.c
1201 devices/af_packet/af_packet_api.c
1204 list(APPEND VNET_MULTIARCH_SOURCES
1205 devices/netmap/device.c
1206 devices/af_packet/device.c
1209 list(APPEND VNET_HEADERS
1210 devices/af_packet/af_packet.h
1213 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1215 ##############################################################################
1217 ##############################################################################
1219 list(APPEND VNET_SOURCES
1220 devices/netmap/netmap.c
1221 devices/netmap/device.c
1222 devices/netmap/node.c
1223 devices/netmap/cli.c
1224 devices/netmap/netmap_api.c
1227 list(APPEND VNET_HEADERS
1228 devices/netmap/netmap.h
1231 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1233 ##############################################################################
1234 # Driver feature graph arc support
1235 ##############################################################################
1237 list(APPEND VNET_SOURCES
1239 feature/feature_api.c
1240 feature/registration.c
1243 list(APPEND VNET_HEADERS
1247 list(APPEND VNET_API_FILES feature/feature.api)
1249 ##############################################################################
1250 # Unix kernel related
1251 ##############################################################################
1253 # FIXME: unix/hgshm.c
1255 list(APPEND VNET_SOURCES
1260 list(APPEND VNET_HEADERS
1264 ##############################################################################
1266 ##############################################################################
1268 list(APPEND VNET_SOURCES
1280 fib/fib_entry_src_rr.c
1281 fib/fib_entry_src_interface.c
1282 fib/fib_entry_src_interpose.c
1283 fib/fib_entry_src_default_route.c
1284 fib/fib_entry_src_special.c
1285 fib/fib_entry_src_api.c
1286 fib/fib_entry_src_adj.c
1287 fib/fib_entry_src_mpls.c
1288 fib/fib_entry_src_lisp.c
1289 fib/fib_entry_cover.c
1290 fib/fib_entry_delegate.c
1295 fib/fib_attached_export.c
1300 list(APPEND VNET_HEADERS
1310 fib/fib_entry_delegate.h
1313 ##############################################################################
1315 ##############################################################################
1317 list(APPEND VNET_SOURCES
1321 adj/adj_midchain_delegate.c
1331 list(APPEND VNET_MULTIARCH_SOURCES
1336 list(APPEND VNET_HEADERS
1345 ##############################################################################
1346 # Data-Plane Objects
1347 ##############################################################################
1349 list(APPEND VNET_SOURCES
1357 dpo/load_balance_map.c
1361 dpo/interface_rx_dpo.c
1362 dpo/interface_tx_dpo.c
1363 dpo/mpls_disposition.c
1364 dpo/mpls_label_dpo.c
1369 list(APPEND VNET_MULTIARCH_SOURCES
1371 dpo/mpls_disposition.c
1373 dpo/mpls_label_dpo.c
1374 dpo/interface_rx_dpo.c
1377 list(APPEND VNET_HEADERS
1389 ##############################################################################
1391 ##############################################################################
1393 list(APPEND VNET_SOURCES
1403 mfib/mfib_entry_cover.c
1404 mfib/mfib_entry_delegate.c
1405 mfib/mfib_entry_src.c
1406 mfib/mfib_entry_src_rr.c
1410 list(APPEND VNET_MULTIARCH_SOURCES
1414 list(APPEND VNET_HEADERS
1420 ##############################################################################
1422 ##############################################################################
1424 list(APPEND VNET_SOURCES
1431 list(APPEND VNET_HEADERS
1435 ##############################################################################
1437 ##############################################################################
1439 list(APPEND VNET_SOURCES
1442 qos/qos_egress_map.c
1444 qos/qos_record_node.c
1449 list(APPEND VNET_MULTIARCH_SOURCES
1450 qos/qos_record_node.c
1454 list(APPEND VNET_API_FILES qos/qos.api)
1456 ##############################################################################
1458 ##############################################################################
1460 list(APPEND VNET_SOURCES
1461 bier/bier_bit_string.c
1464 bier/bier_fmask_db.c
1473 bier/bier_imp_node.c
1475 bier/bier_disp_entry.c
1476 bier/bier_disp_lookup_node.c
1477 bier/bier_disp_dispatch_node.c
1478 bier/bier_disp_table.c
1479 bier/bier_bift_table.c
1482 list(APPEND VNET_MULTIARCH_SOURCES
1483 bier/bier_disp_dispatch_node.c
1484 bier/bier_disp_lookup_node.c
1485 bier/bier_imp_node.c
1488 list(APPEND VNET_HEADERS
1495 list(APPEND VNET_API_FILES bier/bier.api)
1497 ##############################################################################
1499 ##############################################################################
1501 list (APPEND VNET_SOURCES
1507 list(APPEND VNET_HEADERS
1512 list(APPEND VNET_API_FILES syslog/syslog.api)
1514 ##############################################################################
1516 ##############################################################################
1518 add_vpp_library(vnet
1519 SOURCES ${VNET_SOURCES}
1520 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1521 INSTALL_HEADERS ${VNET_HEADERS}
1522 API_FILES ${VNET_API_FILES}
1523 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1527 ##############################################################################