This repository was archived by the owner on Dec 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathInetConfig.h
749 lines (691 loc) · 22.6 KB
/
InetConfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
/*
*
* Copyright (c) 2013-2018 Nest Labs, Inc.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* This file defines default compile-time configuration constants
* for the Nest InetLayer, an Internet Protocol communications
* abstraction layer.
*
* Package integrators that wish to override these values should
* either use preprocessor definitions or create a project-
* specific InetProjectConfig.h header and then assert
* HAVE_INETPROJECTCONFIG_H via the package configuration tool
* via --with-weave-inet-project-includes=DIR where DIR is the
* directory that contains the header.
*
* NOTE WELL: On some platforms, this header is included by C-language programs.
*
*/
#ifndef INETCONFIG_H
#define INETCONFIG_H
/*--- Include configuration headers ---*/
#include <SystemLayer/SystemConfig.h>
/*
* If the WEAVE_SYSTEM_CONFIG_TRANSFER_INETLAYER_PROJECT_CONFIGURATION option is not applicable, then the "InetProjectConfig.h"
* header was not included by <SystemLayer/SystemConfig.h> and therefore it must be included here.
*/
#if !WEAVE_SYSTEM_CONFIG_TRANSFER_INETLAYER_PROJECT_CONFIGURATION
/* Include a project-specific configuration file, if defined.
*
* An application or module that incorporates Weave can define a project configuration
* file to override standard Inet Layer configuration with application-specific values.
* The project config file is typically located outside the OpenWeave source tree,
* alongside the source code for the application.
*/
#ifdef INET_PROJECT_CONFIG_INCLUDE
#include INET_PROJECT_CONFIG_INCLUDE
#endif // INET_PROJECT_CONFIG_INCLUDE
#endif // !WEAVE_SYSTEM_CONFIG_TRANSFER_INETLAYER_PROJECT_CONFIGURATION
/* Include a platform-specific configuration file, if defined.
*
* A platform configuration file contains overrides to standard Inet Layer configuration
* that are specific to the platform or OS on which Weave is running. It is typically
* provided as apart of an adaptation layer that adapts OpenWeave to the target
* environment. This adaptation layer may be included in the OpenWeave source tree
* itself or implemented externally.
*/
#ifdef INET_PLATFORM_CONFIG_INCLUDE
#include INET_PLATFORM_CONFIG_INCLUDE
#endif
// clang-format off
/**
* @def INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES
*
* @brief
* This boolean configuration option is (1) if the obsolescent interfaces
* of the INET layer that now reside elsewhere, for example, in the Weave System
* Layer are aliased for transitional purposes.
*
*/
#ifndef INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES
#define INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES 0
#endif // INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES
#if INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES && !WEAVE_SYSTEM_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES
#error "REQUIRED: if INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES then WEAVE_SYSTEM_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES!"
#endif // INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES && !WEAVE_SYSTEM_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES
/**
* @def INET_CONFIG_MAX_IP_AND_UDP_HEADER_SIZE
*
* @brief
* The maximum space required for IPv6 and UDP headers.
* Useful when ensuring a Weave message will not exceed a UDP MTU.
*
*/
#ifndef INET_CONFIG_MAX_IP_AND_UDP_HEADER_SIZE
#define INET_CONFIG_MAX_IP_AND_UDP_HEADER_SIZE (40 + 8)
#endif // INET_CONFIG_MAX_IP_AND_UDP_HEADER_SIZE
/**
* @def INET_CONFIG_ERROR_TYPE
*
* @brief
* This defines the data type used to represent errors for the
* InetLayer subsystem.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_ERROR_TYPE.
*
*/
#ifndef INET_CONFIG_ERROR_TYPE
#define INET_CONFIG_ERROR_TYPE WEAVE_SYSTEM_CONFIG_ERROR_TYPE
#endif // !defined(INET_CONFIG_ERROR_TYPE)
/**
* @def INET_CONFIG_NO_ERROR
*
* @brief
* This defines the InetLayer error code for no error or success.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_NO_ERROR.
*
*/
#ifndef INET_CONFIG_NO_ERROR
#define INET_CONFIG_NO_ERROR WEAVE_SYSTEM_CONFIG_NO_ERROR
#endif // !defined(INET_CONFIG_NO_ERROR)
/**
* @def INET_CONFIG_ERROR_MIN
*
* @brief
* This defines the base or minimum InetLayer error number range.
*
*/
#ifndef INET_CONFIG_ERROR_MIN
#define INET_CONFIG_ERROR_MIN 1000
#endif // INET_CONFIG_ERROR_MIN
/**
* @def INET_CONFIG_ERROR_MAX
*
* @brief
* This defines the top or maximum InetLayer error number range.
*
*/
#ifndef INET_CONFIG_ERROR_MAX
#define INET_CONFIG_ERROR_MAX 1999
#endif // INET_CONFIG_ERROR_MAX
/**
* @def _INET_CONFIG_ERROR
*
* @brief
* This defines a mapping function for InetLayer errors that allows
* mapping such errors into a platform- or system-specific range.
*
*/
#ifndef _INET_CONFIG_ERROR
#define _INET_CONFIG_ERROR(e) (INET_ERROR_MIN + (e))
#endif // _INET_CONFIG_ERROR
/**
* @def INET_CONFIG_WILL_OVERRIDE_OS_ERROR_FUNCS
*
* @brief
* This defines whether (1) or not (0) your platform will override
* the platform- and system-specific INET_MapOSError,
* INET_DescribeOSError, and INET_IsOSError functions.
*
*/
#ifndef INET_CONFIG_WILL_OVERRIDE_OS_ERROR_FUNCS
#define INET_CONFIG_WILL_OVERRIDE_OS_ERROR_FUNCS 0
#endif // INET_CONFIG_WILL_OVERRIDE_OS_ERROR_FUNCS
/**
* @def INET_CONFIG_WILL_OVERRIDE_LWIP_ERROR_FUNCS
*
* @brief
* This defines whether (1) or not (0) your platform will override
* the platform- and system-specific INET_MapLwIPError,
* INET_DescribeLwIPError, and INET_IsLwIPError functions.
*
*/
#ifndef INET_CONFIG_WILL_OVERRIDE_LWIP_ERROR_FUNCS
#define INET_CONFIG_WILL_OVERRIDE_LWIP_ERROR_FUNCS 0
#endif // INET_CONFIG_WILL_OVERRIDE_LWIP_ERROR_FUNCS
/**
* @def INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS
*
* @brief
* This defines whether (1) or not (0) your platform will override
* the platform- and system-specific InetLayer WillInit, DidInit,
* WillShutdown, and DidShutdown.
*
*/
#ifndef INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS
#define INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS 0
#endif // INET_CONFIG_WILL_OVERRIDE_PLATFORM_XTOR_FUNCS
/**
* @def INET_CONFIG_MAX_DROPPABLE_EVENTS
*
* @brief
* This is the maximum number of UDP or raw network transport
* packet events / messages that may be dropped due to packet
* buffer starvation.
*
* In some implementations, there may be a shared event / message
* queue for the InetLayer used by other system events / messages.
*
* If the length of that queue is considerably longer than the
* number of packet buffers available, it may lead to buffer
* exhaustion. As a result, using the queue itself to implement
* backpressure is insufficient, and we need an external mechanism
* to prevent buffer starvation in the rest of the system and
* getting into deadlock situations.
*
* For both UDP and raw network transport traffic we can easily
* drop incoming packets without impacting the correctness of
* higher level protocols.
*
*/
#ifndef INET_CONFIG_MAX_DROPPABLE_EVENTS
#define INET_CONFIG_MAX_DROPPABLE_EVENTS 0
#endif // INET_CONFIG_MAX_DROPPABLE_EVENTS
/**
* @def INET_CONFIG_NUM_RAW_ENDPOINTS
*
* @brief
* This is the total number of "raw" (direct-IP, non-TCP/-UDP) end
* point context structures.
*
* Up to this many outstanding "raw" communication flows may be in
* use.
*
*/
#ifndef INET_CONFIG_NUM_RAW_ENDPOINTS
#define INET_CONFIG_NUM_RAW_ENDPOINTS 8
#endif // INET_CONFIG_NUM_RAW_ENDPOINTS
/**
* @def INET_CONFIG_NUM_TCP_ENDPOINTS
*
* @brief
* This is the total number of TCP end point context structures.
*
* Up to this many outstanding TCP communication flows may be in
* use.
*
*/
#ifndef INET_CONFIG_NUM_TCP_ENDPOINTS
#define INET_CONFIG_NUM_TCP_ENDPOINTS 64
#endif // INET_CONFIG_NUM_TCP_ENDPOINTS
/**
* @def INET_CONFIG_NUM_UDP_ENDPOINTS
*
* @brief
* This is the total number of UDP end point context structures.
*
* Up to this many outstanding UDP communication flows may be in
* use.
*
*/
#ifndef INET_CONFIG_NUM_UDP_ENDPOINTS
#define INET_CONFIG_NUM_UDP_ENDPOINTS 64
#endif // INET_CONFIG_NUM_UDP_ENDPOINTS
/**
* @def INET_CONFIG_NUM_TUN_ENDPOINTS
*
* @brief
* This is the total number of TUN end point context structures.
*
* Up to this many outstanding TUN endpoints may be instantiated.
*
*/
#ifndef INET_CONFIG_NUM_TUN_ENDPOINTS
#define INET_CONFIG_NUM_TUN_ENDPOINTS 64
#endif // INET_CONFIG_NUM_TUN_ENDPOINTS
/**
* @def INET_CONFIG_NUM_DNS_RESOLVERS
*
* @brief
* This is the total number of outstanding DNS resolution request
* contexts.
*
* Up to this many DNS resolution requests may be in in use.
*
*/
#ifndef INET_CONFIG_NUM_DNS_RESOLVERS
#define INET_CONFIG_NUM_DNS_RESOLVERS 4
#endif // INET_CONFIG_NUM_DNS_RESOLVERS
/**
* @def INET_CONFIG_MAX_DNS_ADDRS
*
* @brief
* This is the maximum allowable number of addresses that may
* be returned in a single DNS hostname lookup.
*
*/
#ifndef INET_CONFIG_MAX_DNS_ADDRS
#define INET_CONFIG_MAX_DNS_ADDRS 16
#endif // INET_CONFIG_MAX_DNS_ADDRS
/**
* @def INET_TCP_IDLE_CHECK_INTERVAL
*
* @brief
* This is the interval, in milliseconds, at which checks are made
* to detect idle TCP connections.
*
*/
#ifndef INET_TCP_IDLE_CHECK_INTERVAL
#define INET_TCP_IDLE_CHECK_INTERVAL 100
#endif // INET_TCP_IDLE_CHECK_INTERVAL
/**
* @def INET_CONFIG_ENABLE_DNS_RESOLVER
*
* @brief
* Defines whether (1) or not (0) to enable the ability
* to instantiate the DNS resolver.
*
*/
#ifndef INET_CONFIG_ENABLE_DNS_RESOLVER
#define INET_CONFIG_ENABLE_DNS_RESOLVER 0
#endif // INET_CONFIG_ENABLE_DNS_RESOLVER
/**
* @def INET_CONFIG_ENABLE_RAW_ENDPOINT
*
* @brief
* Defines whether (1) or not (0) to enable the ability
* to instantiate a Raw endpoint.
*
*/
#ifndef INET_CONFIG_ENABLE_RAW_ENDPOINT
#define INET_CONFIG_ENABLE_RAW_ENDPOINT 0
#endif // INET_CONFIG_ENABLE_RAW_ENDPOINT
/**
* @def INET_CONFIG_ENABLE_TCP_ENDPOINT
*
* @brief
* Defines whether (1) or not (0) to enable the ability
* to instantiate a TCP endpoint.
*
*/
#ifndef INET_CONFIG_ENABLE_TCP_ENDPOINT
#define INET_CONFIG_ENABLE_TCP_ENDPOINT 0
#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT
/**
* @def INET_CONFIG_ENABLE_TUN_ENDPOINT
*
* @brief
* Defines whether (1) or not (0) to enable the ability
* to instantiate a Tunnel endpoint for tun interfaces.
* By default, set when LWIP is enabled or being built
* on a Linux platform.
*
*/
#ifndef INET_CONFIG_ENABLE_TUN_ENDPOINT
#define INET_CONFIG_ENABLE_TUN_ENDPOINT 0
#endif // INET_CONFIG_ENABLE_TUN_ENDPOINT
/**
* @def INET_CONFIG_ENABLE_UDP_ENDPOINT
*
* @brief
* Defines whether (1) or not (0) to enable the ability
* to instantiate a UDP endpoint.
*
*/
#ifndef INET_CONFIG_ENABLE_UDP_ENDPOINT
#define INET_CONFIG_ENABLE_UDP_ENDPOINT 0
#endif // INET_CONFIG_ENABLE_UDP_ENDPOINT
/**
* @def INET_CONFIG_EVENT_RESERVED
*
* @brief
* This defines the first number in the default Weave System Layer event code space reserved for use by the Inet Layer.
* Event codes used by each layer must not overlap.
*/
#ifndef INET_CONFIG_EVENT_RESERVED
#define INET_CONFIG_EVENT_RESERVED 1000
#endif /* INET_CONFIG_EVENT_RESERVED */
/**
* @def _INET_CONFIG_EVENT
*
* @brief
* This defines a mapping function for InetLayer event types that allows
* mapping such event types into a platform- or system-specific range.
*
* @note
* By default, this definition is a copy of _WEAVE_SYSTEM_CONFIG_LWIP_EVENT.
*
*/
#ifndef _INET_CONFIG_EVENT
#define _INET_CONFIG_EVENT(e) _WEAVE_SYSTEM_CONFIG_LWIP_EVENT(INET_CONFIG_EVENT_RESERVED + (e))
#endif // _INET_CONFIG_EVENT
/*
* NOTE WELL: the following configuration parameters and macro definitions are
* obsolescent. They are provided here to facilitate transition.
*/
#if INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES
/**
* @def INET_LWIP
*
* @brief
* Use LwIP.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_USE_LWIP.
*/
#ifndef INET_LWIP
#define INET_LWIP WEAVE_SYSTEM_CONFIG_USE_LWIP
#endif // !defined(INET_LWIP)
/**
* @def INET_SOCKETS
*
* @brief
* Use BSD sockets.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_USE_SOCKETS.
*/
#ifndef INET_SOCKETS
#define INET_SOCKETS WEAVE_SYSTEM_CONFIG_USE_SOCKETS
#endif // !defined(INET_SOCKETS)
/**
* @def INET_CONFIG_POSIX_LOCKING
*
* @brief
* Use POSIX locking. This is enabled by default when not compiling
* for BSD sockets.
*
* Unless you are simulating an LwIP-based system on a Unix-style
* host, this value should be left at its default.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_POSIX_LOCKING.
*
*/
#ifndef INET_CONFIG_POSIX_LOCKING
#define INET_CONFIG_POSIX_LOCKING WEAVE_SYSTEM_CONFIG_POSIX_LOCKING
#endif // !defined(INET_CONFIG_POSIX_LOCKING)
/**
* @def INET_CONFIG_FREERTOS_LOCKING
*
* @brief
* Use FreeRTOS locking.
*
* This should be generally asserted (1) for FreeRTOS + LwIP-based
* systems and deasserted (0) for BSD sockets-based systems.
*
* However, if you are simulating an LwIP-based system atop POSIX
* threads and BSD sockets, this should also be deasserted (0).
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_FREERTOS_LOCKING.
*
*/
#ifndef INET_CONFIG_FREERTOS_LOCKING
#define INET_CONFIG_FREERTOS_LOCKING WEAVE_SYSTEM_CONFIG_FREERTOS_LOCKING
#endif // !defined(INET_CONFIG_FREERTOS_LOCKING)
/**
* @def INET_CONFIG_WILL_OVERRIDE_PLATFORM_EVENT_FUNCS
*
* @brief
* This defines whether (1) or not (0) your platform will override
* the platform- and system-specific PostEvent, DispatchEvents, and
* DispatchEvent functions.
*
*/
#ifndef INET_CONFIG_WILL_OVERRIDE_PLATFORM_EVENT_FUNCS
#define INET_CONFIG_WILL_OVERRIDE_PLATFORM_EVENT_FUNCS 0
#endif // INET_CONFIG_WILL_OVERRIDE_PLATFORM_EVENT_FUNCS
/**
* @def INET_CONFIG_EVENT_TYPE
*
* @brief
* This defines the type for InetEvent types, typically
* an integral type.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_LWIP_EVENT_TYPE.
*
*/
#ifndef INET_CONFIG_EVENT_TYPE
#define INET_CONFIG_EVENT_TYPE WEAVE_SYSTEM_CONFIG_LWIP_EVENT_TYPE
#endif // INET_CONFIG_EVENT_TYPE
/**
* @def INET_CONFIG_EVENT_OBJECT_TYPE
*
* @brief
* This defines the type of InetEvent objects or "messages".
*
* Such types are not directly used by the InetLayer but are
* "passed through". Consequently a forward declaration and a
* const pointer or reference are appropriate.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_LWIP_EVENT_OBJECT_TYPE.
*
*/
#ifndef INET_CONFIG_EVENT_OBJECT_TYPE
#define INET_CONFIG_EVENT_OBJECT_TYPE WEAVE_SYSTEM_CONFIG_LWIP_EVENT_OBJECT_TYPE
#endif // INET_CONFIG_EVENT_OBJECT_TYPE
/**
* @def INET_CONFIG_NUM_BUFS
*
* @brief
* This is the total number of packet buffers for the BSD sockets
* configuration.
*
* This may be set to zero (0) to enable unbounded dynamic
* allocation using malloc.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_PACKETBUFFER_MAXALLOC.
*
*/
#ifndef INET_CONFIG_NUM_BUFS
#define INET_CONFIG_NUM_BUFS WEAVE_SYSTEM_CONFIG_PACKETBUFFER_MAXALLOC
#endif // INET_CONFIG_NUM_BUFS
/**
* @def INET_CONFIG_NUM_TIMERS
*
* @brief
* This is the total number of available timers.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_NUM_TIMERS.
*
*/
#ifndef INET_CONFIG_NUM_TIMERS
#define INET_CONFIG_NUM_TIMERS WEAVE_SYSTEM_CONFIG_NUM_TIMERS
#endif // INET_CONFIG_NUM_TIMERS
/**
* @def INET_CONFIG_HEADER_RESERVE_SIZE
*
* @brief
* The number of bytes to reserve in a network packet buffer to contain
* all the possible protocol encapsulation headers before the application
* message text.
*
* @note
* By default, this parameter is a copy of WEAVE_SYSTEM_CONFIG_HEADER_RESERVE_SIZE.
*
*/
#ifndef INET_CONFIG_HEADER_RESERVE_SIZE
#define INET_CONFIG_HEADER_RESERVE_SIZE WEAVE_SYSTEM_CONFIG_HEADER_RESERVE_SIZE
#endif // INET_CONFIG_HEADER_RESERVE_SIZE
#endif // INET_CONFIG_PROVIDE_OBSOLESCENT_INTERFACES
/**
* @def INET_CONFIG_TEST
*
* @brief
* Defines whether (1) or not (0) to enable testing aids
*/
#ifndef INET_CONFIG_TEST
#define INET_CONFIG_TEST 0
#endif
/**
* @def INET_CONFIG_TUNNEL_DEVICE_NAME
*
* @brief
* Defines tunnel device name
*/
#ifndef INET_CONFIG_TUNNEL_DEVICE_NAME
#define INET_CONFIG_TUNNEL_DEVICE_NAME "/dev/net/tun"
#endif //INET_CONFIG_TUNNEL_DEVICE_NAME
/**
* @def INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS
*
* @brief Enable asynchronous dns name resolution for Linux sockets.
*/
#ifndef INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS
#define INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS 1
#endif // INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS
/**
* @def INET_CONFIG_DNS_ASYNC_MAX_THREAD_COUNT
*
* @brief The maximum number of POSIX threads that would be performing
* asynchronous DNS resolution.
*/
#ifndef INET_CONFIG_DNS_ASYNC_MAX_THREAD_COUNT
#define INET_CONFIG_DNS_ASYNC_MAX_THREAD_COUNT 2
#endif // INET_CONFIG_DNS_ASYNC_MAX_THREAD_COUNT
/**
* @def INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT
*
* @brief
* When this flag is set, the InetLayer implements
* a mechanism that simulates the TCP_USER_TIMEOUT
* socket option for Linux sockets.
*
* @details
* The TCP_USER_TIMEOUT option specifies the maximum
* amount of time in milliseconds that transmitted
* data may remain unacknowledged before TCP will
* forcibly close the corresponding connection.
* See RFC 5482, for further details.
*
* This flag is set to override the usage of the system
* defined TCP_USER_TIMEOUT socket option for Linux.
* The reason for having this overriding feature
* was to overcome some limitations of the system
* socket option wherein the TCP_USER_TIMEOUT was
* not taking effect when
* 1) The IP address of the interface of the TCP
* connection was removed.
* 2) The interface of the TCP connection was
* brought down.
*
*/
#ifndef INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT
#define INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT 1
#endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT
/**
* @def INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS
*
* @brief
* When this flag is set, the InetLayer enables
* callbacks to the upper layer notifying it when
* the send channel of the TCP connection changes
* between being idle or not idle.
*
* @note
* When enabled, the TCP send queue is actively
* polled to determine if sent data has been
* acknowledged.
*
*/
#ifndef INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS
#define INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS 0
#endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS
/**
* @def INET_CONFIG_TCP_SEND_QUEUE_POLL_INTERVAL_MSEC
*
* @brief
* The default polling interval to check the progress
* on the TCP SendQueue to determine if sent data is
* being acknowledged.
*
* @details
* If progress is being made, then the TCP UserTimeout
* period would be shifted further ahead by resetting
* the max poll count. If, however, progress is not made,
* then the next timer would still fire at the next poll
* interval without resetting the poll count. The
* connection would be torn down when the poll count
* reaches zero.
*/
#ifndef INET_CONFIG_TCP_SEND_QUEUE_POLL_INTERVAL_MSEC
#define INET_CONFIG_TCP_SEND_QUEUE_POLL_INTERVAL_MSEC 500
#endif // INET_CONFIG_TCP_SEND_QUEUE_POLL_INTERVAL_MSEC
/**
* @def INET_CONFIG_DEFAULT_TCP_USER_TIMEOUT_MSEC
*
* @brief
* The default value of the TCP_USER_TIMEOUT in
* milliseconds. Set to equivalent of 5 minutes.
*
*
* @details
* This value specifies the maximum amount of
* time in milliseconds that transmitted data may remain
* unacknowledged before TCP will forcibly close the
* corresponding connection.
* See RFC 5482, for further details.
*/
#ifndef INET_CONFIG_DEFAULT_TCP_USER_TIMEOUT_MSEC
#define INET_CONFIG_DEFAULT_TCP_USER_TIMEOUT_MSEC (5 * 60 * 1000)
#endif // INET_CONFIG_DEFAULT_TCP_USER_TIMEOUT_MSEC
/**
* @def INET_CONFIG_IP_MULTICAST_HOP_LIMIT
*
* @brief
* The default value of the Hop Limit field in
* the IP multicast packet.
*
*
* @details
* This value specifies the hop limit that could be set in the
* outgoing IP packet to override any default settings(made by
* the kernel) for the hop limit field in the IP header.
* On Linux platforms, the hoplimit field is set to 1 for
* multicast packets.
*/
#ifndef INET_CONFIG_IP_MULTICAST_HOP_LIMIT
#define INET_CONFIG_IP_MULTICAST_HOP_LIMIT (64)
#endif // INET_CONFIG_IP_MULTICAST_HOP_LIMIT
/**
* @def INET_CONFIG_TCP_CONN_REPAIR_SUPPORTED
*
* @brief
* When this flag is enabled, the TCPEndPoint can attempt to
* restore the TCP connection using supplied information from
* a previously active connection.
*
* @note
* The TCP connection restoration can only be done
* from the client side. Upon failure to restore, the client
* would fall back to establishing a negotiated TCP connection.
*
*/
#ifndef INET_CONFIG_TCP_CONN_REPAIR_SUPPORTED
#define INET_CONFIG_TCP_CONN_REPAIR_SUPPORTED (0)
#endif // INET_CONFIG_TCP_CONN_REPAIR_SUPPORTED
// clang-format on
#endif /* INETCONFIG_H */