Line data Source code
1 : /* SPDX-FileCopyrightText: Copyright 2026 Cozens Software Solutions Limited
2 : * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0 OR LicenseRef-PolyForm-Internal-Use-1.0.0 OR LicenseRef-COSOSO-Commercial
3 : */
4 :
5 : #include "lwip/opt.h"
6 :
7 : /* The variant for an lwIP built without LWIP_TCP_KEEPALIVE, where keep_intvl
8 : and keep_cnt are not fields of a pcb and the stack applies its own compile-
9 : time values for both. Only the idle period is ours to set. */
10 : #if LWIP_TCP && !LWIP_TCP_KEEPALIVE
11 :
12 : #include "lwip/tcp.h"
13 :
14 : #include "SolidSyslogLwipRawTcpStreamPrivate.h"
15 : #include "SolidSyslogTunables.h"
16 :
17 : enum
18 : {
19 : MILLISECONDS_PER_SECOND = 1000
20 : };
21 :
22 65 : void SolidSyslogLwipRawTcpStream_ApplyKeepalive(struct tcp_pcb* pcb)
23 : {
24 65 : pcb->keep_idle = (u32_t) SOLIDSYSLOG_TCP_KEEPALIVE_IDLE_SECONDS * MILLISECONDS_PER_SECOND;
25 65 : }
26 :
27 : #endif /* LWIP_TCP && !LWIP_TCP_KEEPALIVE */
|