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 with LWIP_TCP_KEEPALIVE, where the probe
8 : interval and count are per-pcb fields, so all three timings are ours. */
9 : #if LWIP_TCP && LWIP_TCP_KEEPALIVE
10 :
11 : #include "lwip/tcp.h"
12 :
13 : #include "SolidSyslogLwipRawTcpStreamPrivate.h"
14 : #include "SolidSyslogTunables.h"
15 :
16 : enum
17 : {
18 : MILLISECONDS_PER_SECOND = 1000
19 : };
20 :
21 3 : void SolidSyslogLwipRawTcpStream_ApplyKeepalive(struct tcp_pcb* pcb)
22 : {
23 3 : pcb->keep_idle = (u32_t) SOLIDSYSLOG_TCP_KEEPALIVE_IDLE_SECONDS * MILLISECONDS_PER_SECOND;
24 3 : pcb->keep_intvl = (u32_t) SOLIDSYSLOG_TCP_KEEPALIVE_INTERVAL_SECONDS * MILLISECONDS_PER_SECOND;
25 3 : pcb->keep_cnt = (u32_t) SOLIDSYSLOG_TCP_KEEPALIVE_PROBE_COUNT;
26 3 : }
27 :
28 : #endif /* LWIP_TCP && LWIP_TCP_KEEPALIVE */
|