Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
net_timeout.h
Go to the documentation of this file.
1
7/*
8 * Copyright (c) 2018 Intel Corporation
9 * Copyright (c) 2020 Nordic Semiconductor ASA
10 *
11 * SPDX-License-Identifier: Apache-2.0
12 */
13
14#ifndef ZEPHYR_INCLUDE_NET_NET_TIMEOUT_H_
15#define ZEPHYR_INCLUDE_NET_NET_TIMEOUT_H_
16
26#include <string.h>
27#include <stdbool.h>
28#include <limits.h>
29#include <zephyr/types.h>
30#include <zephyr/sys/slist.h>
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
50#define NET_TIMEOUT_MAX_VALUE ((uint32_t)INT32_MAX)
51
88
98void net_timeout_set(struct net_timeout *timeout,
99 uint32_t lifetime,
100 uint32_t now);
101
116 int64_t now);
117
136 uint32_t now);
137
157 uint32_t now);
158
159#ifdef __cplusplus
160}
161#endif
162
168#endif /* ZEPHYR_INCLUDE_NET_NET_TIMEOUT_H_ */
uint32_t net_timeout_evaluate(struct net_timeout *timeout, uint32_t now)
Update state to reflect elapsed time and get new delay.
uint32_t net_timeout_remaining(const struct net_timeout *timeout, uint32_t now)
Calculate the remaining time to the timeout in whole seconds.
int64_t net_timeout_deadline(const struct net_timeout *timeout, int64_t now)
Return the 64-bit system time at which the timeout will complete.
void net_timeout_set(struct net_timeout *timeout, uint32_t lifetime, uint32_t now)
Configure a network timeout structure.
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT64_TYPE__ int64_t
Definition stdint.h:75
Generic struct for handling network timeouts.
Definition net_timeout.h:57
uint32_t timer_timeout
Portion of remaining timeout that does not exceed NET_TIMEOUT_MAX_VALUE.
Definition net_timeout.h:78
uint32_t wrap_counter
Timer wrap count.
Definition net_timeout.h:86
sys_snode_t node
Used to link multiple timeouts that share a common timer infrastructure.
Definition net_timeout.h:64
uint32_t timer_start
Time at which the timer was last set.
Definition net_timeout.h:70