Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
stun_client.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3 * SPDX-FileCopyrightText: Copyright (c) 2026 Kirill Shypachov
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_NET_STUN_CLIENT_H_
14#define ZEPHYR_INCLUDE_NET_STUN_CLIENT_H_
15
33
34#include <stdint.h>
35
36#include <zephyr/net/net_ip.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
43#define STUN_CLIENT_DEFAULT_PORT 3478U
44
78int stun_client_query(int sock, const struct net_sockaddr *server, net_socklen_t server_len,
79 uint32_t timeout_ms, struct net_sockaddr_storage *mapped);
80
110int stun_client_simple(const char *host, uint16_t port, uint32_t timeout_ms,
111 struct net_sockaddr_storage *mapped);
112
113#ifdef __cplusplus
114}
115#endif
116
118
119#endif /* ZEPHYR_INCLUDE_NET_STUN_CLIENT_H_ */
uint32_t net_socklen_t
Length of a socket address.
Definition net_ip.h:172
int stun_client_simple(const char *host, uint16_t port, uint32_t timeout_ms, struct net_sockaddr_storage *mapped)
Ask a STUN server, given by name, for the address it sees this device at.
int stun_client_query(int sock, const struct net_sockaddr *server, net_socklen_t server_len, uint32_t timeout_ms, struct net_sockaddr_storage *mapped)
Ask a STUN server for the address it sees a socket at.
IPv6 and IPv4 definitions.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Generic sockaddr struct.
Definition net_ip.h:462