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/ip_classify.c
388 classify/in_out_acl.c
389 classify/policer_classify.c
390 classify/flow_classify.c
391 classify/flow_classify_node.c
392 classify/vnet_classify.h
393 classify/classify_api.c
396 list(APPEND VNET_MULTIARCH_SOURCES
397 classify/ip_classify.c
398 classify/flow_classify_node.c
401 list(APPEND VNET_HEADERS
402 classify/vnet_classify.h
403 classify/in_out_acl.h
404 classify/policer_classify.h
405 classify/flow_classify.h
408 list(APPEND VNET_API_FILES classify/classify.api)
410 ##############################################################################
411 # Layer 3 protocols go here
412 ##############################################################################
414 ##############################################################################
415 # Layer 3 protocol: IP v4/v6
416 ##############################################################################
417 list(APPEND VNET_SOURCES
430 ip/ip4_source_and_port_range_check.c
431 ip/ip4_source_check.c
459 list(APPEND VNET_MULTIARCH_SOURCES
460 ip/ip4_source_check.c
471 list(APPEND VNET_HEADERS
484 ip/ip6_hop_by_hop_packet.h
489 ip/ip_source_and_port_range_check.h
498 list(APPEND VNET_API_FILES
504 list(APPEND VNET_MULTIARCH_SOURCES
510 ##############################################################################
512 ##############################################################################
513 list(APPEND VNET_SOURCES
517 list(APPEND VNET_HEADERS
518 ethernet/arp_packet.h
522 ##############################################################################
523 # Bidirectional Forwarding Detection
524 ##############################################################################
526 list(APPEND VNET_HEADERS
533 list(APPEND VNET_SOURCES
542 list(APPEND VNET_API_FILES bfd/bfd.api)
544 ##############################################################################
546 ##############################################################################
548 list(APPEND VNET_SOURCES
554 list(APPEND VNET_HEADERS
558 ##############################################################################
559 # Layer 3 protocol: IPSec
560 ##############################################################################
561 list(APPEND VNET_SOURCES
571 ipsec/ipsec_spd_policy.c
582 list(APPEND VNET_MULTIARCH_SOURCES
593 list(APPEND VNET_API_FILES ipsec/ipsec.api)
595 list(APPEND VNET_SOURCES
599 list(APPEND VNET_HEADERS
602 ipsec/ipsec_spd_policy.h
610 ##############################################################################
611 # Layer 3 protocol: osi
612 ##############################################################################
613 list(APPEND VNET_SOURCES
619 list(APPEND VNET_HEADERS
623 ##############################################################################
624 # Layer 4 protocol: tcp
625 ##############################################################################
626 list(APPEND VNET_SOURCES
630 tcp/tcp_syn_filter4.c
640 list(APPEND VNET_MULTIARCH_SOURCES
643 tcp/tcp_syn_filter4.c
646 list(APPEND VNET_HEADERS
654 list(APPEND VNET_API_FILES tcp/tcp.api)
656 ##############################################################################
657 # Layer 4 protocol: udp
658 ##############################################################################
659 list(APPEND VNET_SOURCES
670 list(APPEND VNET_MULTIARCH_SOURCES
675 list(APPEND VNET_HEADERS
681 list(APPEND VNET_API_FILES udp/udp.api)
683 ##############################################################################
684 # Tunnel protocol: gre
685 ##############################################################################
686 list(APPEND VNET_SOURCES
694 list(APPEND VNET_MULTIARCH_SOURCES
699 list(APPEND VNET_HEADERS
705 list(APPEND VNET_API_FILES gre/gre.api)
707 ##############################################################################
708 # Tunnel protocol: ipip
709 ##############################################################################
710 list(APPEND VNET_SOURCES
718 list(APPEND VNET_MULTIARCH_SOURCES
722 list(APPEND VNET_HEADERS
726 list(APPEND VNET_API_FILES ipip/ipip.api)
728 ##############################################################################
729 # Tunnel protocol: l2tpv3
730 ##############################################################################
731 list(APPEND VNET_SOURCES
739 list(APPEND VNET_MULTIARCH_SOURCES
744 list(APPEND VNET_HEADERS
749 list(APPEND VNET_API_FILES l2tp/l2tp.api)
751 ##############################################################################
752 # Tunnel protocol: gre+mpls
753 ##############################################################################
754 list(APPEND VNET_SOURCES
766 list(APPEND VNET_MULTIARCH_SOURCES
773 list(APPEND VNET_HEADERS
781 list(APPEND VNET_API_FILES mpls/mpls.api)
783 ##############################################################################
784 # Tunnel protocol: vxlan-gbp
785 ##############################################################################
786 list(APPEND VNET_SOURCES
789 vxlan-gbp/vxlan_gbp_api.c
790 vxlan-gbp/vxlan_gbp.c
791 vxlan-gbp/vxlan_gbp_packet.c
794 list (APPEND VNET_MULTIARCH_SOURCES
799 list(APPEND VNET_HEADERS
800 vxlan-gbp/vxlan_gbp.h
801 vxlan-gbp/vxlan_gbp_packet.h
802 vxlan-gbp/vxlan_gbp_error.def
805 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
807 ##############################################################################
808 # Tunnel protocol: vxlan-gpe
809 ##############################################################################
811 list(APPEND VNET_SOURCES
812 vxlan-gpe/vxlan_gpe.c
815 vxlan-gpe/vxlan_gpe_api.c
818 list (APPEND VNET_MULTIARCH_SOURCES
822 list(APPEND VNET_HEADERS
823 vxlan-gpe/vxlan_gpe.h
824 vxlan-gpe/vxlan_gpe_packet.h
825 vxlan-gpe/vxlan_gpe_error.def
828 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
830 ##############################################################################
831 # LISP control plane: lisp-cp
832 ##############################################################################
834 list(APPEND VNET_SOURCES
836 lisp-cp/lisp_cp_dpo.c
838 lisp-cp/gid_dictionary.c
839 lisp-cp/lisp_msg_serdes.c
847 list(APPEND VNET_HEADERS
850 lisp-cp/gid_dictionary.h
851 lisp-cp/lisp_cp_messages.h
852 lisp-cp/lisp_msg_serdes.h
856 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
857 list(APPEND VNET_API_FILES lisp-cp/one.api)
859 ##############################################################################
860 # Tunnel protocol: lisp-gpe
861 ##############################################################################
863 list(APPEND VNET_SOURCES
865 lisp-gpe/lisp_gpe_sub_interface.c
866 lisp-gpe/lisp_gpe_adjacency.c
867 lisp-gpe/lisp_gpe_tunnel.c
868 lisp-gpe/lisp_gpe_fwd_entry.c
869 lisp-gpe/lisp_gpe_tenant.c
872 lisp-gpe/lisp_gpe_api.c
875 list(APPEND VNET_HEADERS
877 lisp-gpe/lisp_gpe_fwd_entry.h
878 lisp-gpe/lisp_gpe_tenant.h
879 lisp-gpe/lisp_gpe_packet.h
880 lisp-gpe/lisp_gpe_error.def
883 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
885 ##############################################################################
887 ##############################################################################
888 list(APPEND VNET_SOURCES
890 dhcp/dhcp_client_detect.c
891 dhcp/dhcp6_client_common_dp.c
892 dhcp/dhcp6_pd_client_dp.c
893 dhcp/dhcp6_pd_client_cp.c
894 dhcp/dhcp6_ia_na_client_dp.c
895 dhcp/dhcp6_ia_na_client_cp.c
899 list(APPEND VNET_MULTIARCH_SOURCES
900 dhcp/dhcp_client_detect.c
903 list(APPEND VNET_HEADERS
905 dhcp/dhcp6_client_common_dp.h
906 dhcp/dhcp6_pd_client_dp.h
907 dhcp/dhcp6_ia_na_client_dp.h
910 list(APPEND VNET_API_FILES
912 dhcp/dhcp6_pd_client_cp.api
913 dhcp/dhcp6_ia_na_client_cp.api
916 ##############################################################################
918 ##############################################################################
919 list(APPEND VNET_SOURCES
920 dhcp/dhcp6_proxy_node.c
921 dhcp/dhcp4_proxy_node.c
925 list(APPEND VNET_HEADERS
929 dhcp/dhcp6_proxy_error.def
930 dhcp/dhcp4_proxy_error.def
933 ##############################################################################
934 # ipv6 segment routing
935 ##############################################################################
937 list(APPEND VNET_SOURCES
940 srv6/sr_policy_rewrite.c
945 list(APPEND VNET_HEADERS
950 list(APPEND VNET_API_FILES srv6/sr.api)
952 ##############################################################################
953 # mpls segment routing
954 ##############################################################################
956 list(APPEND VNET_SOURCES
957 srmpls/sr_mpls_policy.c
958 srmpls/sr_mpls_steering.c
962 list(APPEND VNET_HEADERS
966 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
968 ##############################################################################
969 # IPFIX / netflow v10
970 ##############################################################################
971 list(APPEND VNET_SOURCES
972 ipfix-export/flow_report.c
973 ipfix-export/flow_api.c
976 list(APPEND VNET_HEADERS
977 ipfix-export/flow_report.h
978 ipfix-export/ipfix_info_elements.h
979 ipfix-export/ipfix_packet.h
982 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
984 ##############################################################################
985 # IPFIX classify code
986 ##############################################################################
988 list(APPEND VNET_SOURCES
989 ipfix-export/flow_report_classify.c
992 list(APPEND VNET_HEADERS
993 ipfix-export/flow_report_classify.h
996 ##############################################################################
998 ##############################################################################
1000 list(APPEND VNET_SOURCES
1001 lawful-intercept/lawful_intercept.c
1002 lawful-intercept/node.c
1005 list(APPEND VNET_MULTIARCH_SOURCES
1006 lawful-intercept/node.c
1009 list(APPEND VNET_HEADERS
1010 lawful-intercept/lawful_intercept.h
1013 ##############################################################################
1014 # SPAN (port mirroring)
1015 ##############################################################################
1017 list(APPEND VNET_SOURCES
1023 list(APPEND VNET_MULTIARCH_SOURCES
1027 list(APPEND VNET_HEADERS
1031 list(APPEND VNET_API_FILES span/span.api)
1033 ##############################################################################
1035 ##############################################################################
1036 list(APPEND VNET_SOURCES
1042 dns/resolver_process.c
1045 list(APPEND VNET_HEADERS
1049 list(APPEND VNET_API_FILES dns/dns.api)
1051 ##############################################################################
1053 ##############################################################################
1055 list(APPEND VNET_SOURCES
1065 list(APPEND VNET_HEADERS
1070 list(APPEND VNET_API_FILES pg/pg.api)
1072 ##############################################################################
1074 ##############################################################################
1076 list(APPEND VNET_SOURCES
1077 devices/virtio/device.c
1078 devices/virtio/node.c
1079 devices/virtio/vhost_user.c
1080 devices/virtio/vhost_user_input.c
1081 devices/virtio/vhost_user_output.c
1082 devices/virtio/vhost_user_api.c
1083 devices/virtio/virtio.c
1084 devices/virtio/virtio_api.c
1085 devices/virtio/cli.c
1086 devices/virtio/pci.c
1089 list(APPEND VNET_HEADERS
1090 devices/virtio/pci.h
1091 devices/virtio/virtio.h
1092 devices/virtio/vhost_user.h
1095 list(APPEND VNET_MULTIARCH_SOURCES
1096 devices/virtio/vhost_user_input.c
1097 devices/virtio/vhost_user_output.c
1098 devices/netmap/node.c
1099 devices/virtio/node.c
1100 devices/af_packet/node.c
1101 devices/virtio/device.c
1104 list(APPEND VNET_API_FILES
1105 devices/virtio/vhost_user.api
1106 devices/virtio/virtio.api
1109 ##############################################################################
1110 # tap interface (with virtio backend)
1111 ##############################################################################
1113 list(APPEND VNET_SOURCES
1116 devices/tap/tapv2_api.c
1119 list(APPEND VNET_HEADERS
1123 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1125 ##############################################################################
1126 # tap interface (with virtio backend)
1127 ##############################################################################
1129 list(APPEND VNET_SOURCES
1130 devices/pipe/pipe_api.c
1134 list(APPEND VNET_HEADERS
1138 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1140 ##############################################################################
1141 # session managmeent
1142 ##############################################################################
1144 list(APPEND VNET_SOURCES
1146 session/session_table.c
1147 session/session_rules_table.c
1148 session/session_lookup.c
1149 session/session_node.c
1151 session/application.c
1152 session/application_worker.c
1153 session/session_cli.c
1154 session/application_interface.c
1155 session/application_local.c
1156 session/application_namespace.c
1157 session/segment_manager.c
1158 session/session_api.c
1161 list(APPEND VNET_HEADERS
1163 session/session_table.h
1164 session/session_rules_table.h
1165 session/session_types.h
1166 session/session_lookup.h
1167 session/application.h
1169 session/transport_types.h
1170 session/application_interface.h
1171 session/application_local.h
1172 session/application_namespace.h
1173 session/session_debug.h
1174 session/segment_manager.h
1175 session/mma_template.h
1176 session/mma_template.c
1181 list(APPEND VNET_API_FILES session/session.api)
1183 ##############################################################################
1185 ##############################################################################
1187 list(APPEND VNET_SOURCES
1191 list(APPEND VNET_HEADERS
1196 ##############################################################################
1197 # Linux packet interface
1198 ##############################################################################
1200 list(APPEND VNET_SOURCES
1201 devices/af_packet/af_packet.c
1202 devices/af_packet/device.c
1203 devices/af_packet/node.c
1204 devices/af_packet/cli.c
1205 devices/af_packet/af_packet_api.c
1208 list(APPEND VNET_MULTIARCH_SOURCES
1209 devices/netmap/device.c
1210 devices/af_packet/device.c
1213 list(APPEND VNET_HEADERS
1214 devices/af_packet/af_packet.h
1217 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1219 ##############################################################################
1221 ##############################################################################
1223 list(APPEND VNET_SOURCES
1224 devices/netmap/netmap.c
1225 devices/netmap/device.c
1226 devices/netmap/node.c
1227 devices/netmap/cli.c
1228 devices/netmap/netmap_api.c
1231 list(APPEND VNET_HEADERS
1232 devices/netmap/netmap.h
1235 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1237 ##############################################################################
1238 # Driver feature graph arc support
1239 ##############################################################################
1241 list(APPEND VNET_SOURCES
1243 feature/feature_api.c
1244 feature/registration.c
1247 list(APPEND VNET_HEADERS
1251 list(APPEND VNET_API_FILES feature/feature.api)
1253 ##############################################################################
1254 # Unix kernel related
1255 ##############################################################################
1257 # FIXME: unix/hgshm.c
1259 list(APPEND VNET_SOURCES
1264 list(APPEND VNET_HEADERS
1268 ##############################################################################
1270 ##############################################################################
1272 list(APPEND VNET_SOURCES
1284 fib/fib_entry_src_rr.c
1285 fib/fib_entry_src_interface.c
1286 fib/fib_entry_src_interpose.c
1287 fib/fib_entry_src_default_route.c
1288 fib/fib_entry_src_special.c
1289 fib/fib_entry_src_api.c
1290 fib/fib_entry_src_adj.c
1291 fib/fib_entry_src_mpls.c
1292 fib/fib_entry_src_lisp.c
1293 fib/fib_entry_cover.c
1294 fib/fib_entry_delegate.c
1295 fib/fib_entry_track.c
1300 fib/fib_attached_export.c
1305 list(APPEND VNET_HEADERS
1315 fib/fib_entry_delegate.h
1318 list(APPEND VNET_API_FILES fib/fib_types.api)
1320 ##############################################################################
1322 ##############################################################################
1324 list(APPEND VNET_SOURCES
1328 adj/adj_midchain_delegate.c
1338 list(APPEND VNET_MULTIARCH_SOURCES
1343 list(APPEND VNET_HEADERS
1353 ##############################################################################
1354 # Data-Plane Objects
1355 ##############################################################################
1357 list(APPEND VNET_SOURCES
1365 dpo/load_balance_map.c
1369 dpo/interface_rx_dpo.c
1370 dpo/interface_tx_dpo.c
1371 dpo/mpls_disposition.c
1372 dpo/mpls_label_dpo.c
1378 list(APPEND VNET_MULTIARCH_SOURCES
1380 dpo/mpls_disposition.c
1382 dpo/mpls_label_dpo.c
1383 dpo/interface_rx_dpo.c
1386 list(APPEND VNET_HEADERS
1398 ##############################################################################
1400 ##############################################################################
1402 list(APPEND VNET_SOURCES
1412 mfib/mfib_entry_cover.c
1413 mfib/mfib_entry_delegate.c
1414 mfib/mfib_entry_src.c
1415 mfib/mfib_entry_src_rr.c
1419 list(APPEND VNET_MULTIARCH_SOURCES
1423 list(APPEND VNET_HEADERS
1429 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1431 ##############################################################################
1433 ##############################################################################
1435 list(APPEND VNET_SOURCES
1442 list(APPEND VNET_HEADERS
1446 ##############################################################################
1448 ##############################################################################
1450 list(APPEND VNET_SOURCES
1453 qos/qos_egress_map.c
1455 qos/qos_record_node.c
1457 qos/qos_store_node.c
1462 list(APPEND VNET_MULTIARCH_SOURCES
1463 qos/qos_record_node.c
1467 list(APPEND VNET_API_FILES qos/qos.api)
1469 ##############################################################################
1471 ##############################################################################
1473 list(APPEND VNET_SOURCES
1474 bier/bier_bit_string.c
1477 bier/bier_fmask_db.c
1486 bier/bier_imp_node.c
1488 bier/bier_disp_entry.c
1489 bier/bier_disp_lookup_node.c
1490 bier/bier_disp_dispatch_node.c
1491 bier/bier_disp_table.c
1492 bier/bier_bift_table.c
1495 list(APPEND VNET_MULTIARCH_SOURCES
1496 bier/bier_disp_dispatch_node.c
1497 bier/bier_disp_lookup_node.c
1498 bier/bier_imp_node.c
1501 list(APPEND VNET_HEADERS
1508 list(APPEND VNET_API_FILES bier/bier.api)
1510 ##############################################################################
1512 ##############################################################################
1514 list (APPEND VNET_SOURCES
1520 list(APPEND VNET_HEADERS
1525 list(APPEND VNET_API_FILES syslog/syslog.api)
1527 ##############################################################################
1529 ##############################################################################
1531 add_vpp_library(vnet
1532 SOURCES ${VNET_SOURCES}
1533 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1534 INSTALL_HEADERS ${VNET_HEADERS}
1535 API_FILES ${VNET_API_FILES}
1536 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1540 ##############################################################################