1 /* 2 * Copyright (c) 2015-2021 Apple Inc. All rights reserved. 3 * 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. The rights granted to you under the License 10 * may not be used to create, or enable the creation or redistribution of, 11 * unlawful or unlicensed copies of an Apple operating system, or to 12 * circumvent, violate, or enable the circumvention or violation of, any 13 * terms of an Apple operating system software license agreement. 14 * 15 * Please obtain a copy of the License at 16 * http://www.opensource.apple.com/apsl/ and read it before using this file. 17 * 18 * The Original Code and all software distributed under the License are 19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 * Please see the License for the specific language governing rights and 24 * limitations under the License. 25 * 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27 */ 28 29 #include <kern/debug.h> 30 31 #if !SKYWALK 32 33 #define STUB(_name) \ 34 __attribute__((noreturn)) \ 35 int _name(void); \ 36 int \ 37 _name(void) \ 38 { \ 39 panic("stub called in a config with no SKYWALK"); \ 40 /* NOTREACHED */ \ 41 __builtin_unreachable(); \ 42 } 43 44 STUB(kern_buflet_get_data_address); 45 STUB(kern_buflet_get_data_offset); 46 STUB(kern_buflet_get_data_length); 47 STUB(kern_buflet_get_data_limit); 48 STUB(kern_buflet_get_object_address); 49 STUB(kern_buflet_get_object_limit); 50 STUB(kern_buflet_get_object_segment); 51 STUB(kern_buflet_set_data_address); 52 STUB(kern_buflet_set_data_offset); 53 STUB(kern_buflet_set_data_length); 54 STUB(kern_buflet_set_data_limit); 55 STUB(kern_channel_advance_slot); 56 STUB(kern_channel_available_slot_count); 57 STUB(kern_channel_get_context); 58 STUB(kern_channel_get_next_slot); 59 STUB(kern_channel_notify); 60 STUB(kern_channel_reclaim); 61 STUB(kern_channel_ring_get_container); 62 STUB(kern_channel_ring_get_context); 63 STUB(kern_channel_slot_get_context); 64 STUB(kern_channel_slot_attach_packet); 65 STUB(kern_channel_slot_detach_packet); 66 STUB(kern_channel_slot_get_packet); 67 STUB(kern_channel_increment_ring_stats); 68 STUB(kern_channel_increment_ring_net_stats); 69 STUB(kern_channel_tx_refill); 70 STUB(kern_channel_get_service_class); 71 STUB(kern_netif_queue_rx_enqueue); 72 STUB(kern_netif_queue_tx_dequeue); 73 STUB(kern_netif_queue_get_service_class); 74 STUB(kern_copy_and_inet_checksum); 75 STUB(kern_inet_checksum); 76 STUB(kern_nexus_attr_create); 77 STUB(kern_nexus_attr_clone); 78 STUB(kern_nexus_attr_destroy); 79 STUB(kern_nexus_attr_set); 80 STUB(kern_nexus_attr_get); 81 STUB(kern_nexus_controller_create); 82 STUB(kern_nexus_controller_destroy); 83 STUB(kern_nexus_controller_alloc_provider_instance); 84 STUB(kern_nexus_controller_alloc_net_provider_instance); 85 STUB(kern_nexus_controller_bind_provider_instance); 86 STUB(kern_nexus_controller_deregister_provider); 87 STUB(kern_nexus_controller_free_provider_instance); 88 STUB(kern_nexus_controller_read_provider_attr); 89 STUB(kern_nexus_controller_register_provider); 90 STUB(kern_nexus_controller_unbind_provider_instance); 91 STUB(kern_nexus_deregister_domain_provider); 92 STUB(kern_nexus_get_default_domain_provider); 93 STUB(kern_nexus_get_context); 94 STUB(kern_nexus_get_pbufpool); 95 STUB(kern_nexus_register_domain_provider); 96 STUB(kern_nexus_netif_llink_add); 97 STUB(kern_nexus_netif_llink_remove); 98 STUB(kern_packet_clear_flow_uuid); 99 STUB(kern_packet_clone); 100 STUB(kern_packet_clone_nosleep); 101 STUB(kern_packet_get_euuid); 102 STUB(kern_packet_finalize); 103 STUB(kern_packet_get_buflet_count); 104 STUB(kern_packet_get_data_length); 105 STUB(kern_packet_get_flow_uuid); 106 STUB(kern_packet_get_inet_checksum); 107 STUB(kern_packet_get_headroom); 108 STUB(kern_packet_get_link_broadcast); 109 STUB(kern_packet_get_link_ethfcs); 110 STUB(kern_packet_get_link_header_offset); 111 STUB(kern_packet_get_link_header_length); 112 STUB(kern_packet_get_link_multicast); 113 STUB(kern_packet_get_network_header_offset); 114 STUB(kern_packet_get_next_buflet); 115 STUB(kern_packet_get_object_index); 116 STUB(kern_packet_get_policy_id); 117 STUB(kern_packet_get_service_class); 118 STUB(kern_packet_get_service_class_index); 119 STUB(kern_packet_is_high_priority); 120 STUB(kern_packet_get_traffic_class); 121 STUB(kern_packet_get_timestamp); 122 STUB(kern_packet_get_transport_header_offset); 123 STUB(kern_packet_get_transport_new_flow); 124 STUB(kern_packet_get_transport_retransmit); 125 STUB(kern_packet_get_transport_last_packet); 126 STUB(kern_packet_get_transport_traffic_background) 127 STUB(kern_packet_get_transport_traffic_realtime) 128 STUB(kern_packet_set_flow_uuid); 129 STUB(kern_packet_set_inet_checksum); 130 STUB(kern_packet_set_headroom); 131 STUB(kern_packet_set_link_broadcast); 132 STUB(kern_packet_set_link_header_offset); 133 STUB(kern_packet_set_link_header_length); 134 STUB(kern_packet_set_link_multicast); 135 STUB(kern_packet_set_link_ethfcs); 136 STUB(kern_packet_set_network_header_offset); 137 STUB(kern_packet_set_policy_id); 138 STUB(kern_packet_set_service_class); 139 STUB(kern_packet_set_timestamp); 140 STUB(kern_packet_set_traffic_class); 141 STUB(kern_packet_set_transport_header_offset); 142 STUB(kern_packet_get_timestamp_requested); 143 STUB(kern_packet_get_tx_completion_status); 144 STUB(kern_packet_set_tx_completion_status); 145 STUB(kern_packet_tx_completion); 146 STUB(kern_packet_set_group_start); 147 STUB(kern_packet_get_group_start); 148 STUB(kern_packet_set_group_end); 149 STUB(kern_packet_get_group_end); 150 STUB(kern_packet_set_expire_time); 151 STUB(kern_packet_get_expire_time); 152 STUB(kern_packet_set_token); 153 STUB(kern_packet_get_token); 154 STUB(kern_packet_get_packetid); 155 STUB(kern_packet_set_vlan_tag); 156 STUB(kern_packet_get_vlan_tag); 157 STUB(kern_packet_get_vlan_id); 158 STUB(kern_packet_get_vlan_priority); 159 STUB(kern_packet_set_wake_flag); 160 STUB(kern_packet_get_wake_flag); 161 STUB(kern_packet_add_buflet); 162 STUB(kern_packet_append); 163 STUB(kern_packet_get_next); 164 STUB(kern_packet_set_next); 165 STUB(kern_packet_set_chain_counts); 166 STUB(kern_packet_get_chain_counts); 167 STUB(kern_packet_set_trace_id); 168 STUB(kern_packet_get_trace_id); 169 STUB(kern_packet_trace_event); 170 STUB(kern_packet_copy_bytes); 171 STUB(kern_pbufpool_alloc); 172 STUB(kern_pbufpool_alloc_batch); 173 STUB(kern_pbufpool_alloc_batch_callback); 174 STUB(kern_pbufpool_alloc_nosleep); 175 STUB(kern_pbufpool_alloc_batch_nosleep); 176 STUB(kern_pbufpool_alloc_batch_nosleep_callback); 177 STUB(kern_pbufpool_create); 178 STUB(kern_pbufpool_destroy); 179 STUB(kern_pbufpool_free); 180 STUB(kern_pbufpool_free_batch); 181 STUB(kern_pbufpool_free_chain); 182 STUB(kern_pbufpool_get_context); 183 STUB(kern_pbufpool_get_memory_info); 184 STUB(kern_pbufpool_alloc_buffer); 185 STUB(kern_pbufpool_alloc_buffer_nosleep); 186 STUB(kern_pbufpool_free_buffer); 187 STUB(kern_pbufpool_alloc_buflet); 188 STUB(kern_pbufpool_alloc_buflet_nosleep); 189 STUB(kern_segment_get_index); 190 #if NETWORKING 191 STUB(bpf_tap_packet_in); 192 STUB(bpf_tap_packet_out); 193 #endif 194 #undef STUB 195 #endif /* !SKYWALK */ 196