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
78 ##############################################################################
80 ##############################################################################
81 list(APPEND VNET_SOURCES
88 list(APPEND VNET_MULTIARCH_SOURCES
92 list(APPEND VNET_HEADERS
98 list(APPEND VNET_API_FILES policer/policer.api)
100 ##############################################################################
102 ##############################################################################
103 list(APPEND VNET_SOURCES
111 list(APPEND VNET_MULTIARCH_SOURCES
117 list(APPEND VNET_HEADERS
121 list(APPEND VNET_API_FILES cop/cop.api)
123 ##############################################################################
124 # Layer 2 protocols go here
125 ##############################################################################
127 ##############################################################################
128 # Layer 2 protocol: Ethernet
129 ##############################################################################
130 list(APPEND VNET_SOURCES
131 ethernet/ethernet_types_api.c
135 ethernet/mac_address.c
139 ethernet/p2p_ethernet.c
140 ethernet/p2p_ethernet_input.c
141 ethernet/p2p_ethernet_api.c
144 list(APPEND VNET_MULTIARCH_SOURCES
146 ethernet/p2p_ethernet_input.c
149 list(APPEND VNET_HEADERS
152 ethernet/mac_address.h
156 ethernet/p2p_ethernet.h
159 list(APPEND VNET_API_FILES
160 ethernet/p2p_ethernet.api
161 ethernet/ethernet_types.api)
163 ##############################################################################
164 # Layer 2 protocol: Ethernet bridging
165 ##############################################################################
166 list(APPEND VNET_SOURCES
172 l2/l2_input_classify.c
173 l2/l2_output_classify.c
183 l2/l2_in_out_feat_arc.c
191 list(APPEND VNET_MULTIARCH_SOURCES
197 l2/l2_in_out_feat_arc.c
198 l2/l2_input_classify.c
200 l2/l2_output_classify.c
210 list(APPEND VNET_HEADERS
227 list(APPEND VNET_API_FILES l2/l2.api)
229 ##############################################################################
230 # Layer 2 protocol: SRP
231 ##############################################################################
232 list(APPEND VNET_SOURCES
239 list(APPEND VNET_HEADERS
244 ##############################################################################
245 # Layer 2 protocol: PPP
246 ##############################################################################
247 list(APPEND VNET_SOURCES
253 list(APPEND VNET_HEADERS
259 ##############################################################################
260 # Layer 2 protocol: HDLC
261 ##############################################################################
262 list(APPEND VNET_SOURCES
268 list(APPEND VNET_HEADERS
274 ##############################################################################
275 # Layer 2 protocol: LLC
276 ##############################################################################
277 list(APPEND VNET_SOURCES
283 list(APPEND VNET_HEADERS
287 ##############################################################################
288 # Layer 2 protocol: SNAP
289 ##############################################################################
290 list(APPEND VNET_SOURCES
296 list(APPEND VNET_HEADERS
300 ##############################################################################
302 ##############################################################################
303 list(APPEND VNET_SOURCES
310 list(APPEND VNET_MULTIARCH_SOURCES
314 list(APPEND VNET_HEADERS
317 vxlan/vxlan_error.def
320 list(APPEND VNET_MULTIARCH_SOURCES vxlan/decap.c)
322 list(APPEND VNET_API_FILES vxlan/vxlan.api)
324 ##############################################################################
326 ##############################################################################
327 list(APPEND VNET_SOURCES
334 list(APPEND VNET_MULTIARCH_SOURCES
339 list(APPEND VNET_HEADERS
341 geneve/geneve_packet.h
342 geneve/geneve_error.def
345 list(APPEND VNET_API_FILES geneve/geneve.api)
347 ##############################################################################
349 ##############################################################################
350 list(APPEND VNET_SOURCES
357 list(APPEND VNET_HEADERS
361 list(APPEND VNET_MULTIARCH_SOURCES bonding/node.c bonding/device.c)
362 list(APPEND VNET_API_FILES bonding/bond.api)
364 ##############################################################################
366 ##############################################################################
367 list(APPEND VNET_SOURCES
375 list(APPEND VNET_HEADERS
380 list(APPEND VNET_API_FILES lldp/lldp.api)
382 ##############################################################################
383 # Layer 2/3 "classify"
384 ##############################################################################
385 list(APPEND VNET_SOURCES
386 classify/vnet_classify.c
387 classify/trace_classify.h
388 classify/ip_classify.c
389 classify/in_out_acl.c
390 classify/policer_classify.c
391 classify/flow_classify.c
392 classify/flow_classify_node.c
393 classify/vnet_classify.h
394 classify/classify_api.c
397 list(APPEND VNET_MULTIARCH_SOURCES
398 classify/ip_classify.c
399 classify/flow_classify_node.c
402 list(APPEND VNET_HEADERS
403 classify/vnet_classify.h
404 classify/trace_classify.h
405 classify/in_out_acl.h
406 classify/policer_classify.h
407 classify/flow_classify.h
410 list(APPEND VNET_API_FILES classify/classify.api)
412 ##############################################################################
413 # Layer 3 protocols go here
414 ##############################################################################
416 ##############################################################################
417 # Layer 3 protocol: IP v4/v6
418 ##############################################################################
419 list(APPEND VNET_SOURCES
432 ip/ip4_source_and_port_range_check.c
433 ip/ip4_source_check.c
461 list(APPEND VNET_MULTIARCH_SOURCES
462 ip/ip4_source_check.c
473 list(APPEND VNET_HEADERS
486 ip/ip6_hop_by_hop_packet.h
491 ip/ip_source_and_port_range_check.h
500 list(APPEND VNET_API_FILES
506 list(APPEND VNET_MULTIARCH_SOURCES
512 ##############################################################################
514 ##############################################################################
515 list(APPEND VNET_SOURCES
519 list(APPEND VNET_HEADERS
520 ethernet/arp_packet.h
524 ##############################################################################
525 # Bidirectional Forwarding Detection
526 ##############################################################################
528 list(APPEND VNET_HEADERS
535 list(APPEND VNET_SOURCES
544 list(APPEND VNET_API_FILES bfd/bfd.api)
546 ##############################################################################
548 ##############################################################################
550 list(APPEND VNET_SOURCES
556 list(APPEND VNET_HEADERS
560 ##############################################################################
561 # Layer 3 protocol: IPSec
562 ##############################################################################
563 list(APPEND VNET_SOURCES
573 ipsec/ipsec_spd_policy.c
584 list(APPEND VNET_MULTIARCH_SOURCES
595 list(APPEND VNET_API_FILES ipsec/ipsec.api)
597 list(APPEND VNET_SOURCES
601 list(APPEND VNET_HEADERS
604 ipsec/ipsec_spd_policy.h
612 ##############################################################################
613 # Layer 3 protocol: osi
614 ##############################################################################
615 list(APPEND VNET_SOURCES
621 list(APPEND VNET_HEADERS
625 ##############################################################################
626 # Layer 4 protocol: tcp
627 ##############################################################################
628 list(APPEND VNET_SOURCES
632 tcp/tcp_syn_filter4.c
642 list(APPEND VNET_MULTIARCH_SOURCES
645 tcp/tcp_syn_filter4.c
648 list(APPEND VNET_HEADERS
656 list(APPEND VNET_API_FILES tcp/tcp.api)
658 ##############################################################################
659 # Layer 4 protocol: udp
660 ##############################################################################
661 list(APPEND VNET_SOURCES
672 list(APPEND VNET_MULTIARCH_SOURCES
677 list(APPEND VNET_HEADERS
683 list(APPEND VNET_API_FILES udp/udp.api)
685 ##############################################################################
686 # Tunnel protocol: gre
687 ##############################################################################
688 list(APPEND VNET_SOURCES
696 list(APPEND VNET_MULTIARCH_SOURCES
701 list(APPEND VNET_HEADERS
707 list(APPEND VNET_API_FILES gre/gre.api)
709 ##############################################################################
710 # Tunnel protocol: ipip
711 ##############################################################################
712 list(APPEND VNET_SOURCES
720 list(APPEND VNET_MULTIARCH_SOURCES
724 list(APPEND VNET_HEADERS
728 list(APPEND VNET_API_FILES ipip/ipip.api)
730 ##############################################################################
731 # Tunnel protocol: l2tpv3
732 ##############################################################################
733 list(APPEND VNET_SOURCES
741 list(APPEND VNET_MULTIARCH_SOURCES
746 list(APPEND VNET_HEADERS
751 list(APPEND VNET_API_FILES l2tp/l2tp.api)
753 ##############################################################################
754 # Tunnel protocol: gre+mpls
755 ##############################################################################
756 list(APPEND VNET_SOURCES
768 list(APPEND VNET_MULTIARCH_SOURCES
775 list(APPEND VNET_HEADERS
783 list(APPEND VNET_API_FILES mpls/mpls.api)
785 ##############################################################################
786 # Tunnel protocol: vxlan-gbp
787 ##############################################################################
788 list(APPEND VNET_SOURCES
791 vxlan-gbp/vxlan_gbp_api.c
792 vxlan-gbp/vxlan_gbp.c
793 vxlan-gbp/vxlan_gbp_packet.c
796 list (APPEND VNET_MULTIARCH_SOURCES
801 list(APPEND VNET_HEADERS
802 vxlan-gbp/vxlan_gbp.h
803 vxlan-gbp/vxlan_gbp_packet.h
804 vxlan-gbp/vxlan_gbp_error.def
807 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
809 ##############################################################################
810 # Tunnel protocol: vxlan-gpe
811 ##############################################################################
813 list(APPEND VNET_SOURCES
814 vxlan-gpe/vxlan_gpe.c
817 vxlan-gpe/vxlan_gpe_api.c
820 list (APPEND VNET_MULTIARCH_SOURCES
824 list(APPEND VNET_HEADERS
825 vxlan-gpe/vxlan_gpe.h
826 vxlan-gpe/vxlan_gpe_packet.h
827 vxlan-gpe/vxlan_gpe_error.def
830 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
832 ##############################################################################
833 # LISP control plane: lisp-cp
834 ##############################################################################
836 list(APPEND VNET_SOURCES
838 lisp-cp/lisp_cp_dpo.c
840 lisp-cp/gid_dictionary.c
841 lisp-cp/lisp_msg_serdes.c
849 list(APPEND VNET_HEADERS
852 lisp-cp/gid_dictionary.h
853 lisp-cp/lisp_cp_messages.h
854 lisp-cp/lisp_msg_serdes.h
858 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
859 list(APPEND VNET_API_FILES lisp-cp/one.api)
861 ##############################################################################
862 # Tunnel protocol: lisp-gpe
863 ##############################################################################
865 list(APPEND VNET_SOURCES
867 lisp-gpe/lisp_gpe_sub_interface.c
868 lisp-gpe/lisp_gpe_adjacency.c
869 lisp-gpe/lisp_gpe_tunnel.c
870 lisp-gpe/lisp_gpe_fwd_entry.c
871 lisp-gpe/lisp_gpe_tenant.c
874 lisp-gpe/lisp_gpe_api.c
877 list(APPEND VNET_HEADERS
879 lisp-gpe/lisp_gpe_fwd_entry.h
880 lisp-gpe/lisp_gpe_tenant.h
881 lisp-gpe/lisp_gpe_packet.h
882 lisp-gpe/lisp_gpe_error.def
885 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
887 ##############################################################################
889 ##############################################################################
890 list(APPEND VNET_SOURCES
892 dhcp/dhcp_client_detect.c
893 dhcp/dhcp6_client_common_dp.c
894 dhcp/dhcp6_pd_client_dp.c
895 dhcp/dhcp6_pd_client_cp.c
896 dhcp/dhcp6_ia_na_client_dp.c
897 dhcp/dhcp6_ia_na_client_cp.c
901 list(APPEND VNET_MULTIARCH_SOURCES
902 dhcp/dhcp_client_detect.c
905 list(APPEND VNET_HEADERS
907 dhcp/dhcp6_client_common_dp.h
908 dhcp/dhcp6_pd_client_dp.h
909 dhcp/dhcp6_ia_na_client_dp.h
912 list(APPEND VNET_API_FILES
914 dhcp/dhcp6_pd_client_cp.api
915 dhcp/dhcp6_ia_na_client_cp.api
918 ##############################################################################
920 ##############################################################################
921 list(APPEND VNET_SOURCES
922 dhcp/dhcp6_proxy_node.c
923 dhcp/dhcp4_proxy_node.c
927 list(APPEND VNET_HEADERS
931 dhcp/dhcp6_proxy_error.def
932 dhcp/dhcp4_proxy_error.def
935 ##############################################################################
936 # ipv6 segment routing
937 ##############################################################################
939 list(APPEND VNET_SOURCES
942 srv6/sr_policy_rewrite.c
947 list(APPEND VNET_HEADERS
952 list(APPEND VNET_API_FILES srv6/sr.api)
954 ##############################################################################
955 # mpls segment routing
956 ##############################################################################
958 list(APPEND VNET_SOURCES
959 srmpls/sr_mpls_policy.c
960 srmpls/sr_mpls_steering.c
964 list(APPEND VNET_HEADERS
968 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
970 ##############################################################################
971 # IPFIX / netflow v10
972 ##############################################################################
973 list(APPEND VNET_SOURCES
974 ipfix-export/flow_report.c
975 ipfix-export/flow_api.c
978 list(APPEND VNET_HEADERS
979 ipfix-export/flow_report.h
980 ipfix-export/ipfix_info_elements.h
981 ipfix-export/ipfix_packet.h
984 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
986 ##############################################################################
987 # IPFIX classify code
988 ##############################################################################
990 list(APPEND VNET_SOURCES
991 ipfix-export/flow_report_classify.c
994 list(APPEND VNET_HEADERS
995 ipfix-export/flow_report_classify.h
998 ##############################################################################
1000 ##############################################################################
1002 list(APPEND VNET_SOURCES
1003 lawful-intercept/lawful_intercept.c
1004 lawful-intercept/node.c
1007 list(APPEND VNET_MULTIARCH_SOURCES
1008 lawful-intercept/node.c
1011 list(APPEND VNET_HEADERS
1012 lawful-intercept/lawful_intercept.h
1015 ##############################################################################
1016 # SPAN (port mirroring)
1017 ##############################################################################
1019 list(APPEND VNET_SOURCES
1025 list(APPEND VNET_MULTIARCH_SOURCES
1029 list(APPEND VNET_HEADERS
1033 list(APPEND VNET_API_FILES span/span.api)
1035 ##############################################################################
1037 ##############################################################################
1039 list(APPEND VNET_SOURCES
1049 list(APPEND VNET_HEADERS
1054 list(APPEND VNET_API_FILES pg/pg.api)
1056 ##############################################################################
1058 ##############################################################################
1060 list(APPEND VNET_SOURCES
1061 devices/virtio/device.c
1062 devices/virtio/node.c
1063 devices/virtio/vhost_user.c
1064 devices/virtio/vhost_user_input.c
1065 devices/virtio/vhost_user_output.c
1066 devices/virtio/vhost_user_api.c
1067 devices/virtio/virtio.c
1068 devices/virtio/virtio_api.c
1069 devices/virtio/cli.c
1070 devices/virtio/pci.c
1073 list(APPEND VNET_HEADERS
1074 devices/virtio/pci.h
1075 devices/virtio/virtio.h
1076 devices/virtio/vhost_user.h
1079 list(APPEND VNET_MULTIARCH_SOURCES
1080 devices/virtio/vhost_user_input.c
1081 devices/virtio/vhost_user_output.c
1082 devices/netmap/node.c
1083 devices/virtio/node.c
1084 devices/af_packet/node.c
1085 devices/virtio/device.c
1088 list(APPEND VNET_API_FILES
1089 devices/virtio/vhost_user.api
1090 devices/virtio/virtio.api
1093 ##############################################################################
1094 # tap interface (with virtio backend)
1095 ##############################################################################
1097 list(APPEND VNET_SOURCES
1100 devices/tap/tapv2_api.c
1103 list(APPEND VNET_HEADERS
1107 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1109 ##############################################################################
1110 # tap interface (with virtio backend)
1111 ##############################################################################
1113 list(APPEND VNET_SOURCES
1114 devices/pipe/pipe_api.c
1118 list(APPEND VNET_HEADERS
1122 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1124 ##############################################################################
1125 # session managmeent
1126 ##############################################################################
1128 list(APPEND VNET_SOURCES
1130 session/session_table.c
1131 session/session_rules_table.c
1132 session/session_lookup.c
1133 session/session_node.c
1135 session/application.c
1136 session/application_worker.c
1137 session/session_cli.c
1138 session/application_interface.c
1139 session/application_local.c
1140 session/application_namespace.c
1141 session/segment_manager.c
1142 session/session_api.c
1145 list(APPEND VNET_HEADERS
1147 session/session_table.h
1148 session/session_rules_table.h
1149 session/session_types.h
1150 session/session_lookup.h
1151 session/application.h
1153 session/transport_types.h
1154 session/application_interface.h
1155 session/application_local.h
1156 session/application_namespace.h
1157 session/session_debug.h
1158 session/segment_manager.h
1159 session/mma_template.h
1160 session/mma_template.c
1165 list(APPEND VNET_API_FILES session/session.api)
1167 ##############################################################################
1169 ##############################################################################
1171 list(APPEND VNET_SOURCES
1175 list(APPEND VNET_HEADERS
1180 ##############################################################################
1181 # Linux packet interface
1182 ##############################################################################
1184 list(APPEND VNET_SOURCES
1185 devices/af_packet/af_packet.c
1186 devices/af_packet/device.c
1187 devices/af_packet/node.c
1188 devices/af_packet/cli.c
1189 devices/af_packet/af_packet_api.c
1192 list(APPEND VNET_MULTIARCH_SOURCES
1193 devices/netmap/device.c
1194 devices/af_packet/device.c
1197 list(APPEND VNET_HEADERS
1198 devices/af_packet/af_packet.h
1201 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1203 ##############################################################################
1205 ##############################################################################
1207 list(APPEND VNET_SOURCES
1208 devices/netmap/netmap.c
1209 devices/netmap/device.c
1210 devices/netmap/node.c
1211 devices/netmap/cli.c
1212 devices/netmap/netmap_api.c
1215 list(APPEND VNET_HEADERS
1216 devices/netmap/netmap.h
1219 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1221 ##############################################################################
1222 # Driver feature graph arc support
1223 ##############################################################################
1225 list(APPEND VNET_SOURCES
1227 feature/feature_api.c
1228 feature/registration.c
1231 list(APPEND VNET_HEADERS
1235 list(APPEND VNET_API_FILES feature/feature.api)
1237 ##############################################################################
1238 # Unix kernel related
1239 ##############################################################################
1241 # FIXME: unix/hgshm.c
1243 list(APPEND VNET_SOURCES
1248 list(APPEND VNET_HEADERS
1252 ##############################################################################
1254 ##############################################################################
1256 list(APPEND VNET_SOURCES
1268 fib/fib_entry_src_rr.c
1269 fib/fib_entry_src_interface.c
1270 fib/fib_entry_src_interpose.c
1271 fib/fib_entry_src_default_route.c
1272 fib/fib_entry_src_special.c
1273 fib/fib_entry_src_api.c
1274 fib/fib_entry_src_adj.c
1275 fib/fib_entry_src_mpls.c
1276 fib/fib_entry_src_lisp.c
1277 fib/fib_entry_cover.c
1278 fib/fib_entry_delegate.c
1279 fib/fib_entry_track.c
1284 fib/fib_attached_export.c
1289 list(APPEND VNET_HEADERS
1299 fib/fib_entry_delegate.h
1302 list(APPEND VNET_API_FILES fib/fib_types.api)
1304 ##############################################################################
1306 ##############################################################################
1308 list(APPEND VNET_SOURCES
1312 adj/adj_midchain_delegate.c
1322 list(APPEND VNET_MULTIARCH_SOURCES
1327 list(APPEND VNET_HEADERS
1337 ##############################################################################
1338 # Data-Plane Objects
1339 ##############################################################################
1341 list(APPEND VNET_SOURCES
1349 dpo/load_balance_map.c
1353 dpo/interface_rx_dpo.c
1354 dpo/interface_tx_dpo.c
1355 dpo/mpls_disposition.c
1356 dpo/mpls_label_dpo.c
1362 list(APPEND VNET_MULTIARCH_SOURCES
1364 dpo/mpls_disposition.c
1366 dpo/mpls_label_dpo.c
1367 dpo/interface_rx_dpo.c
1370 list(APPEND VNET_HEADERS
1382 ##############################################################################
1384 ##############################################################################
1386 list(APPEND VNET_SOURCES
1396 mfib/mfib_entry_cover.c
1397 mfib/mfib_entry_delegate.c
1398 mfib/mfib_entry_src.c
1399 mfib/mfib_entry_src_rr.c
1403 list(APPEND VNET_MULTIARCH_SOURCES
1407 list(APPEND VNET_HEADERS
1413 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1415 ##############################################################################
1417 ##############################################################################
1419 list(APPEND VNET_SOURCES
1426 list(APPEND VNET_HEADERS
1430 ##############################################################################
1432 ##############################################################################
1434 list(APPEND VNET_SOURCES
1437 qos/qos_egress_map.c
1439 qos/qos_record_node.c
1441 qos/qos_store_node.c
1446 list(APPEND VNET_MULTIARCH_SOURCES
1447 qos/qos_record_node.c
1451 list(APPEND VNET_API_FILES qos/qos.api)
1453 ##############################################################################
1455 ##############################################################################
1457 list(APPEND VNET_SOURCES
1458 bier/bier_bit_string.c
1461 bier/bier_fmask_db.c
1470 bier/bier_imp_node.c
1472 bier/bier_disp_entry.c
1473 bier/bier_disp_lookup_node.c
1474 bier/bier_disp_dispatch_node.c
1475 bier/bier_disp_table.c
1476 bier/bier_bift_table.c
1479 list(APPEND VNET_MULTIARCH_SOURCES
1480 bier/bier_disp_dispatch_node.c
1481 bier/bier_disp_lookup_node.c
1482 bier/bier_imp_node.c
1485 list(APPEND VNET_HEADERS
1492 list(APPEND VNET_API_FILES bier/bier.api)
1494 ##############################################################################
1496 ##############################################################################
1498 list (APPEND VNET_SOURCES
1504 list(APPEND VNET_HEADERS
1509 list(APPEND VNET_API_FILES syslog/syslog.api)
1511 ##############################################################################
1513 ##############################################################################
1515 add_vpp_library(vnet
1516 SOURCES ${VNET_SOURCES}
1517 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1518 INSTALL_HEADERS ${VNET_HEADERS}
1519 API_FILES ${VNET_API_FILES}
1520 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1524 ##############################################################################