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 ##############################################################################
1037 list(APPEND VNET_SOURCES
1047 list(APPEND VNET_HEADERS
1052 list(APPEND VNET_API_FILES pg/pg.api)
1054 ##############################################################################
1056 ##############################################################################
1058 list(APPEND VNET_SOURCES
1059 devices/virtio/device.c
1060 devices/virtio/node.c
1061 devices/virtio/vhost_user.c
1062 devices/virtio/vhost_user_input.c
1063 devices/virtio/vhost_user_output.c
1064 devices/virtio/vhost_user_api.c
1065 devices/virtio/virtio.c
1066 devices/virtio/virtio_api.c
1067 devices/virtio/cli.c
1068 devices/virtio/pci.c
1071 list(APPEND VNET_HEADERS
1072 devices/virtio/pci.h
1073 devices/virtio/virtio.h
1074 devices/virtio/vhost_user.h
1077 list(APPEND VNET_MULTIARCH_SOURCES
1078 devices/virtio/vhost_user_input.c
1079 devices/virtio/vhost_user_output.c
1080 devices/netmap/node.c
1081 devices/virtio/node.c
1082 devices/af_packet/node.c
1083 devices/virtio/device.c
1086 list(APPEND VNET_API_FILES
1087 devices/virtio/vhost_user.api
1088 devices/virtio/virtio.api
1091 ##############################################################################
1092 # tap interface (with virtio backend)
1093 ##############################################################################
1095 list(APPEND VNET_SOURCES
1098 devices/tap/tapv2_api.c
1101 list(APPEND VNET_HEADERS
1105 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1107 ##############################################################################
1108 # tap interface (with virtio backend)
1109 ##############################################################################
1111 list(APPEND VNET_SOURCES
1112 devices/pipe/pipe_api.c
1116 list(APPEND VNET_HEADERS
1120 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1122 ##############################################################################
1123 # session managmeent
1124 ##############################################################################
1126 list(APPEND VNET_SOURCES
1128 session/session_table.c
1129 session/session_rules_table.c
1130 session/session_lookup.c
1131 session/session_node.c
1133 session/application.c
1134 session/application_worker.c
1135 session/session_cli.c
1136 session/application_interface.c
1137 session/application_local.c
1138 session/application_namespace.c
1139 session/segment_manager.c
1140 session/session_api.c
1143 list(APPEND VNET_HEADERS
1145 session/session_table.h
1146 session/session_rules_table.h
1147 session/session_types.h
1148 session/session_lookup.h
1149 session/application.h
1151 session/transport_types.h
1152 session/application_interface.h
1153 session/application_local.h
1154 session/application_namespace.h
1155 session/session_debug.h
1156 session/segment_manager.h
1157 session/mma_template.h
1158 session/mma_template.c
1163 list(APPEND VNET_API_FILES session/session.api)
1165 ##############################################################################
1167 ##############################################################################
1169 list(APPEND VNET_SOURCES
1173 list(APPEND VNET_HEADERS
1178 ##############################################################################
1179 # Linux packet interface
1180 ##############################################################################
1182 list(APPEND VNET_SOURCES
1183 devices/af_packet/af_packet.c
1184 devices/af_packet/device.c
1185 devices/af_packet/node.c
1186 devices/af_packet/cli.c
1187 devices/af_packet/af_packet_api.c
1190 list(APPEND VNET_MULTIARCH_SOURCES
1191 devices/netmap/device.c
1192 devices/af_packet/device.c
1195 list(APPEND VNET_HEADERS
1196 devices/af_packet/af_packet.h
1199 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1201 ##############################################################################
1203 ##############################################################################
1205 list(APPEND VNET_SOURCES
1206 devices/netmap/netmap.c
1207 devices/netmap/device.c
1208 devices/netmap/node.c
1209 devices/netmap/cli.c
1210 devices/netmap/netmap_api.c
1213 list(APPEND VNET_HEADERS
1214 devices/netmap/netmap.h
1217 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1219 ##############################################################################
1220 # Driver feature graph arc support
1221 ##############################################################################
1223 list(APPEND VNET_SOURCES
1225 feature/feature_api.c
1226 feature/registration.c
1229 list(APPEND VNET_HEADERS
1233 list(APPEND VNET_API_FILES feature/feature.api)
1235 ##############################################################################
1236 # Unix kernel related
1237 ##############################################################################
1239 # FIXME: unix/hgshm.c
1241 list(APPEND VNET_SOURCES
1246 list(APPEND VNET_HEADERS
1250 ##############################################################################
1252 ##############################################################################
1254 list(APPEND VNET_SOURCES
1266 fib/fib_entry_src_rr.c
1267 fib/fib_entry_src_interface.c
1268 fib/fib_entry_src_interpose.c
1269 fib/fib_entry_src_default_route.c
1270 fib/fib_entry_src_special.c
1271 fib/fib_entry_src_api.c
1272 fib/fib_entry_src_adj.c
1273 fib/fib_entry_src_mpls.c
1274 fib/fib_entry_src_lisp.c
1275 fib/fib_entry_cover.c
1276 fib/fib_entry_delegate.c
1277 fib/fib_entry_track.c
1282 fib/fib_attached_export.c
1287 list(APPEND VNET_HEADERS
1297 fib/fib_entry_delegate.h
1300 list(APPEND VNET_API_FILES fib/fib_types.api)
1302 ##############################################################################
1304 ##############################################################################
1306 list(APPEND VNET_SOURCES
1310 adj/adj_midchain_delegate.c
1320 list(APPEND VNET_MULTIARCH_SOURCES
1325 list(APPEND VNET_HEADERS
1335 ##############################################################################
1336 # Data-Plane Objects
1337 ##############################################################################
1339 list(APPEND VNET_SOURCES
1347 dpo/load_balance_map.c
1351 dpo/interface_rx_dpo.c
1352 dpo/interface_tx_dpo.c
1353 dpo/mpls_disposition.c
1354 dpo/mpls_label_dpo.c
1360 list(APPEND VNET_MULTIARCH_SOURCES
1362 dpo/mpls_disposition.c
1364 dpo/mpls_label_dpo.c
1365 dpo/interface_rx_dpo.c
1368 list(APPEND VNET_HEADERS
1380 ##############################################################################
1382 ##############################################################################
1384 list(APPEND VNET_SOURCES
1394 mfib/mfib_entry_cover.c
1395 mfib/mfib_entry_delegate.c
1396 mfib/mfib_entry_src.c
1397 mfib/mfib_entry_src_rr.c
1401 list(APPEND VNET_MULTIARCH_SOURCES
1405 list(APPEND VNET_HEADERS
1411 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1413 ##############################################################################
1415 ##############################################################################
1417 list(APPEND VNET_SOURCES
1424 list(APPEND VNET_HEADERS
1428 ##############################################################################
1430 ##############################################################################
1432 list(APPEND VNET_SOURCES
1435 qos/qos_egress_map.c
1437 qos/qos_record_node.c
1439 qos/qos_store_node.c
1444 list(APPEND VNET_MULTIARCH_SOURCES
1445 qos/qos_record_node.c
1449 list(APPEND VNET_API_FILES qos/qos.api)
1451 ##############################################################################
1453 ##############################################################################
1455 list(APPEND VNET_SOURCES
1456 bier/bier_bit_string.c
1459 bier/bier_fmask_db.c
1468 bier/bier_imp_node.c
1470 bier/bier_disp_entry.c
1471 bier/bier_disp_lookup_node.c
1472 bier/bier_disp_dispatch_node.c
1473 bier/bier_disp_table.c
1474 bier/bier_bift_table.c
1477 list(APPEND VNET_MULTIARCH_SOURCES
1478 bier/bier_disp_dispatch_node.c
1479 bier/bier_disp_lookup_node.c
1480 bier/bier_imp_node.c
1483 list(APPEND VNET_HEADERS
1490 list(APPEND VNET_API_FILES bier/bier.api)
1492 ##############################################################################
1494 ##############################################################################
1496 list (APPEND VNET_SOURCES
1502 list(APPEND VNET_HEADERS
1507 list(APPEND VNET_API_FILES syslog/syslog.api)
1509 ##############################################################################
1511 ##############################################################################
1513 add_vpp_library(vnet
1514 SOURCES ${VNET_SOURCES}
1515 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1516 INSTALL_HEADERS ${VNET_HEADERS}
1517 API_FILES ${VNET_API_FILES}
1518 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1522 ##############################################################################