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
434 ip/reass/ip4_full_reass.c
435 ip/reass/ip4_sv_reass.c
445 ip/reass/ip6_full_reass.c
446 ip/reass/ip6_sv_reass.c
463 list(APPEND VNET_MULTIARCH_SOURCES
464 ip/ip4_source_check.c
466 ip/reass/ip4_full_reass.c
468 ip/reass/ip6_full_reass.c
469 ip/reass/ip4_sv_reass.c
471 ip/reass/ip6_full_reass.c
472 ip/reass/ip6_sv_reass.c
479 list(APPEND VNET_HEADERS
492 ip/ip6_hop_by_hop_packet.h
497 ip/ip_source_and_port_range_check.h
507 list(APPEND VNET_API_FILES
513 list(APPEND VNET_MULTIARCH_SOURCES
519 ##############################################################################
521 ##############################################################################
522 list(APPEND VNET_SOURCES
526 list(APPEND VNET_HEADERS
527 ethernet/arp_packet.h
531 ##############################################################################
532 # Bidirectional Forwarding Detection
533 ##############################################################################
535 list(APPEND VNET_HEADERS
542 list(APPEND VNET_SOURCES
551 list(APPEND VNET_API_FILES bfd/bfd.api)
553 ##############################################################################
555 ##############################################################################
557 list(APPEND VNET_SOURCES
563 list(APPEND VNET_HEADERS
567 ##############################################################################
568 # Layer 3 protocol: IPSec
569 ##############################################################################
570 list(APPEND VNET_SOURCES
578 ipsec/ipsec_spd_policy.c
587 ipsec/ipsec_types_api.c
590 list(APPEND VNET_MULTIARCH_SOURCES
600 list(APPEND VNET_API_FILES ipsec/ipsec_types.api)
601 list(APPEND VNET_API_FILES ipsec/ipsec.api)
603 list(APPEND VNET_SOURCES
607 list(APPEND VNET_HEADERS
610 ipsec/ipsec_spd_policy.h
613 ipsec/ipsec_types_api.h
619 ##############################################################################
620 # Layer 3 protocol: osi
621 ##############################################################################
622 list(APPEND VNET_SOURCES
628 list(APPEND VNET_HEADERS
632 ##############################################################################
633 # Layer 4 protocol: tcp
634 ##############################################################################
635 list(APPEND VNET_SOURCES
639 tcp/tcp_syn_filter4.c
649 list(APPEND VNET_MULTIARCH_SOURCES
652 tcp/tcp_syn_filter4.c
655 list(APPEND VNET_HEADERS
663 list(APPEND VNET_API_FILES tcp/tcp.api)
665 ##############################################################################
666 # Layer 4 protocol: udp
667 ##############################################################################
668 list(APPEND VNET_SOURCES
679 list(APPEND VNET_MULTIARCH_SOURCES
684 list(APPEND VNET_HEADERS
690 list(APPEND VNET_API_FILES udp/udp.api)
692 ##############################################################################
693 # Tunnel protocol: gre
694 ##############################################################################
695 list(APPEND VNET_SOURCES
703 list(APPEND VNET_MULTIARCH_SOURCES
708 list(APPEND VNET_HEADERS
714 list(APPEND VNET_API_FILES gre/gre.api)
716 ##############################################################################
717 # Tunnel protocol: ipip
718 ##############################################################################
719 list(APPEND VNET_SOURCES
725 ipip/ipip_types_api.c
728 list(APPEND VNET_MULTIARCH_SOURCES
732 list(APPEND VNET_HEADERS
734 ipip/ipip_types_api.h
737 list(APPEND VNET_API_FILES
742 ##############################################################################
743 # Tunnel protocol: l2tpv3
744 ##############################################################################
745 list(APPEND VNET_SOURCES
753 list(APPEND VNET_MULTIARCH_SOURCES
758 list(APPEND VNET_HEADERS
763 list(APPEND VNET_API_FILES l2tp/l2tp.api)
765 ##############################################################################
766 # Tunnel protocol: gre+mpls
767 ##############################################################################
768 list(APPEND VNET_SOURCES
780 list(APPEND VNET_MULTIARCH_SOURCES
787 list(APPEND VNET_HEADERS
795 list(APPEND VNET_API_FILES mpls/mpls.api)
797 ##############################################################################
798 # Tunnel protocol: vxlan-gbp
799 ##############################################################################
800 list(APPEND VNET_SOURCES
803 vxlan-gbp/vxlan_gbp_api.c
804 vxlan-gbp/vxlan_gbp.c
805 vxlan-gbp/vxlan_gbp_packet.c
808 list (APPEND VNET_MULTIARCH_SOURCES
813 list(APPEND VNET_HEADERS
814 vxlan-gbp/vxlan_gbp.h
815 vxlan-gbp/vxlan_gbp_packet.h
816 vxlan-gbp/vxlan_gbp_error.def
819 list(APPEND VNET_API_FILES vxlan-gbp/vxlan_gbp.api)
821 ##############################################################################
822 # Tunnel protocol: vxlan-gpe
823 ##############################################################################
825 list(APPEND VNET_SOURCES
826 vxlan-gpe/vxlan_gpe.c
829 vxlan-gpe/vxlan_gpe_api.c
832 list (APPEND VNET_MULTIARCH_SOURCES
836 list(APPEND VNET_HEADERS
837 vxlan-gpe/vxlan_gpe.h
838 vxlan-gpe/vxlan_gpe_packet.h
839 vxlan-gpe/vxlan_gpe_error.def
842 list(APPEND VNET_API_FILES vxlan-gpe/vxlan_gpe.api)
844 ##############################################################################
845 # LISP control plane: lisp-cp
846 ##############################################################################
848 list(APPEND VNET_SOURCES
850 lisp-cp/lisp_cp_dpo.c
852 lisp-cp/gid_dictionary.c
853 lisp-cp/lisp_msg_serdes.c
861 list(APPEND VNET_HEADERS
864 lisp-cp/gid_dictionary.h
865 lisp-cp/lisp_cp_messages.h
866 lisp-cp/lisp_msg_serdes.h
870 list(APPEND VNET_API_FILES lisp-cp/lisp.api)
871 list(APPEND VNET_API_FILES lisp-cp/one.api)
873 ##############################################################################
874 # Tunnel protocol: lisp-gpe
875 ##############################################################################
877 list(APPEND VNET_SOURCES
879 lisp-gpe/lisp_gpe_sub_interface.c
880 lisp-gpe/lisp_gpe_adjacency.c
881 lisp-gpe/lisp_gpe_tunnel.c
882 lisp-gpe/lisp_gpe_fwd_entry.c
883 lisp-gpe/lisp_gpe_tenant.c
886 lisp-gpe/lisp_gpe_api.c
889 list(APPEND VNET_HEADERS
891 lisp-gpe/lisp_gpe_fwd_entry.h
892 lisp-gpe/lisp_gpe_tenant.h
893 lisp-gpe/lisp_gpe_packet.h
894 lisp-gpe/lisp_gpe_error.def
897 list(APPEND VNET_API_FILES lisp-gpe/lisp_gpe.api)
899 ##############################################################################
900 # ipv6 segment routing
901 ##############################################################################
903 list(APPEND VNET_SOURCES
906 srv6/sr_policy_rewrite.c
911 list(APPEND VNET_HEADERS
916 list(APPEND VNET_API_FILES srv6/sr.api)
918 ##############################################################################
919 # mpls segment routing
920 ##############################################################################
922 list(APPEND VNET_SOURCES
923 srmpls/sr_mpls_policy.c
924 srmpls/sr_mpls_steering.c
928 list(APPEND VNET_HEADERS
932 list(APPEND VNET_API_FILES srmpls/sr_mpls.api)
934 ##############################################################################
935 # IPFIX / netflow v10
936 ##############################################################################
937 list(APPEND VNET_SOURCES
938 ipfix-export/flow_report.c
939 ipfix-export/flow_api.c
942 list(APPEND VNET_HEADERS
943 ipfix-export/flow_report.h
944 ipfix-export/ipfix_info_elements.h
945 ipfix-export/ipfix_packet.h
948 list(APPEND VNET_API_FILES ipfix-export/ipfix_export.api)
950 ##############################################################################
952 ##############################################################################
953 list(APPEND VNET_SOURCES
960 list(APPEND VNET_HEADERS
964 list(APPEND VNET_API_FILES
968 ##############################################################################
969 # IPFIX classify code
970 ##############################################################################
972 list(APPEND VNET_SOURCES
973 ipfix-export/flow_report_classify.c
976 list(APPEND VNET_HEADERS
977 ipfix-export/flow_report_classify.h
980 ##############################################################################
982 ##############################################################################
984 list(APPEND VNET_SOURCES
985 lawful-intercept/lawful_intercept.c
986 lawful-intercept/node.c
989 list(APPEND VNET_MULTIARCH_SOURCES
990 lawful-intercept/node.c
993 list(APPEND VNET_HEADERS
994 lawful-intercept/lawful_intercept.h
997 ##############################################################################
998 # SPAN (port mirroring)
999 ##############################################################################
1001 list(APPEND VNET_SOURCES
1007 list(APPEND VNET_MULTIARCH_SOURCES
1011 list(APPEND VNET_HEADERS
1015 list(APPEND VNET_API_FILES span/span.api)
1017 ##############################################################################
1019 ##############################################################################
1021 list(APPEND VNET_SOURCES
1031 list(APPEND VNET_HEADERS
1036 list(APPEND VNET_API_FILES pg/pg.api)
1038 ##############################################################################
1040 ##############################################################################
1042 list(APPEND VNET_SOURCES
1043 devices/virtio/cli.c
1044 devices/virtio/device.c
1045 devices/virtio/format.c
1046 devices/virtio/node.c
1047 devices/virtio/pci.c
1048 devices/virtio/vhost_user.c
1049 devices/virtio/vhost_user_input.c
1050 devices/virtio/vhost_user_output.c
1051 devices/virtio/vhost_user_api.c
1052 devices/virtio/virtio.c
1053 devices/virtio/virtio_api.c
1054 devices/virtio/virtio_types_api.c
1057 list(APPEND VNET_HEADERS
1058 devices/virtio/pci.h
1059 devices/virtio/virtio.h
1060 devices/virtio/vhost_user.h
1061 devices/virtio/virtio_types_api.h
1064 list(APPEND VNET_MULTIARCH_SOURCES
1065 devices/virtio/vhost_user_input.c
1066 devices/virtio/vhost_user_output.c
1067 devices/netmap/node.c
1068 devices/virtio/node.c
1069 devices/af_packet/node.c
1070 devices/virtio/device.c
1073 list(APPEND VNET_API_FILES
1074 devices/virtio/vhost_user.api
1075 devices/virtio/virtio.api
1076 devices/virtio/virtio_types.api
1079 ##############################################################################
1080 # tap interface (with virtio backend)
1081 ##############################################################################
1083 list(APPEND VNET_SOURCES
1086 devices/tap/tapv2_api.c
1089 list(APPEND VNET_HEADERS
1093 list(APPEND VNET_API_FILES devices/tap/tapv2.api)
1095 ##############################################################################
1096 # tap interface (with virtio backend)
1097 ##############################################################################
1099 list(APPEND VNET_SOURCES
1100 devices/pipe/pipe_api.c
1104 list(APPEND VNET_HEADERS
1108 list(APPEND VNET_API_FILES devices/pipe/pipe.api)
1110 ##############################################################################
1111 # session managmeent
1112 ##############################################################################
1114 list(APPEND VNET_SOURCES
1116 session/session_table.c
1117 session/session_rules_table.c
1118 session/session_lookup.c
1119 session/session_node.c
1121 session/application.c
1122 session/application_worker.c
1123 session/session_cli.c
1124 session/application_interface.c
1125 session/application_local.c
1126 session/application_namespace.c
1127 session/segment_manager.c
1128 session/session_api.c
1131 list(APPEND VNET_HEADERS
1133 session/session_table.h
1134 session/session_rules_table.h
1135 session/session_types.h
1136 session/session_lookup.h
1137 session/application.h
1139 session/transport_types.h
1140 session/application_interface.h
1141 session/application_local.h
1142 session/application_namespace.h
1143 session/session_debug.h
1144 session/segment_manager.h
1145 session/mma_template.h
1146 session/mma_template.c
1151 list(APPEND VNET_API_FILES session/session.api)
1153 ##############################################################################
1155 ##############################################################################
1157 list(APPEND VNET_SOURCES
1161 list(APPEND VNET_HEADERS
1166 ##############################################################################
1167 # Linux packet interface
1168 ##############################################################################
1170 list(APPEND VNET_SOURCES
1171 devices/af_packet/af_packet.c
1172 devices/af_packet/device.c
1173 devices/af_packet/node.c
1174 devices/af_packet/cli.c
1175 devices/af_packet/af_packet_api.c
1178 list(APPEND VNET_MULTIARCH_SOURCES
1179 devices/netmap/device.c
1180 devices/af_packet/device.c
1183 list(APPEND VNET_HEADERS
1184 devices/af_packet/af_packet.h
1187 list(APPEND VNET_API_FILES devices/af_packet/af_packet.api)
1189 ##############################################################################
1191 ##############################################################################
1193 list(APPEND VNET_SOURCES
1194 devices/netmap/netmap.c
1195 devices/netmap/device.c
1196 devices/netmap/node.c
1197 devices/netmap/cli.c
1198 devices/netmap/netmap_api.c
1201 list(APPEND VNET_HEADERS
1202 devices/netmap/netmap.h
1205 list(APPEND VNET_API_FILES devices/netmap/netmap.api)
1207 ##############################################################################
1208 # Driver feature graph arc support
1209 ##############################################################################
1211 list(APPEND VNET_SOURCES
1213 feature/feature_api.c
1214 feature/registration.c
1217 list(APPEND VNET_HEADERS
1221 list(APPEND VNET_API_FILES feature/feature.api)
1223 ##############################################################################
1224 # Unix kernel related
1225 ##############################################################################
1227 # FIXME: unix/hgshm.c
1229 list(APPEND VNET_SOURCES
1234 list(APPEND VNET_HEADERS
1238 ##############################################################################
1240 ##############################################################################
1242 list(APPEND VNET_SOURCES
1254 fib/fib_entry_src_adj.c
1255 fib/fib_entry_src_api.c
1256 fib/fib_entry_src_drop.c
1257 fib/fib_entry_src_interface.c
1258 fib/fib_entry_src_interpose.c
1259 fib/fib_entry_src_lisp.c
1260 fib/fib_entry_src_mpls.c
1261 fib/fib_entry_src_simple.c
1262 fib/fib_entry_src_rr.c
1263 fib/fib_entry_cover.c
1264 fib/fib_entry_delegate.c
1265 fib/fib_entry_track.c
1271 fib/fib_attached_export.c
1276 list(APPEND VNET_HEADERS
1286 fib/fib_entry_delegate.h
1290 list(APPEND VNET_API_FILES fib/fib_types.api)
1292 ##############################################################################
1294 ##############################################################################
1296 list(APPEND VNET_SOURCES
1300 adj/adj_midchain_delegate.c
1310 list(APPEND VNET_MULTIARCH_SOURCES
1315 list(APPEND VNET_HEADERS
1325 ##############################################################################
1326 # Data-Plane Objects
1327 ##############################################################################
1329 list(APPEND VNET_SOURCES
1337 dpo/load_balance_map.c
1341 dpo/interface_rx_dpo.c
1342 dpo/interface_tx_dpo.c
1343 dpo/mpls_disposition.c
1344 dpo/mpls_label_dpo.c
1350 list(APPEND VNET_MULTIARCH_SOURCES
1352 dpo/mpls_disposition.c
1354 dpo/mpls_label_dpo.c
1355 dpo/interface_rx_dpo.c
1358 list(APPEND VNET_HEADERS
1370 ##############################################################################
1372 ##############################################################################
1374 list(APPEND VNET_SOURCES
1384 mfib/mfib_entry_cover.c
1385 mfib/mfib_entry_delegate.c
1386 mfib/mfib_entry_src.c
1387 mfib/mfib_entry_src_rr.c
1391 list(APPEND VNET_MULTIARCH_SOURCES
1395 list(APPEND VNET_HEADERS
1401 list(APPEND VNET_API_FILES mfib/mfib_types.api)
1403 ##############################################################################
1405 ##############################################################################
1407 list(APPEND VNET_SOURCES
1414 list(APPEND VNET_HEADERS
1418 ##############################################################################
1420 ##############################################################################
1422 list(APPEND VNET_SOURCES
1425 qos/qos_egress_map.c
1427 qos/qos_record_node.c
1429 qos/qos_store_node.c
1434 list(APPEND VNET_MULTIARCH_SOURCES
1435 qos/qos_record_node.c
1439 list(APPEND VNET_API_FILES qos/qos.api)
1441 ##############################################################################
1443 ##############################################################################
1445 list(APPEND VNET_SOURCES
1446 bier/bier_bit_string.c
1449 bier/bier_fmask_db.c
1458 bier/bier_imp_node.c
1460 bier/bier_disp_entry.c
1461 bier/bier_disp_lookup_node.c
1462 bier/bier_disp_dispatch_node.c
1463 bier/bier_disp_table.c
1464 bier/bier_bift_table.c
1467 list(APPEND VNET_MULTIARCH_SOURCES
1468 bier/bier_disp_dispatch_node.c
1469 bier/bier_disp_lookup_node.c
1470 bier/bier_imp_node.c
1473 list(APPEND VNET_HEADERS
1480 list(APPEND VNET_API_FILES bier/bier.api)
1482 ##############################################################################
1484 ##############################################################################
1486 list (APPEND VNET_SOURCES
1492 list(APPEND VNET_HEADERS
1497 list(APPEND VNET_API_FILES syslog/syslog.api)
1499 ##############################################################################
1501 ##############################################################################
1503 list (APPEND VNET_SOURCES
1509 list(APPEND VNET_HEADERS
1513 list(APPEND VNET_API_FILES nhrp/nhrp.api)
1515 ##############################################################################
1517 ##############################################################################
1519 add_vpp_library(vnet
1520 SOURCES ${VNET_SOURCES}
1521 MULTIARCH_SOURCES ${VNET_MULTIARCH_SOURCES}
1522 INSTALL_HEADERS ${VNET_HEADERS}
1523 API_FILES ${VNET_API_FILES}
1524 LINK_LIBRARIES vppinfra svm vlib ${OPENSSL_LIBRARIES}
1528 ##############################################################################