1#  Copyright (c) 2020, The OpenThread Authors.
2#  All rights reserved.
3#
4#  Redistribution and use in source and binary forms, with or without
5#  modification, are permitted provided that the following conditions are met:
6#  1. Redistributions of source code must retain the above copyright
7#     notice, this list of conditions and the following disclaimer.
8#  2. Redistributions in binary form must reproduce the above copyright
9#     notice, this list of conditions and the following disclaimer in the
10#     documentation and/or other materials provided with the distribution.
11#  3. Neither the name of the copyright holder nor the
12#     names of its contributors may be used to endorse or promote products
13#     derived from this software without specific prior written permission.
14#
15#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19#  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20#  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21#  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25#  POSSIBILITY OF SUCH DAMAGE.
26#
27
28import("../../etc/gn/openthread.gni")
29
30visibility = [ "../../*" ]
31
32if (openthread_enable_core_config_args) {
33  config("core_config_args") {
34    defines = []
35
36    if (openthread_config_thread_version == "1.1") {
37      defines += [ "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_1" ]
38    } else if (openthread_config_thread_version == "1.2") {
39      defines += [ "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_2" ]
40    } else if (openthread_config_thread_version == "1.3") {
41      defines += [ "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_3" ]
42    } else if (openthread_config_thread_version == "1.3.1") {
43      defines += [ "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_3_1" ]
44    } else if (openthread_config_thread_version == "1.4") {
45      defines += [ "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_4" ]
46    } else if (openthread_config_thread_version != "") {
47      assert(false,
48             "Unrecognized Thread version: ${openthread_config_thread_version}")
49    }
50
51    if (openthread_config_log_output == "none") {
52      defines +=
53          [ "OPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_NONE" ]
54    } else if (openthread_config_log_output == "debug_uart") {
55      defines += [
56        "OPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART",
57      ]
58    } else if (openthread_config_log_output == "app") {
59      defines +=
60          [ "OPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_APP" ]
61    } else if (openthread_config_log_output == "platform_defined") {
62      defines += [ "OPENTHREAD_CONFIG_LOG_OUTPUT=OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED" ]
63    } else if (openthread_config_log_output != "") {
64      assert(false, "Unrecognized log output: ${openthread_config_log_output}")
65    }
66
67    if (!openthread_config_assert_enable) {
68      defines += [ "OPENTHREAD_CONFIG_ASSERT_ENABLE=0" ]
69    }
70
71    if (openthread_config_anycast_locator_enable) {
72      defines += [ "OPENTHREAD_CONFIG_ANYCAST_LOCATOR_ENABLE=1" ]
73    }
74
75    if (openthread_config_backbone_router_enable) {
76      defines += [ "OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1" ]
77    }
78
79    if (openthread_config_ble_tcat_enable) {
80      defines += [ "OPENTHREAD_CONFIG_BLE_TCAT_ENABLE=1" ]
81    }
82
83    if (openthread_config_border_agent_enable) {
84      defines += [ "OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1" ]
85    }
86
87    if (openthread_config_border_router_enable) {
88      defines += [ "OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1" ]
89    }
90
91    if (openthread_config_border_routing_enable) {
92      defines += [ "OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE=1" ]
93    }
94
95    if (openthread_external_mbedtls != "") {
96      defines += [ "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=0" ]
97    } else if (!openthread_config_enable_builtin_mbedtls_management) {
98      defines += [ "OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT=0" ]
99    }
100
101    if (openthread_config_channel_manager_enable) {
102      defines += [ "OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1" ]
103    }
104
105    if (openthread_config_channel_monitor_enable) {
106      defines += [ "OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1" ]
107    }
108
109    if (openthread_config_coap_api_enable) {
110      defines += [ "OPENTHREAD_CONFIG_COAP_API_ENABLE=1" ]
111    }
112
113    if (openthread_config_coap_secure_api_enable) {
114      defines += [ "OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1" ]
115    }
116
117    if (openthread_config_coap_observe_api_enable) {
118      defines += [ "OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE=1" ]
119    }
120
121    if (openthread_config_commissioner_enable) {
122      defines += [ "OPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1" ]
123    }
124
125    if (openthread_config_mac_csl_receiver_enable) {
126      defines += [ "OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1" ]
127    }
128
129    if (openthread_config_dhcp6_client_enable) {
130      defines += [ "OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1" ]
131    }
132
133    if (openthread_config_dhcp6_server_enable) {
134      defines += [ "OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1" ]
135    }
136
137    if (openthread_config_diag_enable) {
138      defines += [ "OPENTHREAD_CONFIG_DIAG_ENABLE=1" ]
139    }
140
141    if (openthread_config_dns_client_enable) {
142      defines += [ "OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1" ]
143    }
144
145    if (openthread_config_dnssd_server_enable) {
146      defines += [ "OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE=1" ]
147    }
148
149    if (openthread_config_ecdsa_enable) {
150      defines += [ "OPENTHREAD_CONFIG_ECDSA_ENABLE=1" ]
151    }
152
153    if (openthread_config_dua_enable) {
154      defines += [ "OPENTHREAD_CONFIG_DUA_ENABLE=1" ]
155    }
156
157    if (openthread_config_mlr_enable) {
158      defines += [ "OPENTHREAD_CONFIG_MLR_ENABLE=1" ]
159    }
160
161    if (openthread_config_heap_external_enable) {
162      defines += [ "OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1" ]
163    }
164
165    if (openthread_config_ip6_fragmentation_enable) {
166      defines += [ "OPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1" ]
167    }
168
169    if (openthread_config_jam_detection_enable) {
170      defines += [ "OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1" ]
171    }
172
173    if (openthread_config_joiner_enable) {
174      defines += [ "OPENTHREAD_CONFIG_JOINER_ENABLE=1" ]
175    }
176
177    if (openthread_config_link_metrics_initiator_enable) {
178      defines += [ "DOPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE=1" ]
179    }
180
181    if (openthread_config_link_metrics_subject_enable) {
182      defines += [ "DOPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE=1" ]
183    }
184
185    if (openthread_config_link_raw_enable) {
186      defines += [ "OPENTHREAD_CONFIG_LINK_RAW_ENABLE=1" ]
187    }
188
189    if (openthread_config_log_level_dynamic_enable) {
190      defines += [ "OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1" ]
191    }
192
193    if (openthread_config_mac_filter_enable) {
194      defines += [ "OPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1" ]
195    }
196
197    if (openthread_config_message_use_heap) {
198      defines += [ "OPENTHREAD_CONFIG_MESSAGE_USE_HEAP_ENABLE=1" ]
199    }
200
201    if (openthread_config_mle_long_routes_enable) {
202      defines += [ "OPENTHREAD_CONFIG_MLE_LONG_ROUTES_ENABLE=1" ]
203    }
204
205    if (openthread_config_multiple_instance_enable) {
206      defines += [ "OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE=1" ]
207    }
208
209    if (openthread_config_tmf_netdiag_client_enable) {
210      defines += [ "OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE=1" ]
211    }
212
213    if (openthread_config_platform_netif_enable) {
214      defines += [ "OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1" ]
215    }
216
217
218    if (openthread_config_platform_udp_enable) {
219      defines += [ "OPENTHREAD_CONFIG_PLATFORM_UDP_ENABLE=1" ]
220    }
221
222    if (openthread_config_reference_device_enable) {
223      defines += [ "OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1" ]
224    }
225
226    if (openthread_config_tmf_netdata_service_enable) {
227      defines += [ "OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1" ]
228    }
229
230    if (openthread_settings_ram) {
231      defines += [ "OPENTHREAD_SETTINGS_RAM=1" ]
232    }
233
234    if (openthread_config_ip6_slaac_enable) {
235      defines += [ "OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1" ]
236    }
237
238    if (openthread_config_sntp_client_enable) {
239      defines += [ "OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1" ]
240    }
241
242    if (openthread_config_srp_client_enable) {
243      defines += [ "OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE=1" ]
244    }
245
246    if (openthread_config_srp_server_enable) {
247      defines += [ "OPENTHREAD_CONFIG_SRP_SERVER_ENABLE=1" ]
248    }
249
250    if (openthread_config_ping_sender) {
251      defines += [ "OPENTHREAD_CONFIG_PING_SENDER_ENABLE=1" ]
252    }
253
254    if (openthread_config_time_sync_enable) {
255      defines += [ "OPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1" ]
256    }
257
258    if (openthread_config_udp_forward_enable) {
259      defines += [ "OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1" ]
260    }
261
262    if (openthread_config_full_logs) {
263      defines += [ "OPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG" ]
264      defines += [ "OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL=1" ]
265    }
266
267    if (openthread_config_otns_enable) {
268      defines += [ "OPENTHREAD_CONFIG_OTNS_ENABLE=1" ]
269    }
270
271    if (openthread_config_coexistence_enable) {
272      defines += [ "OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE=1" ]
273    }
274  }
275}
276
277config("core_config") {
278  defines = []
279  configs = []
280
281  if (openthread_project_core_config_file != "") {
282    defines += [ "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${openthread_project_core_config_file}\"" ]
283  }
284
285  if (openthread_core_config_platform_check_file != "") {
286    defines += [ "OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=\"${openthread_core_config_platform_check_file}\"" ]
287  }
288
289  if (openthread_package_name != "") {
290    defines += [ "PACKAGE_NAME=\"${openthread_package_name}\"" ]
291  }
292
293  if (openthread_package_version != "") {
294    defines += [ "PACKAGE_VERSION=\"${openthread_package_version}\"" ]
295  }
296
297  if (openthread_enable_core_config_args) {
298    configs += [ ":core_config_args" ]
299  }
300
301  include_dirs = [
302    "..",
303    ".",
304  ]
305}
306
307openthread_core_files = [
308  "api/backbone_router_api.cpp",
309  "api/backbone_router_ftd_api.cpp",
310  "api/ble_secure_api.cpp",
311  "api/border_agent_api.cpp",
312  "api/border_router_api.cpp",
313  "api/border_routing_api.cpp",
314  "api/channel_manager_api.cpp",
315  "api/channel_monitor_api.cpp",
316  "api/child_supervision_api.cpp",
317  "api/coap_api.cpp",
318  "api/coap_secure_api.cpp",
319  "api/commissioner_api.cpp",
320  "api/crypto_api.cpp",
321  "api/dataset_api.cpp",
322  "api/dataset_ftd_api.cpp",
323  "api/dataset_updater_api.cpp",
324  "api/diags_api.cpp",
325  "api/dns_api.cpp",
326  "api/dns_server_api.cpp",
327  "api/error_api.cpp",
328  "api/heap_api.cpp",
329  "api/history_tracker_api.cpp",
330  "api/icmp6_api.cpp",
331  "api/instance_api.cpp",
332  "api/ip6_api.cpp",
333  "api/jam_detection_api.cpp",
334  "api/joiner_api.cpp",
335  "api/link_api.cpp",
336  "api/link_metrics_api.cpp",
337  "api/link_raw_api.cpp",
338  "api/logging_api.cpp",
339  "api/mdns_api.cpp",
340  "api/mesh_diag_api.cpp",
341  "api/message_api.cpp",
342  "api/multi_radio_api.cpp",
343  "api/nat64_api.cpp",
344  "api/netdata_api.cpp",
345  "api/netdata_publisher_api.cpp",
346  "api/netdiag_api.cpp",
347  "api/network_time_api.cpp",
348  "api/ping_sender_api.cpp",
349  "api/radio_stats_api.cpp",
350  "api/random_crypto_api.cpp",
351  "api/random_noncrypto_api.cpp",
352  "api/server_api.cpp",
353  "api/sntp_api.cpp",
354  "api/srp_client_api.cpp",
355  "api/srp_client_buffers_api.cpp",
356  "api/srp_server_api.cpp",
357  "api/tasklet_api.cpp",
358  "api/tcp_api.cpp",
359  "api/tcp_ext_api.cpp",
360  "api/thread_api.cpp",
361  "api/thread_ftd_api.cpp",
362  "api/trel_api.cpp",
363  "api/udp_api.cpp",
364  "api/verhoeff_checksum_api.cpp",
365  "backbone_router/backbone_tmf.cpp",
366  "backbone_router/backbone_tmf.hpp",
367  "backbone_router/bbr_leader.cpp",
368  "backbone_router/bbr_leader.hpp",
369  "backbone_router/bbr_local.cpp",
370  "backbone_router/bbr_local.hpp",
371  "backbone_router/bbr_manager.cpp",
372  "backbone_router/bbr_manager.hpp",
373  "backbone_router/multicast_listeners_table.cpp",
374  "backbone_router/multicast_listeners_table.hpp",
375  "backbone_router/ndproxy_table.cpp",
376  "backbone_router/ndproxy_table.hpp",
377  "border_router/infra_if.cpp",
378  "border_router/infra_if.hpp",
379  "border_router/routing_manager.cpp",
380  "border_router/routing_manager.hpp",
381  "coap/coap.cpp",
382  "coap/coap.hpp",
383  "coap/coap_message.cpp",
384  "coap/coap_message.hpp",
385  "coap/coap_secure.cpp",
386  "coap/coap_secure.hpp",
387  "common/appender.cpp",
388  "common/appender.hpp",
389  "common/arg_macros.hpp",
390  "common/array.hpp",
391  "common/as_core_type.hpp",
392  "common/binary_search.cpp",
393  "common/binary_search.hpp",
394  "common/bit_vector.hpp",
395  "common/callback.hpp",
396  "common/clearable.hpp",
397  "common/code_utils.hpp",
398  "common/const_cast.hpp",
399  "common/crc16.cpp",
400  "common/crc16.hpp",
401  "common/data.cpp",
402  "common/data.hpp",
403  "common/debug.hpp",
404  "common/encoding.hpp",
405  "common/equatable.hpp",
406  "common/error.cpp",
407  "common/error.hpp",
408  "common/frame_builder.cpp",
409  "common/frame_builder.hpp",
410  "common/frame_data.cpp",
411  "common/frame_data.hpp",
412  "common/heap.cpp",
413  "common/heap.hpp",
414  "common/heap_allocatable.hpp",
415  "common/heap_array.hpp",
416  "common/heap_data.cpp",
417  "common/heap_data.hpp",
418  "common/heap_string.cpp",
419  "common/heap_string.hpp",
420  "common/iterator_utils.hpp",
421  "common/linked_list.hpp",
422  "common/locator.hpp",
423  "common/locator_getters.hpp",
424  "common/log.cpp",
425  "common/log.hpp",
426  "common/logging.hpp",
427  "common/message.cpp",
428  "common/message.hpp",
429  "common/new.hpp",
430  "common/non_copyable.hpp",
431  "common/notifier.cpp",
432  "common/notifier.hpp",
433  "common/num_utils.hpp",
434  "common/numeric_limits.hpp",
435  "common/offset_range.cpp",
436  "common/offset_range.hpp",
437  "common/owned_ptr.hpp",
438  "common/owning_list.hpp",
439  "common/pool.hpp",
440  "common/preference.cpp",
441  "common/preference.hpp",
442  "common/ptr_wrapper.hpp",
443  "common/random.cpp",
444  "common/random.hpp",
445  "common/retain_ptr.hpp",
446  "common/serial_number.hpp",
447  "common/settings.cpp",
448  "common/settings.hpp",
449  "common/settings_driver.hpp",
450  "common/string.cpp",
451  "common/string.hpp",
452  "common/tasklet.cpp",
453  "common/tasklet.hpp",
454  "common/time.hpp",
455  "common/time_ticker.cpp",
456  "common/time_ticker.hpp",
457  "common/timer.cpp",
458  "common/timer.hpp",
459  "common/tlvs.cpp",
460  "common/tlvs.hpp",
461  "common/trickle_timer.cpp",
462  "common/trickle_timer.hpp",
463  "common/type_traits.hpp",
464  "common/uptime.cpp",
465  "common/uptime.hpp",
466  "crypto/aes_ccm.cpp",
467  "crypto/aes_ccm.hpp",
468  "crypto/aes_ecb.cpp",
469  "crypto/aes_ecb.hpp",
470  "crypto/context_size.hpp",
471  "crypto/crypto_platform.cpp",
472  "crypto/ecdsa.hpp",
473  "crypto/hkdf_sha256.cpp",
474  "crypto/hkdf_sha256.hpp",
475  "crypto/hmac_sha256.cpp",
476  "crypto/hmac_sha256.hpp",
477  "crypto/mbedtls.cpp",
478  "crypto/mbedtls.hpp",
479  "crypto/sha256.cpp",
480  "crypto/sha256.hpp",
481  "crypto/storage.cpp",
482  "crypto/storage.hpp",
483  "diags/factory_diags.cpp",
484  "diags/factory_diags.hpp",
485  "instance/extension.hpp",
486  "instance/instance.cpp",
487  "instance/instance.hpp",
488  "mac/channel_mask.cpp",
489  "mac/channel_mask.hpp",
490  "mac/data_poll_handler.cpp",
491  "mac/data_poll_handler.hpp",
492  "mac/data_poll_sender.cpp",
493  "mac/data_poll_sender.hpp",
494  "mac/link_raw.cpp",
495  "mac/link_raw.hpp",
496  "mac/mac.cpp",
497  "mac/mac.hpp",
498  "mac/mac_filter.cpp",
499  "mac/mac_filter.hpp",
500  "mac/mac_frame.cpp",
501  "mac/mac_frame.hpp",
502  "mac/mac_header_ie.cpp",
503  "mac/mac_header_ie.hpp",
504  "mac/mac_links.cpp",
505  "mac/mac_links.hpp",
506  "mac/mac_types.cpp",
507  "mac/mac_types.hpp",
508  "mac/sub_mac.cpp",
509  "mac/sub_mac.hpp",
510  "mac/sub_mac_callbacks.cpp",
511  "mac/sub_mac_csl_receiver.cpp",
512  "meshcop/announce_begin_client.cpp",
513  "meshcop/announce_begin_client.hpp",
514  "meshcop/border_agent.cpp",
515  "meshcop/border_agent.hpp",
516  "meshcop/commissioner.cpp",
517  "meshcop/commissioner.hpp",
518  "meshcop/dataset.cpp",
519  "meshcop/dataset.hpp",
520  "meshcop/dataset_manager.cpp",
521  "meshcop/dataset_manager.hpp",
522  "meshcop/dataset_manager_ftd.cpp",
523  "meshcop/dataset_updater.cpp",
524  "meshcop/dataset_updater.hpp",
525  "meshcop/energy_scan_client.cpp",
526  "meshcop/energy_scan_client.hpp",
527  "meshcop/extended_panid.cpp",
528  "meshcop/extended_panid.hpp",
529  "meshcop/joiner.cpp",
530  "meshcop/joiner.hpp",
531  "meshcop/joiner_router.cpp",
532  "meshcop/joiner_router.hpp",
533  "meshcop/meshcop.cpp",
534  "meshcop/meshcop.hpp",
535  "meshcop/meshcop_leader.cpp",
536  "meshcop/meshcop_leader.hpp",
537  "meshcop/meshcop_tlvs.cpp",
538  "meshcop/meshcop_tlvs.hpp",
539  "meshcop/network_name.cpp",
540  "meshcop/network_name.hpp",
541  "meshcop/panid_query_client.cpp",
542  "meshcop/panid_query_client.hpp",
543  "meshcop/secure_transport.cpp",
544  "meshcop/secure_transport.hpp",
545  "meshcop/tcat_agent.cpp",
546  "meshcop/tcat_agent.hpp",
547  "meshcop/timestamp.cpp",
548  "meshcop/timestamp.hpp",
549  "net/checksum.cpp",
550  "net/checksum.hpp",
551  "net/dhcp6.hpp",
552  "net/dhcp6_client.cpp",
553  "net/dhcp6_client.hpp",
554  "net/dhcp6_server.cpp",
555  "net/dhcp6_server.hpp",
556  "net/dns_client.cpp",
557  "net/dns_client.hpp",
558  "net/dns_dso.cpp",
559  "net/dns_dso.hpp",
560  "net/dns_platform.cpp",
561  "net/dns_types.cpp",
562  "net/dns_types.hpp",
563  "net/dnssd.cpp",
564  "net/dnssd.hpp",
565  "net/dnssd_server.cpp",
566  "net/dnssd_server.hpp",
567  "net/icmp6.cpp",
568  "net/icmp6.hpp",
569  "net/ip4_types.cpp",
570  "net/ip4_types.hpp",
571  "net/ip6.cpp",
572  "net/ip6.hpp",
573  "net/ip6_address.cpp",
574  "net/ip6_address.hpp",
575  "net/ip6_filter.cpp",
576  "net/ip6_filter.hpp",
577  "net/ip6_headers.cpp",
578  "net/ip6_headers.hpp",
579  "net/ip6_mpl.cpp",
580  "net/ip6_mpl.hpp",
581  "net/ip6_types.hpp",
582  "net/mdns.cpp",
583  "net/mdns.hpp",
584  "net/nat64_translator.cpp",
585  "net/nat64_translator.hpp",
586  "net/nd6.cpp",
587  "net/nd6.hpp",
588  "net/nd_agent.cpp",
589  "net/nd_agent.hpp",
590  "net/netif.cpp",
591  "net/netif.hpp",
592  "net/sntp_client.cpp",
593  "net/sntp_client.hpp",
594  "net/socket.cpp",
595  "net/socket.hpp",
596  "net/srp_advertising_proxy.cpp",
597  "net/srp_advertising_proxy.hpp",
598  "net/srp_client.cpp",
599  "net/srp_client.hpp",
600  "net/srp_server.cpp",
601  "net/srp_server.hpp",
602  "net/tcp6.cpp",
603  "net/tcp6.hpp",
604  "net/tcp6_ext.cpp",
605  "net/tcp6_ext.hpp",
606  "net/udp6.cpp",
607  "net/udp6.hpp",
608  "radio/ble_secure.cpp",
609  "radio/ble_secure.hpp",
610  "radio/max_power_table.hpp",
611  "radio/radio.cpp",
612  "radio/radio.hpp",
613  "radio/radio_callbacks.cpp",
614  "radio/radio_platform.cpp",
615  "radio/trel_interface.cpp",
616  "radio/trel_interface.hpp",
617  "radio/trel_link.cpp",
618  "radio/trel_link.hpp",
619  "radio/trel_packet.cpp",
620  "radio/trel_packet.hpp",
621  "thread/address_resolver.cpp",
622  "thread/address_resolver.hpp",
623  "thread/announce_begin_server.cpp",
624  "thread/announce_begin_server.hpp",
625  "thread/announce_sender.cpp",
626  "thread/announce_sender.hpp",
627  "thread/anycast_locator.cpp",
628  "thread/anycast_locator.hpp",
629  "thread/child.cpp",
630  "thread/child.hpp",
631  "thread/child_mask.hpp",
632  "thread/child_supervision.cpp",
633  "thread/child_supervision.hpp",
634  "thread/child_table.cpp",
635  "thread/child_table.hpp",
636  "thread/csl_tx_scheduler.cpp",
637  "thread/csl_tx_scheduler.hpp",
638  "thread/discover_scanner.cpp",
639  "thread/discover_scanner.hpp",
640  "thread/dua_manager.cpp",
641  "thread/dua_manager.hpp",
642  "thread/energy_scan_server.cpp",
643  "thread/energy_scan_server.hpp",
644  "thread/indirect_sender.cpp",
645  "thread/indirect_sender.hpp",
646  "thread/indirect_sender_frame_context.hpp",
647  "thread/key_manager.cpp",
648  "thread/key_manager.hpp",
649  "thread/link_metrics.cpp",
650  "thread/link_metrics.hpp",
651  "thread/link_metrics_tlvs.hpp",
652  "thread/link_metrics_types.cpp",
653  "thread/link_metrics_types.hpp",
654  "thread/link_quality.cpp",
655  "thread/link_quality.hpp",
656  "thread/lowpan.cpp",
657  "thread/lowpan.hpp",
658  "thread/mesh_forwarder.cpp",
659  "thread/mesh_forwarder.hpp",
660  "thread/mesh_forwarder_ftd.cpp",
661  "thread/mesh_forwarder_mtd.cpp",
662  "thread/mle.cpp",
663  "thread/mle.hpp",
664  "thread/mle_router.cpp",
665  "thread/mle_router.hpp",
666  "thread/mle_tlvs.cpp",
667  "thread/mle_tlvs.hpp",
668  "thread/mle_types.cpp",
669  "thread/mle_types.hpp",
670  "thread/mlr_manager.cpp",
671  "thread/mlr_manager.hpp",
672  "thread/mlr_types.hpp",
673  "thread/neighbor.cpp",
674  "thread/neighbor.hpp",
675  "thread/neighbor_table.cpp",
676  "thread/neighbor_table.hpp",
677  "thread/network_data.cpp",
678  "thread/network_data.hpp",
679  "thread/network_data_leader.cpp",
680  "thread/network_data_leader.hpp",
681  "thread/network_data_leader_ftd.cpp",
682  "thread/network_data_local.cpp",
683  "thread/network_data_local.hpp",
684  "thread/network_data_notifier.cpp",
685  "thread/network_data_notifier.hpp",
686  "thread/network_data_publisher.cpp",
687  "thread/network_data_publisher.hpp",
688  "thread/network_data_service.cpp",
689  "thread/network_data_service.hpp",
690  "thread/network_data_tlvs.cpp",
691  "thread/network_data_tlvs.hpp",
692  "thread/network_data_types.cpp",
693  "thread/network_data_types.hpp",
694  "thread/network_diagnostic.cpp",
695  "thread/network_diagnostic.hpp",
696  "thread/network_diagnostic_tlvs.cpp",
697  "thread/network_diagnostic_tlvs.hpp",
698  "thread/panid_query_server.cpp",
699  "thread/panid_query_server.hpp",
700  "thread/radio_selector.cpp",
701  "thread/radio_selector.hpp",
702  "thread/router.cpp",
703  "thread/router.hpp",
704  "thread/router_table.cpp",
705  "thread/router_table.hpp",
706  "thread/src_match_controller.cpp",
707  "thread/src_match_controller.hpp",
708  "thread/thread_netif.cpp",
709  "thread/thread_netif.hpp",
710  "thread/thread_tlvs.hpp",
711  "thread/time_sync_service.cpp",
712  "thread/time_sync_service.hpp",
713  "thread/tmf.cpp",
714  "thread/tmf.hpp",
715  "thread/uri_paths.cpp",
716  "thread/uri_paths.hpp",
717  "thread/version.hpp",
718  "utils/channel_manager.cpp",
719  "utils/channel_manager.hpp",
720  "utils/channel_monitor.cpp",
721  "utils/channel_monitor.hpp",
722  "utils/flash.cpp",
723  "utils/flash.hpp",
724  "utils/heap.cpp",
725  "utils/heap.hpp",
726  "utils/history_tracker.cpp",
727  "utils/history_tracker.hpp",
728  "utils/jam_detector.cpp",
729  "utils/jam_detector.hpp",
730  "utils/link_metrics_manager.cpp",
731  "utils/link_metrics_manager.hpp",
732  "utils/mesh_diag.cpp",
733  "utils/mesh_diag.hpp",
734  "utils/otns.cpp",
735  "utils/otns.hpp",
736  "utils/parse_cmdline.cpp",
737  "utils/parse_cmdline.hpp",
738  "utils/ping_sender.cpp",
739  "utils/ping_sender.hpp",
740  "utils/power_calibration.cpp",
741  "utils/power_calibration.hpp",
742  "utils/slaac_address.cpp",
743  "utils/slaac_address.hpp",
744  "utils/srp_client_buffers.cpp",
745  "utils/srp_client_buffers.hpp",
746  "utils/verhoeff_checksum.cpp",
747  "utils/verhoeff_checksum.hpp",
748]
749
750openthread_radio_sources = [
751  "api/diags_api.cpp",
752  "api/error_api.cpp",
753  "api/instance_api.cpp",
754  "api/link_raw_api.cpp",
755  "api/logging_api.cpp",
756  "api/random_noncrypto_api.cpp",
757  "api/tasklet_api.cpp",
758  "common/binary_search.cpp",
759  "common/binary_search.hpp",
760  "common/error.hpp",
761  "common/frame_builder.cpp",
762  "common/frame_builder.hpp",
763  "common/log.cpp",
764  "common/random.cpp",
765  "common/string.cpp",
766  "common/tasklet.cpp",
767  "common/timer.cpp",
768  "common/uptime.cpp",
769  "crypto/aes_ccm.cpp",
770  "crypto/aes_ecb.cpp",
771  "crypto/crypto_platform.cpp",
772  "crypto/storage.cpp",
773  "diags/factory_diags.cpp",
774  "instance/instance.cpp",
775  "mac/link_raw.cpp",
776  "mac/mac_frame.cpp",
777  "mac/mac_header_ie.cpp",
778  "mac/mac_types.cpp",
779  "mac/sub_mac.cpp",
780  "mac/sub_mac_callbacks.cpp",
781  "radio/radio.cpp",
782  "radio/radio_callbacks.cpp",
783  "radio/radio_platform.cpp",
784  "thread/link_quality.cpp",
785  "utils/parse_cmdline.cpp",
786  "utils/power_calibration.cpp",
787]
788
789header_pattern = [
790  "*.h",
791  "*.hpp",
792]
793
794openthread_core_headers = filter_include(openthread_core_files, header_pattern)
795openthread_core_sources = filter_exclude(openthread_core_files, header_pattern)
796
797source_set("libopenthread_core_config") {
798  public = [
799    "config/announce_sender.h",
800    "config/backbone_router.h",
801    "config/border_agent.h",
802    "config/border_router.h",
803    "config/border_routing.h",
804    "config/channel_manager.h",
805    "config/channel_monitor.h",
806    "config/child_supervision.h",
807    "config/coap.h",
808    "config/commissioner.h",
809    "config/crypto.h",
810    "config/dataset_updater.h",
811    "config/dhcp6_client.h",
812    "config/dhcp6_server.h",
813    "config/diag.h",
814    "config/dns_client.h",
815    "config/dns_dso.h",
816    "config/dnssd_server.h",
817    "config/history_tracker.h",
818    "config/ip6.h",
819    "config/joiner.h",
820    "config/link_metrics_manager.h",
821    "config/link_quality.h",
822    "config/link_raw.h",
823    "config/logging.h",
824    "config/mac.h",
825    "config/mdns.h",
826    "config/mesh_diag.h",
827    "config/mesh_forwarder.h",
828    "config/misc.h",
829    "config/mle.h",
830    "config/nat64.h",
831    "config/netdata_publisher.h",
832    "config/network_diagnostic.h",
833    "config/openthread-core-config-check.h",
834    "config/parent_search.h",
835    "config/ping_sender.h",
836    "config/platform.h",
837    "config/power_calibration.h",
838    "config/radio_link.h",
839    "config/secure_transport.h",
840    "config/sntp_client.h",
841    "config/srp_client.h",
842    "config/srp_server.h",
843    "config/time_sync.h",
844    "config/tmf.h",
845    "config/trel.h",
846    "openthread-core-config.h",
847  ]
848  public_configs = [
849    ":core_config",
850    "../..:openthread_config",
851  ]
852  public_deps = [
853    "../../include/openthread:openthread_config",
854    "../../include/openthread",
855  ]
856  public_deps += openthread_core_config_deps
857}
858
859source_set("libopenthread_core_headers") {
860  public = openthread_core_headers
861  public_deps = [
862    ":libopenthread_core_config",
863    "../../include/openthread",
864  ]
865  visibility += [ "*" ]
866}
867
868group("libopenthread_platform") {
869  public_deps = []
870  if (openthread_external_platform != "") {
871    public_deps += [ openthread_external_platform ]
872  }
873  public_deps += [
874    ":libopenthread_core_headers",
875    "${mbedtls_target}",
876  ]
877}
878
879static_library("libopenthread-ftd") {
880  sources = openthread_core_sources
881  public_deps = [ ":libopenthread_platform" ]
882  public_configs = [ "../..:openthread_ftd_config" ]
883}
884
885static_library("libopenthread-mtd") {
886  sources = openthread_core_sources
887  public_deps = [ ":libopenthread_platform" ]
888  public_configs = [ "../..:openthread_mtd_config" ]
889}
890
891static_library("libopenthread-radio") {
892  sources = openthread_radio_sources
893  public_deps = [ ":libopenthread_platform" ]
894  public_configs = [ "../..:openthread_radio_config" ]
895}
896